@macrostrat/data-sheet 4.11.2 → 4.11.3

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 CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.11.3] - 2026-11-18 [_changes_](https://github.com/UW-Macrostrat/web-components/compare/@macrostrat/data-sheet-v4.11.2...@macrostrat/data-sheet-v4.11.3)
4
+
5
+ ### Patch Changes
6
+
7
+ - In an editable sheet, `editable: false` columns show a lock icon in the header
8
+ and dimmed values
9
+ [d124066a](https://github.com/UW-Macrostrat/web-components/commit/d124066aba51390eac5a28ad140941ce57a21c1e)
10
+ - Fix keyboard shortcuts (e.g. Cmd+C copy) doing nothing in read-only sheets,
11
+ whose hotkeys were built from a stale, empty action list
12
+ [04999807](https://github.com/UW-Macrostrat/web-components/commit/0499980775c755265782a0abe0addd3b6a4df017)
13
+
3
14
  ## [4.11.2] - 2026-11-18 [_changes_](https://github.com/UW-Macrostrat/web-components/compare/@macrostrat/data-sheet-v4.11.1...@macrostrat/data-sheet-v4.11.2)
4
15
 
5
16
  ### Patch Changes
@@ -126,7 +126,7 @@ function DataSheetRenderer({
126
126
  core.ctx.useSync(core.tableActionsAtom, _actions);
127
127
  const getHotkeys = core.ctx.useSet(keyHandling.tableHotkeysAtom);
128
128
  const hotkeysConfig = react.useMemo(() => {
129
- return getHotkeys();
129
+ return getHotkeys(_actions);
130
130
  }, [_actions]);
131
131
  const { handleKeyDown, handleKeyUp } = core$1.useHotkeys(hotkeysConfig);
132
132
  const selectedRegions = core.useSelector((state) => state.selection ?? []);
@@ -1 +1 @@
1
- {"version":3,"file":"data-sheet.cjs","sources":["../src/data-sheet.ts"],"sourcesContent":["import { useHotkeys } from \"@blueprintjs/core\";\nimport {\n Column,\n RegionCardinality,\n RowHeaderCell,\n Table,\n} from \"@blueprintjs/table\";\nimport \"@blueprintjs/table/lib/css/table.css\";\nimport {\n CSSProperties,\n ReactNode,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n} from \"react\";\nimport {\n LoadErrorOverlay,\n LoadProgressIndicator,\n ActionsToolbar,\n ActiveFiltersList,\n} from \"./components\";\nimport { basicCellRenderer, renderColumnHeaderCell } from \"./renderers\";\nimport h from \"./main.module.sass\";\nimport {\n columnSpecAtom,\n ctx,\n dataProviderAtom,\n dataRefreshTokenAtom,\n DataSheetProvider,\n DataViewRendererType,\n DEFAULT_ROW_STATUS_STYLES,\n FetchData,\n persistViaProvider,\n RowStatusStyles,\n splitDataProviderProps,\n storeAtom,\n tableActionsAtom,\n TableElementStatus,\n useSelector,\n useStoreAPI,\n VisibleCells,\n} from \"./provider\";\nimport { atom } from \"jotai\";\nimport { CellRendererDebugOverlay, tableHotkeysAtom } from \"./utils\";\nimport {\n clipboardActions,\n columnControlActions,\n createSaveAction,\n resetChangesAction,\n TableAction,\n TableActionContext,\n} from \"./actions\";\nimport {\n tableFooterAtom,\n useDataLoader,\n useScrollHandler,\n} from \"./postgrest-table\";\nimport {\n CellInteraction,\n DataSheetDensity,\n DataSheetProps,\n DataSheetRendererProps,\n FetchDataOptions,\n} from \"./types.ts\";\nimport { ErrorCallout } from \"@macrostrat/ui-components\";\n\n// More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args\n\n// TODO: add a \"copy to selection\" tool (the little square in the bottom right corner of a cell)\n// This should copy the value of a cell (or a set of cells in the same row) downwards.\n\n/** Approximate column-header + scrollbar allowance, used to size the table to\n * its content in paged mode. */\nconst COLUMN_HEADER_HEIGHT = 34;\n\nexport function DataSheet<T>(props: DataSheetProps<T>) {\n const {\n data,\n columnSpec,\n columnSpecOptions,\n editable = true,\n enableColumnReordering = false,\n enableFocusedCell = false,\n defaultColumnWidth = 150,\n children,\n name,\n ...rest\n } = props;\n\n const [providerProps, rendererProps] = splitDataProviderProps<T>({\n ...props,\n viewType: DataViewRendererType.TABLE,\n });\n return h(\n DataSheetProvider<T>,\n providerProps,\n h(DataSheetRenderer<any>, rendererProps),\n );\n}\n\nconst verboseAtom = atom(false);\n\n/** The table (cell-grid) renderer. Assumes it is rendered inside a\n * `DataSheetProvider` (the `DataSheet` wrapper, or `DataView`). Exported so a\n * shared-store `DataView` can mount it directly alongside `_DataPanel`. */\nexport function DataSheetRenderer<T>({\n fetchData,\n provider,\n pageSize,\n fetchMode,\n filterDebounce,\n initialData,\n onVisibleCellsChange,\n onUpdateData,\n onEdit,\n onSave,\n updatedData: updatedDataProp,\n rowStatus: rowStatusProp,\n // Identity/canDeleteRows sync (was here) is now handled by the provider\n // (`DataSheetProviderInner`); still destructured so `identity`/`refreshToken`\n // don't leak into `...rest` (spread onto the Blueprint `Table` below).\n identity: _identity,\n deriveOverlay,\n refreshToken: _refreshToken,\n onDeleteRows,\n name,\n verbose = false,\n debug = false,\n enableFocusedCell,\n autoFocusEditor = true,\n cellInteraction,\n enableClipboard = true,\n density = DataSheetDensity.HIGH,\n selectionModes,\n actions,\n filters,\n columnHeaderCellRenderer,\n statusBar,\n rowStatusStyles,\n rowHeaderRenderer,\n children,\n ...tableProps\n}: DataSheetRendererProps<T>) {\n /**\n * @param data: The data to be displayed in the table\n * @param columnSpec: The specification for all columns in the table. If not provided, the column spec will be generated from the data.\n * @param columnSpecOptions: Options for generating a column spec from data\n */\n\n ctx.useSync(verboseAtom, verbose);\n\n const editable = useSelector((state) => state.editable);\n\n // The active data source is resolved in the wrapper (`DataSheet`) and held in\n // the provider layer; read it here rather than resolving per render.\n const {\n provider: activeProvider,\n isLocalProvider,\n localCount,\n } = ctx.useValue(dataProviderAtom);\n\n // When an explicit provider owns persistence, its methods drive the built-in\n // Save (batch: edits→saveRows, added→insertRow, deleted→deleteRows), then a\n // refresh. Otherwise the loose `onSave` handler is used.\n const bumpRefresh = ctx.useSet(dataRefreshTokenAtom);\n const providerSave = useMemo(() => {\n const p = provider;\n if (\n p == null ||\n (p.saveRows == null && p.deleteRows == null && p.insertRow == null)\n ) {\n return null;\n }\n return async (actionCtx: TableActionContext<T>) => {\n await persistViaProvider(p, actionCtx);\n bumpRefresh((v) => v + 1);\n };\n }, [provider, bumpRefresh]);\n const saveHandler = onSave ?? providerSave;\n\n // Sync table actions to atom. Consumer actions come first (they override a\n // built-in by reusing its id); the built-in column controls (sort/filter)\n // fill in the rest — so both the toolbar and the header dropdown source from\n // one registry. Built-ins self-gate (single sortable/filterable column).\n const _actions: TableAction[] = useMemo(() => {\n const _actions: TableAction[] = [];\n const add = (list: TableAction[]) => {\n for (const a of list) {\n if (!_actions.some((x) => x.id === a.id)) _actions.push(a);\n }\n };\n if (actions != null) add(actions);\n add(columnControlActions);\n if (enableClipboard) add(clipboardActions);\n // Save/reset last — they're the most significant actions — and present for\n // every cardinality (editable), so the toolbar stays mounted regardless of\n // selection.\n if (editable) {\n if (saveHandler != null) add([createSaveAction(saveHandler)]);\n add([resetChangesAction]);\n }\n return _actions;\n }, [actions, enableClipboard, editable, saveHandler]);\n\n /*** TODO: generalize this, probably shouldn't need 'set' */\n ctx.useSync(tableActionsAtom, _actions);\n const getHotkeys = ctx.useSet(tableHotkeysAtom);\n\n // This is quite hacky!\n const hotkeysConfig = useMemo(() => {\n return getHotkeys();\n }, [_actions]);\n\n const { handleKeyDown, handleKeyUp } = useHotkeys(hotkeysConfig);\n\n // For now, we only consider a single cell \"focused\" when we have one cell selected.\n // Multi-cell selections have a different set of \"bulk\" actions.\n const selectedRegions = useSelector<T>((state) => state.selection ?? []);\n\n const data = useSelector((state) => state.data);\n\n const rowStatus = useSelector((state) => state.rowStatus);\n\n const focusedCell = useSelector((state) => state.focusedCell);\n\n const ref = useSelector((state) => state.tableRef);\n\n const columnSpec = useSelector((state) => state.columnSpec);\n\n // A sparse array to hold updates\n // TODO: create a \"changeset\" concept to facilitate undo/redo\n const updatedData = useSelector((state) => state.updatedData);\n\n const onSelection = useSelector((state) => state.onSelection);\n\n const storeAPI = useStoreAPI<T>();\n\n const onScroll = useScrollHandler();\n const _onVisibleCellsChange = useCallback(\n (visibleCells: VisibleCells) => {\n onScroll(visibleCells);\n onVisibleCellsChange?.(visibleCells);\n },\n [onVisibleCellsChange, onScroll],\n );\n\n useEffect(() => {\n if (!verbose) return;\n console.log(\"Updated data\", updatedData);\n }, [updatedData]);\n\n useEffect(() => {\n onUpdateData?.(updatedData, data);\n }, [onUpdateData, data, updatedData]);\n\n useEffect(() => {\n if (!verbose) return;\n console.log(\"Selected regions\", selectedRegions);\n }, [selectedRegions]);\n\n const tableElementRef = useRef<HTMLElement>(null);\n useEffect(() => {\n // Return the focus to the table\n tableElementRef.current?.focus();\n }, [focusedCell]);\n\n const columnWidths = ctx.useValue(columnWidthsAtom);\n\n // When filters are active, only show matching rows\n const filteredRowIndices = useSelector((state) => state.filteredRowIndices);\n const totalRows = Math.max(updatedData.length, data.length);\n const numRows =\n filteredRowIndices != null ? filteredRowIndices.length : totalRows;\n\n let className = `${density}-density`;\n\n const { rowHeight, style } = styleParamsForDensity(density);\n\n // In paged mode the row count is small and fixed, so let the table size to\n // its content (header + rows) instead of filling the viewport.\n const footerInfo = ctx.useValue(tableFooterAtom);\n let holderStyle: CSSProperties | undefined = undefined;\n if (footerInfo.mode === \"paged\") {\n holderStyle = {\n flex: \"0 0 auto\" as const,\n height: numRows * rowHeight + COLUMN_HEADER_HEIGHT,\n };\n }\n\n const onColumnsReordered = useSelector((state) => state.onColumnsReordered);\n // Whether table-level column drag-reordering is enabled. Held in the store\n // (set from the `enableColumnReordering` prop by the provider); it must reach\n // the Blueprint `Table` — the `onColumnsReordered` handler alone doesn't turn\n // on the drag affordance.\n const enableColumnReordering = useSelector(\n (state) => state.enableColumnReordering,\n );\n\n // Auto-detect if any columns have sortable/filterable set.\n // If so and no explicit columnHeaderCellRenderer was provided,\n // use the built-in client-side sort/filter header.\n const hasSortableOrFilterable = useMemo(\n () =>\n columnSpec.some(\n (col) =>\n col.sortable ||\n col.filterable ||\n (Array.isArray(col.filters) && col.filters.length > 0),\n ),\n [columnSpec],\n );\n\n const columnSorts = useSelector((state) => state.columnSorts);\n const activeFilters = useSelector((state) => state.activeFilters);\n\n // Cell activation mode, defaulting from the legacy `autoFocusEditor` boolean\n // so existing consumers are unaffected. Synced into the store so the cell\n // renderer, editors, and key handlers all read it consistently.\n const cellInteractionMode: CellInteraction =\n cellInteraction ?? (autoFocusEditor ? \"auto\" : \"manual\");\n\n const storeState = storeAPI;\n useEffect(() => {\n storeState.setState({ cellInteraction: cellInteractionMode });\n }, [storeState, cellInteractionMode]);\n\n useEffect(() => {\n // Give the store a handle to the focusable holder so editors can return\n // keyboard focus to the table when the cursor leaves them.\n storeState.setState({ tableElement: tableElementRef.current });\n }, [storeState]);\n\n // The row height is the density's; cells report it to their renderers\n const densityRowHeight = styleParamsForDensity(density).rowHeight;\n useEffect(() => {\n storeState.setState({ rowHeight: densityRowHeight });\n }, [storeState, densityRowHeight]);\n\n useEffect(() => {\n storeState.setState({ onEdit });\n }, [storeState, onEdit]);\n\n useEffect(() => {\n // Controlled overlay: mirror the caller's edited state into the store as\n // the source of truth. Optimistic in-table edits are superseded on the\n // next render when the caller passes an updated value back. When the caller\n // controls it, the loader-boundary identity remap steps aside.\n const controlled =\n updatedDataProp !== undefined ||\n rowStatusProp !== undefined ||\n deriveOverlay != null;\n const patch: Record<string, unknown> = { controlledOverlay: controlled };\n if (updatedDataProp !== undefined) patch.updatedData = updatedDataProp;\n if (rowStatusProp !== undefined) patch.rowStatus = rowStatusProp;\n storeState.setState(patch);\n }, [storeState, updatedDataProp, rowStatusProp, deriveOverlay]);\n\n // Derived controlled overlay: the library owns the loaded rows, so it runs\n // the consumer's `deriveOverlay(rows)` here and pushes the result. Re-derives\n // when the rows load/change or the function's identity changes (close it over\n // your external edit state). The `controlledOverlay` flag above suppresses the\n // loader-boundary identity remap so this derivation is authoritative.\n useEffect(() => {\n if (deriveOverlay == null) return;\n const overlay = deriveOverlay(data);\n storeState.setState({\n updatedData: overlay.updatedData,\n rowStatus: overlay.rowStatus,\n });\n }, [deriveOverlay, data, storeState]);\n\n // Function `columnSpec` derivation is hoisted to the provider\n // (`DataSheetProviderInner`), shared by both renderers.\n\n // Identity and canDeleteRows sync are hoisted to the provider\n // (`DataSheetProviderInner`), shared with `_DataPanel` — both depend only on\n // the resolved data provider, not any sheet-specific state.\n\n // Merge consumer `rowStatusStyles` over the built-in defaults and hand the\n // result to the store, where the cell renderer and row-header renderer read\n // it. Merged (not replaced) so overriding one status doesn't drop the rest.\n const mergedRowStatusStyles = useMemo<RowStatusStyles>(\n () => ({ ...DEFAULT_ROW_STATUS_STYLES, ...rowStatusStyles }),\n [rowStatusStyles],\n );\n useEffect(() => {\n storeState.setState({ rowStatusStyles: mergedRowStatusStyles });\n }, [storeState, mergedRowStatusStyles]);\n\n const realizedColumns = useMemo(() => {\n return columnSpec.map((col, colIndex) => {\n let fn =\n col.headerRenderer ??\n columnHeaderCellRenderer ??\n renderColumnHeaderCell;\n let activeSort: any = null;\n let activeFilter: any = null;\n if (col.sortable) {\n activeSort = columnSorts?.find((s) => s.key === col.key);\n }\n // The active filter for this column is whichever active filter targets\n // it (a rich `col.filters` filter or the generic operator filter) — match\n // by columnKey rather than a fixed id.\n for (const entry of activeFilters?.values() ?? []) {\n if ((entry as any)?.filter?.columnKey === col.key) {\n activeFilter = entry;\n break;\n }\n }\n\n const _columnHeaderCellRenderer: any = (colIndex) => {\n return fn(\n {\n col,\n colIndex,\n activeSort,\n activeFilter,\n },\n colIndex,\n );\n };\n\n return h(Column, {\n id: col.key,\n name: col.name,\n columnHeaderCellRenderer: _columnHeaderCellRenderer as any,\n cellRenderer: (rowIndex) => {\n const state = storeAPI.getState();\n return basicCellRenderer<T>(\n rowIndex,\n colIndex,\n col,\n state,\n filteredRowIndices,\n );\n },\n });\n });\n }, [\n columnSpec,\n columnSorts,\n activeFilters,\n storeAPI,\n filteredRowIndices,\n columnHeaderCellRenderer,\n ]);\n\n const onColumnWidthChanged = useSelector(\n (state) => state.onColumnWidthChanged,\n );\n\n const rowHeaderCellRenderer = useCallback(\n (rowIndex: number) => {\n let dataRowIndex = rowIndex;\n if (filteredRowIndices != null) {\n dataRowIndex = filteredRowIndices[rowIndex] ?? rowIndex;\n }\n const statusVal = rowStatus[dataRowIndex];\n let style: CSSProperties | undefined;\n if (statusVal != null) {\n style = mergedRowStatusStyles[statusVal]?.headerStyle;\n }\n\n const defaultLabel = `${dataRowIndex + 1}`;\n // A custom renderer supplies the header's *name* content (a group-key\n // label, an omit indicator, …); a nullish return keeps the default\n // 1-based label. Either way the node is wrapped in a `RowHeaderCell` so\n // status styling and the row index are always applied — the renderer is\n // not responsible for producing the whole cell.\n let name: ReactNode = defaultLabel;\n if (rowHeaderRenderer != null) {\n const custom = rowHeaderRenderer({\n rowIndex: dataRowIndex,\n visibleIndex: rowIndex,\n row: data[dataRowIndex] ?? updatedData[dataRowIndex],\n status: statusVal,\n isDeleted: statusVal === TableElementStatus.DELETED,\n defaultLabel,\n });\n if (custom != null) name = custom;\n }\n\n return h(RowHeaderCell, {\n enableRowReordering: false,\n index: rowIndex,\n name,\n style,\n });\n },\n [\n rowStatus,\n filteredRowIndices,\n mergedRowStatusStyles,\n rowHeaderRenderer,\n data,\n updatedData,\n ],\n );\n\n // Done with hooks!\n /** Guard for unacceptable state combinations:\n * editable = true requires selectionModes to include cells, else the user cannot select a cell to edit.\n * TODO: make this an impossible state to enter.\n */\n if (\n editable &&\n selectionModes &&\n !selectionModes.includes(RegionCardinality.CELLS)\n ) {\n return h(ErrorCallout, {\n title: \"Invalid selection mode\",\n description: \"Editable sheet requires cell selection\",\n });\n }\n\n // TODO: hoist this\n let _selectionModes = selectionModes;\n if (\n editable &&\n _selectionModes != null &&\n !_selectionModes.includes(RegionCardinality.CELLS)\n ) {\n _selectionModes = [..._selectionModes, RegionCardinality.CELLS];\n // Ensure selection mode includes \"cells\"\n }\n\n const cellRendererDependencies = [\n data,\n updatedData,\n focusedCell,\n rowStatus,\n filteredRowIndices,\n ];\n\n // Drive the table from the active provider's `fetchData`. A local (in-memory)\n // provider loads the whole array at once; a remote one uses the `pageSize` /\n // `fetchMode` props and shows load progress.\n let _showLoadProgress: boolean = false;\n let dataLoader: ReactNode = null;\n if (activeProvider != null) {\n _showLoadProgress = !isLocalProvider;\n // A local (in-memory) source loads all its rows in one page; its count\n // rides on the resolved provider (`localCount`), so `_DataSheet` no longer\n // takes a `data` prop — live rows come only from the store.\n dataLoader = h(_DataLoaderManager, {\n key: \"__data_loader\",\n fetchData: activeProvider.fetchData,\n pageSize: isLocalProvider ? Math.max(localCount, 1) : pageSize,\n fetchMode: isLocalProvider ? undefined : fetchMode,\n filterDebounce,\n initialData,\n });\n }\n const showFilterBar =\n (filters != null && filters.length > 0) || hasSortableOrFilterable;\n\n let filterStatus: ReactNode = null;\n if (showFilterBar) {\n filterStatus = h(ActiveFiltersList, { filters: filters ?? [] });\n }\n\n return h(\"div.data-sheet-container\", { className, style }, [\n // The actions/tools toolbar (selection-modal). Table-scoped controls like\n // scroll-to-row / full-text search live here as ordinary actions.\n h(ActionsToolbar, { actions: _actions }),\n dataLoader,\n children,\n h(\n \"div.data-sheet-holder\",\n {\n tabIndex: 0,\n onKeyDown: handleKeyDown,\n onKeyUp: handleKeyUp,\n ref: tableElementRef,\n style: holderStyle,\n },\n [\n // Inside the holder, so the toolbar and filters stay reachable.\n h.if(_showLoadProgress)(LoadErrorOverlay),\n h(\n Table as any, // Some sort of hyperscript type error\n {\n ref,\n numRows,\n className: \"data-sheet\",\n enableFocusedCell,\n enableColumnReordering,\n onColumnsReordered,\n focusedCell,\n selectedRegions,\n defaultRowHeight: rowHeight,\n columnWidths,\n onColumnWidthChanged,\n onSelection,\n /** TODO: we could enable this if we had a use-case */\n enableRowReordering: false,\n enableRowResizing: false,\n // The cell renderer is memoized internally based on these data dependencies\n cellRendererDependencies,\n onVisibleCellsChange: _onVisibleCellsChange,\n rowHeaderCellRenderer,\n selectionModes: _selectionModes,\n ...tableProps,\n getCellClipboardData: null,\n },\n realizedColumns,\n ),\n ],\n ),\n h(\"div.status-bar\", [\n filterStatus,\n statusBar,\n h(\"div.spacer\"),\n h.if(_showLoadProgress)(LoadProgressIndicator),\n ]),\n h.if(debug)(CellRendererDebugOverlay, {\n cellRendererDependencies,\n names: [\n \"data\",\n \"updatedData\",\n \"focusedCell\",\n \"rowStatus\",\n \"filteredRowIndices\",\n ],\n }),\n ]);\n}\n\nconst EMPTY_MAP = new Map<string, number>();\n\nconst columnWidthsIndexAtom = atom(\n (get) => get(storeAtom)?.columnWidthsIndex ?? EMPTY_MAP,\n);\nconst defaultColumnWidthAtom = atom(\n (get) => get(storeAtom)?.defaultColumnWidth ?? 150,\n);\n\nconst columnWidthsAtom = atom((get) => {\n const ix = get(columnWidthsIndexAtom);\n return get(columnSpecAtom).map(\n (col) => ix.get(col.key) ?? col.width ?? get(defaultColumnWidthAtom),\n );\n});\n\nfunction styleParamsForDensity(density: DataSheetDensity): {\n rowHeight: number;\n style: Record<string, string>;\n} {\n switch (density) {\n case DataSheetDensity.MEDIUM:\n return {\n rowHeight: 24,\n style: {\n \"--data-sheet-row-height\": \"24px\",\n \"--data-sheet-font-size\": \"14px\",\n },\n };\n case DataSheetDensity.LOW:\n return {\n rowHeight: 30,\n style: {\n \"--data-sheet-row-height\": \"30px\",\n \"--data-sheet-font-size\": \"18px\",\n },\n };\n case DataSheetDensity.HIGH:\n default:\n return {\n rowHeight: 20,\n style: {\n \"--data-sheet-row-height\": \"20px\",\n \"--data-sheet-font-size\": \"12px\",\n },\n };\n }\n}\n\n/** Convenience component: runs `useChunkLoader` from inside a `DataSheet`.\n * Render as a child of `DataSheet` (it renders nothing itself). */\nfunction _DataLoaderManager<T = any>({\n fetchData,\n ...rest\n}: {\n fetchData: FetchData<T>;\n} & FetchDataOptions<any>) {\n useDataLoader(fetchData, rest);\n return null;\n}\n"],"names":["splitDataProviderProps","DataViewRendererType","h","DataSheetProvider","atom","DataSheetDensity","ctx","useSelector","dataProviderAtom","dataRefreshTokenAtom","useMemo","persistViaProvider","_actions","columnControlActions","clipboardActions","createSaveAction","resetChangesAction","tableActionsAtom","tableHotkeysAtom","useHotkeys","useStoreAPI","useScrollHandler","useCallback","useEffect","useRef","tableFooterAtom","activeFilters","DEFAULT_ROW_STATUS_STYLES","renderColumnHeaderCell","colIndex","Column","basicCellRenderer","style","name","TableElementStatus","RowHeaderCell","RegionCardinality","ErrorCallout","ActiveFiltersList","ActionsToolbar","LoadErrorOverlay","Table","LoadProgressIndicator","CellRendererDebugOverlay","storeAtom","columnSpecAtom","useDataLoader"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA0EA,MAAM,uBAAuB;AAEtB,SAAS,UAAa,OAA0B;AACrD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX,yBAAyB;AAAA,IACzB,oBAAoB;AAAA,IACpB,qBAAqB;AAAA,IACrB;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,IACD;AAEJ,QAAM,CAAC,eAAe,aAAa,IAAIA,4BAA0B;AAAA,IAC/D,GAAG;AAAA,IACH,UAAUC,aAAAA,qBAAqB;AAAA,EAAA,CAChC;AACD,SAAOC,YAAAA;AAAAA,IACLC,KAAAA;AAAAA,IACA;AAAA,IACAD,YAAAA,QAAE,mBAAwB,aAAa;AAAA,EAAA;AAE3C;AAEA,MAAM,cAAcE,MAAAA,KAAK,KAAK;AAKvB,SAAS,kBAAqB;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb,WAAW;AAAA;AAAA;AAAA;AAAA,EAIX,UAAU;AAAA,EACV;AAAA,EACA,cAAc;AAAA,EACd;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV,QAAQ;AAAA,EACR;AAAA,EACA,kBAAkB;AAAA,EAClB;AAAA,EACA,kBAAkB;AAAA,EAClB,UAAUC,QAAAA,iBAAiB;AAAA,EAC3B;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IAAI;AAC7B,SAAO;AACT;;;"}
1
+ {"version":3,"file":"data-sheet.cjs","sources":["../src/data-sheet.ts"],"sourcesContent":["import { useHotkeys } from \"@blueprintjs/core\";\nimport {\n Column,\n RegionCardinality,\n RowHeaderCell,\n Table,\n} from \"@blueprintjs/table\";\nimport \"@blueprintjs/table/lib/css/table.css\";\nimport {\n CSSProperties,\n ReactNode,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n} from \"react\";\nimport {\n LoadErrorOverlay,\n LoadProgressIndicator,\n ActionsToolbar,\n ActiveFiltersList,\n} from \"./components\";\nimport { basicCellRenderer, renderColumnHeaderCell } from \"./renderers\";\nimport h from \"./main.module.sass\";\nimport {\n columnSpecAtom,\n ctx,\n dataProviderAtom,\n dataRefreshTokenAtom,\n DataSheetProvider,\n DataViewRendererType,\n DEFAULT_ROW_STATUS_STYLES,\n FetchData,\n persistViaProvider,\n RowStatusStyles,\n splitDataProviderProps,\n storeAtom,\n tableActionsAtom,\n TableElementStatus,\n useSelector,\n useStoreAPI,\n VisibleCells,\n} from \"./provider\";\nimport { atom } from \"jotai\";\nimport { CellRendererDebugOverlay, tableHotkeysAtom } from \"./utils\";\nimport {\n clipboardActions,\n columnControlActions,\n createSaveAction,\n resetChangesAction,\n TableAction,\n TableActionContext,\n} from \"./actions\";\nimport {\n tableFooterAtom,\n useDataLoader,\n useScrollHandler,\n} from \"./postgrest-table\";\nimport {\n CellInteraction,\n DataSheetDensity,\n DataSheetProps,\n DataSheetRendererProps,\n FetchDataOptions,\n} from \"./types.ts\";\nimport { ErrorCallout } from \"@macrostrat/ui-components\";\n\n// More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args\n\n// TODO: add a \"copy to selection\" tool (the little square in the bottom right corner of a cell)\n// This should copy the value of a cell (or a set of cells in the same row) downwards.\n\n/** Approximate column-header + scrollbar allowance, used to size the table to\n * its content in paged mode. */\nconst COLUMN_HEADER_HEIGHT = 34;\n\nexport function DataSheet<T>(props: DataSheetProps<T>) {\n const {\n data,\n columnSpec,\n columnSpecOptions,\n editable = true,\n enableColumnReordering = false,\n enableFocusedCell = false,\n defaultColumnWidth = 150,\n children,\n name,\n ...rest\n } = props;\n\n const [providerProps, rendererProps] = splitDataProviderProps<T>({\n ...props,\n viewType: DataViewRendererType.TABLE,\n });\n return h(\n DataSheetProvider<T>,\n providerProps,\n h(DataSheetRenderer<any>, rendererProps),\n );\n}\n\nconst verboseAtom = atom(false);\n\n/** The table (cell-grid) renderer. Assumes it is rendered inside a\n * `DataSheetProvider` (the `DataSheet` wrapper, or `DataView`). Exported so a\n * shared-store `DataView` can mount it directly alongside `_DataPanel`. */\nexport function DataSheetRenderer<T>({\n fetchData,\n provider,\n pageSize,\n fetchMode,\n filterDebounce,\n initialData,\n onVisibleCellsChange,\n onUpdateData,\n onEdit,\n onSave,\n updatedData: updatedDataProp,\n rowStatus: rowStatusProp,\n // Identity/canDeleteRows sync (was here) is now handled by the provider\n // (`DataSheetProviderInner`); still destructured so `identity`/`refreshToken`\n // don't leak into `...rest` (spread onto the Blueprint `Table` below).\n identity: _identity,\n deriveOverlay,\n refreshToken: _refreshToken,\n onDeleteRows,\n name,\n verbose = false,\n debug = false,\n enableFocusedCell,\n autoFocusEditor = true,\n cellInteraction,\n enableClipboard = true,\n density = DataSheetDensity.HIGH,\n selectionModes,\n actions,\n filters,\n columnHeaderCellRenderer,\n statusBar,\n rowStatusStyles,\n rowHeaderRenderer,\n children,\n ...tableProps\n}: DataSheetRendererProps<T>) {\n /**\n * @param data: The data to be displayed in the table\n * @param columnSpec: The specification for all columns in the table. If not provided, the column spec will be generated from the data.\n * @param columnSpecOptions: Options for generating a column spec from data\n */\n\n ctx.useSync(verboseAtom, verbose);\n\n const editable = useSelector((state) => state.editable);\n\n // The active data source is resolved in the wrapper (`DataSheet`) and held in\n // the provider layer; read it here rather than resolving per render.\n const {\n provider: activeProvider,\n isLocalProvider,\n localCount,\n } = ctx.useValue(dataProviderAtom);\n\n // When an explicit provider owns persistence, its methods drive the built-in\n // Save (batch: edits→saveRows, added→insertRow, deleted→deleteRows), then a\n // refresh. Otherwise the loose `onSave` handler is used.\n const bumpRefresh = ctx.useSet(dataRefreshTokenAtom);\n const providerSave = useMemo(() => {\n const p = provider;\n if (\n p == null ||\n (p.saveRows == null && p.deleteRows == null && p.insertRow == null)\n ) {\n return null;\n }\n return async (actionCtx: TableActionContext<T>) => {\n await persistViaProvider(p, actionCtx);\n bumpRefresh((v) => v + 1);\n };\n }, [provider, bumpRefresh]);\n const saveHandler = onSave ?? providerSave;\n\n // Sync table actions to atom. Consumer actions come first (they override a\n // built-in by reusing its id); the built-in column controls (sort/filter)\n // fill in the rest — so both the toolbar and the header dropdown source from\n // one registry. Built-ins self-gate (single sortable/filterable column).\n const _actions: TableAction[] = useMemo(() => {\n const _actions: TableAction[] = [];\n const add = (list: TableAction[]) => {\n for (const a of list) {\n if (!_actions.some((x) => x.id === a.id)) _actions.push(a);\n }\n };\n if (actions != null) add(actions);\n add(columnControlActions);\n if (enableClipboard) add(clipboardActions);\n // Save/reset last — they're the most significant actions — and present for\n // every cardinality (editable), so the toolbar stays mounted regardless of\n // selection.\n if (editable) {\n if (saveHandler != null) add([createSaveAction(saveHandler)]);\n add([resetChangesAction]);\n }\n return _actions;\n }, [actions, enableClipboard, editable, saveHandler]);\n\n /*** TODO: generalize this, probably shouldn't need 'set' */\n ctx.useSync(tableActionsAtom, _actions);\n const getHotkeys = ctx.useSet(tableHotkeysAtom);\n\n // This is quite hacky!\n const hotkeysConfig = useMemo(() => {\n return getHotkeys(_actions);\n }, [_actions]);\n\n const { handleKeyDown, handleKeyUp } = useHotkeys(hotkeysConfig);\n\n // For now, we only consider a single cell \"focused\" when we have one cell selected.\n // Multi-cell selections have a different set of \"bulk\" actions.\n const selectedRegions = useSelector<T>((state) => state.selection ?? []);\n\n const data = useSelector((state) => state.data);\n\n const rowStatus = useSelector((state) => state.rowStatus);\n\n const focusedCell = useSelector((state) => state.focusedCell);\n\n const ref = useSelector((state) => state.tableRef);\n\n const columnSpec = useSelector((state) => state.columnSpec);\n\n // A sparse array to hold updates\n // TODO: create a \"changeset\" concept to facilitate undo/redo\n const updatedData = useSelector((state) => state.updatedData);\n\n const onSelection = useSelector((state) => state.onSelection);\n\n const storeAPI = useStoreAPI<T>();\n\n const onScroll = useScrollHandler();\n const _onVisibleCellsChange = useCallback(\n (visibleCells: VisibleCells) => {\n onScroll(visibleCells);\n onVisibleCellsChange?.(visibleCells);\n },\n [onVisibleCellsChange, onScroll],\n );\n\n useEffect(() => {\n if (!verbose) return;\n console.log(\"Updated data\", updatedData);\n }, [updatedData]);\n\n useEffect(() => {\n onUpdateData?.(updatedData, data);\n }, [onUpdateData, data, updatedData]);\n\n useEffect(() => {\n if (!verbose) return;\n console.log(\"Selected regions\", selectedRegions);\n }, [selectedRegions]);\n\n const tableElementRef = useRef<HTMLElement>(null);\n useEffect(() => {\n // Return the focus to the table\n tableElementRef.current?.focus();\n }, [focusedCell]);\n\n const columnWidths = ctx.useValue(columnWidthsAtom);\n\n // When filters are active, only show matching rows\n const filteredRowIndices = useSelector((state) => state.filteredRowIndices);\n const totalRows = Math.max(updatedData.length, data.length);\n const numRows =\n filteredRowIndices != null ? filteredRowIndices.length : totalRows;\n\n let className = `${density}-density`;\n\n const { rowHeight, style } = styleParamsForDensity(density);\n\n // In paged mode the row count is small and fixed, so let the table size to\n // its content (header + rows) instead of filling the viewport.\n const footerInfo = ctx.useValue(tableFooterAtom);\n let holderStyle: CSSProperties | undefined = undefined;\n if (footerInfo.mode === \"paged\") {\n holderStyle = {\n flex: \"0 0 auto\" as const,\n height: numRows * rowHeight + COLUMN_HEADER_HEIGHT,\n };\n }\n\n const onColumnsReordered = useSelector((state) => state.onColumnsReordered);\n // Whether table-level column drag-reordering is enabled. Held in the store\n // (set from the `enableColumnReordering` prop by the provider); it must reach\n // the Blueprint `Table` — the `onColumnsReordered` handler alone doesn't turn\n // on the drag affordance.\n const enableColumnReordering = useSelector(\n (state) => state.enableColumnReordering,\n );\n\n // Auto-detect if any columns have sortable/filterable set.\n // If so and no explicit columnHeaderCellRenderer was provided,\n // use the built-in client-side sort/filter header.\n const hasSortableOrFilterable = useMemo(\n () =>\n columnSpec.some(\n (col) =>\n col.sortable ||\n col.filterable ||\n (Array.isArray(col.filters) && col.filters.length > 0),\n ),\n [columnSpec],\n );\n\n const columnSorts = useSelector((state) => state.columnSorts);\n const activeFilters = useSelector((state) => state.activeFilters);\n\n // Cell activation mode, defaulting from the legacy `autoFocusEditor` boolean\n // so existing consumers are unaffected. Synced into the store so the cell\n // renderer, editors, and key handlers all read it consistently.\n const cellInteractionMode: CellInteraction =\n cellInteraction ?? (autoFocusEditor ? \"auto\" : \"manual\");\n\n const storeState = storeAPI;\n useEffect(() => {\n storeState.setState({ cellInteraction: cellInteractionMode });\n }, [storeState, cellInteractionMode]);\n\n useEffect(() => {\n // Give the store a handle to the focusable holder so editors can return\n // keyboard focus to the table when the cursor leaves them.\n storeState.setState({ tableElement: tableElementRef.current });\n }, [storeState]);\n\n // The row height is the density's; cells report it to their renderers\n const densityRowHeight = styleParamsForDensity(density).rowHeight;\n useEffect(() => {\n storeState.setState({ rowHeight: densityRowHeight });\n }, [storeState, densityRowHeight]);\n\n useEffect(() => {\n storeState.setState({ onEdit });\n }, [storeState, onEdit]);\n\n useEffect(() => {\n // Controlled overlay: mirror the caller's edited state into the store as\n // the source of truth. Optimistic in-table edits are superseded on the\n // next render when the caller passes an updated value back. When the caller\n // controls it, the loader-boundary identity remap steps aside.\n const controlled =\n updatedDataProp !== undefined ||\n rowStatusProp !== undefined ||\n deriveOverlay != null;\n const patch: Record<string, unknown> = { controlledOverlay: controlled };\n if (updatedDataProp !== undefined) patch.updatedData = updatedDataProp;\n if (rowStatusProp !== undefined) patch.rowStatus = rowStatusProp;\n storeState.setState(patch);\n }, [storeState, updatedDataProp, rowStatusProp, deriveOverlay]);\n\n // Derived controlled overlay: the library owns the loaded rows, so it runs\n // the consumer's `deriveOverlay(rows)` here and pushes the result. Re-derives\n // when the rows load/change or the function's identity changes (close it over\n // your external edit state). The `controlledOverlay` flag above suppresses the\n // loader-boundary identity remap so this derivation is authoritative.\n useEffect(() => {\n if (deriveOverlay == null) return;\n const overlay = deriveOverlay(data);\n storeState.setState({\n updatedData: overlay.updatedData,\n rowStatus: overlay.rowStatus,\n });\n }, [deriveOverlay, data, storeState]);\n\n // Function `columnSpec` derivation is hoisted to the provider\n // (`DataSheetProviderInner`), shared by both renderers.\n\n // Identity and canDeleteRows sync are hoisted to the provider\n // (`DataSheetProviderInner`), shared with `_DataPanel` — both depend only on\n // the resolved data provider, not any sheet-specific state.\n\n // Merge consumer `rowStatusStyles` over the built-in defaults and hand the\n // result to the store, where the cell renderer and row-header renderer read\n // it. Merged (not replaced) so overriding one status doesn't drop the rest.\n const mergedRowStatusStyles = useMemo<RowStatusStyles>(\n () => ({ ...DEFAULT_ROW_STATUS_STYLES, ...rowStatusStyles }),\n [rowStatusStyles],\n );\n useEffect(() => {\n storeState.setState({ rowStatusStyles: mergedRowStatusStyles });\n }, [storeState, mergedRowStatusStyles]);\n\n const realizedColumns = useMemo(() => {\n return columnSpec.map((col, colIndex) => {\n let fn =\n col.headerRenderer ??\n columnHeaderCellRenderer ??\n renderColumnHeaderCell;\n let activeSort: any = null;\n let activeFilter: any = null;\n if (col.sortable) {\n activeSort = columnSorts?.find((s) => s.key === col.key);\n }\n // The active filter for this column is whichever active filter targets\n // it (a rich `col.filters` filter or the generic operator filter) — match\n // by columnKey rather than a fixed id.\n for (const entry of activeFilters?.values() ?? []) {\n if ((entry as any)?.filter?.columnKey === col.key) {\n activeFilter = entry;\n break;\n }\n }\n\n const _columnHeaderCellRenderer: any = (colIndex) => {\n return fn(\n {\n col,\n colIndex,\n activeSort,\n activeFilter,\n },\n colIndex,\n );\n };\n\n return h(Column, {\n id: col.key,\n name: col.name,\n columnHeaderCellRenderer: _columnHeaderCellRenderer as any,\n cellRenderer: (rowIndex) => {\n const state = storeAPI.getState();\n return basicCellRenderer<T>(\n rowIndex,\n colIndex,\n col,\n state,\n filteredRowIndices,\n );\n },\n });\n });\n }, [\n columnSpec,\n columnSorts,\n activeFilters,\n storeAPI,\n filteredRowIndices,\n columnHeaderCellRenderer,\n ]);\n\n const onColumnWidthChanged = useSelector(\n (state) => state.onColumnWidthChanged,\n );\n\n const rowHeaderCellRenderer = useCallback(\n (rowIndex: number) => {\n let dataRowIndex = rowIndex;\n if (filteredRowIndices != null) {\n dataRowIndex = filteredRowIndices[rowIndex] ?? rowIndex;\n }\n const statusVal = rowStatus[dataRowIndex];\n let style: CSSProperties | undefined;\n if (statusVal != null) {\n style = mergedRowStatusStyles[statusVal]?.headerStyle;\n }\n\n const defaultLabel = `${dataRowIndex + 1}`;\n // A custom renderer supplies the header's *name* content (a group-key\n // label, an omit indicator, …); a nullish return keeps the default\n // 1-based label. Either way the node is wrapped in a `RowHeaderCell` so\n // status styling and the row index are always applied — the renderer is\n // not responsible for producing the whole cell.\n let name: ReactNode = defaultLabel;\n if (rowHeaderRenderer != null) {\n const custom = rowHeaderRenderer({\n rowIndex: dataRowIndex,\n visibleIndex: rowIndex,\n row: data[dataRowIndex] ?? updatedData[dataRowIndex],\n status: statusVal,\n isDeleted: statusVal === TableElementStatus.DELETED,\n defaultLabel,\n });\n if (custom != null) name = custom;\n }\n\n return h(RowHeaderCell, {\n enableRowReordering: false,\n index: rowIndex,\n name,\n style,\n });\n },\n [\n rowStatus,\n filteredRowIndices,\n mergedRowStatusStyles,\n rowHeaderRenderer,\n data,\n updatedData,\n ],\n );\n\n // Done with hooks!\n /** Guard for unacceptable state combinations:\n * editable = true requires selectionModes to include cells, else the user cannot select a cell to edit.\n * TODO: make this an impossible state to enter.\n */\n if (\n editable &&\n selectionModes &&\n !selectionModes.includes(RegionCardinality.CELLS)\n ) {\n return h(ErrorCallout, {\n title: \"Invalid selection mode\",\n description: \"Editable sheet requires cell selection\",\n });\n }\n\n // TODO: hoist this\n let _selectionModes = selectionModes;\n if (\n editable &&\n _selectionModes != null &&\n !_selectionModes.includes(RegionCardinality.CELLS)\n ) {\n _selectionModes = [..._selectionModes, RegionCardinality.CELLS];\n // Ensure selection mode includes \"cells\"\n }\n\n const cellRendererDependencies = [\n data,\n updatedData,\n focusedCell,\n rowStatus,\n filteredRowIndices,\n ];\n\n // Drive the table from the active provider's `fetchData`. A local (in-memory)\n // provider loads the whole array at once; a remote one uses the `pageSize` /\n // `fetchMode` props and shows load progress.\n let _showLoadProgress: boolean = false;\n let dataLoader: ReactNode = null;\n if (activeProvider != null) {\n _showLoadProgress = !isLocalProvider;\n // A local (in-memory) source loads all its rows in one page; its count\n // rides on the resolved provider (`localCount`), so `_DataSheet` no longer\n // takes a `data` prop — live rows come only from the store.\n dataLoader = h(_DataLoaderManager, {\n key: \"__data_loader\",\n fetchData: activeProvider.fetchData,\n pageSize: isLocalProvider ? Math.max(localCount, 1) : pageSize,\n fetchMode: isLocalProvider ? undefined : fetchMode,\n filterDebounce,\n initialData,\n });\n }\n const showFilterBar =\n (filters != null && filters.length > 0) || hasSortableOrFilterable;\n\n let filterStatus: ReactNode = null;\n if (showFilterBar) {\n filterStatus = h(ActiveFiltersList, { filters: filters ?? [] });\n }\n\n return h(\"div.data-sheet-container\", { className, style }, [\n // The actions/tools toolbar (selection-modal). Table-scoped controls like\n // scroll-to-row / full-text search live here as ordinary actions.\n h(ActionsToolbar, { actions: _actions }),\n dataLoader,\n children,\n h(\n \"div.data-sheet-holder\",\n {\n tabIndex: 0,\n onKeyDown: handleKeyDown,\n onKeyUp: handleKeyUp,\n ref: tableElementRef,\n style: holderStyle,\n },\n [\n // Inside the holder, so the toolbar and filters stay reachable.\n h.if(_showLoadProgress)(LoadErrorOverlay),\n h(\n Table as any, // Some sort of hyperscript type error\n {\n ref,\n numRows,\n className: \"data-sheet\",\n enableFocusedCell,\n enableColumnReordering,\n onColumnsReordered,\n focusedCell,\n selectedRegions,\n defaultRowHeight: rowHeight,\n columnWidths,\n onColumnWidthChanged,\n onSelection,\n /** TODO: we could enable this if we had a use-case */\n enableRowReordering: false,\n enableRowResizing: false,\n // The cell renderer is memoized internally based on these data dependencies\n cellRendererDependencies,\n onVisibleCellsChange: _onVisibleCellsChange,\n rowHeaderCellRenderer,\n selectionModes: _selectionModes,\n ...tableProps,\n getCellClipboardData: null,\n },\n realizedColumns,\n ),\n ],\n ),\n h(\"div.status-bar\", [\n filterStatus,\n statusBar,\n h(\"div.spacer\"),\n h.if(_showLoadProgress)(LoadProgressIndicator),\n ]),\n h.if(debug)(CellRendererDebugOverlay, {\n cellRendererDependencies,\n names: [\n \"data\",\n \"updatedData\",\n \"focusedCell\",\n \"rowStatus\",\n \"filteredRowIndices\",\n ],\n }),\n ]);\n}\n\nconst EMPTY_MAP = new Map<string, number>();\n\nconst columnWidthsIndexAtom = atom(\n (get) => get(storeAtom)?.columnWidthsIndex ?? EMPTY_MAP,\n);\nconst defaultColumnWidthAtom = atom(\n (get) => get(storeAtom)?.defaultColumnWidth ?? 150,\n);\n\nconst columnWidthsAtom = atom((get) => {\n const ix = get(columnWidthsIndexAtom);\n return get(columnSpecAtom).map(\n (col) => ix.get(col.key) ?? col.width ?? get(defaultColumnWidthAtom),\n );\n});\n\nfunction styleParamsForDensity(density: DataSheetDensity): {\n rowHeight: number;\n style: Record<string, string>;\n} {\n switch (density) {\n case DataSheetDensity.MEDIUM:\n return {\n rowHeight: 24,\n style: {\n \"--data-sheet-row-height\": \"24px\",\n \"--data-sheet-font-size\": \"14px\",\n },\n };\n case DataSheetDensity.LOW:\n return {\n rowHeight: 30,\n style: {\n \"--data-sheet-row-height\": \"30px\",\n \"--data-sheet-font-size\": \"18px\",\n },\n };\n case DataSheetDensity.HIGH:\n default:\n return {\n rowHeight: 20,\n style: {\n \"--data-sheet-row-height\": \"20px\",\n \"--data-sheet-font-size\": \"12px\",\n },\n };\n }\n}\n\n/** Convenience component: runs `useChunkLoader` from inside a `DataSheet`.\n * Render as a child of `DataSheet` (it renders nothing itself). */\nfunction _DataLoaderManager<T = any>({\n fetchData,\n ...rest\n}: {\n fetchData: FetchData<T>;\n} & FetchDataOptions<any>) {\n useDataLoader(fetchData, rest);\n return null;\n}\n"],"names":["splitDataProviderProps","DataViewRendererType","h","DataSheetProvider","atom","DataSheetDensity","ctx","useSelector","dataProviderAtom","dataRefreshTokenAtom","useMemo","persistViaProvider","_actions","columnControlActions","clipboardActions","createSaveAction","resetChangesAction","tableActionsAtom","tableHotkeysAtom","useHotkeys","useStoreAPI","useScrollHandler","useCallback","useEffect","useRef","tableFooterAtom","activeFilters","DEFAULT_ROW_STATUS_STYLES","renderColumnHeaderCell","colIndex","Column","basicCellRenderer","style","name","TableElementStatus","RowHeaderCell","RegionCardinality","ErrorCallout","ActiveFiltersList","ActionsToolbar","LoadErrorOverlay","Table","LoadProgressIndicator","CellRendererDebugOverlay","storeAtom","columnSpecAtom","useDataLoader"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA0EA,MAAM,uBAAuB;AAEtB,SAAS,UAAa,OAA0B;AACrD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX,yBAAyB;AAAA,IACzB,oBAAoB;AAAA,IACpB,qBAAqB;AAAA,IACrB;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,IACD;AAEJ,QAAM,CAAC,eAAe,aAAa,IAAIA,4BAA0B;AAAA,IAC/D,GAAG;AAAA,IACH,UAAUC,aAAAA,qBAAqB;AAAA,EAAA,CAChC;AACD,SAAOC,YAAAA;AAAAA,IACLC,KAAAA;AAAAA,IACA;AAAA,IACAD,YAAAA,QAAE,mBAAwB,aAAa;AAAA,EAAA;AAE3C;AAEA,MAAM,cAAcE,MAAAA,KAAK,KAAK;AAKvB,SAAS,kBAAqB;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb,WA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QAAAA,iBAAiB;AAAA,IACtB;AACE,aAAO;AAAA,QACL,WAAW;AAAA,QACX,OAAO;AAAA,UACL,2BAA2B;AAAA,UAC3B,0BAA0B;AAAA,QAAA;AAAA,MAC5B;AAAA,EACF;AAEN;AAIA,SAAS,mBAA4B;AAAA,EACnC;AAAA,EACA,GAAG;AACL,GAE2B;AACzByC,cAAAA,cAAc,WAAW,IAAI;AAC7B,SAAO;AACT;;;"}
@@ -1097,12 +1097,12 @@
1097
1097
  }/*
1098
1098
  * Copyright 2023 Palantir Technologies, Inc. All rights reserved.
1099
1099
  */
1100
- .bp6-dark ._data-sheet-container_13078_4, .bp6-dark ._data-sheet-holder_13078_4 {
1100
+ .bp6-dark ._data-sheet-container_p13ib_4, .bp6-dark ._data-sheet-holder_p13ib_4 {
1101
1101
  --data-sheet-cell-background-color-internal: var(--data-sheet-cell-background-color, #2f343c);
1102
1102
  --data-sheet-divider-color-internal: var(--data-sheet-divider-color, rgba(17, 20, 24, 0.4));
1103
1103
  }
1104
1104
 
1105
- ._data-sheet-container_13078_4, ._data-sheet-holder_13078_4 {
1105
+ ._data-sheet-container_p13ib_4, ._data-sheet-holder_p13ib_4 {
1106
1106
  flex: 1;
1107
1107
  min-height: 0;
1108
1108
  font-size: var(--data-sheet-font-size, 12px);
@@ -1111,34 +1111,34 @@
1111
1111
  --data-sheet-divider-color-internal: var(--data-sheet-divider-color, rgba(17, 20, 24, 0.15));
1112
1112
  --data-sheet-cell-background-color-internal: var(--data-sheet-cell-background-color, #edeff2);
1113
1113
  }
1114
- ._data-sheet-container_13078_4 .bp6-table-cell, ._data-sheet-holder_13078_4 .bp6-table-cell {
1114
+ ._data-sheet-container_p13ib_4 .bp6-table-cell, ._data-sheet-holder_p13ib_4 .bp6-table-cell {
1115
1115
  --tag-line-height: 1.25;
1116
1116
  --tag-picker-height: calc(var(--data-sheet-row-height) - 1px);
1117
1117
  --tag-picker-overflow: hidden;
1118
1118
  --tag-row-wrap: nowrap;
1119
1119
  padding: var(--data-sheet-cell-padding);
1120
1120
  }
1121
- ._data-sheet-container_13078_4 .bp6-table-cell:not([class*=bp6-intent-]):not(.bp6-loading), ._data-sheet-holder_13078_4 .bp6-table-cell:not([class*=bp6-intent-]):not(.bp6-loading) {
1121
+ ._data-sheet-container_p13ib_4 .bp6-table-cell:not([class*=bp6-intent-]):not(.bp6-loading), ._data-sheet-holder_p13ib_4 .bp6-table-cell:not([class*=bp6-intent-]):not(.bp6-loading) {
1122
1122
  color: var(--text-color);
1123
1123
  }
1124
- ._data-sheet-container_13078_4 .bp6-table-cell, ._data-sheet-container_13078_4 .bp6-table-row-name, ._data-sheet-holder_13078_4 .bp6-table-cell, ._data-sheet-holder_13078_4 .bp6-table-row-name {
1124
+ ._data-sheet-container_p13ib_4 .bp6-table-cell, ._data-sheet-container_p13ib_4 .bp6-table-row-name, ._data-sheet-holder_p13ib_4 .bp6-table-cell, ._data-sheet-holder_p13ib_4 .bp6-table-row-name {
1125
1125
  font-size: var(--data-sheet-font-size);
1126
1126
  line-height: var(--data-sheet-row-height);
1127
1127
  }
1128
- ._data-sheet-container_13078_4 .bp6-table-cell, ._data-sheet-holder_13078_4 .bp6-table-cell {
1128
+ ._data-sheet-container_p13ib_4 .bp6-table-cell, ._data-sheet-holder_p13ib_4 .bp6-table-cell {
1129
1129
  box-shadow: inset 0 -1px 0 var(--data-sheet-divider-color-internal), inset -1px 0 0 var(--data-sheet-divider-color-internal);
1130
1130
  }
1131
- ._data-sheet-container_13078_4 .bp6-table-cell-client, ._data-sheet-holder_13078_4 .bp6-table-cell-client {
1131
+ ._data-sheet-container_p13ib_4 .bp6-table-cell-client, ._data-sheet-holder_p13ib_4 .bp6-table-cell-client {
1132
1132
  background-color: var(--data-sheet-cell-background-color-internal);
1133
1133
  }
1134
- ._data-sheet-container_13078_4 .bp6-table-row-name, ._data-sheet-holder_13078_4 .bp6-table-row-name {
1134
+ ._data-sheet-container_p13ib_4 .bp6-table-row-name, ._data-sheet-holder_p13ib_4 .bp6-table-row-name {
1135
1135
  color: var(--secondary-color);
1136
1136
  }
1137
- ._data-sheet-container_13078_4 .bp6-table-column-name, ._data-sheet-holder_13078_4 .bp6-table-column-name {
1137
+ ._data-sheet-container_p13ib_4 .bp6-table-column-name, ._data-sheet-holder_p13ib_4 .bp6-table-column-name {
1138
1138
  font-size: 1.2em;
1139
1139
  }
1140
1140
 
1141
- ._data-sheet-container_13078_4 {
1141
+ ._data-sheet-container_p13ib_4 {
1142
1142
  display: flex;
1143
1143
  position: relative;
1144
1144
  height: 100%;
@@ -1147,14 +1147,14 @@
1147
1147
  max-width: 100%;
1148
1148
  }
1149
1149
 
1150
- ._data-sheet_13078_4 {
1150
+ ._data-sheet_p13ib_4 {
1151
1151
  height: 100%;
1152
1152
  }
1153
- ._data-sheet_13078_4 .bp6-table-quadrant {
1153
+ ._data-sheet_p13ib_4 .bp6-table-quadrant {
1154
1154
  background-color: var(--panel-secondary-background-color);
1155
1155
  }
1156
1156
 
1157
- ._input-cell_13078_61 input {
1157
+ ._input-cell_p13ib_61 input {
1158
1158
  width: 100%;
1159
1159
  height: 100%;
1160
1160
  padding: 0;
@@ -1167,16 +1167,20 @@
1167
1167
  font-family: inherit;
1168
1168
  font-size: inherit;
1169
1169
  }
1170
- ._input-cell_13078_61 input:focus {
1170
+ ._input-cell_p13ib_61 input:focus {
1171
1171
  outline: none;
1172
1172
  }
1173
1173
 
1174
- ._derived-cell_13078_78 {
1174
+ ._derived-cell_p13ib_78 {
1175
1175
  color: var(--pz-text-subtle-color, var(--secondary-color)) !important;
1176
1176
  font-style: italic;
1177
1177
  }
1178
1178
 
1179
- ._value-viewer-cell_13078_83 .bp6-popover-target {
1179
+ ._readonly-cell_p13ib_83 {
1180
+ color: var(--pz-text-subtle-color, var(--secondary-color)) !important;
1181
+ }
1182
+
1183
+ ._value-viewer-cell_p13ib_87 .bp6-popover-target {
1180
1184
  width: 100%;
1181
1185
  height: var(--data-sheet-row-height);
1182
1186
  position: relative;
@@ -1184,11 +1188,11 @@
1184
1188
  margin: calc(var(--data-sheet-cell-padding) * -1);
1185
1189
  }
1186
1190
 
1187
- ._editor-cell_13078_91 {
1191
+ ._editor-cell_p13ib_95 {
1188
1192
  --tag-outline: 0 0 0 1px rgba(128, 128, 128, 0.35);
1189
1193
  }
1190
1194
 
1191
- ._editor-cell_13078_91 .bp6-popover-target {
1195
+ ._editor-cell_p13ib_95 .bp6-popover-target {
1192
1196
  position: absolute;
1193
1197
  top: 0;
1194
1198
  left: 0;
@@ -1196,20 +1200,20 @@
1196
1200
  height: 100%;
1197
1201
  }
1198
1202
 
1199
- ._hidden-input_13078_103 {
1203
+ ._hidden-input_p13ib_107 {
1200
1204
  opacity: 0;
1201
1205
  position: absolute;
1202
1206
  width: 0;
1203
1207
  }
1204
1208
 
1205
- ._data-editor-anchor_13078_109 {
1209
+ ._data-editor-anchor_p13ib_113 {
1206
1210
  width: 100%;
1207
1211
  height: 100%;
1208
1212
  margin: 0;
1209
1213
  pointer-events: none;
1210
1214
  }
1211
1215
 
1212
- ._corner-drag-handle_13078_116 {
1216
+ ._corner-drag-handle_p13ib_120 {
1213
1217
  position: absolute;
1214
1218
  bottom: 0;
1215
1219
  right: 0;
@@ -1219,23 +1223,23 @@
1219
1223
  background-color: dodgerblue;
1220
1224
  }
1221
1225
 
1222
- ._data-sheet-toolbar_13078_126 {
1226
+ ._data-sheet-toolbar_p13ib_130 {
1223
1227
  display: flex;
1224
1228
  flex-direction: row;
1225
1229
  margin-bottom: 4px;
1226
1230
  }
1227
1231
 
1228
- ._spacer_13078_132 {
1232
+ ._spacer_p13ib_136 {
1229
1233
  flex-grow: 1;
1230
1234
  }
1231
1235
 
1232
- ._table-control_13078_136 {
1236
+ ._table-control_p13ib_140 {
1233
1237
  display: flex;
1234
1238
  flex-direction: row;
1235
1239
  margin-bottom: 0.25em;
1236
1240
  }
1237
1241
 
1238
- ._status-bar_13078_142 {
1242
+ ._status-bar_p13ib_146 {
1239
1243
  display: flex;
1240
1244
  flex-direction: row;
1241
1245
  padding: 0.2em 0.5em;
@@ -1243,7 +1247,7 @@
1243
1247
  background-color: var(--panel-secondary-background-color);
1244
1248
  }
1245
1249
 
1246
- ._data-sheet-holder_13078_4 {
1250
+ ._data-sheet-holder_p13ib_4 {
1247
1251
  position: relative;
1248
1252
  }._filter-form-container_1r3aw_1 {
1249
1253
  display: flex;
@@ -124,7 +124,7 @@ function DataSheetRenderer({
124
124
  ctx.useSync(tableActionsAtom, _actions);
125
125
  const getHotkeys = ctx.useSet(tableHotkeysAtom);
126
126
  const hotkeysConfig = useMemo(() => {
127
- return getHotkeys();
127
+ return getHotkeys(_actions);
128
128
  }, [_actions]);
129
129
  const { handleKeyDown, handleKeyUp } = useHotkeys(hotkeysConfig);
130
130
  const selectedRegions = useSelector((state) => state.selection ?? []);
@@ -1 +1 @@
1
- {"version":3,"file":"data-sheet.js","sources":["../src/data-sheet.ts"],"sourcesContent":["import { useHotkeys } from \"@blueprintjs/core\";\nimport {\n Column,\n RegionCardinality,\n RowHeaderCell,\n Table,\n} from \"@blueprintjs/table\";\nimport \"@blueprintjs/table/lib/css/table.css\";\nimport {\n CSSProperties,\n ReactNode,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n} from \"react\";\nimport {\n LoadErrorOverlay,\n LoadProgressIndicator,\n ActionsToolbar,\n ActiveFiltersList,\n} from \"./components\";\nimport { basicCellRenderer, renderColumnHeaderCell } from \"./renderers\";\nimport h from \"./main.module.sass\";\nimport {\n columnSpecAtom,\n ctx,\n dataProviderAtom,\n dataRefreshTokenAtom,\n DataSheetProvider,\n DataViewRendererType,\n DEFAULT_ROW_STATUS_STYLES,\n FetchData,\n persistViaProvider,\n RowStatusStyles,\n splitDataProviderProps,\n storeAtom,\n tableActionsAtom,\n TableElementStatus,\n useSelector,\n useStoreAPI,\n VisibleCells,\n} from \"./provider\";\nimport { atom } from \"jotai\";\nimport { CellRendererDebugOverlay, tableHotkeysAtom } from \"./utils\";\nimport {\n clipboardActions,\n columnControlActions,\n createSaveAction,\n resetChangesAction,\n TableAction,\n TableActionContext,\n} from \"./actions\";\nimport {\n tableFooterAtom,\n useDataLoader,\n useScrollHandler,\n} from \"./postgrest-table\";\nimport {\n CellInteraction,\n DataSheetDensity,\n DataSheetProps,\n DataSheetRendererProps,\n FetchDataOptions,\n} from \"./types.ts\";\nimport { ErrorCallout } from \"@macrostrat/ui-components\";\n\n// More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args\n\n// TODO: add a \"copy to selection\" tool (the little square in the bottom right corner of a cell)\n// This should copy the value of a cell (or a set of cells in the same row) downwards.\n\n/** Approximate column-header + scrollbar allowance, used to size the table to\n * its content in paged mode. */\nconst COLUMN_HEADER_HEIGHT = 34;\n\nexport function DataSheet<T>(props: DataSheetProps<T>) {\n const {\n data,\n columnSpec,\n columnSpecOptions,\n editable = true,\n enableColumnReordering = false,\n enableFocusedCell = false,\n defaultColumnWidth = 150,\n children,\n name,\n ...rest\n } = props;\n\n const [providerProps, rendererProps] = splitDataProviderProps<T>({\n ...props,\n viewType: DataViewRendererType.TABLE,\n });\n return h(\n DataSheetProvider<T>,\n providerProps,\n h(DataSheetRenderer<any>, rendererProps),\n );\n}\n\nconst verboseAtom = atom(false);\n\n/** The table (cell-grid) renderer. Assumes it is rendered inside a\n * `DataSheetProvider` (the `DataSheet` wrapper, or `DataView`). Exported so a\n * shared-store `DataView` can mount it directly alongside `_DataPanel`. */\nexport function DataSheetRenderer<T>({\n fetchData,\n provider,\n pageSize,\n fetchMode,\n filterDebounce,\n initialData,\n onVisibleCellsChange,\n onUpdateData,\n onEdit,\n onSave,\n updatedData: updatedDataProp,\n rowStatus: rowStatusProp,\n // Identity/canDeleteRows sync (was here) is now handled by the provider\n // (`DataSheetProviderInner`); still destructured so `identity`/`refreshToken`\n // don't leak into `...rest` (spread onto the Blueprint `Table` below).\n identity: _identity,\n deriveOverlay,\n refreshToken: _refreshToken,\n onDeleteRows,\n name,\n verbose = false,\n debug = false,\n enableFocusedCell,\n autoFocusEditor = true,\n cellInteraction,\n enableClipboard = true,\n density = DataSheetDensity.HIGH,\n selectionModes,\n actions,\n filters,\n columnHeaderCellRenderer,\n statusBar,\n rowStatusStyles,\n rowHeaderRenderer,\n children,\n ...tableProps\n}: DataSheetRendererProps<T>) {\n /**\n * @param data: The data to be displayed in the table\n * @param columnSpec: The specification for all columns in the table. If not provided, the column spec will be generated from the data.\n * @param columnSpecOptions: Options for generating a column spec from data\n */\n\n ctx.useSync(verboseAtom, verbose);\n\n const editable = useSelector((state) => state.editable);\n\n // The active data source is resolved in the wrapper (`DataSheet`) and held in\n // the provider layer; read it here rather than resolving per render.\n const {\n provider: activeProvider,\n isLocalProvider,\n localCount,\n } = ctx.useValue(dataProviderAtom);\n\n // When an explicit provider owns persistence, its methods drive the built-in\n // Save (batch: edits→saveRows, added→insertRow, deleted→deleteRows), then a\n // refresh. Otherwise the loose `onSave` handler is used.\n const bumpRefresh = ctx.useSet(dataRefreshTokenAtom);\n const providerSave = useMemo(() => {\n const p = provider;\n if (\n p == null ||\n (p.saveRows == null && p.deleteRows == null && p.insertRow == null)\n ) {\n return null;\n }\n return async (actionCtx: TableActionContext<T>) => {\n await persistViaProvider(p, actionCtx);\n bumpRefresh((v) => v + 1);\n };\n }, [provider, bumpRefresh]);\n const saveHandler = onSave ?? providerSave;\n\n // Sync table actions to atom. Consumer actions come first (they override a\n // built-in by reusing its id); the built-in column controls (sort/filter)\n // fill in the rest — so both the toolbar and the header dropdown source from\n // one registry. Built-ins self-gate (single sortable/filterable column).\n const _actions: TableAction[] = useMemo(() => {\n const _actions: TableAction[] = [];\n const add = (list: TableAction[]) => {\n for (const a of list) {\n if (!_actions.some((x) => x.id === a.id)) _actions.push(a);\n }\n };\n if (actions != null) add(actions);\n add(columnControlActions);\n if (enableClipboard) add(clipboardActions);\n // Save/reset last — they're the most significant actions — and present for\n // every cardinality (editable), so the toolbar stays mounted regardless of\n // selection.\n if (editable) {\n if (saveHandler != null) add([createSaveAction(saveHandler)]);\n add([resetChangesAction]);\n }\n return _actions;\n }, [actions, enableClipboard, editable, saveHandler]);\n\n /*** TODO: generalize this, probably shouldn't need 'set' */\n ctx.useSync(tableActionsAtom, _actions);\n const getHotkeys = ctx.useSet(tableHotkeysAtom);\n\n // This is quite hacky!\n const hotkeysConfig = useMemo(() => {\n return getHotkeys();\n }, [_actions]);\n\n const { handleKeyDown, handleKeyUp } = useHotkeys(hotkeysConfig);\n\n // For now, we only consider a single cell \"focused\" when we have one cell selected.\n // Multi-cell selections have a different set of \"bulk\" actions.\n const selectedRegions = useSelector<T>((state) => state.selection ?? []);\n\n const data = useSelector((state) => state.data);\n\n const rowStatus = useSelector((state) => state.rowStatus);\n\n const focusedCell = useSelector((state) => state.focusedCell);\n\n const ref = useSelector((state) => state.tableRef);\n\n const columnSpec = useSelector((state) => state.columnSpec);\n\n // A sparse array to hold updates\n // TODO: create a \"changeset\" concept to facilitate undo/redo\n const updatedData = useSelector((state) => state.updatedData);\n\n const onSelection = useSelector((state) => state.onSelection);\n\n const storeAPI = useStoreAPI<T>();\n\n const onScroll = useScrollHandler();\n const _onVisibleCellsChange = useCallback(\n (visibleCells: VisibleCells) => {\n onScroll(visibleCells);\n onVisibleCellsChange?.(visibleCells);\n },\n [onVisibleCellsChange, onScroll],\n );\n\n useEffect(() => {\n if (!verbose) return;\n console.log(\"Updated data\", updatedData);\n }, [updatedData]);\n\n useEffect(() => {\n onUpdateData?.(updatedData, data);\n }, [onUpdateData, data, updatedData]);\n\n useEffect(() => {\n if (!verbose) return;\n console.log(\"Selected regions\", selectedRegions);\n }, [selectedRegions]);\n\n const tableElementRef = useRef<HTMLElement>(null);\n useEffect(() => {\n // Return the focus to the table\n tableElementRef.current?.focus();\n }, [focusedCell]);\n\n const columnWidths = ctx.useValue(columnWidthsAtom);\n\n // When filters are active, only show matching rows\n const filteredRowIndices = useSelector((state) => state.filteredRowIndices);\n const totalRows = Math.max(updatedData.length, data.length);\n const numRows =\n filteredRowIndices != null ? filteredRowIndices.length : totalRows;\n\n let className = `${density}-density`;\n\n const { rowHeight, style } = styleParamsForDensity(density);\n\n // In paged mode the row count is small and fixed, so let the table size to\n // its content (header + rows) instead of filling the viewport.\n const footerInfo = ctx.useValue(tableFooterAtom);\n let holderStyle: CSSProperties | undefined = undefined;\n if (footerInfo.mode === \"paged\") {\n holderStyle = {\n flex: \"0 0 auto\" as const,\n height: numRows * rowHeight + COLUMN_HEADER_HEIGHT,\n };\n }\n\n const onColumnsReordered = useSelector((state) => state.onColumnsReordered);\n // Whether table-level column drag-reordering is enabled. Held in the store\n // (set from the `enableColumnReordering` prop by the provider); it must reach\n // the Blueprint `Table` — the `onColumnsReordered` handler alone doesn't turn\n // on the drag affordance.\n const enableColumnReordering = useSelector(\n (state) => state.enableColumnReordering,\n );\n\n // Auto-detect if any columns have sortable/filterable set.\n // If so and no explicit columnHeaderCellRenderer was provided,\n // use the built-in client-side sort/filter header.\n const hasSortableOrFilterable = useMemo(\n () =>\n columnSpec.some(\n (col) =>\n col.sortable ||\n col.filterable ||\n (Array.isArray(col.filters) && col.filters.length > 0),\n ),\n [columnSpec],\n );\n\n const columnSorts = useSelector((state) => state.columnSorts);\n const activeFilters = useSelector((state) => state.activeFilters);\n\n // Cell activation mode, defaulting from the legacy `autoFocusEditor` boolean\n // so existing consumers are unaffected. Synced into the store so the cell\n // renderer, editors, and key handlers all read it consistently.\n const cellInteractionMode: CellInteraction =\n cellInteraction ?? (autoFocusEditor ? \"auto\" : \"manual\");\n\n const storeState = storeAPI;\n useEffect(() => {\n storeState.setState({ cellInteraction: cellInteractionMode });\n }, [storeState, cellInteractionMode]);\n\n useEffect(() => {\n // Give the store a handle to the focusable holder so editors can return\n // keyboard focus to the table when the cursor leaves them.\n storeState.setState({ tableElement: tableElementRef.current });\n }, [storeState]);\n\n // The row height is the density's; cells report it to their renderers\n const densityRowHeight = styleParamsForDensity(density).rowHeight;\n useEffect(() => {\n storeState.setState({ rowHeight: densityRowHeight });\n }, [storeState, densityRowHeight]);\n\n useEffect(() => {\n storeState.setState({ onEdit });\n }, [storeState, onEdit]);\n\n useEffect(() => {\n // Controlled overlay: mirror the caller's edited state into the store as\n // the source of truth. Optimistic in-table edits are superseded on the\n // next render when the caller passes an updated value back. When the caller\n // controls it, the loader-boundary identity remap steps aside.\n const controlled =\n updatedDataProp !== undefined ||\n rowStatusProp !== undefined ||\n deriveOverlay != null;\n const patch: Record<string, unknown> = { controlledOverlay: controlled };\n if (updatedDataProp !== undefined) patch.updatedData = updatedDataProp;\n if (rowStatusProp !== undefined) patch.rowStatus = rowStatusProp;\n storeState.setState(patch);\n }, [storeState, updatedDataProp, rowStatusProp, deriveOverlay]);\n\n // Derived controlled overlay: the library owns the loaded rows, so it runs\n // the consumer's `deriveOverlay(rows)` here and pushes the result. Re-derives\n // when the rows load/change or the function's identity changes (close it over\n // your external edit state). The `controlledOverlay` flag above suppresses the\n // loader-boundary identity remap so this derivation is authoritative.\n useEffect(() => {\n if (deriveOverlay == null) return;\n const overlay = deriveOverlay(data);\n storeState.setState({\n updatedData: overlay.updatedData,\n rowStatus: overlay.rowStatus,\n });\n }, [deriveOverlay, data, storeState]);\n\n // Function `columnSpec` derivation is hoisted to the provider\n // (`DataSheetProviderInner`), shared by both renderers.\n\n // Identity and canDeleteRows sync are hoisted to the provider\n // (`DataSheetProviderInner`), shared with `_DataPanel` — both depend only on\n // the resolved data provider, not any sheet-specific state.\n\n // Merge consumer `rowStatusStyles` over the built-in defaults and hand the\n // result to the store, where the cell renderer and row-header renderer read\n // it. Merged (not replaced) so overriding one status doesn't drop the rest.\n const mergedRowStatusStyles = useMemo<RowStatusStyles>(\n () => ({ ...DEFAULT_ROW_STATUS_STYLES, ...rowStatusStyles }),\n [rowStatusStyles],\n );\n useEffect(() => {\n storeState.setState({ rowStatusStyles: mergedRowStatusStyles });\n }, [storeState, mergedRowStatusStyles]);\n\n const realizedColumns = useMemo(() => {\n return columnSpec.map((col, colIndex) => {\n let fn =\n col.headerRenderer ??\n columnHeaderCellRenderer ??\n renderColumnHeaderCell;\n let activeSort: any = null;\n let activeFilter: any = null;\n if (col.sortable) {\n activeSort = columnSorts?.find((s) => s.key === col.key);\n }\n // The active filter for this column is whichever active filter targets\n // it (a rich `col.filters` filter or the generic operator filter) — match\n // by columnKey rather than a fixed id.\n for (const entry of activeFilters?.values() ?? []) {\n if ((entry as any)?.filter?.columnKey === col.key) {\n activeFilter = entry;\n break;\n }\n }\n\n const _columnHeaderCellRenderer: any = (colIndex) => {\n return fn(\n {\n col,\n colIndex,\n activeSort,\n activeFilter,\n },\n colIndex,\n );\n };\n\n return h(Column, {\n id: col.key,\n name: col.name,\n columnHeaderCellRenderer: _columnHeaderCellRenderer as any,\n cellRenderer: (rowIndex) => {\n const state = storeAPI.getState();\n return basicCellRenderer<T>(\n rowIndex,\n colIndex,\n col,\n state,\n filteredRowIndices,\n );\n },\n });\n });\n }, [\n columnSpec,\n columnSorts,\n activeFilters,\n storeAPI,\n filteredRowIndices,\n columnHeaderCellRenderer,\n ]);\n\n const onColumnWidthChanged = useSelector(\n (state) => state.onColumnWidthChanged,\n );\n\n const rowHeaderCellRenderer = useCallback(\n (rowIndex: number) => {\n let dataRowIndex = rowIndex;\n if (filteredRowIndices != null) {\n dataRowIndex = filteredRowIndices[rowIndex] ?? rowIndex;\n }\n const statusVal = rowStatus[dataRowIndex];\n let style: CSSProperties | undefined;\n if (statusVal != null) {\n style = mergedRowStatusStyles[statusVal]?.headerStyle;\n }\n\n const defaultLabel = `${dataRowIndex + 1}`;\n // A custom renderer supplies the header's *name* content (a group-key\n // label, an omit indicator, …); a nullish return keeps the default\n // 1-based label. Either way the node is wrapped in a `RowHeaderCell` so\n // status styling and the row index are always applied — the renderer is\n // not responsible for producing the whole cell.\n let name: ReactNode = defaultLabel;\n if (rowHeaderRenderer != null) {\n const custom = rowHeaderRenderer({\n rowIndex: dataRowIndex,\n visibleIndex: rowIndex,\n row: data[dataRowIndex] ?? updatedData[dataRowIndex],\n status: statusVal,\n isDeleted: statusVal === TableElementStatus.DELETED,\n defaultLabel,\n });\n if (custom != null) name = custom;\n }\n\n return h(RowHeaderCell, {\n enableRowReordering: false,\n index: rowIndex,\n name,\n style,\n });\n },\n [\n rowStatus,\n filteredRowIndices,\n mergedRowStatusStyles,\n rowHeaderRenderer,\n data,\n updatedData,\n ],\n );\n\n // Done with hooks!\n /** Guard for unacceptable state combinations:\n * editable = true requires selectionModes to include cells, else the user cannot select a cell to edit.\n * TODO: make this an impossible state to enter.\n */\n if (\n editable &&\n selectionModes &&\n !selectionModes.includes(RegionCardinality.CELLS)\n ) {\n return h(ErrorCallout, {\n title: \"Invalid selection mode\",\n description: \"Editable sheet requires cell selection\",\n });\n }\n\n // TODO: hoist this\n let _selectionModes = selectionModes;\n if (\n editable &&\n _selectionModes != null &&\n !_selectionModes.includes(RegionCardinality.CELLS)\n ) {\n _selectionModes = [..._selectionModes, RegionCardinality.CELLS];\n // Ensure selection mode includes \"cells\"\n }\n\n const cellRendererDependencies = [\n data,\n updatedData,\n focusedCell,\n rowStatus,\n filteredRowIndices,\n ];\n\n // Drive the table from the active provider's `fetchData`. A local (in-memory)\n // provider loads the whole array at once; a remote one uses the `pageSize` /\n // `fetchMode` props and shows load progress.\n let _showLoadProgress: boolean = false;\n let dataLoader: ReactNode = null;\n if (activeProvider != null) {\n _showLoadProgress = !isLocalProvider;\n // A local (in-memory) source loads all its rows in one page; its count\n // rides on the resolved provider (`localCount`), so `_DataSheet` no longer\n // takes a `data` prop — live rows come only from the store.\n dataLoader = h(_DataLoaderManager, {\n key: \"__data_loader\",\n fetchData: activeProvider.fetchData,\n pageSize: isLocalProvider ? Math.max(localCount, 1) : pageSize,\n fetchMode: isLocalProvider ? undefined : fetchMode,\n filterDebounce,\n initialData,\n });\n }\n const showFilterBar =\n (filters != null && filters.length > 0) || hasSortableOrFilterable;\n\n let filterStatus: ReactNode = null;\n if (showFilterBar) {\n filterStatus = h(ActiveFiltersList, { filters: filters ?? [] });\n }\n\n return h(\"div.data-sheet-container\", { className, style }, [\n // The actions/tools toolbar (selection-modal). Table-scoped controls like\n // scroll-to-row / full-text search live here as ordinary actions.\n h(ActionsToolbar, { actions: _actions }),\n dataLoader,\n children,\n h(\n \"div.data-sheet-holder\",\n {\n tabIndex: 0,\n onKeyDown: handleKeyDown,\n onKeyUp: handleKeyUp,\n ref: tableElementRef,\n style: holderStyle,\n },\n [\n // Inside the holder, so the toolbar and filters stay reachable.\n h.if(_showLoadProgress)(LoadErrorOverlay),\n h(\n Table as any, // Some sort of hyperscript type error\n {\n ref,\n numRows,\n className: \"data-sheet\",\n enableFocusedCell,\n enableColumnReordering,\n onColumnsReordered,\n focusedCell,\n selectedRegions,\n defaultRowHeight: rowHeight,\n columnWidths,\n onColumnWidthChanged,\n onSelection,\n /** TODO: we could enable this if we had a use-case */\n enableRowReordering: false,\n enableRowResizing: false,\n // The cell renderer is memoized internally based on these data dependencies\n cellRendererDependencies,\n onVisibleCellsChange: _onVisibleCellsChange,\n rowHeaderCellRenderer,\n selectionModes: _selectionModes,\n ...tableProps,\n getCellClipboardData: null,\n },\n realizedColumns,\n ),\n ],\n ),\n h(\"div.status-bar\", [\n filterStatus,\n statusBar,\n h(\"div.spacer\"),\n h.if(_showLoadProgress)(LoadProgressIndicator),\n ]),\n h.if(debug)(CellRendererDebugOverlay, {\n cellRendererDependencies,\n names: [\n \"data\",\n \"updatedData\",\n \"focusedCell\",\n \"rowStatus\",\n \"filteredRowIndices\",\n ],\n }),\n ]);\n}\n\nconst EMPTY_MAP = new Map<string, number>();\n\nconst columnWidthsIndexAtom = atom(\n (get) => get(storeAtom)?.columnWidthsIndex ?? EMPTY_MAP,\n);\nconst defaultColumnWidthAtom = atom(\n (get) => get(storeAtom)?.defaultColumnWidth ?? 150,\n);\n\nconst columnWidthsAtom = atom((get) => {\n const ix = get(columnWidthsIndexAtom);\n return get(columnSpecAtom).map(\n (col) => ix.get(col.key) ?? col.width ?? get(defaultColumnWidthAtom),\n );\n});\n\nfunction styleParamsForDensity(density: DataSheetDensity): {\n rowHeight: number;\n style: Record<string, string>;\n} {\n switch (density) {\n case DataSheetDensity.MEDIUM:\n return {\n rowHeight: 24,\n style: {\n \"--data-sheet-row-height\": \"24px\",\n \"--data-sheet-font-size\": \"14px\",\n },\n };\n case DataSheetDensity.LOW:\n return {\n rowHeight: 30,\n style: {\n \"--data-sheet-row-height\": \"30px\",\n \"--data-sheet-font-size\": \"18px\",\n },\n };\n case DataSheetDensity.HIGH:\n default:\n return {\n rowHeight: 20,\n style: {\n \"--data-sheet-row-height\": \"20px\",\n \"--data-sheet-font-size\": \"12px\",\n },\n };\n }\n}\n\n/** Convenience component: runs `useChunkLoader` from inside a `DataSheet`.\n * Render as a child of `DataSheet` (it renders nothing itself). */\nfunction _DataLoaderManager<T = any>({\n fetchData,\n ...rest\n}: {\n fetchData: FetchData<T>;\n} & FetchDataOptions<any>) {\n useDataLoader(fetchData, rest);\n return null;\n}\n"],"names":["_actions","colIndex","style","name"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA0EA,MAAM,uBAAuB;AAEtB,SAAS,UAAa,OAA0B;AACrD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX,yBAAyB;AAAA,IACzB,oBAAoB;AAAA,IACpB,qBAAqB;AAAA,IACrB;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,IACD;AAEJ,QAAM,CAAC,eAAe,aAAa,IAAI,uBAA0B;AAAA,IAC/D,GAAG;AAAA,IACH,UAAU,qBAAqB;AAAA,EAAA,CAChC;AACD,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,EAAE,mBAAwB,aAAa;AAAA,EAAA;AAE3C;AAEA,MAAM,cAAc,KAAK,KAAK;AAKvB,SAAS,kBAAqB;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAa;AA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AAc,EAAE;AAAA,IACzB,CAAC,QAAQ,GAAG,IAAI,IAAI,GAAG,KAAK,IAAI,SAAS,IAAI,sBAAsB;AAAA,EAAA;AAEvE,CAAC;AAED,SAAS,sBAAsB,SAG7B;AACA,UAAQ,SAAA;AAAA,IACN,KAAK,iBAAiB;AACpB,aAAO;AAAA,QACL,WAAW;AAAA,QACX,OAAO;AAAA,UACL,2BAA2B;AAAA,UAC3B,0BAA0B;AAAA,QAAA;AAAA,MAC5B;AAAA,IAEJ,KAAK,iBAAiB;AACpB,aAAO;AAAA,QACL,WAAW;AAAA,QACX,OAAO;AAAA,UACL,2BAA2B;AAAA,UAC3B,0BAA0B;AAAA,QAAA;AAAA,MAC5B;AAAA,IAEJ,KAAK,iBAAiB;AAAA,IACtB;AACE,aAAO;AAAA,QACL,WAAW;AAAA,QACX,OAAO;AAAA,UACL,2BAA2B;AAAA,UAC3B,0BAA0B;AAAA,QAAA;AAAA,MAC5B;AAAA,EACF;AAEN;AAIA,SAAS,mBAA4B;AAAA,EACnC;AAAA,EACA,GAAG;AACL,GAE2B;AACzB,gBAAc,WAAW,IAAI;AAC7B,SAAO;AACT;"}
1
+ {"version":3,"file":"data-sheet.js","sources":["../src/data-sheet.ts"],"sourcesContent":["import { useHotkeys } from \"@blueprintjs/core\";\nimport {\n Column,\n RegionCardinality,\n RowHeaderCell,\n Table,\n} from \"@blueprintjs/table\";\nimport \"@blueprintjs/table/lib/css/table.css\";\nimport {\n CSSProperties,\n ReactNode,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n} from \"react\";\nimport {\n LoadErrorOverlay,\n LoadProgressIndicator,\n ActionsToolbar,\n ActiveFiltersList,\n} from \"./components\";\nimport { basicCellRenderer, renderColumnHeaderCell } from \"./renderers\";\nimport h from \"./main.module.sass\";\nimport {\n columnSpecAtom,\n ctx,\n dataProviderAtom,\n dataRefreshTokenAtom,\n DataSheetProvider,\n DataViewRendererType,\n DEFAULT_ROW_STATUS_STYLES,\n FetchData,\n persistViaProvider,\n RowStatusStyles,\n splitDataProviderProps,\n storeAtom,\n tableActionsAtom,\n TableElementStatus,\n useSelector,\n useStoreAPI,\n VisibleCells,\n} from \"./provider\";\nimport { atom } from \"jotai\";\nimport { CellRendererDebugOverlay, tableHotkeysAtom } from \"./utils\";\nimport {\n clipboardActions,\n columnControlActions,\n createSaveAction,\n resetChangesAction,\n TableAction,\n TableActionContext,\n} from \"./actions\";\nimport {\n tableFooterAtom,\n useDataLoader,\n useScrollHandler,\n} from \"./postgrest-table\";\nimport {\n CellInteraction,\n DataSheetDensity,\n DataSheetProps,\n DataSheetRendererProps,\n FetchDataOptions,\n} from \"./types.ts\";\nimport { ErrorCallout } from \"@macrostrat/ui-components\";\n\n// More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args\n\n// TODO: add a \"copy to selection\" tool (the little square in the bottom right corner of a cell)\n// This should copy the value of a cell (or a set of cells in the same row) downwards.\n\n/** Approximate column-header + scrollbar allowance, used to size the table to\n * its content in paged mode. */\nconst COLUMN_HEADER_HEIGHT = 34;\n\nexport function DataSheet<T>(props: DataSheetProps<T>) {\n const {\n data,\n columnSpec,\n columnSpecOptions,\n editable = true,\n enableColumnReordering = false,\n enableFocusedCell = false,\n defaultColumnWidth = 150,\n children,\n name,\n ...rest\n } = props;\n\n const [providerProps, rendererProps] = splitDataProviderProps<T>({\n ...props,\n viewType: DataViewRendererType.TABLE,\n });\n return h(\n DataSheetProvider<T>,\n providerProps,\n h(DataSheetRenderer<any>, rendererProps),\n );\n}\n\nconst verboseAtom = atom(false);\n\n/** The table (cell-grid) renderer. Assumes it is rendered inside a\n * `DataSheetProvider` (the `DataSheet` wrapper, or `DataView`). Exported so a\n * shared-store `DataView` can mount it directly alongside `_DataPanel`. */\nexport function DataSheetRenderer<T>({\n fetchData,\n provider,\n pageSize,\n fetchMode,\n filterDebounce,\n initialData,\n onVisibleCellsChange,\n onUpdateData,\n onEdit,\n onSave,\n updatedData: updatedDataProp,\n rowStatus: rowStatusProp,\n // Identity/canDeleteRows sync (was here) is now handled by the provider\n // (`DataSheetProviderInner`); still destructured so `identity`/`refreshToken`\n // don't leak into `...rest` (spread onto the Blueprint `Table` below).\n identity: _identity,\n deriveOverlay,\n refreshToken: _refreshToken,\n onDeleteRows,\n name,\n verbose = false,\n debug = false,\n enableFocusedCell,\n autoFocusEditor = true,\n cellInteraction,\n enableClipboard = true,\n density = DataSheetDensity.HIGH,\n selectionModes,\n actions,\n filters,\n columnHeaderCellRenderer,\n statusBar,\n rowStatusStyles,\n rowHeaderRenderer,\n children,\n ...tableProps\n}: DataSheetRendererProps<T>) {\n /**\n * @param data: The data to be displayed in the table\n * @param columnSpec: The specification for all columns in the table. If not provided, the column spec will be generated from the data.\n * @param columnSpecOptions: Options for generating a column spec from data\n */\n\n ctx.useSync(verboseAtom, verbose);\n\n const editable = useSelector((state) => state.editable);\n\n // The active data source is resolved in the wrapper (`DataSheet`) and held in\n // the provider layer; read it here rather than resolving per render.\n const {\n provider: activeProvider,\n isLocalProvider,\n localCount,\n } = ctx.useValue(dataProviderAtom);\n\n // When an explicit provider owns persistence, its methods drive the built-in\n // Save (batch: edits→saveRows, added→insertRow, deleted→deleteRows), then a\n // refresh. Otherwise the loose `onSave` handler is used.\n const bumpRefresh = ctx.useSet(dataRefreshTokenAtom);\n const providerSave = useMemo(() => {\n const p = provider;\n if (\n p == null ||\n (p.saveRows == null && p.deleteRows == null && p.insertRow == null)\n ) {\n return null;\n }\n return async (actionCtx: TableActionContext<T>) => {\n await persistViaProvider(p, actionCtx);\n bumpRefresh((v) => v + 1);\n };\n }, [provider, bumpRefresh]);\n const saveHandler = onSave ?? providerSave;\n\n // Sync table actions to atom. Consumer actions come first (they override a\n // built-in by reusing its id); the built-in column controls (sort/filter)\n // fill in the rest — so both the toolbar and the header dropdown source from\n // one registry. Built-ins self-gate (single sortable/filterable column).\n const _actions: TableAction[] = useMemo(() => {\n const _actions: TableAction[] = [];\n const add = (list: TableAction[]) => {\n for (const a of list) {\n if (!_actions.some((x) => x.id === a.id)) _actions.push(a);\n }\n };\n if (actions != null) add(actions);\n add(columnControlActions);\n if (enableClipboard) add(clipboardActions);\n // Save/reset last — they're the most significant actions — and present for\n // every cardinality (editable), so the toolbar stays mounted regardless of\n // selection.\n if (editable) {\n if (saveHandler != null) add([createSaveAction(saveHandler)]);\n add([resetChangesAction]);\n }\n return _actions;\n }, [actions, enableClipboard, editable, saveHandler]);\n\n /*** TODO: generalize this, probably shouldn't need 'set' */\n ctx.useSync(tableActionsAtom, _actions);\n const getHotkeys = ctx.useSet(tableHotkeysAtom);\n\n // This is quite hacky!\n const hotkeysConfig = useMemo(() => {\n return getHotkeys(_actions);\n }, [_actions]);\n\n const { handleKeyDown, handleKeyUp } = useHotkeys(hotkeysConfig);\n\n // For now, we only consider a single cell \"focused\" when we have one cell selected.\n // Multi-cell selections have a different set of \"bulk\" actions.\n const selectedRegions = useSelector<T>((state) => state.selection ?? []);\n\n const data = useSelector((state) => state.data);\n\n const rowStatus = useSelector((state) => state.rowStatus);\n\n const focusedCell = useSelector((state) => state.focusedCell);\n\n const ref = useSelector((state) => state.tableRef);\n\n const columnSpec = useSelector((state) => state.columnSpec);\n\n // A sparse array to hold updates\n // TODO: create a \"changeset\" concept to facilitate undo/redo\n const updatedData = useSelector((state) => state.updatedData);\n\n const onSelection = useSelector((state) => state.onSelection);\n\n const storeAPI = useStoreAPI<T>();\n\n const onScroll = useScrollHandler();\n const _onVisibleCellsChange = useCallback(\n (visibleCells: VisibleCells) => {\n onScroll(visibleCells);\n onVisibleCellsChange?.(visibleCells);\n },\n [onVisibleCellsChange, onScroll],\n );\n\n useEffect(() => {\n if (!verbose) return;\n console.log(\"Updated data\", updatedData);\n }, [updatedData]);\n\n useEffect(() => {\n onUpdateData?.(updatedData, data);\n }, [onUpdateData, data, updatedData]);\n\n useEffect(() => {\n if (!verbose) return;\n console.log(\"Selected regions\", selectedRegions);\n }, [selectedRegions]);\n\n const tableElementRef = useRef<HTMLElement>(null);\n useEffect(() => {\n // Return the focus to the table\n tableElementRef.current?.focus();\n }, [focusedCell]);\n\n const columnWidths = ctx.useValue(columnWidthsAtom);\n\n // When filters are active, only show matching rows\n const filteredRowIndices = useSelector((state) => state.filteredRowIndices);\n const totalRows = Math.max(updatedData.length, data.length);\n const numRows =\n filteredRowIndices != null ? filteredRowIndices.length : totalRows;\n\n let className = `${density}-density`;\n\n const { rowHeight, style } = styleParamsForDensity(density);\n\n // In paged mode the row count is small and fixed, so let the table size to\n // its content (header + rows) instead of filling the viewport.\n const footerInfo = ctx.useValue(tableFooterAtom);\n let holderStyle: CSSProperties | undefined = undefined;\n if (footerInfo.mode === \"paged\") {\n holderStyle = {\n flex: \"0 0 auto\" as const,\n height: numRows * rowHeight + COLUMN_HEADER_HEIGHT,\n };\n }\n\n const onColumnsReordered = useSelector((state) => state.onColumnsReordered);\n // Whether table-level column drag-reordering is enabled. Held in the store\n // (set from the `enableColumnReordering` prop by the provider); it must reach\n // the Blueprint `Table` — the `onColumnsReordered` handler alone doesn't turn\n // on the drag affordance.\n const enableColumnReordering = useSelector(\n (state) => state.enableColumnReordering,\n );\n\n // Auto-detect if any columns have sortable/filterable set.\n // If so and no explicit columnHeaderCellRenderer was provided,\n // use the built-in client-side sort/filter header.\n const hasSortableOrFilterable = useMemo(\n () =>\n columnSpec.some(\n (col) =>\n col.sortable ||\n col.filterable ||\n (Array.isArray(col.filters) && col.filters.length > 0),\n ),\n [columnSpec],\n );\n\n const columnSorts = useSelector((state) => state.columnSorts);\n const activeFilters = useSelector((state) => state.activeFilters);\n\n // Cell activation mode, defaulting from the legacy `autoFocusEditor` boolean\n // so existing consumers are unaffected. Synced into the store so the cell\n // renderer, editors, and key handlers all read it consistently.\n const cellInteractionMode: CellInteraction =\n cellInteraction ?? (autoFocusEditor ? \"auto\" : \"manual\");\n\n const storeState = storeAPI;\n useEffect(() => {\n storeState.setState({ cellInteraction: cellInteractionMode });\n }, [storeState, cellInteractionMode]);\n\n useEffect(() => {\n // Give the store a handle to the focusable holder so editors can return\n // keyboard focus to the table when the cursor leaves them.\n storeState.setState({ tableElement: tableElementRef.current });\n }, [storeState]);\n\n // The row height is the density's; cells report it to their renderers\n const densityRowHeight = styleParamsForDensity(density).rowHeight;\n useEffect(() => {\n storeState.setState({ rowHeight: densityRowHeight });\n }, [storeState, densityRowHeight]);\n\n useEffect(() => {\n storeState.setState({ onEdit });\n }, [storeState, onEdit]);\n\n useEffect(() => {\n // Controlled overlay: mirror the caller's edited state into the store as\n // the source of truth. Optimistic in-table edits are superseded on the\n // next render when the caller passes an updated value back. When the caller\n // controls it, the loader-boundary identity remap steps aside.\n const controlled =\n updatedDataProp !== undefined ||\n rowStatusProp !== undefined ||\n deriveOverlay != null;\n const patch: Record<string, unknown> = { controlledOverlay: controlled };\n if (updatedDataProp !== undefined) patch.updatedData = updatedDataProp;\n if (rowStatusProp !== undefined) patch.rowStatus = rowStatusProp;\n storeState.setState(patch);\n }, [storeState, updatedDataProp, rowStatusProp, deriveOverlay]);\n\n // Derived controlled overlay: the library owns the loaded rows, so it runs\n // the consumer's `deriveOverlay(rows)` here and pushes the result. Re-derives\n // when the rows load/change or the function's identity changes (close it over\n // your external edit state). The `controlledOverlay` flag above suppresses the\n // loader-boundary identity remap so this derivation is authoritative.\n useEffect(() => {\n if (deriveOverlay == null) return;\n const overlay = deriveOverlay(data);\n storeState.setState({\n updatedData: overlay.updatedData,\n rowStatus: overlay.rowStatus,\n });\n }, [deriveOverlay, data, storeState]);\n\n // Function `columnSpec` derivation is hoisted to the provider\n // (`DataSheetProviderInner`), shared by both renderers.\n\n // Identity and canDeleteRows sync are hoisted to the provider\n // (`DataSheetProviderInner`), shared with `_DataPanel` — both depend only on\n // the resolved data provider, not any sheet-specific state.\n\n // Merge consumer `rowStatusStyles` over the built-in defaults and hand the\n // result to the store, where the cell renderer and row-header renderer read\n // it. Merged (not replaced) so overriding one status doesn't drop the rest.\n const mergedRowStatusStyles = useMemo<RowStatusStyles>(\n () => ({ ...DEFAULT_ROW_STATUS_STYLES, ...rowStatusStyles }),\n [rowStatusStyles],\n );\n useEffect(() => {\n storeState.setState({ rowStatusStyles: mergedRowStatusStyles });\n }, [storeState, mergedRowStatusStyles]);\n\n const realizedColumns = useMemo(() => {\n return columnSpec.map((col, colIndex) => {\n let fn =\n col.headerRenderer ??\n columnHeaderCellRenderer ??\n renderColumnHeaderCell;\n let activeSort: any = null;\n let activeFilter: any = null;\n if (col.sortable) {\n activeSort = columnSorts?.find((s) => s.key === col.key);\n }\n // The active filter for this column is whichever active filter targets\n // it (a rich `col.filters` filter or the generic operator filter) — match\n // by columnKey rather than a fixed id.\n for (const entry of activeFilters?.values() ?? []) {\n if ((entry as any)?.filter?.columnKey === col.key) {\n activeFilter = entry;\n break;\n }\n }\n\n const _columnHeaderCellRenderer: any = (colIndex) => {\n return fn(\n {\n col,\n colIndex,\n activeSort,\n activeFilter,\n },\n colIndex,\n );\n };\n\n return h(Column, {\n id: col.key,\n name: col.name,\n columnHeaderCellRenderer: _columnHeaderCellRenderer as any,\n cellRenderer: (rowIndex) => {\n const state = storeAPI.getState();\n return basicCellRenderer<T>(\n rowIndex,\n colIndex,\n col,\n state,\n filteredRowIndices,\n );\n },\n });\n });\n }, [\n columnSpec,\n columnSorts,\n activeFilters,\n storeAPI,\n filteredRowIndices,\n columnHeaderCellRenderer,\n ]);\n\n const onColumnWidthChanged = useSelector(\n (state) => state.onColumnWidthChanged,\n );\n\n const rowHeaderCellRenderer = useCallback(\n (rowIndex: number) => {\n let dataRowIndex = rowIndex;\n if (filteredRowIndices != null) {\n dataRowIndex = filteredRowIndices[rowIndex] ?? rowIndex;\n }\n const statusVal = rowStatus[dataRowIndex];\n let style: CSSProperties | undefined;\n if (statusVal != null) {\n style = mergedRowStatusStyles[statusVal]?.headerStyle;\n }\n\n const defaultLabel = `${dataRowIndex + 1}`;\n // A custom renderer supplies the header's *name* content (a group-key\n // label, an omit indicator, …); a nullish return keeps the default\n // 1-based label. Either way the node is wrapped in a `RowHeaderCell` so\n // status styling and the row index are always applied — the renderer is\n // not responsible for producing the whole cell.\n let name: ReactNode = defaultLabel;\n if (rowHeaderRenderer != null) {\n const custom = rowHeaderRenderer({\n rowIndex: dataRowIndex,\n visibleIndex: rowIndex,\n row: data[dataRowIndex] ?? updatedData[dataRowIndex],\n status: statusVal,\n isDeleted: statusVal === TableElementStatus.DELETED,\n defaultLabel,\n });\n if (custom != null) name = custom;\n }\n\n return h(RowHeaderCell, {\n enableRowReordering: false,\n index: rowIndex,\n name,\n style,\n });\n },\n [\n rowStatus,\n filteredRowIndices,\n mergedRowStatusStyles,\n rowHeaderRenderer,\n data,\n updatedData,\n ],\n );\n\n // Done with hooks!\n /** Guard for unacceptable state combinations:\n * editable = true requires selectionModes to include cells, else the user cannot select a cell to edit.\n * TODO: make this an impossible state to enter.\n */\n if (\n editable &&\n selectionModes &&\n !selectionModes.includes(RegionCardinality.CELLS)\n ) {\n return h(ErrorCallout, {\n title: \"Invalid selection mode\",\n description: \"Editable sheet requires cell selection\",\n });\n }\n\n // TODO: hoist this\n let _selectionModes = selectionModes;\n if (\n editable &&\n _selectionModes != null &&\n !_selectionModes.includes(RegionCardinality.CELLS)\n ) {\n _selectionModes = [..._selectionModes, RegionCardinality.CELLS];\n // Ensure selection mode includes \"cells\"\n }\n\n const cellRendererDependencies = [\n data,\n updatedData,\n focusedCell,\n rowStatus,\n filteredRowIndices,\n ];\n\n // Drive the table from the active provider's `fetchData`. A local (in-memory)\n // provider loads the whole array at once; a remote one uses the `pageSize` /\n // `fetchMode` props and shows load progress.\n let _showLoadProgress: boolean = false;\n let dataLoader: ReactNode = null;\n if (activeProvider != null) {\n _showLoadProgress = !isLocalProvider;\n // A local (in-memory) source loads all its rows in one page; its count\n // rides on the resolved provider (`localCount`), so `_DataSheet` no longer\n // takes a `data` prop — live rows come only from the store.\n dataLoader = h(_DataLoaderManager, {\n key: \"__data_loader\",\n fetchData: activeProvider.fetchData,\n pageSize: isLocalProvider ? Math.max(localCount, 1) : pageSize,\n fetchMode: isLocalProvider ? undefined : fetchMode,\n filterDebounce,\n initialData,\n });\n }\n const showFilterBar =\n (filters != null && filters.length > 0) || hasSortableOrFilterable;\n\n let filterStatus: ReactNode = null;\n if (showFilterBar) {\n filterStatus = h(ActiveFiltersList, { filters: filters ?? [] });\n }\n\n return h(\"div.data-sheet-container\", { className, style }, [\n // The actions/tools toolbar (selection-modal). Table-scoped controls like\n // scroll-to-row / full-text search live here as ordinary actions.\n h(ActionsToolbar, { actions: _actions }),\n dataLoader,\n children,\n h(\n \"div.data-sheet-holder\",\n {\n tabIndex: 0,\n onKeyDown: handleKeyDown,\n onKeyUp: handleKeyUp,\n ref: tableElementRef,\n style: holderStyle,\n },\n [\n // Inside the holder, so the toolbar and filters stay reachable.\n h.if(_showLoadProgress)(LoadErrorOverlay),\n h(\n Table as any, // Some sort of hyperscript type error\n {\n ref,\n numRows,\n className: \"data-sheet\",\n enableFocusedCell,\n enableColumnReordering,\n onColumnsReordered,\n focusedCell,\n selectedRegions,\n defaultRowHeight: rowHeight,\n columnWidths,\n onColumnWidthChanged,\n onSelection,\n /** TODO: we could enable this if we had a use-case */\n enableRowReordering: false,\n enableRowResizing: false,\n // The cell renderer is memoized internally based on these data dependencies\n cellRendererDependencies,\n onVisibleCellsChange: _onVisibleCellsChange,\n rowHeaderCellRenderer,\n selectionModes: _selectionModes,\n ...tableProps,\n getCellClipboardData: null,\n },\n realizedColumns,\n ),\n ],\n ),\n h(\"div.status-bar\", [\n filterStatus,\n statusBar,\n h(\"div.spacer\"),\n h.if(_showLoadProgress)(LoadProgressIndicator),\n ]),\n h.if(debug)(CellRendererDebugOverlay, {\n cellRendererDependencies,\n names: [\n \"data\",\n \"updatedData\",\n \"focusedCell\",\n \"rowStatus\",\n \"filteredRowIndices\",\n ],\n }),\n ]);\n}\n\nconst EMPTY_MAP = new Map<string, number>();\n\nconst columnWidthsIndexAtom = atom(\n (get) => get(storeAtom)?.columnWidthsIndex ?? EMPTY_MAP,\n);\nconst defaultColumnWidthAtom = atom(\n (get) => get(storeAtom)?.defaultColumnWidth ?? 150,\n);\n\nconst columnWidthsAtom = atom((get) => {\n const ix = get(columnWidthsIndexAtom);\n return get(columnSpecAtom).map(\n (col) => ix.get(col.key) ?? col.width ?? get(defaultColumnWidthAtom),\n );\n});\n\nfunction styleParamsForDensity(density: DataSheetDensity): {\n rowHeight: number;\n style: Record<string, string>;\n} {\n switch (density) {\n case DataSheetDensity.MEDIUM:\n return {\n rowHeight: 24,\n style: {\n \"--data-sheet-row-height\": \"24px\",\n \"--data-sheet-font-size\": \"14px\",\n },\n };\n case DataSheetDensity.LOW:\n return {\n rowHeight: 30,\n style: {\n \"--data-sheet-row-height\": \"30px\",\n \"--data-sheet-font-size\": \"18px\",\n },\n };\n case DataSheetDensity.HIGH:\n default:\n return {\n rowHeight: 20,\n style: {\n \"--data-sheet-row-height\": \"20px\",\n \"--data-sheet-font-size\": \"12px\",\n },\n };\n }\n}\n\n/** Convenience component: runs `useChunkLoader` from inside a `DataSheet`.\n * Render as a child of `DataSheet` (it renders nothing itself). */\nfunction _DataLoaderManager<T = any>({\n fetchData,\n ...rest\n}: {\n fetchData: FetchData<T>;\n} & FetchDataOptions<any>) {\n useDataLoader(fetchData, rest);\n return null;\n}\n"],"names":["_actions","colIndex","style","name"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA0EA,MAAM,uBAAuB;AAEtB,SAAS,UAAa,OAA0B;AACrD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX,yBAAyB;AAAA,IACzB,oBAAoB;AAAA,IACpB,qBAAqB;AAAA,IACrB;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,IACD;AAEJ,QAAM,CAAC,eAAe,aAAa,IAAI,uBAA0B;AAAA,IAC/D,GAAG;AAAA,IACH,UAAU,qBAAqB;AAAA,EAAA,CAChC;AACD,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,EAAE,mBAA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5B,CAAC,QAAQ,IAAI,SAAS,GAAG,qBAAqB;AAChD;AACA,MAAM,yBAAyB;AAAA,EAC7B,CAAC,QAAQ,IAAI,SAAS,GAAG,sBAAsB;AACjD;AAEA,MAAM,mBAAmB,KAAK,CAAC,QAAQ;AACrC,QAAM,KAAK,IAAI,qBAAqB;AACpC,SAAO,IAAI,cAAc,EAAE;AAAA,IACzB,CAAC,QAAQ,GAAG,IAAI,IAAI,GAAG,KAAK,IAAI,SAAS,IAAI,sBAAsB;AAAA,EAAA;AAEvE,CAAC;AAED,SAAS,sBAAsB,SAG7B;AACA,UAAQ,SAAA;AAAA,IACN,KAAK,iBAAiB;AACpB,aAAO;AAAA,QACL,WAAW;AAAA,QACX,OAAO;AAAA,UACL,2BAA2B;AAAA,UAC3B,0BAA0B;AAAA,QAAA;AAAA,MAC5B;AAAA,IAEJ,KAAK,iBAAiB;AACpB,aAAO;AAAA,QACL,WAAW;AAAA,QACX,OAAO;AAAA,UACL,2BAA2B;AAAA,UAC3B,0BAA0B;AAAA,QAAA;AAAA,MAC5B;AAAA,IAEJ,KAAK,iBAAiB;AAAA,IACtB;AACE,aAAO;AAAA,QACL,WAAW;AAAA,QACX,OAAO;AAAA,UACL,2BAA2B;AAAA,UAC3B,0BAA0B;AAAA,QAAA;AAAA,MAC5B;AAAA,EACF;AAEN;AAIA,SAAS,mBAA4B;AAAA,EACnC;AAAA,EACA,GAAG;AACL,GAE2B;AACzB,gBAAc,WAAW,IAAI;AAC7B,SAAO;AACT;"}
@@ -3,22 +3,23 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
3
3
  const h$1 = require("@macrostrat/hyper");
4
4
  const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
5
5
  const h__default = /* @__PURE__ */ _interopDefault(h$1);
6
- const spacer = "_spacer_13078_132";
6
+ const spacer = "_spacer_p13ib_136";
7
7
  const styles = {
8
- "data-sheet-container": "_data-sheet-container_13078_4",
9
- "data-sheet-holder": "_data-sheet-holder_13078_4",
10
- "data-sheet": "_data-sheet_13078_4",
11
- "input-cell": "_input-cell_13078_61",
12
- "derived-cell": "_derived-cell_13078_78",
13
- "value-viewer-cell": "_value-viewer-cell_13078_83",
14
- "editor-cell": "_editor-cell_13078_91",
15
- "hidden-input": "_hidden-input_13078_103",
16
- "data-editor-anchor": "_data-editor-anchor_13078_109",
17
- "corner-drag-handle": "_corner-drag-handle_13078_116",
18
- "data-sheet-toolbar": "_data-sheet-toolbar_13078_126",
8
+ "data-sheet-container": "_data-sheet-container_p13ib_4",
9
+ "data-sheet-holder": "_data-sheet-holder_p13ib_4",
10
+ "data-sheet": "_data-sheet_p13ib_4",
11
+ "input-cell": "_input-cell_p13ib_61",
12
+ "derived-cell": "_derived-cell_p13ib_78",
13
+ "readonly-cell": "_readonly-cell_p13ib_83",
14
+ "value-viewer-cell": "_value-viewer-cell_p13ib_87",
15
+ "editor-cell": "_editor-cell_p13ib_95",
16
+ "hidden-input": "_hidden-input_p13ib_107",
17
+ "data-editor-anchor": "_data-editor-anchor_p13ib_113",
18
+ "corner-drag-handle": "_corner-drag-handle_p13ib_120",
19
+ "data-sheet-toolbar": "_data-sheet-toolbar_p13ib_130",
19
20
  spacer,
20
- "table-control": "_table-control_13078_136",
21
- "status-bar": "_status-bar_13078_142"
21
+ "table-control": "_table-control_p13ib_140",
22
+ "status-bar": "_status-bar_p13ib_146"
22
23
  };
23
24
  let h = h__default.default.styled(styles);
24
25
  Object.assign(h, styles);
@@ -1 +1 @@
1
- {"version":3,"file":"main.module.sass.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"main.module.sass.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,20 +1,21 @@
1
1
  import h$1 from "@macrostrat/hyper";
2
- const spacer = "_spacer_13078_132";
2
+ const spacer = "_spacer_p13ib_136";
3
3
  const styles = {
4
- "data-sheet-container": "_data-sheet-container_13078_4",
5
- "data-sheet-holder": "_data-sheet-holder_13078_4",
6
- "data-sheet": "_data-sheet_13078_4",
7
- "input-cell": "_input-cell_13078_61",
8
- "derived-cell": "_derived-cell_13078_78",
9
- "value-viewer-cell": "_value-viewer-cell_13078_83",
10
- "editor-cell": "_editor-cell_13078_91",
11
- "hidden-input": "_hidden-input_13078_103",
12
- "data-editor-anchor": "_data-editor-anchor_13078_109",
13
- "corner-drag-handle": "_corner-drag-handle_13078_116",
14
- "data-sheet-toolbar": "_data-sheet-toolbar_13078_126",
4
+ "data-sheet-container": "_data-sheet-container_p13ib_4",
5
+ "data-sheet-holder": "_data-sheet-holder_p13ib_4",
6
+ "data-sheet": "_data-sheet_p13ib_4",
7
+ "input-cell": "_input-cell_p13ib_61",
8
+ "derived-cell": "_derived-cell_p13ib_78",
9
+ "readonly-cell": "_readonly-cell_p13ib_83",
10
+ "value-viewer-cell": "_value-viewer-cell_p13ib_87",
11
+ "editor-cell": "_editor-cell_p13ib_95",
12
+ "hidden-input": "_hidden-input_p13ib_107",
13
+ "data-editor-anchor": "_data-editor-anchor_p13ib_113",
14
+ "corner-drag-handle": "_corner-drag-handle_p13ib_120",
15
+ "data-sheet-toolbar": "_data-sheet-toolbar_p13ib_130",
15
16
  spacer,
16
- "table-control": "_table-control_13078_136",
17
- "status-bar": "_status-bar_13078_142"
17
+ "table-control": "_table-control_p13ib_140",
18
+ "status-bar": "_status-bar_p13ib_146"
18
19
  };
19
20
  let h = h$1.styled(styles);
20
21
  Object.assign(h, styles);
@@ -1 +1 @@
1
- {"version":3,"file":"main.module.sass.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"main.module.sass.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}