@osdk/react-components 0.50.0-main-a21e2ae84fb4393b21da4c6cfffa2609e90eb36b → 0.50.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/CHANGELOG.md +2 -1
  2. package/build/browser/object-table/ObjectTable.js +8 -0
  3. package/build/browser/object-table/ObjectTable.js.map +1 -1
  4. package/build/browser/object-table/ObjectTableApi.js.map +1 -1
  5. package/build/browser/object-table/hooks/useLoadedObjectsChanged.js +52 -0
  6. package/build/browser/object-table/hooks/useLoadedObjectsChanged.js.map +1 -0
  7. package/build/browser/public/experimental/object-table.js +1 -0
  8. package/build/browser/public/experimental/object-table.js.map +1 -1
  9. package/build/browser/util/UserAgent.js +1 -1
  10. package/build/browser/util/UserAgent.js.map +1 -1
  11. package/build/cjs/{chunk-RBWRFU5Z.cjs → chunk-2GOF2S3Y.cjs} +4 -4
  12. package/build/cjs/{chunk-RBWRFU5Z.cjs.map → chunk-2GOF2S3Y.cjs.map} +1 -1
  13. package/build/cjs/{chunk-JV7LCS3L.cjs → chunk-3KYJ76C2.cjs} +4 -4
  14. package/build/cjs/{chunk-JV7LCS3L.cjs.map → chunk-3KYJ76C2.cjs.map} +1 -1
  15. package/build/cjs/chunk-4FQZPGVB.cjs +11 -0
  16. package/build/cjs/{chunk-5PN4U76X.cjs.map → chunk-4FQZPGVB.cjs.map} +1 -1
  17. package/build/cjs/{chunk-6BCYUVYP.cjs → chunk-6CAHX3VA.cjs} +4 -4
  18. package/build/cjs/{chunk-6BCYUVYP.cjs.map → chunk-6CAHX3VA.cjs.map} +1 -1
  19. package/build/cjs/{chunk-2TRVPZP7.cjs → chunk-CGTQTLNP.cjs} +4 -4
  20. package/build/cjs/{chunk-2TRVPZP7.cjs.map → chunk-CGTQTLNP.cjs.map} +1 -1
  21. package/build/cjs/{chunk-YDPH36AY.cjs → chunk-HCQFQKBI.cjs} +455 -362
  22. package/build/cjs/chunk-HCQFQKBI.cjs.map +1 -0
  23. package/build/cjs/chunk-I3VH56N7.cjs +11 -0
  24. package/build/cjs/{chunk-OH3XB3R5.cjs.map → chunk-I3VH56N7.cjs.map} +1 -1
  25. package/build/cjs/{chunk-QAFJAYIV.cjs → chunk-IP66AR3O.cjs} +4 -4
  26. package/build/cjs/{chunk-QAFJAYIV.cjs.map → chunk-IP66AR3O.cjs.map} +1 -1
  27. package/build/cjs/{chunk-Q7CH7JSG.cjs → chunk-Q25HTQ6S.cjs} +4 -4
  28. package/build/cjs/{chunk-Q7CH7JSG.cjs.map → chunk-Q25HTQ6S.cjs.map} +1 -1
  29. package/build/cjs/{chunk-X3OQ47PS.cjs → chunk-QCYEJARX.cjs} +4 -4
  30. package/build/cjs/{chunk-X3OQ47PS.cjs.map → chunk-QCYEJARX.cjs.map} +1 -1
  31. package/build/cjs/chunk-QYPTAETF.cjs +11 -0
  32. package/build/cjs/{chunk-2VHFKA5C.cjs.map → chunk-QYPTAETF.cjs.map} +1 -1
  33. package/build/cjs/chunk-TBLSN4KJ.cjs +11 -0
  34. package/build/cjs/{chunk-LEUSWUNX.cjs.map → chunk-TBLSN4KJ.cjs.map} +1 -1
  35. package/build/cjs/{chunk-SJGUCU2N.cjs → chunk-WT74OJ7T.cjs} +4 -4
  36. package/build/cjs/{chunk-SJGUCU2N.cjs.map → chunk-WT74OJ7T.cjs.map} +1 -1
  37. package/build/cjs/{chunk-IWRCOFOC.cjs → chunk-ZX5S74BN.cjs} +3 -3
  38. package/build/cjs/chunk-ZX5S74BN.cjs.map +1 -0
  39. package/build/cjs/public/experimental/action-form.cjs +4 -4
  40. package/build/cjs/public/experimental/cbac-picker.cjs +11 -11
  41. package/build/cjs/public/experimental/document-viewer.cjs +4 -4
  42. package/build/cjs/public/experimental/email-viewer.cjs +3 -3
  43. package/build/cjs/public/experimental/filter-list.cjs +15 -15
  44. package/build/cjs/public/experimental/image-viewer.cjs +3 -3
  45. package/build/cjs/public/experimental/markdown-renderer.cjs +5 -5
  46. package/build/cjs/public/experimental/object-table.cjs +25 -21
  47. package/build/cjs/public/experimental/object-table.d.cts +45 -2
  48. package/build/cjs/public/experimental/pdf-viewer.cjs +7 -7
  49. package/build/cjs/public/experimental/spreadsheet-viewer.cjs +3 -3
  50. package/build/cjs/public/experimental/tiff-renderer.cjs +5 -5
  51. package/build/cjs/public/experimental/video-viewer.cjs +3 -3
  52. package/build/cjs/public/experimental/xml-viewer.cjs +3 -3
  53. package/build/cjs/public/experimental.cjs +79 -75
  54. package/build/cjs/public/experimental.d.cts +1 -1
  55. package/build/esm/object-table/ObjectTable.js +8 -0
  56. package/build/esm/object-table/ObjectTable.js.map +1 -1
  57. package/build/esm/object-table/ObjectTableApi.js.map +1 -1
  58. package/build/esm/object-table/hooks/useLoadedObjectsChanged.js +52 -0
  59. package/build/esm/object-table/hooks/useLoadedObjectsChanged.js.map +1 -0
  60. package/build/esm/public/experimental/object-table.js +1 -0
  61. package/build/esm/public/experimental/object-table.js.map +1 -1
  62. package/build/esm/util/UserAgent.js +1 -1
  63. package/build/esm/util/UserAgent.js.map +1 -1
  64. package/build/types/object-table/ObjectTable.d.ts +1 -1
  65. package/build/types/object-table/ObjectTable.d.ts.map +1 -1
  66. package/build/types/object-table/ObjectTableApi.d.ts +32 -0
  67. package/build/types/object-table/ObjectTableApi.d.ts.map +1 -1
  68. package/build/types/object-table/hooks/useLoadedObjectsChanged.d.ts +21 -0
  69. package/build/types/object-table/hooks/useLoadedObjectsChanged.d.ts.map +1 -0
  70. package/build/types/public/experimental/object-table.d.ts +2 -1
  71. package/build/types/public/experimental/object-table.d.ts.map +1 -1
  72. package/docs/ObjectTable.md +26 -0
  73. package/docs/ObjectTableOverview.md +17 -15
  74. package/package.json +3 -3
  75. package/build/cjs/chunk-2VHFKA5C.cjs +0 -11
  76. package/build/cjs/chunk-5PN4U76X.cjs +0 -11
  77. package/build/cjs/chunk-IWRCOFOC.cjs.map +0 -1
  78. package/build/cjs/chunk-LEUSWUNX.cjs +0 -11
  79. package/build/cjs/chunk-OH3XB3R5.cjs +0 -11
  80. package/build/cjs/chunk-YDPH36AY.cjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @osdk/react-components
2
2
 
3
- ## 0.50.0-main-a21e2ae84fb4393b21da4c6cfffa2609e90eb36b
3
+ ## 0.50.0
4
4
 
5
5
  ### Minor Changes
6
6
 
@@ -15,6 +15,7 @@
15
15
 
16
16
  - 710ee1d: FilterList: support both controlled and uncontrolled collapse. `onCollapsedChange` no longer gates the collapse control — it is now purely an event listener that fires in both modes. Pass `collapsed` for controlled mode or the new `defaultCollapsed` to seed uncontrolled mode; `collapsed` takes precedence when both are given. Previously `collapsed` did nothing unless `onCollapsedChange` was also supplied. The new `enableCollapse` prop defaults to `true`, so existing collapse setups keep working and lists that had no collapse control gain one; pass `enableCollapse={false}` to opt out.
17
17
  - 4179237: Revert labels override on ObjectTable in PR 3697
18
+ - f615778: Add `onLoadedObjectsChanged` callback to `ObjectTable`, reporting the loaded rows and the object set's total count
18
19
  - a71d606: Normalize viewer component naming so every viewer follows the `<X>Viewer` / `Base<X>Viewer` pattern, and drop the `Media` suffix from the media-wrapper prop types.
19
20
 
20
21
  The `experimental/markdown-renderer` and `experimental/tiff-renderer` import paths are unchanged. They get renamed later, when the `experimental/` prefix is dropped, so consumers change import paths once rather than twice.
@@ -21,6 +21,7 @@ import { useColumnPinning } from "./hooks/useColumnPinning.js";
21
21
  import { useColumnResize } from "./hooks/useColumnResize.js";
22
22
  import { useColumnVisibility } from "./hooks/useColumnVisibility.js";
23
23
  import { useEditableTable } from "./hooks/useEditableTable.js";
24
+ import { useLoadedObjectsChanged } from "./hooks/useLoadedObjectsChanged.js";
24
25
  import { useObjectTableData } from "./hooks/useObjectTableData.js";
25
26
  import { useObjectTableSnapshot } from "./hooks/useObjectTableSnapshot.js";
26
27
  import { useRowSelection } from "./hooks/useRowSelection.js";
@@ -45,6 +46,7 @@ export function ObjectTable({
45
46
  onColumnsPinnedChanged,
46
47
  onColumnResize,
47
48
  onRowSelectionChanged,
49
+ onLoadedObjectsChanged,
48
50
  onColumnHeaderClick,
49
51
  renderCellContextMenu,
50
52
  selectionMode = "none",
@@ -96,6 +98,12 @@ export function ObjectTable({
96
98
  pageSize,
97
99
  streamUpdates
98
100
  });
101
+ useLoadedObjectsChanged({
102
+ loadedObjects: data,
103
+ totalCount,
104
+ isLoading,
105
+ onLoadedObjectsChanged
106
+ });
99
107
  const {
100
108
  columns,
101
109
  loading: isColumnsLoading
@@ -1 +1 @@
1
- {"version":3,"file":"ObjectTable.js","names":["getCoreRowModel","useReactTable","React","useCallback","useImperativeHandle","useMemo","useColumnDefs","useColumnPinning","useColumnResize","useColumnVisibility","useEditableTable","useObjectTableData","useObjectTableSnapshot","useRowSelection","useSelectionColumn","useTableSorting","BaseTable","deriveSelectionObjectSet","getRowId","getRowIdFromPrimaryKey","EMPTY_ARRAY","ObjectTable","objectType","objectSet","columnDefinitions","filter","objectSetOptions","dedupeIntervalMs","pageSize","streamUpdates","orderBy","defaultOrderBy","onOrderByChanged","onColumnsPinnedChanged","onColumnResize","onRowSelectionChanged","onColumnHeaderClick","renderCellContextMenu","selectionMode","selectedRows","isAllSelected","isAllSelectedProp","onColumnVisibilityChanged","onCellValueChanged","onSubmitEdits","enableOrdering","enableColumnPinning","enableColumnResizing","enableColumnConfig","editMode","focusedRow","onFocusedRowChanged","tableRef","props","columnSizing","onColumnSizingChange","sorting","onSortingChange","orderByState","data","fetchMore","isLoading","error","totalCount","resultingObjectSet","objectOrInterfaceType","columns","loading","isColumnsLoading","handleRowSelectionChanged","change","isSelectAll","rowSelection","hasSelection","onToggleAll","onToggleRow","enableRowSelection","selectionColumn","columnVisibility","onColumnVisibilityChange","columnOrder","onColumnOrderChange","allColumns","columnPinning","onColumnPinningChange","hasSelectionColumn","editableConfig","table","state","enableSorting","columnResizeMode","columnResizeDirection","manualSorting","defaultColumn","minSize","meta","onCellEdit","onCellValidationError","clearCellValidationError","cellEdits","isInEditMode","editModeState","isActive","validationErrors","getSnapshot","onRenderCellContextMenu","row","cell","getValue","handleColumnHeaderClick","columnId","undefined","headerMenuFeatureFlags","showSortingItems","showPinningItems","showResizeItem","showConfigItem","createElement","fetchNextPage","onRowClick","rowHeight","renderEmptyState","className","getRowAttributes","showEditFooter","focusedRowId"],"sources":["ObjectTable.tsx"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ObjectOrInterfaceDefinition,\n Osdk,\n PropertyKeys,\n QueryDefinition,\n SimplePropertyDef,\n} from \"@osdk/api\";\nimport type { Cell } from \"@tanstack/react-table\";\nimport { getCoreRowModel, useReactTable } from \"@tanstack/react-table\";\nimport React, { useCallback, useImperativeHandle, useMemo } from \"react\";\n\nimport { useColumnDefs } from \"./hooks/useColumnDefs.js\";\nimport { useColumnPinning } from \"./hooks/useColumnPinning.js\";\nimport { useColumnResize } from \"./hooks/useColumnResize.js\";\nimport { useColumnVisibility } from \"./hooks/useColumnVisibility.js\";\nimport { useEditableTable } from \"./hooks/useEditableTable.js\";\nimport { useObjectTableData } from \"./hooks/useObjectTableData.js\";\nimport { useObjectTableSnapshot } from \"./hooks/useObjectTableSnapshot.js\";\nimport type { UseRowSelectionChange } from \"./hooks/useRowSelection.js\";\nimport { useRowSelection } from \"./hooks/useRowSelection.js\";\nimport { useSelectionColumn } from \"./hooks/useSelectionColumn.js\";\nimport { useTableSorting } from \"./hooks/useTableSorting.js\";\nimport type { ObjectTableProps } from \"./ObjectTableApi.js\";\nimport { BaseTable } from \"./Table.js\";\nimport type { HeaderMenuFeatureFlags } from \"./TableHeaderWithPopover.js\";\nimport { deriveSelectionObjectSet } from \"./utils/deriveSelectionObjectSet.js\";\nimport { getRowId, getRowIdFromPrimaryKey } from \"./utils/getRowId.js\";\nimport type { EditableConfig } from \"./utils/types.js\";\n\nconst EMPTY_ARRAY: [] = [];\n\nexport function ObjectTable<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n>({\n objectType,\n objectSet,\n columnDefinitions,\n filter,\n objectSetOptions,\n dedupeIntervalMs,\n pageSize,\n streamUpdates,\n orderBy,\n defaultOrderBy,\n onOrderByChanged,\n onColumnsPinnedChanged,\n onColumnResize,\n onRowSelectionChanged,\n onColumnHeaderClick,\n renderCellContextMenu,\n selectionMode = \"none\",\n selectedRows,\n isAllSelected: isAllSelectedProp,\n onColumnVisibilityChanged,\n onCellValueChanged,\n onSubmitEdits,\n enableOrdering = true,\n enableColumnPinning = true,\n enableColumnResizing = true,\n enableColumnConfig = true,\n editMode = \"manual\",\n focusedRow,\n onFocusedRowChanged,\n tableRef,\n ...props\n}: ObjectTableProps<Q, RDPs, FunctionColumns>): React.ReactElement {\n const { columnSizing, onColumnSizingChange } = useColumnResize({\n onColumnResize,\n });\n\n const { sorting, onSortingChange, orderByState } = useTableSorting<\n Q,\n RDPs,\n FunctionColumns\n >({\n orderBy,\n defaultOrderBy,\n onOrderByChanged,\n });\n\n const {\n data,\n fetchMore,\n isLoading,\n error,\n totalCount,\n objectSet: resultingObjectSet,\n } = useObjectTableData<Q, RDPs, FunctionColumns>({\n objectOrInterfaceType: objectType,\n columnDefinitions,\n filter,\n sorting,\n objectSet,\n objectSetOptions,\n dedupeIntervalMs,\n pageSize,\n streamUpdates,\n });\n\n const { columns, loading: isColumnsLoading } = useColumnDefs<\n Q,\n RDPs,\n FunctionColumns\n >(objectType, columnDefinitions);\n\n const handleRowSelectionChanged = useCallback(\n (change: UseRowSelectionChange<Q, RDPs>) => {\n if (!onRowSelectionChanged) return;\n\n onRowSelectionChanged({\n selectedRows: change.selectedRows,\n isSelectAll: change.isSelectAll,\n objectSet: deriveSelectionObjectSet(resultingObjectSet, change),\n });\n },\n [onRowSelectionChanged, resultingObjectSet],\n );\n\n const {\n rowSelection,\n isAllSelected,\n hasSelection,\n onToggleAll,\n onToggleRow,\n enableRowSelection,\n } = useRowSelection<Q, RDPs>({\n selectionMode,\n selectedRows,\n isAllSelected: isAllSelectedProp,\n onRowSelectionChanged: handleRowSelectionChanged,\n data,\n });\n\n const selectionColumn = useSelectionColumn<Q, RDPs>({\n selectionMode,\n isAllSelected,\n hasSelection,\n onToggleAll,\n onToggleRow,\n });\n\n const {\n columnVisibility,\n onColumnVisibilityChange,\n columnOrder,\n onColumnOrderChange,\n } = useColumnVisibility({\n allColumns: columns,\n onColumnVisibilityChanged,\n });\n\n const { columnPinning, onColumnPinningChange } = useColumnPinning({\n columnDefinitions,\n hasSelectionColumn: enableRowSelection,\n onColumnsPinnedChanged,\n });\n\n const allColumns = useMemo(() => {\n return selectionColumn ? [selectionColumn, ...columns] : columns;\n }, [selectionColumn, columns]);\n\n const editableConfig: EditableConfig<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n unknown\n > = useEditableTable({\n editMode,\n onCellValueChanged,\n onSubmitEdits,\n });\n\n const table = useReactTable<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>\n >({\n data: data ?? EMPTY_ARRAY,\n columns: allColumns,\n getCoreRowModel: getCoreRowModel(),\n state: {\n columnVisibility,\n columnOrder,\n rowSelection,\n sorting,\n columnSizing,\n columnPinning,\n },\n onSortingChange,\n onColumnSizingChange,\n onColumnPinningChange,\n onColumnVisibilityChange,\n onColumnOrderChange,\n enableRowSelection,\n enableSorting: enableOrdering,\n columnResizeMode: \"onChange\",\n columnResizeDirection: \"ltr\",\n manualSorting: true, // Enable manual sorting to indicate server-side sorting\n defaultColumn: {\n minSize: 80,\n },\n getRowId,\n meta: {\n onCellEdit: editableConfig.onCellEdit,\n onCellValidationError: editableConfig.onCellValidationError,\n clearCellValidationError: editableConfig.clearCellValidationError,\n cellEdits: editableConfig.cellEdits,\n isInEditMode: editableConfig.editModeState.isActive,\n validationErrors: editableConfig.validationErrors,\n },\n });\n\n const { getSnapshot } = useObjectTableSnapshot<Q, RDPs, FunctionColumns>({\n objectOrInterfaceType: objectType,\n table,\n columnDefinitions,\n objectSet: resultingObjectSet,\n pageSize,\n totalCount,\n orderBy: orderByState,\n });\n\n useImperativeHandle(tableRef, () => ({ getSnapshot }), [getSnapshot]);\n\n const onRenderCellContextMenu = useCallback(\n (\n row: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n cell: Cell<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n unknown\n >,\n ) => {\n return renderCellContextMenu?.(row, cell.getValue());\n },\n [renderCellContextMenu],\n );\n\n const handleColumnHeaderClick = useMemo(\n () =>\n onColumnHeaderClick\n ? (columnId: string) =>\n onColumnHeaderClick(\n columnId as PropertyKeys<Q> | keyof RDPs | keyof FunctionColumns,\n )\n : undefined,\n [onColumnHeaderClick],\n );\n\n const isTableLoading = isLoading || isColumnsLoading;\n\n const headerMenuFeatureFlags: HeaderMenuFeatureFlags = useMemo(\n () => ({\n showSortingItems: enableOrdering,\n showPinningItems: enableColumnPinning,\n showResizeItem: enableColumnResizing,\n showConfigItem: enableColumnConfig,\n }),\n [\n enableOrdering,\n enableColumnPinning,\n enableColumnResizing,\n enableColumnConfig,\n ],\n );\n\n return (\n <BaseTable<Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>>\n table={table}\n isLoading={isTableLoading}\n fetchNextPage={fetchMore}\n onRowClick={props.onRowClick}\n onColumnHeaderClick={handleColumnHeaderClick}\n rowHeight={props.rowHeight}\n renderCellContextMenu={onRenderCellContextMenu}\n renderEmptyState={props.renderEmptyState}\n className={props.className}\n error={error}\n headerMenuFeatureFlags={headerMenuFeatureFlags}\n editableConfig={editableConfig}\n getRowAttributes={props.getRowAttributes}\n showEditFooter={props.showEditFooter}\n focusedRowId={\n focusedRow == null ? focusedRow : getRowIdFromPrimaryKey<Q>(focusedRow)\n }\n onFocusedRowChanged={onFocusedRowChanged}\n />\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA,SAASA,eAAe,EAAEC,aAAa,QAAQ,uBAAuB;AACtE,OAAOC,KAAK,IAAIC,WAAW,EAAEC,mBAAmB,EAAEC,OAAO,QAAQ,OAAO;AAExE,SAASC,aAAa,QAAQ,0BAA0B;AACxD,SAASC,gBAAgB,QAAQ,6BAA6B;AAC9D,SAASC,eAAe,QAAQ,4BAA4B;AAC5D,SAASC,mBAAmB,QAAQ,gCAAgC;AACpE,SAASC,gBAAgB,QAAQ,6BAA6B;AAC9D,SAASC,kBAAkB,QAAQ,+BAA+B;AAClE,SAASC,sBAAsB,QAAQ,mCAAmC;AAE1E,SAASC,eAAe,QAAQ,4BAA4B;AAC5D,SAASC,kBAAkB,QAAQ,+BAA+B;AAClE,SAASC,eAAe,QAAQ,4BAA4B;AAE5D,SAASC,SAAS,QAAQ,YAAY;AAEtC,SAASC,wBAAwB,QAAQ,qCAAqC;AAC9E,SAASC,QAAQ,EAAEC,sBAAsB,QAAQ,qBAAqB;AAGtE,MAAMC,WAAe,GAAG,EAAE;AAE1B,OAAO,SAASC,WAAWA,CAOzB;EACAC,UAAU;EACVC,SAAS;EACTC,iBAAiB;EACjBC,MAAM;EACNC,gBAAgB;EAChBC,gBAAgB;EAChBC,QAAQ;EACRC,aAAa;EACbC,OAAO;EACPC,cAAc;EACdC,gBAAgB;EAChBC,sBAAsB;EACtBC,cAAc;EACdC,qBAAqB;EACrBC,mBAAmB;EACnBC,qBAAqB;E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E,sBAA8C,GAAG3G,OAAO,CAC5D,OAAO;IACL4G,gBAAgB,EAAEpE,cAAc;IAChCqE,gBAAgB,EAAEpE,mBAAmB;IACrCqE,cAAc,EAAEpE,oBAAoB;IACpCqE,cAAc,EAAEpE;EAClB,CAAC,CAAC,EACF,CACEH,cAAc,EACdC,mBAAmB,EACnBC,oBAAoB,EACpBC,kBAAkB,CAEtB,CAAC;EAED,oBACE9C,KAAA,CAAAmH,aAAA,CAACrG,SAAS;IACRuE,KAAK,EAAEA,KAAM;IACb1B,SAAS,EApBUA,SAAS,IAAIO,gBAoBN;IAC1BkD,aAAa,EAAE1D,SAAU;IACzB2D,UAAU,EAAElE,KAAK,CAACkE,UAAW;IAC7BnF,mBAAmB,EAAEyE,uBAAwB;IAC7CW,SAAS,EAAEnE,KAAK,CAACmE,SAAU;IAC3BnF,qBAAqB,EAAEoE,uBAAwB;IAC/CgB,gBAAgB,EAAEpE,KAAK,CAACoE,gBAAiB;IACzCC,SAAS,EAAErE,KAAK,CAACqE,SAAU;IAC3B5D,KAAK,EAAEA,KAAM;IACbkD,sBAAsB,EAAEA,sBAAuB;IAC/C1B,cAAc,EAAEA,cAAe;IAC/BqC,gBAAgB,EAAEtE,KAAK,CAACsE,gBAAiB;IACzCC,cAAc,EAAEvE,KAAK,CAACuE,cAAe;IACrCC,YAAY,EACV3E,UAAU,IAAI,IAAI,GAAGA,UAAU,GAAG/B,sBAAsB,CAAI+B,UAAU,CACvE;IACDC,mBAAmB,EAAEA;EAAoB,CAC1C,CAAC;AAEN","ignoreList":[]}
1
+ {"version":3,"file":"ObjectTable.js","names":["getCoreRowModel","useReactTable","React","useCallback","useImperativeHandle","useMemo","useColumnDefs","useColumnPinning","useColumnResize","useColumnVisibility","useEditableTable","useLoadedObjectsChanged","useObjectTableData","useObjectTableSnapshot","useRowSelection","useSelectionColumn","useTableSorting","BaseTable","deriveSelectionObjectSet","getRowId","getRowIdFromPrimaryKey","EMPTY_ARRAY","ObjectTable","objectType","objectSet","columnDefinitions","filter","objectSetOptions","dedupeIntervalMs","pageSize","streamUpdates","orderBy","defaultOrderBy","onOrderByChanged","onColumnsPinnedChanged","onColumnResize","onRowSelectionChanged","onLoadedObjectsChanged","onColumnHeaderClick","renderCellContextMenu","selectionMode","selectedRows","isAllSelected","isAllSelectedProp","onColumnVisibilityChanged","onCellValueChanged","onSubmitEdits","enableOrdering","enableColumnPinning","enableColumnResizing","enableColumnConfig","editMode","focusedRow","onFocusedRowChanged","tableRef","props","columnSizing","onColumnSizingChange","sorting","onSortingChange","orderByState","data","fetchMore","isLoading","error","totalCount","resultingObjectSet","objectOrInterfaceType","loadedObjects","columns","loading","isColumnsLoading","handleRowSelectionChanged","change","isSelectAll","rowSelection","hasSelection","onToggleAll","onToggleRow","enableRowSelection","selectionColumn","columnVisibility","onColumnVisibilityChange","columnOrder","onColumnOrderChange","allColumns","columnPinning","onColumnPinningChange","hasSelectionColumn","editableConfig","table","state","enableSorting","columnResizeMode","columnResizeDirection","manualSorting","defaultColumn","minSize","meta","onCellEdit","onCellValidationError","clearCellValidationError","cellEdits","isInEditMode","editModeState","isActive","validationErrors","getSnapshot","onRenderCellContextMenu","row","cell","getValue","handleColumnHeaderClick","columnId","undefined","headerMenuFeatureFlags","showSortingItems","showPinningItems","showResizeItem","showConfigItem","createElement","fetchNextPage","onRowClick","rowHeight","renderEmptyState","className","getRowAttributes","showEditFooter","focusedRowId"],"sources":["ObjectTable.tsx"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ObjectOrInterfaceDefinition,\n Osdk,\n PropertyKeys,\n QueryDefinition,\n SimplePropertyDef,\n} from \"@osdk/api\";\nimport type { Cell } from \"@tanstack/react-table\";\nimport { getCoreRowModel, useReactTable } from \"@tanstack/react-table\";\nimport React, { useCallback, useImperativeHandle, useMemo } from \"react\";\n\nimport { useColumnDefs } from \"./hooks/useColumnDefs.js\";\nimport { useColumnPinning } from \"./hooks/useColumnPinning.js\";\nimport { useColumnResize } from \"./hooks/useColumnResize.js\";\nimport { useColumnVisibility } from \"./hooks/useColumnVisibility.js\";\nimport { useEditableTable } from \"./hooks/useEditableTable.js\";\nimport { useLoadedObjectsChanged } from \"./hooks/useLoadedObjectsChanged.js\";\nimport { useObjectTableData } from \"./hooks/useObjectTableData.js\";\nimport { useObjectTableSnapshot } from \"./hooks/useObjectTableSnapshot.js\";\nimport type { UseRowSelectionChange } from \"./hooks/useRowSelection.js\";\nimport { useRowSelection } from \"./hooks/useRowSelection.js\";\nimport { useSelectionColumn } from \"./hooks/useSelectionColumn.js\";\nimport { useTableSorting } from \"./hooks/useTableSorting.js\";\nimport type { ObjectTableProps } from \"./ObjectTableApi.js\";\nimport { BaseTable } from \"./Table.js\";\nimport type { HeaderMenuFeatureFlags } from \"./TableHeaderWithPopover.js\";\nimport { deriveSelectionObjectSet } from \"./utils/deriveSelectionObjectSet.js\";\nimport { getRowId, getRowIdFromPrimaryKey } from \"./utils/getRowId.js\";\nimport type { EditableConfig } from \"./utils/types.js\";\n\nconst EMPTY_ARRAY: [] = [];\n\nexport function ObjectTable<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n>({\n objectType,\n objectSet,\n columnDefinitions,\n filter,\n objectSetOptions,\n dedupeIntervalMs,\n pageSize,\n streamUpdates,\n orderBy,\n defaultOrderBy,\n onOrderByChanged,\n onColumnsPinnedChanged,\n onColumnResize,\n onRowSelectionChanged,\n onLoadedObjectsChanged,\n onColumnHeaderClick,\n renderCellContextMenu,\n selectionMode = \"none\",\n selectedRows,\n isAllSelected: isAllSelectedProp,\n onColumnVisibilityChanged,\n onCellValueChanged,\n onSubmitEdits,\n enableOrdering = true,\n enableColumnPinning = true,\n enableColumnResizing = true,\n enableColumnConfig = true,\n editMode = \"manual\",\n focusedRow,\n onFocusedRowChanged,\n tableRef,\n ...props\n}: ObjectTableProps<Q, RDPs, FunctionColumns>): React.ReactElement {\n const { columnSizing, onColumnSizingChange } = useColumnResize({\n onColumnResize,\n });\n\n const { sorting, onSortingChange, orderByState } = useTableSorting<\n Q,\n RDPs,\n FunctionColumns\n >({\n orderBy,\n defaultOrderBy,\n onOrderByChanged,\n });\n\n const {\n data,\n fetchMore,\n isLoading,\n error,\n totalCount,\n objectSet: resultingObjectSet,\n } = useObjectTableData<Q, RDPs, FunctionColumns>({\n objectOrInterfaceType: objectType,\n columnDefinitions,\n filter,\n sorting,\n objectSet,\n objectSetOptions,\n dedupeIntervalMs,\n pageSize,\n streamUpdates,\n });\n\n useLoadedObjectsChanged<Q, RDPs>({\n loadedObjects: data,\n totalCount,\n isLoading,\n onLoadedObjectsChanged,\n });\n\n const { columns, loading: isColumnsLoading } = useColumnDefs<\n Q,\n RDPs,\n FunctionColumns\n >(objectType, columnDefinitions);\n\n const handleRowSelectionChanged = useCallback(\n (change: UseRowSelectionChange<Q, RDPs>) => {\n if (!onRowSelectionChanged) return;\n\n onRowSelectionChanged({\n selectedRows: change.selectedRows,\n isSelectAll: change.isSelectAll,\n objectSet: deriveSelectionObjectSet(resultingObjectSet, change),\n });\n },\n [onRowSelectionChanged, resultingObjectSet],\n );\n\n const {\n rowSelection,\n isAllSelected,\n hasSelection,\n onToggleAll,\n onToggleRow,\n enableRowSelection,\n } = useRowSelection<Q, RDPs>({\n selectionMode,\n selectedRows,\n isAllSelected: isAllSelectedProp,\n onRowSelectionChanged: handleRowSelectionChanged,\n data,\n });\n\n const selectionColumn = useSelectionColumn<Q, RDPs>({\n selectionMode,\n isAllSelected,\n hasSelection,\n onToggleAll,\n onToggleRow,\n });\n\n const {\n columnVisibility,\n onColumnVisibilityChange,\n columnOrder,\n onColumnOrderChange,\n } = useColumnVisibility({\n allColumns: columns,\n onColumnVisibilityChanged,\n });\n\n const { columnPinning, onColumnPinningChange } = useColumnPinning({\n columnDefinitions,\n hasSelectionColumn: enableRowSelection,\n onColumnsPinnedChanged,\n });\n\n const allColumns = useMemo(() => {\n return selectionColumn ? [selectionColumn, ...columns] : columns;\n }, [selectionColumn, columns]);\n\n const editableConfig: EditableConfig<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n unknown\n > = useEditableTable({\n editMode,\n onCellValueChanged,\n onSubmitEdits,\n });\n\n const table = useReactTable<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>\n >({\n data: data ?? EMPTY_ARRAY,\n columns: allColumns,\n getCoreRowModel: getCoreRowModel(),\n state: {\n columnVisibility,\n columnOrder,\n rowSelection,\n sorting,\n columnSizing,\n columnPinning,\n },\n onSortingChange,\n onColumnSizingChange,\n onColumnPinningChange,\n onColumnVisibilityChange,\n onColumnOrderChange,\n enableRowSelection,\n enableSorting: enableOrdering,\n columnResizeMode: \"onChange\",\n columnResizeDirection: \"ltr\",\n manualSorting: true, // Enable manual sorting to indicate server-side sorting\n defaultColumn: {\n minSize: 80,\n },\n getRowId,\n meta: {\n onCellEdit: editableConfig.onCellEdit,\n onCellValidationError: editableConfig.onCellValidationError,\n clearCellValidationError: editableConfig.clearCellValidationError,\n cellEdits: editableConfig.cellEdits,\n isInEditMode: editableConfig.editModeState.isActive,\n validationErrors: editableConfig.validationErrors,\n },\n });\n\n const { getSnapshot } = useObjectTableSnapshot<Q, RDPs, FunctionColumns>({\n objectOrInterfaceType: objectType,\n table,\n columnDefinitions,\n objectSet: resultingObjectSet,\n pageSize,\n totalCount,\n orderBy: orderByState,\n });\n\n useImperativeHandle(tableRef, () => ({ getSnapshot }), [getSnapshot]);\n\n const onRenderCellContextMenu = useCallback(\n (\n row: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n cell: Cell<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n unknown\n >,\n ) => {\n return renderCellContextMenu?.(row, cell.getValue());\n },\n [renderCellContextMenu],\n );\n\n const handleColumnHeaderClick = useMemo(\n () =>\n onColumnHeaderClick\n ? (columnId: string) =>\n onColumnHeaderClick(\n columnId as PropertyKeys<Q> | keyof RDPs | keyof FunctionColumns,\n )\n : undefined,\n [onColumnHeaderClick],\n );\n\n const isTableLoading = isLoading || isColumnsLoading;\n\n const headerMenuFeatureFlags: HeaderMenuFeatureFlags = useMemo(\n () => ({\n showSortingItems: enableOrdering,\n showPinningItems: enableColumnPinning,\n showResizeItem: enableColumnResizing,\n showConfigItem: enableColumnConfig,\n }),\n [\n enableOrdering,\n enableColumnPinning,\n enableColumnResizing,\n enableColumnConfig,\n ],\n );\n\n return (\n <BaseTable<Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>>\n table={table}\n isLoading={isTableLoading}\n fetchNextPage={fetchMore}\n onRowClick={props.onRowClick}\n onColumnHeaderClick={handleColumnHeaderClick}\n rowHeight={props.rowHeight}\n renderCellContextMenu={onRenderCellContextMenu}\n renderEmptyState={props.renderEmptyState}\n className={props.className}\n error={error}\n headerMenuFeatureFlags={headerMenuFeatureFlags}\n editableConfig={editableConfig}\n getRowAttributes={props.getRowAttributes}\n showEditFooter={props.showEditFooter}\n focusedRowId={\n focusedRow == null ? focusedRow : getRowIdFromPrimaryKey<Q>(focusedRow)\n }\n onFocusedRowChanged={onFocusedRowChanged}\n />\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA,SAASA,eAAe,EAAEC,aAAa,QAAQ,uBAAuB;AACtE,OAAOC,KAAK,IAAI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,CAAAsH,aAAA,CAACvG,SAAS;IACRyE,KAAK,EAAEA,KAAM;IACb3B,SAAS,EApBUA,SAAS,IAAIQ,gBAoBN;IAC1BkD,aAAa,EAAE3D,SAAU;IACzB4D,UAAU,EAAEnE,KAAK,CAACmE,UAAW;IAC7BpF,mBAAmB,EAAE0E,uBAAwB;IAC7CW,SAAS,EAAEpE,KAAK,CAACoE,SAAU;IAC3BpF,qBAAqB,EAAEqE,uBAAwB;IAC/CgB,gBAAgB,EAAErE,KAAK,CAACqE,gBAAiB;IACzCC,SAAS,EAAEtE,KAAK,CAACsE,SAAU;IAC3B7D,KAAK,EAAEA,KAAM;IACbmD,sBAAsB,EAAEA,sBAAuB;IAC/C1B,cAAc,EAAEA,cAAe;IAC/BqC,gBAAgB,EAAEvE,KAAK,CAACuE,gBAAiB;IACzCC,cAAc,EAAExE,KAAK,CAACwE,cAAe;IACrCC,YAAY,EACV5E,UAAU,IAAI,IAAI,GAAGA,UAAU,GAAGhC,sBAAsB,CAAIgC,UAAU,CACvE;IACDC,mBAAmB,EAAEA;EAAoB,CAC1C,CAAC;AAEN","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"ObjectTableApi.js","names":[],"sources":["ObjectTableApi.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n BaseWirePropertyTypes,\n CompileTimeMetadata,\n DerivedProperty,\n ObjectOrInterfaceDefinition,\n ObjectSet,\n Osdk,\n PrimaryKeyType,\n PropertyKeys,\n PropertyValueWireToClient,\n QueryDefinition,\n SimplePropertyDef,\n WhereClause,\n} from \"@osdk/api\";\nimport type { QueryParameterType } from \"@osdk/client/observable\";\nimport type * as React from \"react\";\n\nimport type { CellEditInfo, EditFieldConfig } from \"./utils/types.js\";\n\nexport type { EditFieldConfig } from \"./utils/types.js\";\n\nexport type ColumnDefinition<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> =\n | EditableColumnDefinition<Q, RDPs, FunctionColumns>\n | EditableFunctionColumnDefinition<Q, RDPs, FunctionColumns>\n | ReadonlyColumnDefinition<Q, RDPs, FunctionColumns>\n | ReadonlyFunctionColumnDefinition<Q, RDPs, FunctionColumns>;\n\n/** A column whose value comes from the row's object. */\ntype DerivableValueColumn<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> = {\n /**\n * What the column shows — a property, a linked object property (derived\n * property), or a custom column — and that locator's configuration.\n */\n locator:\n | PropertyColumnLocator<Q>\n | RdpColumnLocator<Q, RDPs>\n | CustomColumnLocator;\n} & CellValueOverride<Q, RDPs, FunctionColumns>;\n\n/**\n * The cell's value and the type it's declared to have.\n *\n * `cellValueType` is required whenever `getCellValue` is provided — declaring\n * the type constrains what `getCellValue` may return, so a column can't\n * advertise one type and hand the cell a value of another. `cellValueType` may\n * also be declared on its own to pick the editor without transforming the\n * value.\n */\ntype CellValueOverride<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> =\n // Use cellValueType + typed getCellValue together\n | {\n [T in BaseWirePropertyTypes]: {\n /**\n * The cell value's data type. Constrains what `getCellValue` may\n * return, and selects the editor for an `editable` column.\n */\n cellValueType: T;\n\n /**\n * Derives the cell's value from the row's object. Without it the column\n * reads the property named by `locator.id`.\n *\n * Use this to change what the cell's value *is* — what it returns is\n * the value the table renders, edits, and passes on to `renderCell`.\n * Use `renderCell` to change only how that value is displayed. The two\n * can be combined.\n */\n getCellValue: (\n object: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n locator: ColumnDefinitionLocator<Q, RDPs, FunctionColumns>,\n ) => PropertyValueWireToClient[T] | null | undefined;\n };\n }[BaseWirePropertyTypes]\n // Using cellValueType alone.\n | {\n [T in BaseWirePropertyTypes]: {\n cellValueType: T;\n getCellValue?: never;\n };\n }[BaseWirePropertyTypes]\n // Neither\n | {\n cellValueType?: undefined;\n getCellValue?: never;\n };\n\n/** A column whose value comes from a function query rather than the row. */\ninterface FunctionValueColumn<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> {\n /** What the column shows, and that locator's configuration. */\n locator: FunctionColumnLocator<Q, RDPs, FunctionColumns>;\n\n /** The cell value's data type. */\n cellValueType?: BaseWirePropertyTypes;\n\n /**\n * Use {@link FunctionColumnLocator}'s own `getValue` instead.\n */\n getCellValue?: never;\n}\n\ninterface SharedColumnDefinition<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> {\n /**\n * @default true\n */\n isVisible?: boolean;\n\n /**\n * @default none\n */\n pinned?: \"left\" | \"right\" | \"none\";\n width?: number;\n minWidth?: number;\n maxWidth?: number;\n resizable?: boolean;\n orderable?: boolean;\n\n /**\n * Custom renderer for the cell value.\n *\n * This changes only how the cell's value is displayed; the value itself is\n * unchanged. To change the value, use `getCellValue` (and declare its\n * `cellValueType`) — `renderCell` then receives that value as its third\n * argument. The two can be combined.\n *\n * Interaction with `editable` columns:\n * - When `editMode: \"manual\"` (default), `renderCell` is used while the\n * table is read-only (Edit Table button visible) and the editable cell\n * takes over once the user enters edit mode.\n * - When `editMode: \"always\"`, the editable cell always wins on editable\n * columns and `renderCell` is ignored — `editMode: \"always\"` opts the\n * column into a permanently-editable surface, leaving no read-only\n * state for `renderCell` to render. Use `editMode: \"manual\"` if you\n * need a custom display alongside editing.\n *\n * @param value - The cell's value, so there's no need to recompute what\n * `getCellValue` (or the property lookup) already produced.\n */\n renderCell?: (\n object: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n locator: ColumnDefinitionLocator<Q, RDPs, FunctionColumns>,\n value: unknown,\n ) => React.ReactNode;\n\n /**\n * If provided, this will be used in the column header.\n * If both columnName and renderHeader are provided, renderHeader will take precedence in the table header.\n * columnName will still be used in other parts where the column name is displayed.\n *\n * If not provided,\n * for a property column, the property displayName will be used\n * for other columns, the id will be used.\n */\n columnName?: string;\n\n /**\n * If provided, this will be used to render the header component.\n * When both columnName and renderHeader are provided, renderHeader will take precedence in the table header.\n */\n renderHeader?: () => React.ReactNode;\n}\n\ninterface EditableColumnOptions<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * `editable` can be a boolean or a predicate that receives the row's object\n * and returns whether the cell is editable\n */\n editable:\n | true\n | ((\n object: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n ) => boolean);\n\n /**\n * Configuration for the cell editor component.\n *\n * When provided, the column uses the specified field component\n * (e.g. dropdown) instead of the default auto-detected text/number input.\n *\n * `getFieldComponentProps` receives the row's object and a map of any\n * pending edits for that row (keyed by column id), and returns the props to\n * pass to the field component. Editor configuration can depend on the\n * current row or on other in-progress edits within the row.\n */\n editFieldConfig?: EditFieldConfig<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>\n >;\n\n /**\n * Additional function to validate the cell value during edit.\n *\n * @param value the current cell value\n * @returns a promise that resolves to an error message string if validation fails, or undefined if validation succeeds\n */\n validateEdit?: (value: unknown) => Promise<string | undefined>;\n}\n\ntype EditableColumnDefinition<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> = SharedColumnDefinition<Q, RDPs, FunctionColumns> &\n EditableColumnOptions<Q, RDPs> &\n DerivableValueColumn<Q, RDPs, FunctionColumns>;\n\n/** Editable column backed by a function query. */\ninterface EditableFunctionColumnDefinition<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n>\n extends\n SharedColumnDefinition<Q, RDPs, FunctionColumns>,\n EditableColumnOptions<Q, RDPs>,\n FunctionValueColumn<Q, RDPs, FunctionColumns> {}\n\n/**\n * Column definition for a read-only column (default).\n * `editFieldConfig` and `validateEdit` are not available.\n */\ntype ReadonlyColumnDefinition<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> = SharedColumnDefinition<Q, RDPs, FunctionColumns> &\n DerivableValueColumn<Q, RDPs, FunctionColumns> & { editable?: false };\n\n/** Read-only column backed by a function query. */\ninterface ReadonlyFunctionColumnDefinition<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n>\n extends\n SharedColumnDefinition<Q, RDPs, FunctionColumns>,\n FunctionValueColumn<Q, RDPs, FunctionColumns> {\n editable?: false;\n}\n\nexport type ExtractQueryParameters<Q extends QueryDefinition> =\n CompileTimeMetadata<Q>[\"parameters\"] extends Record<string, never>\n ? undefined\n : QueryParameterType<CompileTimeMetadata<Q>[\"parameters\"]>;\n\nexport interface PropertyColumnLocator<Q extends ObjectOrInterfaceDefinition> {\n type: \"property\";\n id: PropertyKeys<Q>;\n}\n\n/**\n * Concrete function column locator for a single key K.\n * Correlates the id, queryDefinition, and getFunctionParams types.\n */\ninterface FunctionColumnLocatorForKey<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef>,\n FunctionColumns extends Record<string, QueryDefinition<{}>>,\n K extends keyof FunctionColumns,\n> {\n /**\n * This is equivalent to workshop's function-backed columns.\n * The function needs to meet the specifications stated in https://www.palantir.com/docs/foundry/workshop/widgets-object-table/#function-backed-columns\n */\n type: \"function\";\n id: K;\n queryDefinition: FunctionColumns[K];\n\n /**\n * The function will be called with the current object set to get the input parameters for the function query.\n * @param objectSet - The current object set.\n * @returns - The function's input parameters including the object set.\n */\n getFunctionParams: (\n objectSet: ObjectSet<Q, RDPs>,\n ) => ExtractQueryParameters<FunctionColumns[K]>;\n\n /**\n * Function to generate keys for looking up results in the FunctionsMap.\n * @param object - The object instance\n * @returns - The key to use for looking up this object's result in the FunctionsMap\n */\n getKey: (\n object: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n ) => string;\n\n /**\n * Function to extract the cell value from the raw cell data returned by the function.\n * This is useful when functions return custom types with multiple properties.\n * @param cellData - The raw data returned by the function for this object\n * @returns - The value to display in the cell\n */\n getValue?: (cellData?: unknown) => unknown;\n\n /**\n * Minimum time between re-fetches of the same function with the same parameters, in milliseconds.\n * Defaults to 5 minutes as it is expensive to fetch function columns for a large object set\n * and they are expected to be relatively static in the context of an object table\n *\n * @default 300_000 (5 minutes)\n */\n dedupeIntervalMs?: number;\n\n /**\n * Object type apiNames the function reads but doesn't take as a parameter (e.g.\n * linked object types the function traverses internally). The column auto-revalidates\n * when an action edits an object of any of these types. Param-derived types are\n * tracked automatically and don't need to be listed here.\n */\n dependsOn?: string[];\n}\n\n/**\n * Distributes over each key in FunctionColumns so that id, queryDefinition,\n * and getFunctionParams are correlated per key.\n */\nexport type FunctionColumnLocator<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> = keyof FunctionColumns extends infer K\n ? K extends keyof FunctionColumns\n ? FunctionColumnLocatorForKey<Q, RDPs, FunctionColumns, K>\n : never\n : never;\n\nexport interface RdpColumnLocator<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n type: \"rdp\";\n id: keyof RDPs;\n creator: DerivedProperty.Creator<Q, RDPs[keyof RDPs]>;\n}\n\nexport interface CustomColumnLocator {\n type: \"custom\";\n id: string;\n}\n\nexport type ColumnDefinitionLocator<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> =\n | PropertyColumnLocator<Q>\n | FunctionColumnLocator<Q, RDPs, FunctionColumns>\n | RdpColumnLocator<Q, RDPs>\n | CustomColumnLocator;\n\nexport interface ObjectTableProps<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> {\n /**\n * The object or interface type of the object\n * If objectSet is not provided, objects will be fetched based on this type.\n */\n objectType: Q;\n\n /**\n * The set of objects to show in the table.\n * If provided, the table fetches through this object set instead of fetching based on\n * objectType. Supported for both object and interface types.\n *\n * For an interface object set, rows expose the interface's declared properties;\n * the underlying concrete object's non-interface properties are not loaded.\n * Use objectType-based fetching if you need those.\n */\n objectSet?: ObjectSet<Q>;\n\n /**\n * Ordered list of column definitions to show in the table\n *\n * If not provided, all of the properties of the object type will be shown in default order.\n */\n columnDefinitions?: Array<ColumnDefinition<Q, RDPs, FunctionColumns>>;\n\n objectSetOptions?: ObjectSetOptions<Q>;\n\n /**\n * Minimum time between fetch requests in milliseconds.\n * Increasing this value reduces redundant network calls when the same data\n * is requested multiple times in quick succession.\n *\n * @default 60_000 1 minute\n */\n dedupeIntervalMs?: number;\n\n /**\n * Enable streaming updates via websocket subscription.\n * When true, the table will automatically update when matching\n * objects are added, updated, or removed in Foundry.\n *\n * Limitations: `streamUpdates` cannot be used together with `pivotTo` or\n * `withProperties`. The server does not support websocket subscriptions\n * for link-traversal or derived-property queries. Those queries still\n * fetch data normally but won't receive real-time updates.\n *\n * @default false\n */\n streamUpdates?: boolean;\n\n /**\n * Number of objects to fetch per page.\n *\n * @default 50\n */\n pageSize?: number;\n\n /**\n * The current where clause to filter the objects in the table.\n * If provided, the filter is controlled.\n */\n filter?: WhereClause<Q, RDPs>;\n\n /**\n * Whether the column configuration dialog for column visibility and ordering is available to the user.\n *\n * @default true\n */\n enableColumnConfig?: boolean;\n\n /**\n * Whether columns can be pinned by the user.\n *\n * @default true\n */\n enableColumnPinning?: boolean;\n\n /**\n * Whether columns can be resized by the user.\n *\n * @default true\n */\n enableColumnResizing?: boolean;\n\n /**\n * Called when the column visibility or ordering changed.\n *\n * If provided, the table will allow the user to show/hide columns.\n *\n * @param newStates The columns sorted in their display order in the table and their visibility state.\n */\n onColumnVisibilityChanged?: (\n newStates: Array<{\n columnId: PropertyKeys<Q> | keyof RDPs | keyof FunctionColumns;\n isVisible: boolean;\n }>,\n ) => void;\n\n /**\n * Called when the pinned columns change.\n *\n * If provided, the table will allow the user to pin/unpin columns.\n *\n * @param newStates The new list of column pin states\n */\n onColumnsPinnedChanged?: (\n newStates: Array<{\n columnId: PropertyKeys<Q> | keyof RDPs | keyof FunctionColumns;\n pinned: \"left\" | \"right\" | \"none\";\n }>,\n ) => void;\n\n /**\n * Called when a column is resized.\n *\n * @param columnId The ID of the resized column\n * @param newWidth The new width of the column. When newWidth = null, the column size is reset.\n */\n onColumnResize?: (\n columnId: PropertyKeys<Q> | keyof RDPs | keyof FunctionColumns,\n newWidth: number | null,\n ) => void;\n\n /**\n * Called when a column header is clicked.\n *\n * The columnId matches the `locator.id` configured on the column definition.\n * The dropdown menu trigger is excluded — clicking the chevron opens the\n * header menu instead of firing this callback.\n *\n * @param columnId The id of the clicked column\n */\n onColumnHeaderClick?: (\n columnId: PropertyKeys<Q> | keyof RDPs | keyof FunctionColumns,\n ) => void;\n\n /**\n * Whether the table is sortable by the user.\n *\n * @default true\n */\n enableOrdering?: boolean;\n\n /**\n * The default order by clause to sort the objects in the table.\n * If provided without orderBy prop, the sorting is uncontrolled.\n * If both orderBy and defaultOrderBy are provided, orderBy takes precedence.\n */\n defaultOrderBy?: Array<{\n property: PropertyKeys<Q> | keyof RDPs;\n direction: \"asc\" | \"desc\";\n }>;\n\n /**\n * The current order by clause to sort the objects in the table.\n * If provided, the sorting is controlled.\n * If both orderBy and defaultOrderBy are provided, orderBy takes precedence.\n */\n orderBy?: Array<{\n property: PropertyKeys<Q> | keyof RDPs;\n direction: \"asc\" | \"desc\";\n }>;\n\n /**\n * Called when the order by clause is changed.\n * Required when sorting is controlled.\n *\n * @param newOrderBy The new order by clause\n */\n onOrderByChanged?: (\n newOrderBy: Array<{\n property: PropertyKeys<Q> | keyof RDPs;\n direction: \"asc\" | \"desc\";\n }>,\n ) => void;\n\n /**\n * Selection mode for the table rows.\n *\n * If multiple, a checkbox will be shown for each row to allow selecting multiple rows\n * as well as a top-level checkbox in the header to select all rows.\n *\n * @default \"none\"\n */\n selectionMode?: \"single\" | \"multiple\" | \"none\";\n\n /**\n * The currently selected rows in the table.\n * If provided, the row selection is controlled.\n */\n selectedRows?: PrimaryKeyType<Q>[];\n\n /**\n * Indicates whether all rows are selected in controlled mode.\n * When true, the table will show all rows as selected regardless of the selectedRows array.\n */\n isAllSelected?: boolean;\n\n /**\n * Called when the row selection changes, with a {@link RowSelectionChange}\n * payload describing the new state.\n *\n * @param change The new selection state. See {@link RowSelectionChange}.\n */\n onRowSelectionChanged?: (change: RowSelectionChange<Q, RDPs>) => void;\n\n /**\n * The primary key of the row to render as visually focused (the\n * \"last interacted\" row). When provided, focus state is controlled by\n * the caller.\n *\n * Stored as a primary key rather than a full object so the focus does\n * not go stale when the underlying row data changes.\n *\n * Pass `null` to render no row as focused.\n */\n focusedRow?: PrimaryKeyType<Q> | null;\n\n /**\n * Called when the focused row changes — fires in both controlled and\n * uncontrolled modes so callers can observe focus without taking it\n * over.\n *\n * @param row The newly-focused row object, or `null` if focus was\n * cleared\n */\n onFocusedRowChanged?: (\n row: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs> | null,\n ) => void;\n\n /**\n * Controls the edit mode behavior of the table.\n * - \"always\": Editable cells are immediately in edit mode on row clicked.\n * - \"manual\": User can toggle edit mode on/off via the Edit Table button.\n *\n * @default \"manual\"\n */\n editMode?: \"always\" | \"manual\";\n\n /**\n * Whether to render the bottom edit footer that hosts the\n * \"Edit Table\" / \"Cancel\" / \"Submit Edits\" buttons and the edit-state\n * indicators (modification count, validation errors).\n *\n * @default true whenever the table has at least one column declared\n * editable (i.e. any column with `editable: true` or `editable: (object) => boolean`).\n * When `false`, the \"Edit Table\" and \"Submit Edits\" buttons will not be shown.\n */\n showEditFooter?: boolean;\n\n /**\n * Called after the value of a cell is edited and committed by the user.\n *\n * @param info An object containing details about the cell that was edited,\n * including the rowId, columnId, new and old values, and the row data before the edit\n */\n onCellValueChanged?: (\n info: CellEditInfo<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n unknown\n >,\n ) => void;\n\n /**\n * If provided, the \"Submit Edits\" button will be shown in the edit footer.\n *\n * @param edits an array of edit info containing details about the edited cells\n * including the rowId, columnId, new and old values, and the row data before the edit\n * @return a promise that resolves to true if the edits were successfully submitted\n */\n onSubmitEdits?: (\n edits: CellEditInfo<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n unknown\n >[],\n ) => Promise<boolean>;\n\n /**\n * Called when a row is clicked.\n *\n * @param object The object representing the clicked row\n */\n onRowClick?: (\n object: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n ) => void;\n\n /**\n * If provided, will render this context menu when right clicking on a cell\n */\n renderCellContextMenu?: (\n row: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n cellValue: unknown,\n ) => React.ReactNode;\n\n /**\n * The height of each row in pixels.\n *\n * @default 40\n */\n rowHeight?: number;\n\n /**\n * Render override for the empty state. Called when the table has no\n * rows and no error. When omitted, a default \"No Data\" indicator is\n * rendered.\n */\n renderEmptyState?: () => React.ReactNode;\n\n /**\n * Returns extra HTML attributes (typically `data-*`) to apply to each\n * row element. Use this to drive conditional row styling\n */\n getRowAttributes?: (\n object: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n ) => Record<string, string | undefined>;\n\n /**\n * Imperative handle for programmatic table actions. Pass a ref\n * (`useRef<ObjectTableHandle<Q, RDPs>>(null)`) to call\n * {@link ObjectTableHandle} methods such as\n * {@link ObjectTableHandle.getSnapshot}.\n */\n tableRef?: React.Ref<ObjectTableHandle<Q, RDPs>>;\n\n className?: string;\n}\n\n/**\n * Imperative handle exposing programmatic actions on an {@link ObjectTable}.\n * Obtain it by passing {@link ObjectTableProps.tableRef}.\n */\nexport interface ObjectTableHandle<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Loads every row matching the object set and returns a format-agnostic\n * snapshot of the table's columns, row values, and total count. The caller\n * is responsible for turning the snapshot into a downloadable artifact\n * (CSV, Spreadsheet, JSON, clipboard, …).\n *\n * Property, derived-property, and function-backed columns are included.\n * Function-backed cells are fetched per page during snapshot collection;\n * when a page's fetch fails, `row.getValue(columnId)` returns the thrown\n * `Error` instance for the affected cells while the rest of the snapshot\n * resolves normally.\n * Columns defined with `locator.type === \"custom\"` are omitted because\n * they have no underlying value to export.\n *\n * The returned promise rejects up front when the object set's `totalCount`\n * exceeds `rowLimit`. When `totalCount` is unavailable, it instead rejects\n * mid-load once more than `rowLimit` rows have been pulled, so an unknown\n * count can't drain an unbounded set into the client. Otherwise every\n * matching row is loaded.\n *\n * @param options See {@link ObjectTableSnapshotOptions}.\n */\n getSnapshot: (\n options?: ObjectTableSnapshotOptions,\n ) => Promise<ObjectTableSnapshot<Q, RDPs>>;\n}\n\n/**\n * Options for {@link ObjectTableHandle[\"getSnapshot\"]}.\n */\nexport interface ObjectTableSnapshotOptions {\n /**\n * Upper bound on how many rows the snapshot may contain. When the object\n * set's total row count exceeds this value, `getSnapshot` rejects;\n * otherwise every matching row is loaded.\n *\n * @default 10_000\n */\n rowLimit?: number;\n}\n\n/**\n * A point-in-time capture of an {@link ObjectTable}'s columns and row values,\n * returned by {@link ObjectTableHandle.getSnapshot}.\n */\nexport interface ObjectTableSnapshot<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n columns: ObjectTableDataColumn[];\n rows: ObjectTableDataRow<Q, RDPs>[];\n /**\n * Total number of objects matching the underlying object set, as reported\n * by the API. `undefined` when the API did not provide a count. Encoded as\n * a string to match the underlying list-payload representation.\n */\n totalCount: string | undefined;\n}\n\n/**\n * A single column in an {@link ObjectTableSnapshot}.\n */\nexport interface ObjectTableDataColumn {\n /** Column id, matching the `locator.id` of the column definition. */\n id: string;\n /** Display name shown in the table header. */\n name: string;\n}\n\n/**\n * A single row in an {@link ObjectTableSnapshot}.\n */\nexport interface ObjectTableDataRow<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /** Row id (the underlying object's `$primaryKey` rendered as a string). */\n id: string;\n /** The underlying loaded object. */\n object: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>;\n /**\n * Returns the cell value for a given column id, or `undefined` when the\n * column is not part of the snapshot. Function-backed cells whose query\n * failed surface the thrown `Error` instance as their value.\n */\n getValue: (columnId: string) => unknown;\n}\n\n/**\n * Payload for {@link ObjectTableProps.onRowSelectionChanged}. Consolidates\n * the loaded row instances, the `isSelectAll` semantic intent, and an\n * `ObjectSet` covering the selection.\n */\nexport interface RowSelectionChange<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Loaded row instances currently selected. When `isSelectAll` is true,\n * this reflects only the rows currently in the table — pages not yet\n * fetched are absent. Use `objectSet` for the cross-page view, and\n * `selectedRows.map(r => r.$primaryKey)` if you need the primary keys.\n */\n selectedRows: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>[];\n\n /**\n * True when the user invoked \"select all\" (header checkbox) or when\n * controlled mode supplies `isAllSelected={true}`. Distinct from \"every\n * loaded row happens to be selected\" — that condition is reflected by\n * `selectedRows.length` matching the visible row count but does not set\n * this flag.\n */\n isSelectAll: boolean;\n\n /**\n * An `ObjectSet` representing the selection.\n *\n * - \"Select all\" → the underlying `ObjectSet` (`objectSet` prop if\n * provided, otherwise derived from `objectType` via `client(...)`).\n * This includes rows not yet loaded into the table.\n * - Partial selection → the underlying `ObjectSet` narrowed to\n * `{ $primaryKey: { $in: selectedRows.map(r => r.$primaryKey) } }`.\n * - \"Deselect all\" → an empty `ObjectSet` (`$in: []`).\n *\n * Works for both object and interface types, since the `$primaryKey`\n * special property does not require resolving the underlying primary key\n * property name. `undefined` only when there is no underlying `ObjectSet`\n * to derive from.\n */\n objectSet: ObjectSet<Q, RDPs> | undefined;\n}\n\nexport interface ObjectSetOptions<Q extends ObjectOrInterfaceDefinition> {\n /**\n * Object sets to union with\n */\n union?: ObjectSet<Q>[];\n\n /**\n * Object sets to intersect with\n */\n intersect?: ObjectSet<Q>[];\n\n /**\n * Object sets to subtract from\n */\n subtract?: ObjectSet<Q>[];\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"ObjectTableApi.js","names":[],"sources":["ObjectTableApi.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n BaseWirePropertyTypes,\n CompileTimeMetadata,\n DerivedProperty,\n ObjectOrInterfaceDefinition,\n ObjectSet,\n Osdk,\n PrimaryKeyType,\n PropertyKeys,\n PropertyValueWireToClient,\n QueryDefinition,\n SimplePropertyDef,\n WhereClause,\n} from \"@osdk/api\";\nimport type { QueryParameterType } from \"@osdk/client/observable\";\nimport type * as React from \"react\";\n\nimport type { CellEditInfo, EditFieldConfig } from \"./utils/types.js\";\n\nexport type { EditFieldConfig } from \"./utils/types.js\";\n\nexport type ColumnDefinition<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> =\n | EditableColumnDefinition<Q, RDPs, FunctionColumns>\n | EditableFunctionColumnDefinition<Q, RDPs, FunctionColumns>\n | ReadonlyColumnDefinition<Q, RDPs, FunctionColumns>\n | ReadonlyFunctionColumnDefinition<Q, RDPs, FunctionColumns>;\n\n/** A column whose value comes from the row's object. */\ntype DerivableValueColumn<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> = {\n /**\n * What the column shows — a property, a linked object property (derived\n * property), or a custom column — and that locator's configuration.\n */\n locator:\n | PropertyColumnLocator<Q>\n | RdpColumnLocator<Q, RDPs>\n | CustomColumnLocator;\n} & CellValueOverride<Q, RDPs, FunctionColumns>;\n\n/**\n * The cell's value and the type it's declared to have.\n *\n * `cellValueType` is required whenever `getCellValue` is provided — declaring\n * the type constrains what `getCellValue` may return, so a column can't\n * advertise one type and hand the cell a value of another. `cellValueType` may\n * also be declared on its own to pick the editor without transforming the\n * value.\n */\ntype CellValueOverride<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> =\n // Use cellValueType + typed getCellValue together\n | {\n [T in BaseWirePropertyTypes]: {\n /**\n * The cell value's data type. Constrains what `getCellValue` may\n * return, and selects the editor for an `editable` column.\n */\n cellValueType: T;\n\n /**\n * Derives the cell's value from the row's object. Without it the column\n * reads the property named by `locator.id`.\n *\n * Use this to change what the cell's value *is* — what it returns is\n * the value the table renders, edits, and passes on to `renderCell`.\n * Use `renderCell` to change only how that value is displayed. The two\n * can be combined.\n */\n getCellValue: (\n object: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n locator: ColumnDefinitionLocator<Q, RDPs, FunctionColumns>,\n ) => PropertyValueWireToClient[T] | null | undefined;\n };\n }[BaseWirePropertyTypes]\n // Using cellValueType alone.\n | {\n [T in BaseWirePropertyTypes]: {\n cellValueType: T;\n getCellValue?: never;\n };\n }[BaseWirePropertyTypes]\n // Neither\n | {\n cellValueType?: undefined;\n getCellValue?: never;\n };\n\n/** A column whose value comes from a function query rather than the row. */\ninterface FunctionValueColumn<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> {\n /** What the column shows, and that locator's configuration. */\n locator: FunctionColumnLocator<Q, RDPs, FunctionColumns>;\n\n /** The cell value's data type. */\n cellValueType?: BaseWirePropertyTypes;\n\n /**\n * Use {@link FunctionColumnLocator}'s own `getValue` instead.\n */\n getCellValue?: never;\n}\n\ninterface SharedColumnDefinition<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> {\n /**\n * @default true\n */\n isVisible?: boolean;\n\n /**\n * @default none\n */\n pinned?: \"left\" | \"right\" | \"none\";\n width?: number;\n minWidth?: number;\n maxWidth?: number;\n resizable?: boolean;\n orderable?: boolean;\n\n /**\n * Custom renderer for the cell value.\n *\n * This changes only how the cell's value is displayed; the value itself is\n * unchanged. To change the value, use `getCellValue` (and declare its\n * `cellValueType`) — `renderCell` then receives that value as its third\n * argument. The two can be combined.\n *\n * Interaction with `editable` columns:\n * - When `editMode: \"manual\"` (default), `renderCell` is used while the\n * table is read-only (Edit Table button visible) and the editable cell\n * takes over once the user enters edit mode.\n * - When `editMode: \"always\"`, the editable cell always wins on editable\n * columns and `renderCell` is ignored — `editMode: \"always\"` opts the\n * column into a permanently-editable surface, leaving no read-only\n * state for `renderCell` to render. Use `editMode: \"manual\"` if you\n * need a custom display alongside editing.\n *\n * @param value - The cell's value, so there's no need to recompute what\n * `getCellValue` (or the property lookup) already produced.\n */\n renderCell?: (\n object: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n locator: ColumnDefinitionLocator<Q, RDPs, FunctionColumns>,\n value: unknown,\n ) => React.ReactNode;\n\n /**\n * If provided, this will be used in the column header.\n * If both columnName and renderHeader are provided, renderHeader will take precedence in the table header.\n * columnName will still be used in other parts where the column name is displayed.\n *\n * If not provided,\n * for a property column, the property displayName will be used\n * for other columns, the id will be used.\n */\n columnName?: string;\n\n /**\n * If provided, this will be used to render the header component.\n * When both columnName and renderHeader are provided, renderHeader will take precedence in the table header.\n */\n renderHeader?: () => React.ReactNode;\n}\n\ninterface EditableColumnOptions<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * `editable` can be a boolean or a predicate that receives the row's object\n * and returns whether the cell is editable\n */\n editable:\n | true\n | ((\n object: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n ) => boolean);\n\n /**\n * Configuration for the cell editor component.\n *\n * When provided, the column uses the specified field component\n * (e.g. dropdown) instead of the default auto-detected text/number input.\n *\n * `getFieldComponentProps` receives the row's object and a map of any\n * pending edits for that row (keyed by column id), and returns the props to\n * pass to the field component. Editor configuration can depend on the\n * current row or on other in-progress edits within the row.\n */\n editFieldConfig?: EditFieldConfig<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>\n >;\n\n /**\n * Additional function to validate the cell value during edit.\n *\n * @param value the current cell value\n * @returns a promise that resolves to an error message string if validation fails, or undefined if validation succeeds\n */\n validateEdit?: (value: unknown) => Promise<string | undefined>;\n}\n\ntype EditableColumnDefinition<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> = SharedColumnDefinition<Q, RDPs, FunctionColumns> &\n EditableColumnOptions<Q, RDPs> &\n DerivableValueColumn<Q, RDPs, FunctionColumns>;\n\n/** Editable column backed by a function query. */\ninterface EditableFunctionColumnDefinition<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n>\n extends\n SharedColumnDefinition<Q, RDPs, FunctionColumns>,\n EditableColumnOptions<Q, RDPs>,\n FunctionValueColumn<Q, RDPs, FunctionColumns> {}\n\n/**\n * Column definition for a read-only column (default).\n * `editFieldConfig` and `validateEdit` are not available.\n */\ntype ReadonlyColumnDefinition<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> = SharedColumnDefinition<Q, RDPs, FunctionColumns> &\n DerivableValueColumn<Q, RDPs, FunctionColumns> & { editable?: false };\n\n/** Read-only column backed by a function query. */\ninterface ReadonlyFunctionColumnDefinition<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n>\n extends\n SharedColumnDefinition<Q, RDPs, FunctionColumns>,\n FunctionValueColumn<Q, RDPs, FunctionColumns> {\n editable?: false;\n}\n\nexport type ExtractQueryParameters<Q extends QueryDefinition> =\n CompileTimeMetadata<Q>[\"parameters\"] extends Record<string, never>\n ? undefined\n : QueryParameterType<CompileTimeMetadata<Q>[\"parameters\"]>;\n\nexport interface PropertyColumnLocator<Q extends ObjectOrInterfaceDefinition> {\n type: \"property\";\n id: PropertyKeys<Q>;\n}\n\n/**\n * Concrete function column locator for a single key K.\n * Correlates the id, queryDefinition, and getFunctionParams types.\n */\ninterface FunctionColumnLocatorForKey<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef>,\n FunctionColumns extends Record<string, QueryDefinition<{}>>,\n K extends keyof FunctionColumns,\n> {\n /**\n * This is equivalent to workshop's function-backed columns.\n * The function needs to meet the specifications stated in https://www.palantir.com/docs/foundry/workshop/widgets-object-table/#function-backed-columns\n */\n type: \"function\";\n id: K;\n queryDefinition: FunctionColumns[K];\n\n /**\n * The function will be called with the current object set to get the input parameters for the function query.\n * @param objectSet - The current object set.\n * @returns - The function's input parameters including the object set.\n */\n getFunctionParams: (\n objectSet: ObjectSet<Q, RDPs>,\n ) => ExtractQueryParameters<FunctionColumns[K]>;\n\n /**\n * Function to generate keys for looking up results in the FunctionsMap.\n * @param object - The object instance\n * @returns - The key to use for looking up this object's result in the FunctionsMap\n */\n getKey: (\n object: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n ) => string;\n\n /**\n * Function to extract the cell value from the raw cell data returned by the function.\n * This is useful when functions return custom types with multiple properties.\n * @param cellData - The raw data returned by the function for this object\n * @returns - The value to display in the cell\n */\n getValue?: (cellData?: unknown) => unknown;\n\n /**\n * Minimum time between re-fetches of the same function with the same parameters, in milliseconds.\n * Defaults to 5 minutes as it is expensive to fetch function columns for a large object set\n * and they are expected to be relatively static in the context of an object table\n *\n * @default 300_000 (5 minutes)\n */\n dedupeIntervalMs?: number;\n\n /**\n * Object type apiNames the function reads but doesn't take as a parameter (e.g.\n * linked object types the function traverses internally). The column auto-revalidates\n * when an action edits an object of any of these types. Param-derived types are\n * tracked automatically and don't need to be listed here.\n */\n dependsOn?: string[];\n}\n\n/**\n * Distributes over each key in FunctionColumns so that id, queryDefinition,\n * and getFunctionParams are correlated per key.\n */\nexport type FunctionColumnLocator<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> = keyof FunctionColumns extends infer K\n ? K extends keyof FunctionColumns\n ? FunctionColumnLocatorForKey<Q, RDPs, FunctionColumns, K>\n : never\n : never;\n\nexport interface RdpColumnLocator<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n type: \"rdp\";\n id: keyof RDPs;\n creator: DerivedProperty.Creator<Q, RDPs[keyof RDPs]>;\n}\n\nexport interface CustomColumnLocator {\n type: \"custom\";\n id: string;\n}\n\nexport type ColumnDefinitionLocator<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> =\n | PropertyColumnLocator<Q>\n | FunctionColumnLocator<Q, RDPs, FunctionColumns>\n | RdpColumnLocator<Q, RDPs>\n | CustomColumnLocator;\n\nexport interface ObjectTableProps<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> {\n /**\n * The object or interface type of the object\n * If objectSet is not provided, objects will be fetched based on this type.\n */\n objectType: Q;\n\n /**\n * The set of objects to show in the table.\n * If provided, the table fetches through this object set instead of fetching based on\n * objectType. Supported for both object and interface types.\n *\n * For an interface object set, rows expose the interface's declared properties;\n * the underlying concrete object's non-interface properties are not loaded.\n * Use objectType-based fetching if you need those.\n */\n objectSet?: ObjectSet<Q>;\n\n /**\n * Ordered list of column definitions to show in the table\n *\n * If not provided, all of the properties of the object type will be shown in default order.\n */\n columnDefinitions?: Array<ColumnDefinition<Q, RDPs, FunctionColumns>>;\n\n objectSetOptions?: ObjectSetOptions<Q>;\n\n /**\n * Minimum time between fetch requests in milliseconds.\n * Increasing this value reduces redundant network calls when the same data\n * is requested multiple times in quick succession.\n *\n * @default 60_000 1 minute\n */\n dedupeIntervalMs?: number;\n\n /**\n * Enable streaming updates via websocket subscription.\n * When true, the table will automatically update when matching\n * objects are added, updated, or removed in Foundry.\n *\n * Limitations: `streamUpdates` cannot be used together with `pivotTo` or\n * `withProperties`. The server does not support websocket subscriptions\n * for link-traversal or derived-property queries. Those queries still\n * fetch data normally but won't receive real-time updates.\n *\n * @default false\n */\n streamUpdates?: boolean;\n\n /**\n * Number of objects to fetch per page.\n *\n * @default 50\n */\n pageSize?: number;\n\n /**\n * The current where clause to filter the objects in the table.\n * If provided, the filter is controlled.\n */\n filter?: WhereClause<Q, RDPs>;\n\n /**\n * Whether the column configuration dialog for column visibility and ordering is available to the user.\n *\n * @default true\n */\n enableColumnConfig?: boolean;\n\n /**\n * Whether columns can be pinned by the user.\n *\n * @default true\n */\n enableColumnPinning?: boolean;\n\n /**\n * Whether columns can be resized by the user.\n *\n * @default true\n */\n enableColumnResizing?: boolean;\n\n /**\n * Called when the column visibility or ordering changed.\n *\n * If provided, the table will allow the user to show/hide columns.\n *\n * @param newStates The columns sorted in their display order in the table and their visibility state.\n */\n onColumnVisibilityChanged?: (\n newStates: Array<{\n columnId: PropertyKeys<Q> | keyof RDPs | keyof FunctionColumns;\n isVisible: boolean;\n }>,\n ) => void;\n\n /**\n * Called when the pinned columns change.\n *\n * If provided, the table will allow the user to pin/unpin columns.\n *\n * @param newStates The new list of column pin states\n */\n onColumnsPinnedChanged?: (\n newStates: Array<{\n columnId: PropertyKeys<Q> | keyof RDPs | keyof FunctionColumns;\n pinned: \"left\" | \"right\" | \"none\";\n }>,\n ) => void;\n\n /**\n * Called when a column is resized.\n *\n * @param columnId The ID of the resized column\n * @param newWidth The new width of the column. When newWidth = null, the column size is reset.\n */\n onColumnResize?: (\n columnId: PropertyKeys<Q> | keyof RDPs | keyof FunctionColumns,\n newWidth: number | null,\n ) => void;\n\n /**\n * Called when a column header is clicked.\n *\n * The columnId matches the `locator.id` configured on the column definition.\n * The dropdown menu trigger is excluded — clicking the chevron opens the\n * header menu instead of firing this callback.\n *\n * @param columnId The id of the clicked column\n */\n onColumnHeaderClick?: (\n columnId: PropertyKeys<Q> | keyof RDPs | keyof FunctionColumns,\n ) => void;\n\n /**\n * Whether the table is sortable by the user.\n *\n * @default true\n */\n enableOrdering?: boolean;\n\n /**\n * The default order by clause to sort the objects in the table.\n * If provided without orderBy prop, the sorting is uncontrolled.\n * If both orderBy and defaultOrderBy are provided, orderBy takes precedence.\n */\n defaultOrderBy?: Array<{\n property: PropertyKeys<Q> | keyof RDPs;\n direction: \"asc\" | \"desc\";\n }>;\n\n /**\n * The current order by clause to sort the objects in the table.\n * If provided, the sorting is controlled.\n * If both orderBy and defaultOrderBy are provided, orderBy takes precedence.\n */\n orderBy?: Array<{\n property: PropertyKeys<Q> | keyof RDPs;\n direction: \"asc\" | \"desc\";\n }>;\n\n /**\n * Called when the order by clause is changed.\n * Required when sorting is controlled.\n *\n * @param newOrderBy The new order by clause\n */\n onOrderByChanged?: (\n newOrderBy: Array<{\n property: PropertyKeys<Q> | keyof RDPs;\n direction: \"asc\" | \"desc\";\n }>,\n ) => void;\n\n /**\n * Selection mode for the table rows.\n *\n * If multiple, a checkbox will be shown for each row to allow selecting multiple rows\n * as well as a top-level checkbox in the header to select all rows.\n *\n * @default \"none\"\n */\n selectionMode?: \"single\" | \"multiple\" | \"none\";\n\n /**\n * The currently selected rows in the table.\n * If provided, the row selection is controlled.\n */\n selectedRows?: PrimaryKeyType<Q>[];\n\n /**\n * Indicates whether all rows are selected in controlled mode.\n * When true, the table will show all rows as selected regardless of the selectedRows array.\n */\n isAllSelected?: boolean;\n\n /**\n * Called when the row selection changes, with a {@link RowSelectionChange}\n * payload describing the new state.\n *\n * @param change The new selection state. See {@link RowSelectionChange}.\n */\n onRowSelectionChanged?: (change: RowSelectionChange<Q, RDPs>) => void;\n\n /**\n * Called when the set of loaded rows changes — as pages are fetched, when\n * streamed updates arrive, and after a refetch — with a\n * {@link LoadedObjectsChange} payload.\n *\n * @param change The loaded rows and the total count. See\n * {@link LoadedObjectsChange}.\n */\n onLoadedObjectsChanged?: (change: LoadedObjectsChange<Q, RDPs>) => void;\n\n /**\n * The primary key of the row to render as visually focused (the\n * \"last interacted\" row). When provided, focus state is controlled by\n * the caller.\n *\n * Stored as a primary key rather than a full object so the focus does\n * not go stale when the underlying row data changes.\n *\n * Pass `null` to render no row as focused.\n */\n focusedRow?: PrimaryKeyType<Q> | null;\n\n /**\n * Called when the focused row changes — fires in both controlled and\n * uncontrolled modes so callers can observe focus without taking it\n * over.\n *\n * @param row The newly-focused row object, or `null` if focus was\n * cleared\n */\n onFocusedRowChanged?: (\n row: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs> | null,\n ) => void;\n\n /**\n * Controls the edit mode behavior of the table.\n * - \"always\": Editable cells are immediately in edit mode on row clicked.\n * - \"manual\": User can toggle edit mode on/off via the Edit Table button.\n *\n * @default \"manual\"\n */\n editMode?: \"always\" | \"manual\";\n\n /**\n * Whether to render the bottom edit footer that hosts the\n * \"Edit Table\" / \"Cancel\" / \"Submit Edits\" buttons and the edit-state\n * indicators (modification count, validation errors).\n *\n * @default true whenever the table has at least one column declared\n * editable (i.e. any column with `editable: true` or `editable: (object) => boolean`).\n * When `false`, the \"Edit Table\" and \"Submit Edits\" buttons will not be shown.\n */\n showEditFooter?: boolean;\n\n /**\n * Called after the value of a cell is edited and committed by the user.\n *\n * @param info An object containing details about the cell that was edited,\n * including the rowId, columnId, new and old values, and the row data before the edit\n */\n onCellValueChanged?: (\n info: CellEditInfo<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n unknown\n >,\n ) => void;\n\n /**\n * If provided, the \"Submit Edits\" button will be shown in the edit footer.\n *\n * @param edits an array of edit info containing details about the edited cells\n * including the rowId, columnId, new and old values, and the row data before the edit\n * @return a promise that resolves to true if the edits were successfully submitted\n */\n onSubmitEdits?: (\n edits: CellEditInfo<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n unknown\n >[],\n ) => Promise<boolean>;\n\n /**\n * Called when a row is clicked.\n *\n * @param object The object representing the clicked row\n */\n onRowClick?: (\n object: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n ) => void;\n\n /**\n * If provided, will render this context menu when right clicking on a cell\n */\n renderCellContextMenu?: (\n row: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n cellValue: unknown,\n ) => React.ReactNode;\n\n /**\n * The height of each row in pixels.\n *\n * @default 40\n */\n rowHeight?: number;\n\n /**\n * Render override for the empty state. Called when the table has no\n * rows and no error. When omitted, a default \"No Data\" indicator is\n * rendered.\n */\n renderEmptyState?: () => React.ReactNode;\n\n /**\n * Returns extra HTML attributes (typically `data-*`) to apply to each\n * row element. Use this to drive conditional row styling\n */\n getRowAttributes?: (\n object: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n ) => Record<string, string | undefined>;\n\n /**\n * Imperative handle for programmatic table actions. Pass a ref\n * (`useRef<ObjectTableHandle<Q, RDPs>>(null)`) to call\n * {@link ObjectTableHandle} methods such as\n * {@link ObjectTableHandle.getSnapshot}.\n */\n tableRef?: React.Ref<ObjectTableHandle<Q, RDPs>>;\n\n className?: string;\n}\n\n/**\n * Imperative handle exposing programmatic actions on an {@link ObjectTable}.\n * Obtain it by passing {@link ObjectTableProps.tableRef}.\n */\nexport interface ObjectTableHandle<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Loads every row matching the object set and returns a format-agnostic\n * snapshot of the table's columns, row values, and total count. The caller\n * is responsible for turning the snapshot into a downloadable artifact\n * (CSV, Spreadsheet, JSON, clipboard, …).\n *\n * Property, derived-property, and function-backed columns are included.\n * Function-backed cells are fetched per page during snapshot collection;\n * when a page's fetch fails, `row.getValue(columnId)` returns the thrown\n * `Error` instance for the affected cells while the rest of the snapshot\n * resolves normally.\n * Columns defined with `locator.type === \"custom\"` are omitted because\n * they have no underlying value to export.\n *\n * The returned promise rejects up front when the object set's `totalCount`\n * exceeds `rowLimit`. When `totalCount` is unavailable, it instead rejects\n * mid-load once more than `rowLimit` rows have been pulled, so an unknown\n * count can't drain an unbounded set into the client. Otherwise every\n * matching row is loaded.\n *\n * @param options See {@link ObjectTableSnapshotOptions}.\n */\n getSnapshot: (\n options?: ObjectTableSnapshotOptions,\n ) => Promise<ObjectTableSnapshot<Q, RDPs>>;\n}\n\n/**\n * Options for {@link ObjectTableHandle[\"getSnapshot\"]}.\n */\nexport interface ObjectTableSnapshotOptions {\n /**\n * Upper bound on how many rows the snapshot may contain. When the object\n * set's total row count exceeds this value, `getSnapshot` rejects;\n * otherwise every matching row is loaded.\n *\n * @default 10_000\n */\n rowLimit?: number;\n}\n\n/**\n * A point-in-time capture of an {@link ObjectTable}'s columns and row values,\n * returned by {@link ObjectTableHandle.getSnapshot}.\n */\nexport interface ObjectTableSnapshot<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n columns: ObjectTableDataColumn[];\n rows: ObjectTableDataRow<Q, RDPs>[];\n /**\n * Total number of objects matching the underlying object set, as reported\n * by the API. `undefined` when the API did not provide a count. Encoded as\n * a string to match the underlying list-payload representation.\n */\n totalCount: string | undefined;\n}\n\n/**\n * A single column in an {@link ObjectTableSnapshot}.\n */\nexport interface ObjectTableDataColumn {\n /** Column id, matching the `locator.id` of the column definition. */\n id: string;\n /** Display name shown in the table header. */\n name: string;\n}\n\n/**\n * A single row in an {@link ObjectTableSnapshot}.\n */\nexport interface ObjectTableDataRow<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /** Row id (the underlying object's `$primaryKey` rendered as a string). */\n id: string;\n /** The underlying loaded object. */\n object: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>;\n /**\n * Returns the cell value for a given column id, or `undefined` when the\n * column is not part of the snapshot. Function-backed cells whose query\n * failed surface the thrown `Error` instance as their value.\n */\n getValue: (columnId: string) => unknown;\n}\n\n/**\n * Payload for {@link ObjectTableProps.onLoadedObjectsChanged}.\n */\nexport interface LoadedObjectsChange<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * The rows loaded into the table so far, in display order. Rows on pages\n * the user hasn't scrolled to yet are absent — compare `loadedObjects.length`\n * against `totalCount` to tell whether more remain.\n *\n * Each row carries the values of its function-backed columns alongside its\n * properties, so those cells are readable from the payload.\n */\n loadedObjects: Osdk.Instance<\n Q,\n \"$allBaseProperties\",\n PropertyKeys<Q>,\n RDPs\n >[];\n\n /**\n * Total number of objects matching the underlying object set, as reported\n * by the API. `undefined` when the API did not provide a count. Encoded as\n * a string to match the underlying list-payload representation.\n */\n totalCount: string | undefined;\n}\n\n/**\n * Payload for {@link ObjectTableProps.onRowSelectionChanged}. Consolidates\n * the loaded row instances, the `isSelectAll` semantic intent, and an\n * `ObjectSet` covering the selection.\n */\nexport interface RowSelectionChange<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Loaded row instances currently selected. When `isSelectAll` is true,\n * this reflects only the rows currently in the table — pages not yet\n * fetched are absent. Use `objectSet` for the cross-page view, and\n * `selectedRows.map(r => r.$primaryKey)` if you need the primary keys.\n */\n selectedRows: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>[];\n\n /**\n * True when the user invoked \"select all\" (header checkbox) or when\n * controlled mode supplies `isAllSelected={true}`. Distinct from \"every\n * loaded row happens to be selected\" — that condition is reflected by\n * `selectedRows.length` matching the visible row count but does not set\n * this flag.\n */\n isSelectAll: boolean;\n\n /**\n * An `ObjectSet` representing the selection.\n *\n * - \"Select all\" → the underlying `ObjectSet` (`objectSet` prop if\n * provided, otherwise derived from `objectType` via `client(...)`).\n * This includes rows not yet loaded into the table.\n * - Partial selection → the underlying `ObjectSet` narrowed to\n * `{ $primaryKey: { $in: selectedRows.map(r => r.$primaryKey) } }`.\n * - \"Deselect all\" → an empty `ObjectSet` (`$in: []`).\n *\n * Works for both object and interface types, since the `$primaryKey`\n * special property does not require resolving the underlying primary key\n * property name. `undefined` only when there is no underlying `ObjectSet`\n * to derive from.\n */\n objectSet: ObjectSet<Q, RDPs> | undefined;\n}\n\nexport interface ObjectSetOptions<Q extends ObjectOrInterfaceDefinition> {\n /**\n * Object sets to union with\n */\n union?: ObjectSet<Q>[];\n\n /**\n * Object sets to intersect with\n */\n intersect?: ObjectSet<Q>[];\n\n /**\n * Object sets to subtract from\n */\n subtract?: ObjectSet<Q>[];\n}\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,52 @@
1
+ /*
2
+ * Copyright 2026 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { useEffect } from "react";
18
+ import { useDebouncedCallback } from "../../shared/hooks/useDebouncedCallback.js";
19
+ const EMPTY_ROWS = [];
20
+ const DEBOUNCE_MS = 100;
21
+ const DEBOUNCE_MAX_WAIT_MS = 250;
22
+
23
+ /**
24
+ * Function-backed columns and streamed updates may result in a burst of changes.
25
+ * Setting leading so the first report is immediate,
26
+ * and trailing to report the latest state.
27
+ * `maxWait` caps latency during long streams so slow-drip updates still land.
28
+ */
29
+ const DEBOUNCE_OPTIONS = {
30
+ leading: true,
31
+ trailing: true,
32
+ maxWait: DEBOUNCE_MAX_WAIT_MS
33
+ };
34
+ export function useLoadedObjectsChanged({
35
+ loadedObjects,
36
+ totalCount,
37
+ isLoading,
38
+ onLoadedObjectsChanged
39
+ }) {
40
+ const fireChanged = useDebouncedCallback(change => {
41
+ onLoadedObjectsChanged?.(change);
42
+ }, DEBOUNCE_MS, DEBOUNCE_OPTIONS);
43
+ useEffect(() => {
44
+ if (!isLoading) {
45
+ fireChanged({
46
+ loadedObjects: loadedObjects ?? EMPTY_ROWS,
47
+ totalCount
48
+ });
49
+ }
50
+ }, [loadedObjects, totalCount, isLoading, fireChanged]);
51
+ }
52
+ //# sourceMappingURL=useLoadedObjectsChanged.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLoadedObjectsChanged.js","names":["useEffect","useDebouncedCallback","EMPTY_ROWS","DEBOUNCE_MS","DEBOUNCE_MAX_WAIT_MS","DEBOUNCE_OPTIONS","leading","trailing","maxWait","useLoadedObjectsChanged","loadedObjects","totalCount","isLoading","onLoadedObjectsChanged","fireChanged","change"],"sources":["useLoadedObjectsChanged.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ObjectOrInterfaceDefinition,\n Osdk,\n PropertyKeys,\n SimplePropertyDef,\n} from \"@osdk/api\";\nimport { useEffect } from \"react\";\n\nimport { useDebouncedCallback } from \"../../shared/hooks/useDebouncedCallback.js\";\nimport type { LoadedObjectsChange } from \"../ObjectTableApi.js\";\n\nconst EMPTY_ROWS: never[] = [];\n\nconst DEBOUNCE_MS = 100;\nconst DEBOUNCE_MAX_WAIT_MS = 250;\n\n/**\n * Function-backed columns and streamed updates may result in a burst of changes.\n * Setting leading so the first report is immediate,\n * and trailing to report the latest state.\n * `maxWait` caps latency during long streams so slow-drip updates still land.\n */\nconst DEBOUNCE_OPTIONS = {\n leading: true,\n trailing: true,\n maxWait: DEBOUNCE_MAX_WAIT_MS,\n};\n\nexport interface UseLoadedObjectsChangedProps<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * The rows loaded so far, or `undefined` while the first page is still in\n * flight.\n */\n loadedObjects:\n | Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>[]\n | undefined;\n /** Total objects matching the object set, if the API reported one. */\n totalCount: string | undefined;\n /** Whether the underlying query is currently fetching. */\n isLoading: boolean;\n onLoadedObjectsChanged?: (change: LoadedObjectsChange<Q, RDPs>) => void;\n}\n\nexport function useLoadedObjectsChanged<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>({\n loadedObjects,\n totalCount,\n isLoading,\n onLoadedObjectsChanged,\n}: UseLoadedObjectsChangedProps<Q, RDPs>): void {\n const fireChanged = useDebouncedCallback(\n (change: LoadedObjectsChange<Q, RDPs>) => {\n onLoadedObjectsChanged?.(change);\n },\n DEBOUNCE_MS,\n DEBOUNCE_OPTIONS,\n );\n\n useEffect(() => {\n if (!isLoading) {\n fireChanged({ loadedObjects: loadedObjects ?? EMPTY_ROWS, totalCount });\n }\n }, [loadedObjects, totalCount, isLoading, fireChanged]);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,SAASA,SAAS,QAAQ,OAAO;AAEjC,SAASC,oBAAoB,QAAQ,4CAA4C;AAGjF,MAAMC,UAAmB,GAAG,EAAE;AAE9B,MAAMC,WAAW,GAAG,GAAG;AACvB,MAAMC,oBAAoB,GAAG,GAAG;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,gBAAgB,GAAG;EACvBC,OAAO,EAAE,IAAI;EACbC,QAAQ,EAAE,IAAI;EACdC,OAAO,EAAEJ;AACX,CAAC;AAoBD,OAAO,SAASK,uBAAuBA,CAGrC;EACAC,aAAa;EACbC,UAAU;EACVC,SAAS;EACTC;AACqC,CAAC,EAAQ;EAC9C,MAAMC,WAAW,GAAGb,oBAAoB,CACrCc,MAAoC,IAAK;IACxCF,sBAAsB,GAAGE,MAAM,CAAC;EAClC,CAAC,EACDZ,WAAW,EACXE,gBACF,CAAC;EAEDL,SAAS,CAAC,MAAM;IACd,IAAI,CAACY,SAAS,EAAE;MACdE,WAAW,CAAC;QAAEJ,aAAa,EAAEA,aAAa,IAAIR,UAAU;QAAES;MAAW,CAAC,CAAC;IACzE;EACF,CAAC,EAAE,CAACD,aAAa,EAAEC,UAAU,EAAEC,SAAS,EAAEE,WAAW,CAAC,CAAC;AACzD","ignoreList":[]}
@@ -46,6 +46,7 @@ export { useColumnVisibility } from "../../object-table/hooks/useColumnVisibilit
46
46
 
47
47
  // Row state
48
48
  export { useFocusedRow } from "../../object-table/hooks/useFocusedRow.js";
49
+ export { useLoadedObjectsChanged } from "../../object-table/hooks/useLoadedObjectsChanged.js";
49
50
  export { useRowSelection } from "../../object-table/hooks/useRowSelection.js";
50
51
 
51
52
  // Sorting
@@ -1 +1 @@
1
- {"version":3,"file":"object-table.js","names":["ObjectTable","_ObjectTable","withOsdkMetrics","BaseTable","ColumnConfigDialog","MultiColumnSortDialog","LoadingCell","LoadingCellContent","useFunctionColumnsData","useObjectTableData","useColumnDefs","useSelectionColumn","useColumnPinning","useColumnResize","useColumnVisibility","useFocusedRow","useRowSelection","useTableSorting","useEditableTable","useObjectTableSnapshot","useCellContextMenu"],"sources":["object-table.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// ObjectTable that loads and displays data for a given objectSet\nimport { ObjectTable as _ObjectTable } from \"../../object-table/ObjectTable.js\";\nimport { withOsdkMetrics } from \"../../util/withOsdkMetrics.js\";\nexport const ObjectTable: typeof _ObjectTable = withOsdkMetrics(\n _ObjectTable,\n \"ObjectTable\",\n);\nexport type {\n ColumnDefinition,\n ColumnDefinitionLocator,\n CustomColumnLocator,\n EditFieldConfig,\n FunctionColumnLocator,\n ObjectTableDataColumn,\n ObjectTableDataRow,\n ObjectTableHandle,\n ObjectTableProps,\n ObjectTableSnapshot,\n ObjectTableSnapshotOptions,\n PropertyColumnLocator,\n RdpColumnLocator,\n} from \"../../object-table/ObjectTableApi.js\";\nexport type { CellEditInfo } from \"../../object-table/utils/types.js\";\n\n// BaseTable that does not handle data fetching\nexport type { BaseTableProps } from \"../../object-table/Table.js\";\nexport { BaseTable } from \"../../object-table/Table.js\";\n\nexport { ColumnConfigDialog } from \"../../object-table/ColumnConfigDialog.js\";\nexport type {\n ColumnConfigDialogProps,\n ColumnConfigOptions,\n} from \"../../object-table/ColumnConfigDialog.js\";\n\nexport { MultiColumnSortDialog } from \"../../object-table/MultiColumnSortDialog.js\";\nexport type {\n MultiColumnSortDialogProps,\n SortColumnItem,\n} from \"../../object-table/MultiColumnSortDialog.js\";\n\n// Loading cell components for custom column renderers.\n// Use `LoadingCell` when rendering a full `<td>` element (e.g. in a custom row renderer).\n// Use `LoadingCellContent` when rendering just the skeleton content inside an existing cell.\nexport {\n LoadingCell,\n LoadingCellContent,\n} from \"../../object-table/LoadingCell.js\";\n\n/* --------------------- Headless hooks --------------------- */\n\n// Data loading (OSDK-aware)\nexport {\n type FunctionColumnData,\n useFunctionColumnsData,\n type UseFunctionColumnsDataProps,\n} from \"../../object-table/hooks/useFunctionColumnsData.js\";\nexport {\n useObjectTableData,\n type UseObjectTableDataProps,\n type UseObjectTableDataResult,\n} from \"../../object-table/hooks/useObjectTableData.js\";\n\n// Column definitions\nexport {\n useColumnDefs,\n type UseColumnDefsResult,\n} from \"../../object-table/hooks/useColumnDefs.js\";\nexport {\n useSelectionColumn,\n type UseSelectionColumnProps,\n} from \"../../object-table/hooks/useSelectionColumn.js\";\n\n// Column state\nexport {\n useColumnPinning,\n type UseColumnPinningProps,\n type UseColumnPinningResult,\n} from \"../../object-table/hooks/useColumnPinning.js\";\nexport {\n useColumnResize,\n type UseColumnResizeProps,\n type UseColumnResizeResult,\n} from \"../../object-table/hooks/useColumnResize.js\";\nexport {\n useColumnVisibility,\n type UseColumnVisibilityProps,\n type UseColumnVisibilityResult,\n} from \"../../object-table/hooks/useColumnVisibility.js\";\n\n// Row state\nexport {\n useFocusedRow,\n type UseFocusedRowProps,\n type UseFocusedRowResult,\n} from \"../../object-table/hooks/useFocusedRow.js\";\nexport {\n useRowSelection,\n type UseRowSelectionChange,\n type UseRowSelectionProps,\n type UseRowSelectionResult,\n} from \"../../object-table/hooks/useRowSelection.js\";\n\n// Sorting\nexport {\n useTableSorting,\n type UseTableSortingProps,\n type UseTableSortingResult,\n} from \"../../object-table/hooks/useTableSorting.js\";\n\n// Editing\nexport {\n useEditableTable,\n type UseEditableTableProps,\n} from \"../../object-table/hooks/useEditableTable.js\";\n\n// Snapshot / export\nexport {\n useObjectTableSnapshot,\n type UseObjectTableSnapshotProps,\n} from \"../../object-table/hooks/useObjectTableSnapshot.js\";\n\n// Cell context menu\nexport {\n useCellContextMenu,\n type UseCellContextMenuProps,\n type UseCellContextMenuResult,\n} from \"../../object-table/hooks/useCellContextMenu.js\";\n\n// Supporting types referenced by the hook signatures above\nexport type { PopoverPosition } from \"../../object-table/hooks/useCellContextMenu.js\";\nexport type {\n ObjectSetOptions,\n RowSelectionChange,\n} from \"../../object-table/ObjectTableApi.js\";\nexport type { AsyncCellData } from \"../../object-table/utils/AsyncCellData.js\";\nexport type {\n EditableConfig,\n EditModeState,\n OrderBy,\n} from \"../../object-table/utils/types.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,SAASA,WAAW,IAAIC,YAAY,QAAQ,mCAAmC;AAC/E,SAASC,eAAe,QAAQ,+BAA+B;AAC/D,OAAO,MAAMF,WAAgC,GAAGE,eAAe,CAC7DD,YAAY,EACZ,aACF,CAAC;;AAkBD;;AAEA,SAASE,SAAS,QAAQ,6BAA6B;AAEvD,SAASC,kBAAkB,QAAQ,0CAA0C;AAM7E,SAASC,qBAAqB,QAAQ,6CAA6C;AAMnF;AACA;AACA;AACA,SACEC,WAAW,EACXC,kBAAkB,QACb,mCAAmC;;AAE1C;;AAEA;AACA,SAEEC,sBAAsB,QAEjB,oDAAoD;AAC3D,SACEC,kBAAkB,QAGb,gDAAgD;;AAEvD;AACA,SACEC,aAAa,QAER,2CAA2C;AAClD,SACEC,kBAAkB,QAEb,gDAAgD;;AAEvD;AACA,SACEC,gBAAgB,QAGX,8CAA8C;AACrD,SACEC,eAAe,QAGV,6CAA6C;AACpD,SACEC,mBAAmB,QAGd,iDAAiD;;AAExD;AACA,SACEC,aAAa,QAGR,2CAA2C;AAClD,SACEC,eAAe,QAIV,6CAA6C;;AAEpD;AACA,SACEC,eAAe,QAGV,6CAA6C;;AAEpD;AACA,SACEC,gBAAgB,QAEX,8CAA8C;;AAErD;AACA,SACEC,sBAAsB,QAEjB,oDAAoD;;AAE3D;AACA,SACEC,kBAAkB,QAGb,gDAAgD;;AAEvD","ignoreList":[]}
1
+ {"version":3,"file":"object-table.js","names":["ObjectTable","_ObjectTable","withOsdkMetrics","BaseTable","ColumnConfigDialog","MultiColumnSortDialog","LoadingCell","LoadingCellContent","useFunctionColumnsData","useObjectTableData","useColumnDefs","useSelectionColumn","useColumnPinning","useColumnResize","useColumnVisibility","useFocusedRow","useLoadedObjectsChanged","useRowSelection","useTableSorting","useEditableTable","useObjectTableSnapshot","useCellContextMenu"],"sources":["object-table.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// ObjectTable that loads and displays data for a given objectSet\nimport { ObjectTable as _ObjectTable } from \"../../object-table/ObjectTable.js\";\nimport { withOsdkMetrics } from \"../../util/withOsdkMetrics.js\";\nexport const ObjectTable: typeof _ObjectTable = withOsdkMetrics(\n _ObjectTable,\n \"ObjectTable\",\n);\nexport type {\n ColumnDefinition,\n ColumnDefinitionLocator,\n CustomColumnLocator,\n EditFieldConfig,\n FunctionColumnLocator,\n LoadedObjectsChange,\n ObjectTableDataColumn,\n ObjectTableDataRow,\n ObjectTableHandle,\n ObjectTableProps,\n ObjectTableSnapshot,\n ObjectTableSnapshotOptions,\n PropertyColumnLocator,\n RdpColumnLocator,\n} from \"../../object-table/ObjectTableApi.js\";\nexport type { CellEditInfo } from \"../../object-table/utils/types.js\";\n\n// BaseTable that does not handle data fetching\nexport type { BaseTableProps } from \"../../object-table/Table.js\";\nexport { BaseTable } from \"../../object-table/Table.js\";\n\nexport { ColumnConfigDialog } from \"../../object-table/ColumnConfigDialog.js\";\nexport type {\n ColumnConfigDialogProps,\n ColumnConfigOptions,\n} from \"../../object-table/ColumnConfigDialog.js\";\n\nexport { MultiColumnSortDialog } from \"../../object-table/MultiColumnSortDialog.js\";\nexport type {\n MultiColumnSortDialogProps,\n SortColumnItem,\n} from \"../../object-table/MultiColumnSortDialog.js\";\n\n// Loading cell components for custom column renderers.\n// Use `LoadingCell` when rendering a full `<td>` element (e.g. in a custom row renderer).\n// Use `LoadingCellContent` when rendering just the skeleton content inside an existing cell.\nexport {\n LoadingCell,\n LoadingCellContent,\n} from \"../../object-table/LoadingCell.js\";\n\n/* --------------------- Headless hooks --------------------- */\n\n// Data loading (OSDK-aware)\nexport {\n type FunctionColumnData,\n useFunctionColumnsData,\n type UseFunctionColumnsDataProps,\n} from \"../../object-table/hooks/useFunctionColumnsData.js\";\nexport {\n useObjectTableData,\n type UseObjectTableDataProps,\n type UseObjectTableDataResult,\n} from \"../../object-table/hooks/useObjectTableData.js\";\n\n// Column definitions\nexport {\n useColumnDefs,\n type UseColumnDefsResult,\n} from \"../../object-table/hooks/useColumnDefs.js\";\nexport {\n useSelectionColumn,\n type UseSelectionColumnProps,\n} from \"../../object-table/hooks/useSelectionColumn.js\";\n\n// Column state\nexport {\n useColumnPinning,\n type UseColumnPinningProps,\n type UseColumnPinningResult,\n} from \"../../object-table/hooks/useColumnPinning.js\";\nexport {\n useColumnResize,\n type UseColumnResizeProps,\n type UseColumnResizeResult,\n} from \"../../object-table/hooks/useColumnResize.js\";\nexport {\n useColumnVisibility,\n type UseColumnVisibilityProps,\n type UseColumnVisibilityResult,\n} from \"../../object-table/hooks/useColumnVisibility.js\";\n\n// Row state\nexport {\n useFocusedRow,\n type UseFocusedRowProps,\n type UseFocusedRowResult,\n} from \"../../object-table/hooks/useFocusedRow.js\";\nexport {\n useLoadedObjectsChanged,\n type UseLoadedObjectsChangedProps,\n} from \"../../object-table/hooks/useLoadedObjectsChanged.js\";\nexport {\n useRowSelection,\n type UseRowSelectionChange,\n type UseRowSelectionProps,\n type UseRowSelectionResult,\n} from \"../../object-table/hooks/useRowSelection.js\";\n\n// Sorting\nexport {\n useTableSorting,\n type UseTableSortingProps,\n type UseTableSortingResult,\n} from \"../../object-table/hooks/useTableSorting.js\";\n\n// Editing\nexport {\n useEditableTable,\n type UseEditableTableProps,\n} from \"../../object-table/hooks/useEditableTable.js\";\n\n// Snapshot / export\nexport {\n useObjectTableSnapshot,\n type UseObjectTableSnapshotProps,\n} from \"../../object-table/hooks/useObjectTableSnapshot.js\";\n\n// Cell context menu\nexport {\n useCellContextMenu,\n type UseCellContextMenuProps,\n type UseCellContextMenuResult,\n} from \"../../object-table/hooks/useCellContextMenu.js\";\n\n// Supporting types referenced by the hook signatures above\nexport type { PopoverPosition } from \"../../object-table/hooks/useCellContextMenu.js\";\nexport type {\n ObjectSetOptions,\n RowSelectionChange,\n} from \"../../object-table/ObjectTableApi.js\";\nexport type { AsyncCellData } from \"../../object-table/utils/AsyncCellData.js\";\nexport type {\n EditableConfig,\n EditModeState,\n OrderBy,\n} from \"../../object-table/utils/types.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,SAASA,WAAW,IAAIC,YAAY,QAAQ,mCAAmC;AAC/E,SAASC,eAAe,QAAQ,+BAA+B;AAC/D,OAAO,MAAMF,WAAgC,GAAGE,eAAe,CAC7DD,YAAY,EACZ,aACF,CAAC;;AAmBD;;AAEA,SAASE,SAAS,QAAQ,6BAA6B;AAEvD,SAASC,kBAAkB,QAAQ,0CAA0C;AAM7E,SAASC,qBAAqB,QAAQ,6CAA6C;AAMnF;AACA;AACA;AACA,SACEC,WAAW,EACXC,kBAAkB,QACb,mCAAmC;;AAE1C;;AAEA;AACA,SAEEC,sBAAsB,QAEjB,oDAAoD;AAC3D,SACEC,kBAAkB,QAGb,gDAAgD;;AAEvD;AACA,SACEC,aAAa,QAER,2CAA2C;AAClD,SACEC,kBAAkB,QAEb,gDAAgD;;AAEvD;AACA,SACEC,gBAAgB,QAGX,8CAA8C;AACrD,SACEC,eAAe,QAGV,6CAA6C;AACpD,SACEC,mBAAmB,QAGd,iDAAiD;;AAExD;AACA,SACEC,aAAa,QAGR,2CAA2C;AAClD,SACEC,uBAAuB,QAElB,qDAAqD;AAC5D,SACEC,eAAe,QAIV,6CAA6C;;AAEpD;AACA,SACEC,eAAe,QAGV,6CAA6C;;AAEpD;AACA,SACEC,gBAAgB,QAEX,8CAA8C;;AAErD;AACA,SACEC,sBAAsB,QAEjB,oDAAoD;;AAE3D;AACA,SACEC,kBAAkB,QAGb,gDAAgD;;AAEvD","ignoreList":[]}
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- const PACKAGE_USER_AGENT = `osdk-react-components/${"0.50.0-main-a21e2ae84fb4393b21da4c6cfffa2609e90eb36b"}`;
17
+ const PACKAGE_USER_AGENT = `osdk-react-components/${"0.50.0"}`;
18
18
  export function componentUserAgent(componentName) {
19
19
  return `${PACKAGE_USER_AGENT}/${componentName}`;
20
20
  }
@@ -1 +1 @@
1
- {"version":3,"file":"UserAgent.js","names":["PACKAGE_USER_AGENT","componentUserAgent","componentName"],"sources":["UserAgent.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst PACKAGE_USER_AGENT = `osdk-react-components/${process.env.PACKAGE_VERSION}`;\n\nexport function componentUserAgent(componentName: string): string {\n return `${PACKAGE_USER_AGENT}/${componentName}`;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMA,kBAAkB,GAAG,iFAAsD;AAEjF,OAAO,SAASC,kBAAkBA,CAACC,aAAqB,EAAU;EAChE,OAAO,GAAGF,kBAAkB,IAAIE,aAAa,EAAE;AACjD","ignoreList":[]}
1
+ {"version":3,"file":"UserAgent.js","names":["PACKAGE_USER_AGENT","componentUserAgent","componentName"],"sources":["UserAgent.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst PACKAGE_USER_AGENT = `osdk-react-components/${process.env.PACKAGE_VERSION}`;\n\nexport function componentUserAgent(componentName: string): string {\n return `${PACKAGE_USER_AGENT}/${componentName}`;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMA,kBAAkB,GAAG,mCAAsD;AAEjF,OAAO,SAASC,kBAAkBA,CAACC,aAAqB,EAAU;EAChE,OAAO,GAAGF,kBAAkB,IAAIE,aAAa,EAAE;AACjD","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkHVJTECCC_cjs = require('./chunk-HVJTECCC.cjs');
4
- var chunkIWRCOFOC_cjs = require('./chunk-IWRCOFOC.cjs');
4
+ var chunkZX5S74BN_cjs = require('./chunk-ZX5S74BN.cjs');
5
5
  var icons = require('@blueprintjs/icons');
6
6
  var classnames = require('classnames');
7
7
  require('pdfjs-dist/web/pdf_viewer.css');
@@ -179,12 +179,12 @@ function usePdfViewerInstance(options) {
179
179
  }
180
180
 
181
181
  // src/public/experimental/pdf-viewer.ts
182
- var PdfViewer2 = chunkIWRCOFOC_cjs.withOsdkMetrics(chunkHVJTECCC_cjs.PdfViewer, "PdfViewer");
182
+ var PdfViewer2 = chunkZX5S74BN_cjs.withOsdkMetrics(chunkHVJTECCC_cjs.PdfViewer, "PdfViewer");
183
183
 
184
184
  exports.PdfViewer = PdfViewer2;
185
185
  exports.PdfViewerContent = PdfViewerContent;
186
186
  exports.PdfViewerProvider = PdfViewerProvider;
187
187
  exports.usePdfViewerContext = usePdfViewerContext;
188
188
  exports.usePdfViewerInstance = usePdfViewerInstance;
189
- //# sourceMappingURL=chunk-RBWRFU5Z.cjs.map
190
- //# sourceMappingURL=chunk-RBWRFU5Z.cjs.map
189
+ //# sourceMappingURL=chunk-2GOF2S3Y.cjs.map
190
+ //# sourceMappingURL=chunk-2GOF2S3Y.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/pdf-viewer/components/PdfViewerContent.tsx","../../src/pdf-viewer/PdfViewerContext.tsx","../../src/public/experimental/pdf-viewer.ts"],"names":["EMPTY_ANNOTATION_ARRAY","usePdfViewerCore","usePdfAnnotationsByPage","usePdfFormFields","useRef","useEffect","classnames","BasePdfViewer_default","React","Spin","ErrorIcon","PdfAnnotationOverlay","useContext","usePdfViewerState","usePdfHighlightMode","useMemo","PdfViewer","withOsdkMetrics"],"mappings":";;;;;;;;;;;;;;AA0BO,SAAS,gBAAA,CAAiB;AAAA,EAC/B,GAAA;AAAA,EACA,WAAA,GAAcA,wCAAA;AAAA,EACd,iBAAA;AAAA,EACA,WAAA,GAAc,CAAA;AAAA,EACd,YAAA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AkB,KAAA;AACjD,EAAA,MAAM,cAAA,GAAiB,OAAA,CAAQ,YAAA,IAAgB,IAAA,IAAQ,aAAA;AACvD,EAAA,MAAM;AAAA,IACJ,iBAAA;AAAA,IACA;AAAA,GACF,GAAI,OAAA;AACJ,EAAA,OAAOa,cAAQ,OAAO;AAAA,IACpB,GAAG,MAAA;AAAA,IACH,gBAAA;AAAA,IACA,mBAAA;AAAA,IACA,mBAAA;AAAA,IACA,aAAA;AAAA,IACA,cAAA;AAAA,IACA,WAAA;AAAA,IACA,iBAAA;AAAA,IACA,iBAAA;AAAA,IACA,cAAA;AAAA,IACA,cAAA;AAAA,IACA;AAAA,GACF,CAAA,EAAI,CAAC,MAAA,EAAQ,gBAAA,EAAkB,qBAAqB,mBAAA,EAAqB,aAAA,EAAe,cAAA,EAAgB,WAAA,EAAa,iBAAA,EAAmB,iBAAA,EAAmB,cAAA,EAAgB,cAAA,EAAgB,YAAY,CAAC,CAAA;AAC1M;;;AC7DO,IAAMC,UAAAA,GAAYC,iCAAA,CAAgBD,2BAAA,EAAY,WAAW","file":"chunk-RBWRFU5Z.cjs","sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Error as ErrorIcon, Spin } from \"@blueprintjs/icons\";\nimport classnames from \"classnames\";\nimport \"pdfjs-dist/web/pdf_viewer.css\";\nimport React, { useEffect, useRef } from \"react\";\nimport { EMPTY_ANNOTATION_ARRAY } from \"../constants.js\";\nimport { usePdfAnnotationsByPage } from \"../hooks/usePdfAnnotationsByPage.js\";\nimport { usePdfFormFields } from \"../hooks/usePdfFormFields.js\";\nimport { usePdfViewerCore } from \"../hooks/usePdfViewerCore.js\";\nimport { PdfAnnotationOverlay } from \"./PdfAnnotationOverlay.js\";\nimport styles from \"../BasePdfViewer.module.css\";\nexport function PdfViewerContent({\n src,\n annotations = EMPTY_ANNOTATION_ARRAY,\n onAnnotationClick,\n initialPage = 1,\n initialScale = 1.0,\n onPageChange: onPageChangeProp,\n onScaleChange: onScaleChangeProp,\n formData,\n onFormChange,\n className\n}) {\n const viewer = usePdfViewerCore({\n src,\n initialPage,\n initialScale\n });\n const annotationsByPage = usePdfAnnotationsByPage(annotations);\n usePdfFormFields({\n pdfViewerRef: viewer.pdfViewerRef,\n eventBusRef: viewer.eventBusRef,\n document: viewer.document,\n formData,\n onFormChange\n });\n\n // Use refs for callbacks to avoid firing on initial mount\n const onPageChangeRef = useRef(onPageChangeProp);\n onPageChangeRef.current = onPageChangeProp;\n const onScaleChangeRef = useRef(onScaleChangeProp);\n onScaleChangeRef.current = onScaleChangeProp;\n const isInitialMountRef = useRef(true);\n useEffect(function notifyPageChange() {\n if (isInitialMountRef.current) {\n return;\n }\n onPageChangeRef.current?.(viewer.currentPage);\n }, [viewer.currentPage]);\n useEffect(function notifyScaleChange() {\n if (isInitialMountRef.current) {\n return;\n }\n onScaleChangeRef.current?.(viewer.scale);\n }, [viewer.scale]);\n useEffect(function clearInitialMount() {\n isInitialMountRef.current = false;\n }, []);\n const rootClassName = classnames(styles.pdfViewer, className);\n if (viewer.loading) {\n return /*#__PURE__*/React.createElement(\"div\", {\n className: rootClassName\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: styles.loadingContainer\n }, /*#__PURE__*/React.createElement(Spin, {\n className: styles.spinnerIcon\n }), \"Loading\\u2026\"));\n }\n if (viewer.error != null) {\n return /*#__PURE__*/React.createElement(\"div\", {\n className: rootClassName\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: styles.errorContainer\n }, /*#__PURE__*/React.createElement(ErrorIcon, {\n className: styles.errorIcon\n }), \"Failed to load PDF: \", viewer.error.message));\n }\n if (viewer.document == null) {\n return /*#__PURE__*/React.createElement(\"div\", {\n className: rootClassName\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: styles.loadingContainer\n }, \"No document\"));\n }\n return /*#__PURE__*/React.createElement(\"div\", {\n className: rootClassName\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: styles.scrollContainerWrapper\n }, /*#__PURE__*/React.createElement(\"div\", {\n ref: viewer.containerRef,\n className: styles.scrollContainer\n }, /*#__PURE__*/React.createElement(\"div\", {\n ref: viewer.viewerRef,\n className: \"pdfViewer\"\n }), viewer.portalTargets.map(target => {\n const pageAnnotations = annotationsByPage[target.pageNumber] ?? EMPTY_ANNOTATION_ARRAY;\n if (pageAnnotations.length === 0) {\n return null;\n }\n return /*#__PURE__*/React.createElement(PdfAnnotationOverlay, {\n key: target.pageNumber,\n target: target,\n annotations: pageAnnotations,\n onAnnotationClick: onAnnotationClick\n });\n }))));\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { createContext, useContext, useMemo } from \"react\";\nimport { EMPTY_ANNOTATION_ARRAY } from \"./constants.js\";\nimport { usePdfAnnotationsByPage } from \"./hooks/usePdfAnnotationsByPage.js\";\nimport { usePdfFormFields } from \"./hooks/usePdfFormFields.js\";\nimport { usePdfHighlightMode } from \"./hooks/usePdfHighlightMode.js\";\nimport { usePdfViewerState } from \"./hooks/usePdfViewerState.js\";\n\n/** The shape of the value provided by {@link PdfViewerProvider}. */\n\nconst PdfViewerContext = /*#__PURE__*/createContext(null);\n/** Provides {@link PdfViewerContextValue} to descendant components. */\nexport function PdfViewerProvider({\n value,\n children\n}) {\n return /*#__PURE__*/React.createElement(PdfViewerContext.Provider, {\n value: value\n }, children);\n}\n\n/**\n * Returns the nearest {@link PdfViewerContextValue} from a {@link PdfViewerProvider}.\n * Throws if called outside a provider.\n */\nexport function usePdfViewerContext() {\n const ctx = useContext(PdfViewerContext);\n if (ctx == null) {\n throw new Error(\"usePdfViewerContext must be used within a PdfViewerProvider\");\n }\n return ctx;\n}\n\n/**\n * Consumer-facing setup hook analogous to react-hook-form's `useForm()`.\n * Accepts viewer options and returns a {@link PdfViewerContextValue} suitable\n * for passing to {@link PdfViewerProvider}.\n */\nexport function usePdfViewerInstance(options) {\n const viewer = usePdfViewerState({\n src: options.src,\n initialPage: options.initialPage,\n initialScale: options.initialScale,\n initialAutoSize: options.initialAutoSize,\n initialSidebarOpen: options.initialSidebarOpen,\n sidebarMode: options.sidebarMode,\n onDownload: options.onDownload\n });\n const {\n highlightModeActive,\n toggleHighlightMode\n } = usePdfHighlightMode({\n pdfViewerRef: viewer.pdfViewerRef,\n document: viewer.document,\n enabled: options.enableHighlight ?? options.highlightEnabled ?? false,\n onTextHighlight: options.onTextHighlight,\n onHighlightDelete: options.onHighlightDelete\n });\n const {\n hasFormFields,\n submitFormData\n } = usePdfFormFields({\n pdfViewerRef: viewer.pdfViewerRef,\n eventBusRef: viewer.eventBusRef,\n document: viewer.document,\n formData: options.formData,\n onFormSubmit: options.onFormSubmit,\n onFormChange: options.onFormChange\n });\n const annotations = options.annotations ?? EMPTY_ANNOTATION_ARRAY;\n const annotationsByPage = usePdfAnnotationsByPage(annotations);\n\n // `highlightEnabled` is the deprecated spelling of `enableHighlight`.\n const highlightEnabled = options.enableHighlight ?? options.highlightEnabled ?? false;\n const enableDownload = options.enableDownload ?? false;\n const enableFormSave = options.onFormSubmit != null && hasFormFields;\n const {\n onAnnotationClick,\n outlineIcons\n } = options;\n return useMemo(() => ({\n ...viewer,\n highlightEnabled,\n highlightModeActive,\n toggleHighlightMode,\n hasFormFields,\n submitFormData,\n annotations,\n annotationsByPage,\n onAnnotationClick,\n enableDownload,\n enableFormSave,\n outlineIcons\n }), [viewer, highlightEnabled, highlightModeActive, toggleHighlightMode, hasFormFields, submitFormData, annotations, annotationsByPage, onAnnotationClick, enableDownload, enableFormSave, outlineIcons]);\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// BasePdfViewer\nexport { BasePdfViewer } from \"../../pdf-viewer/BasePdfViewer.js\";\n// PdfViewer building blocks\nexport { PdfViewerAnnotationLayer } from \"../../pdf-viewer/components/PdfViewerAnnotationLayer.js\";\nexport { PdfViewerContent } from \"../../pdf-viewer/components/PdfViewerContent.js\";\nexport { PdfViewerOutlineSidebar } from \"../../pdf-viewer/components/PdfViewerOutlineSidebar.js\";\nexport { PdfViewerSearchBar } from \"../../pdf-viewer/components/PdfViewerSearchBar.js\";\nexport { PdfViewerSidebar } from \"../../pdf-viewer/components/PdfViewerSidebar.js\";\nexport { PdfViewerToolbar } from \"../../pdf-viewer/components/PdfViewerToolbar.js\";\n\n// PdfViewer hooks — primitive\nexport { usePdfAnnotationPortals } from \"../../pdf-viewer/hooks/usePdfAnnotationPortals.js\";\nexport { usePdfAnnotationsByPage } from \"../../pdf-viewer/hooks/usePdfAnnotationsByPage.js\";\nexport { usePdfDocument } from \"../../pdf-viewer/hooks/usePdfDocument.js\";\nexport { usePdfFormFields } from \"../../pdf-viewer/hooks/usePdfFormFields.js\";\nexport { usePdfHighlightMode } from \"../../pdf-viewer/hooks/usePdfHighlightMode.js\";\nexport { usePdfOutline } from \"../../pdf-viewer/hooks/usePdfOutline.js\";\nexport { usePdfViewer } from \"../../pdf-viewer/hooks/usePdfViewer.js\";\nexport { usePdfViewerSearch } from \"../../pdf-viewer/hooks/usePdfViewerSearch.js\";\nexport { usePdfViewerSync } from \"../../pdf-viewer/hooks/usePdfViewerSync.js\";\n\n// PdfViewer context\n\nexport { PdfViewerProvider, usePdfViewerContext, usePdfViewerInstance } from \"../../pdf-viewer/PdfViewerContext.js\";\n\n// PdfViewer hooks — composition\nexport { usePdfViewerCore } from \"../../pdf-viewer/hooks/usePdfViewerCore.js\";\nexport { usePdfViewerState } from \"../../pdf-viewer/hooks/usePdfViewerState.js\";\n\n// PdfViewer (Media wrapper)\nimport { PdfViewer as _PdfViewer } from \"../../pdf-viewer/PdfViewer.js\";\nimport { withOsdkMetrics } from \"../../util/withOsdkMetrics.js\";\nexport const PdfViewer = withOsdkMetrics(_PdfViewer, \"PdfViewer\");"]}
1
+ {"version":3,"sources":["../../src/pdf-viewer/components/PdfViewerContent.tsx","../../src/pdf-viewer/PdfViewerContext.tsx","../../src/public/experimental/pdf-viewer.ts"],"names":["EMPTY_ANNOTATION_ARRAY","usePdfViewerCore","usePdfAnnotationsByPage","usePdfFormFields","useRef","useEffect","classnames","BasePdfViewer_default","React","Spin","ErrorIcon","PdfAnnotationOverlay","useContext","usePdfViewerState","usePdfHighlightMode","useMemo","PdfViewer","withOsdkMetrics"],"mappings":";;;;;;;;;;;;;;AA0BO,SAAS,gBAAA,CAAiB;AAAA,EAC/B,GAAA;AAAA,EACA,WAAA,GAAcA,wCAAA;AAAA,EACd,iBAAA;AAAA,EACA,WAAA,GAAc,CAAA;AAAA,EACd,YAAA,GAAe,CAAA;AAAA,EACf,YAAA,EAAc,gBAAA;AAAA,EACd,aAAA,EAAe,iBAAA;AAAA,EACf,QAAA;AAAA,EACA,YAAA;AAAA,EACA;AACF,CAAA,EAAG;AACD,EAAA,MAAM,S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OAAA;AACJ,EAAA,OAAOa,cAAQ,OAAO;AAAA,IACpB,GAAG,MAAA;AAAA,IACH,gBAAA;AAAA,IACA,mBAAA;AAAA,IACA,mBAAA;AAAA,IACA,aAAA;AAAA,IACA,cAAA;AAAA,IACA,WAAA;AAAA,IACA,iBAAA;AAAA,IACA,iBAAA;AAAA,IACA,cAAA;AAAA,IACA,cAAA;AAAA,IACA;AAAA,GACF,CAAA,EAAI,CAAC,MAAA,EAAQ,gBAAA,EAAkB,qBAAqB,mBAAA,EAAqB,aAAA,EAAe,cAAA,EAAgB,WAAA,EAAa,iBAAA,EAAmB,iBAAA,EAAmB,cAAA,EAAgB,cAAA,EAAgB,YAAY,CAAC,CAAA;AAC1M;;;AC7DO,IAAMC,UAAAA,GAAYC,iCAAA,CAAgBD,2BAAA,EAAY,WAAW","file":"chunk-2GOF2S3Y.cjs","sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Error as ErrorIcon, Spin } from \"@blueprintjs/icons\";\nimport classnames from \"classnames\";\nimport \"pdfjs-dist/web/pdf_viewer.css\";\nimport React, { useEffect, useRef } from \"react\";\nimport { EMPTY_ANNOTATION_ARRAY } from \"../constants.js\";\nimport { usePdfAnnotationsByPage } from \"../hooks/usePdfAnnotationsByPage.js\";\nimport { usePdfFormFields } from \"../hooks/usePdfFormFields.js\";\nimport { usePdfViewerCore } from \"../hooks/usePdfViewerCore.js\";\nimport { PdfAnnotationOverlay } from \"./PdfAnnotationOverlay.js\";\nimport styles from \"../BasePdfViewer.module.css\";\nexport function PdfViewerContent({\n src,\n annotations = EMPTY_ANNOTATION_ARRAY,\n onAnnotationClick,\n initialPage = 1,\n initialScale = 1.0,\n onPageChange: onPageChangeProp,\n onScaleChange: onScaleChangeProp,\n formData,\n onFormChange,\n className\n}) {\n const viewer = usePdfViewerCore({\n src,\n initialPage,\n initialScale\n });\n const annotationsByPage = usePdfAnnotationsByPage(annotations);\n usePdfFormFields({\n pdfViewerRef: viewer.pdfViewerRef,\n eventBusRef: viewer.eventBusRef,\n document: viewer.document,\n formData,\n onFormChange\n });\n\n // Use refs for callbacks to avoid firing on initial mount\n const onPageChangeRef = useRef(onPageChangeProp);\n onPageChangeRef.current = onPageChangeProp;\n const onScaleChangeRef = useRef(onScaleChangeProp);\n onScaleChangeRef.current = onScaleChangeProp;\n const isInitialMountRef = useRef(true);\n useEffect(function notifyPageChange() {\n if (isInitialMountRef.current) {\n return;\n }\n onPageChangeRef.current?.(viewer.currentPage);\n }, [viewer.currentPage]);\n useEffect(function notifyScaleChange() {\n if (isInitialMountRef.current) {\n return;\n }\n onScaleChangeRef.current?.(viewer.scale);\n }, [viewer.scale]);\n useEffect(function clearInitialMount() {\n isInitialMountRef.current = false;\n }, []);\n const rootClassName = classnames(styles.pdfViewer, className);\n if (viewer.loading) {\n return /*#__PURE__*/React.createElement(\"div\", {\n className: rootClassName\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: styles.loadingContainer\n }, /*#__PURE__*/React.createElement(Spin, {\n className: styles.spinnerIcon\n }), \"Loading\\u2026\"));\n }\n if (viewer.error != null) {\n return /*#__PURE__*/React.createElement(\"div\", {\n className: rootClassName\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: styles.errorContainer\n }, /*#__PURE__*/React.createElement(ErrorIcon, {\n className: styles.errorIcon\n }), \"Failed to load PDF: \", viewer.error.message));\n }\n if (viewer.document == null) {\n return /*#__PURE__*/React.createElement(\"div\", {\n className: rootClassName\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: styles.loadingContainer\n }, \"No document\"));\n }\n return /*#__PURE__*/React.createElement(\"div\", {\n className: rootClassName\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: styles.scrollContainerWrapper\n }, /*#__PURE__*/React.createElement(\"div\", {\n ref: viewer.containerRef,\n className: styles.scrollContainer\n }, /*#__PURE__*/React.createElement(\"div\", {\n ref: viewer.viewerRef,\n className: \"pdfViewer\"\n }), viewer.portalTargets.map(target => {\n const pageAnnotations = annotationsByPage[target.pageNumber] ?? EMPTY_ANNOTATION_ARRAY;\n if (pageAnnotations.length === 0) {\n return null;\n }\n return /*#__PURE__*/React.createElement(PdfAnnotationOverlay, {\n key: target.pageNumber,\n target: target,\n annotations: pageAnnotations,\n onAnnotationClick: onAnnotationClick\n });\n }))));\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { createContext, useContext, useMemo } from \"react\";\nimport { EMPTY_ANNOTATION_ARRAY } from \"./constants.js\";\nimport { usePdfAnnotationsByPage } from \"./hooks/usePdfAnnotationsByPage.js\";\nimport { usePdfFormFields } from \"./hooks/usePdfFormFields.js\";\nimport { usePdfHighlightMode } from \"./hooks/usePdfHighlightMode.js\";\nimport { usePdfViewerState } from \"./hooks/usePdfViewerState.js\";\n\n/** The shape of the value provided by {@link PdfViewerProvider}. */\n\nconst PdfViewerContext = /*#__PURE__*/createContext(null);\n/** Provides {@link PdfViewerContextValue} to descendant components. */\nexport function PdfViewerProvider({\n value,\n children\n}) {\n return /*#__PURE__*/React.createElement(PdfViewerContext.Provider, {\n value: value\n }, children);\n}\n\n/**\n * Returns the nearest {@link PdfViewerContextValue} from a {@link PdfViewerProvider}.\n * Throws if called outside a provider.\n */\nexport function usePdfViewerContext() {\n const ctx = useContext(PdfViewerContext);\n if (ctx == null) {\n throw new Error(\"usePdfViewerContext must be used within a PdfViewerProvider\");\n }\n return ctx;\n}\n\n/**\n * Consumer-facing setup hook analogous to react-hook-form's `useForm()`.\n * Accepts viewer options and returns a {@link PdfViewerContextValue} suitable\n * for passing to {@link PdfViewerProvider}.\n */\nexport function usePdfViewerInstance(options) {\n const viewer = usePdfViewerState({\n src: options.src,\n initialPage: options.initialPage,\n initialScale: options.initialScale,\n initialAutoSize: options.initialAutoSize,\n initialSidebarOpen: options.initialSidebarOpen,\n sidebarMode: options.sidebarMode,\n onDownload: options.onDownload\n });\n const {\n highlightModeActive,\n toggleHighlightMode\n } = usePdfHighlightMode({\n pdfViewerRef: viewer.pdfViewerRef,\n document: viewer.document,\n enabled: options.enableHighlight ?? options.highlightEnabled ?? false,\n onTextHighlight: options.onTextHighlight,\n onHighlightDelete: options.onHighlightDelete\n });\n const {\n hasFormFields,\n submitFormData\n } = usePdfFormFields({\n pdfViewerRef: viewer.pdfViewerRef,\n eventBusRef: viewer.eventBusRef,\n document: viewer.document,\n formData: options.formData,\n onFormSubmit: options.onFormSubmit,\n onFormChange: options.onFormChange\n });\n const annotations = options.annotations ?? EMPTY_ANNOTATION_ARRAY;\n const annotationsByPage = usePdfAnnotationsByPage(annotations);\n\n // `highlightEnabled` is the deprecated spelling of `enableHighlight`.\n const highlightEnabled = options.enableHighlight ?? options.highlightEnabled ?? false;\n const enableDownload = options.enableDownload ?? false;\n const enableFormSave = options.onFormSubmit != null && hasFormFields;\n const {\n onAnnotationClick,\n outlineIcons\n } = options;\n return useMemo(() => ({\n ...viewer,\n highlightEnabled,\n highlightModeActive,\n toggleHighlightMode,\n hasFormFields,\n submitFormData,\n annotations,\n annotationsByPage,\n onAnnotationClick,\n enableDownload,\n enableFormSave,\n outlineIcons\n }), [viewer, highlightEnabled, highlightModeActive, toggleHighlightMode, hasFormFields, submitFormData, annotations, annotationsByPage, onAnnotationClick, enableDownload, enableFormSave, outlineIcons]);\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// BasePdfViewer\nexport { BasePdfViewer } from \"../../pdf-viewer/BasePdfViewer.js\";\n// PdfViewer building blocks\nexport { PdfViewerAnnotationLayer } from \"../../pdf-viewer/components/PdfViewerAnnotationLayer.js\";\nexport { PdfViewerContent } from \"../../pdf-viewer/components/PdfViewerContent.js\";\nexport { PdfViewerOutlineSidebar } from \"../../pdf-viewer/components/PdfViewerOutlineSidebar.js\";\nexport { PdfViewerSearchBar } from \"../../pdf-viewer/components/PdfViewerSearchBar.js\";\nexport { PdfViewerSidebar } from \"../../pdf-viewer/components/PdfViewerSidebar.js\";\nexport { PdfViewerToolbar } from \"../../pdf-viewer/components/PdfViewerToolbar.js\";\n\n// PdfViewer hooks — primitive\nexport { usePdfAnnotationPortals } from \"../../pdf-viewer/hooks/usePdfAnnotationPortals.js\";\nexport { usePdfAnnotationsByPage } from \"../../pdf-viewer/hooks/usePdfAnnotationsByPage.js\";\nexport { usePdfDocument } from \"../../pdf-viewer/hooks/usePdfDocument.js\";\nexport { usePdfFormFields } from \"../../pdf-viewer/hooks/usePdfFormFields.js\";\nexport { usePdfHighlightMode } from \"../../pdf-viewer/hooks/usePdfHighlightMode.js\";\nexport { usePdfOutline } from \"../../pdf-viewer/hooks/usePdfOutline.js\";\nexport { usePdfViewer } from \"../../pdf-viewer/hooks/usePdfViewer.js\";\nexport { usePdfViewerSearch } from \"../../pdf-viewer/hooks/usePdfViewerSearch.js\";\nexport { usePdfViewerSync } from \"../../pdf-viewer/hooks/usePdfViewerSync.js\";\n\n// PdfViewer context\n\nexport { PdfViewerProvider, usePdfViewerContext, usePdfViewerInstance } from \"../../pdf-viewer/PdfViewerContext.js\";\n\n// PdfViewer hooks — composition\nexport { usePdfViewerCore } from \"../../pdf-viewer/hooks/usePdfViewerCore.js\";\nexport { usePdfViewerState } from \"../../pdf-viewer/hooks/usePdfViewerState.js\";\n\n// PdfViewer (Media wrapper)\nimport { PdfViewer as _PdfViewer } from \"../../pdf-viewer/PdfViewer.js\";\nimport { withOsdkMetrics } from \"../../util/withOsdkMetrics.js\";\nexport const PdfViewer = withOsdkMetrics(_PdfViewer, \"PdfViewer\");"]}
@@ -1,15 +1,15 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkOKKUYHUO_cjs = require('./chunk-OKKUYHUO.cjs');
4
- var chunkIWRCOFOC_cjs = require('./chunk-IWRCOFOC.cjs');
4
+ var chunkZX5S74BN_cjs = require('./chunk-ZX5S74BN.cjs');
5
5
 
6
6
  // src/public/experimental/tiff-renderer.ts
7
- var TiffViewer2 = chunkIWRCOFOC_cjs.withOsdkMetrics(chunkOKKUYHUO_cjs.TiffViewer, "TiffViewer");
7
+ var TiffViewer2 = chunkZX5S74BN_cjs.withOsdkMetrics(chunkOKKUYHUO_cjs.TiffViewer, "TiffViewer");
8
8
  var TiffRenderer = chunkOKKUYHUO_cjs.BaseTiffViewer;
9
9
  var TiffViewerMedia = TiffViewer2;
10
10
 
11
11
  exports.TiffRenderer = TiffRenderer;
12
12
  exports.TiffViewer = TiffViewer2;
13
13
  exports.TiffViewerMedia = TiffViewerMedia;
14
- //# sourceMappingURL=chunk-JV7LCS3L.cjs.map
15
- //# sourceMappingURL=chunk-JV7LCS3L.cjs.map
14
+ //# sourceMappingURL=chunk-3KYJ76C2.cjs.map
15
+ //# sourceMappingURL=chunk-3KYJ76C2.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/public/experimental/tiff-renderer.ts"],"names":["TiffViewer","withOsdkMetrics","BaseTiffViewer"],"mappings":";;;;;;AA4BO,IAAMA,WAAAA,GAAaC,iCAAA,CAAgBD,4BAAA,EAAa,YAAY;AAO5D,IAAM,YAAA,GAAeE;AAKrB,IAAM,eAAA,GAAkBF","file":"chunk-JV7LCS3L.cjs","sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// This subpath keeps its `tiff-renderer` name for now even though the\n// components it exports are named `TiffViewer`. It gets renamed when the\n// `experimental/` prefix is dropped, so consumers change import paths once\n// rather than twice.\n\nimport { BaseTiffViewer as _BaseTiffViewer } from \"../../images/tiff-viewer/BaseTiffViewer.js\";\nimport { TiffViewer as _TiffViewer } from \"../../images/tiff-viewer/TiffViewer.js\";\nimport { withOsdkMetrics } from \"../../util/withOsdkMetrics.js\";\n\n// BaseTiffViewer\nexport { BaseTiffViewer } from \"../../images/tiff-viewer/BaseTiffViewer.js\";\n// TiffViewer (Media wrapper)\nexport const TiffViewer = withOsdkMetrics(_TiffViewer, \"TiffViewer\");\n\n// Deprecated `Renderer` aliases of the same values, cleared in a later pass.\n// `TiffViewerMediaProps` has none: the `Media` drop is a uniform break because\n// pdf's old name was reused for a different type.\n\n/** @deprecated Use `BaseTiffViewer` instead. */\nexport const TiffRenderer = _BaseTiffViewer;\n\n/** @deprecated Use `BaseTiffViewerProps` instead. */\n\n/** @deprecated Use `TiffViewer` instead. */\nexport const TiffViewerMedia = TiffViewer;"]}
1
+ {"version":3,"sources":["../../src/public/experimental/tiff-renderer.ts"],"names":["TiffViewer","withOsdkMetrics","BaseTiffViewer"],"mappings":";;;;;;AA4BO,IAAMA,WAAAA,GAAaC,iCAAA,CAAgBD,4BAAA,EAAa,YAAY;AAO5D,IAAM,YAAA,GAAeE;AAKrB,IAAM,eAAA,GAAkBF","file":"chunk-3KYJ76C2.cjs","sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// This subpath keeps its `tiff-renderer` name for now even though the\n// components it exports are named `TiffViewer`. It gets renamed when the\n// `experimental/` prefix is dropped, so consumers change import paths once\n// rather than twice.\n\nimport { BaseTiffViewer as _BaseTiffViewer } from \"../../images/tiff-viewer/BaseTiffViewer.js\";\nimport { TiffViewer as _TiffViewer } from \"../../images/tiff-viewer/TiffViewer.js\";\nimport { withOsdkMetrics } from \"../../util/withOsdkMetrics.js\";\n\n// BaseTiffViewer\nexport { BaseTiffViewer } from \"../../images/tiff-viewer/BaseTiffViewer.js\";\n// TiffViewer (Media wrapper)\nexport const TiffViewer = withOsdkMetrics(_TiffViewer, \"TiffViewer\");\n\n// Deprecated `Renderer` aliases of the same values, cleared in a later pass.\n// `TiffViewerMediaProps` has none: the `Media` drop is a uniform break because\n// pdf's old name was reused for a different type.\n\n/** @deprecated Use `BaseTiffViewer` instead. */\nexport const TiffRenderer = _BaseTiffViewer;\n\n/** @deprecated Use `BaseTiffViewerProps` instead. */\n\n/** @deprecated Use `TiffViewer` instead. */\nexport const TiffViewerMedia = TiffViewer;"]}
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ var chunkOISZU73V_cjs = require('./chunk-OISZU73V.cjs');
4
+ var chunkZX5S74BN_cjs = require('./chunk-ZX5S74BN.cjs');
5
+
6
+ // src/public/experimental/email-viewer.ts
7
+ var EmailViewer2 = chunkZX5S74BN_cjs.withOsdkMetrics(chunkOISZU73V_cjs.EmailViewer, "EmailViewer");
8
+
9
+ exports.EmailViewer = EmailViewer2;
10
+ //# sourceMappingURL=chunk-4FQZPGVB.cjs.map
11
+ //# sourceMappingURL=chunk-4FQZPGVB.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/public/experimental/email-viewer.ts"],"names":["EmailViewer","withOsdkMetrics"],"mappings":";;;;;;AAqBO,IAAMA,YAAAA,GAAcC,iCAAA,CAAgBD,6BAAA,EAAc,aAAa","file":"chunk-5PN4U76X.cjs","sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// BaseEmailViewer\nexport { BaseEmailViewer } from \"../../email-viewer/BaseEmailViewer.js\";\n// EmailViewer (Media wrapper)\nimport { EmailViewer as _EmailViewer } from \"../../email-viewer/EmailViewer.js\";\nimport { withOsdkMetrics } from \"../../util/withOsdkMetrics.js\";\nexport const EmailViewer = withOsdkMetrics(_EmailViewer, \"EmailViewer\");"]}
1
+ {"version":3,"sources":["../../src/public/experimental/email-viewer.ts"],"names":["EmailViewer","withOsdkMetrics"],"mappings":";;;;;;AAqBO,IAAMA,YAAAA,GAAcC,iCAAA,CAAgBD,6BAAA,EAAc,aAAa","file":"chunk-4FQZPGVB.cjs","sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// BaseEmailViewer\nexport { BaseEmailViewer } from \"../../email-viewer/BaseEmailViewer.js\";\n// EmailViewer (Media wrapper)\nimport { EmailViewer as _EmailViewer } from \"../../email-viewer/EmailViewer.js\";\nimport { withOsdkMetrics } from \"../../util/withOsdkMetrics.js\";\nexport const EmailViewer = withOsdkMetrics(_EmailViewer, \"EmailViewer\");"]}