@osdk/react-components 0.43.0 → 0.43.1-main-eab07502700f00fae33f4d3d60a4e457d68f5e69

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 (61) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/build/browser/object-table/ObjectTableApi.js.map +1 -1
  3. package/build/browser/util/UserAgent.js +1 -1
  4. package/build/browser/util/UserAgent.js.map +1 -1
  5. package/build/cjs/{chunk-KZINCUSO.cjs → chunk-4RHYSLOF.cjs} +4 -4
  6. package/build/cjs/{chunk-KZINCUSO.cjs.map → chunk-4RHYSLOF.cjs.map} +1 -1
  7. package/build/cjs/{chunk-QBNUA5WG.cjs → chunk-5VZLGEZC.cjs} +4 -4
  8. package/build/cjs/{chunk-QBNUA5WG.cjs.map → chunk-5VZLGEZC.cjs.map} +1 -1
  9. package/build/cjs/{chunk-IGTCAXIJ.cjs → chunk-6FC3IRD6.cjs} +4 -4
  10. package/build/cjs/{chunk-IGTCAXIJ.cjs.map → chunk-6FC3IRD6.cjs.map} +1 -1
  11. package/build/cjs/{chunk-S3ITMFF3.cjs → chunk-76KDF3JW.cjs} +3 -3
  12. package/build/cjs/chunk-76KDF3JW.cjs.map +1 -0
  13. package/build/cjs/chunk-M35GTTYY.cjs +11 -0
  14. package/build/cjs/{chunk-XXYKJGWB.cjs.map → chunk-M35GTTYY.cjs.map} +1 -1
  15. package/build/cjs/chunk-MMXFXPW7.cjs +11 -0
  16. package/build/cjs/{chunk-KTPZ5SKZ.cjs.map → chunk-MMXFXPW7.cjs.map} +1 -1
  17. package/build/cjs/{chunk-FDRBFQS4.cjs → chunk-NJX2FUOF.cjs} +4 -4
  18. package/build/cjs/{chunk-FDRBFQS4.cjs.map → chunk-NJX2FUOF.cjs.map} +1 -1
  19. package/build/cjs/chunk-QGK4II3K.cjs +11 -0
  20. package/build/cjs/{chunk-DVC36NGS.cjs.map → chunk-QGK4II3K.cjs.map} +1 -1
  21. package/build/cjs/{chunk-T2MN4MGM.cjs → chunk-RNADPIG7.cjs} +4 -4
  22. package/build/cjs/{chunk-T2MN4MGM.cjs.map → chunk-RNADPIG7.cjs.map} +1 -1
  23. package/build/cjs/{chunk-P2YIHI5H.cjs → chunk-RZJEJUTM.cjs} +4 -4
  24. package/build/cjs/{chunk-P2YIHI5H.cjs.map → chunk-RZJEJUTM.cjs.map} +1 -1
  25. package/build/cjs/chunk-UHPUV7GG.cjs +11 -0
  26. package/build/cjs/{chunk-3OPZKCH7.cjs.map → chunk-UHPUV7GG.cjs.map} +1 -1
  27. package/build/cjs/{chunk-JCUVNLFE.cjs → chunk-X52ISTY4.cjs} +4 -4
  28. package/build/cjs/{chunk-JCUVNLFE.cjs.map → chunk-X52ISTY4.cjs.map} +1 -1
  29. package/build/cjs/{chunk-D63UEIY6.cjs → chunk-XMJMURMR.cjs} +4 -4
  30. package/build/cjs/{chunk-D63UEIY6.cjs.map → chunk-XMJMURMR.cjs.map} +1 -1
  31. package/build/cjs/chunk-Z5QMB2F7.cjs +11 -0
  32. package/build/cjs/{chunk-JWRNK62V.cjs.map → chunk-Z5QMB2F7.cjs.map} +1 -1
  33. package/build/cjs/public/experimental/action-form.cjs +4 -4
  34. package/build/cjs/public/experimental/cbac-picker.cjs +11 -11
  35. package/build/cjs/public/experimental/document-viewer.cjs +4 -4
  36. package/build/cjs/public/experimental/email-viewer.cjs +3 -3
  37. package/build/cjs/public/experimental/excel-viewer.cjs +3 -3
  38. package/build/cjs/public/experimental/filter-list.cjs +15 -15
  39. package/build/cjs/public/experimental/image-viewer.cjs +3 -3
  40. package/build/cjs/public/experimental/markdown-renderer.cjs +3 -3
  41. package/build/cjs/public/experimental/object-table.cjs +21 -21
  42. package/build/cjs/public/experimental/object-table.d.cts +91 -91
  43. package/build/cjs/public/experimental/pdf-viewer.cjs +7 -7
  44. package/build/cjs/public/experimental/tiff-renderer.cjs +3 -3
  45. package/build/cjs/public/experimental/video-viewer.cjs +3 -3
  46. package/build/cjs/public/experimental/xml-viewer.cjs +3 -3
  47. package/build/cjs/public/experimental.cjs +71 -71
  48. package/build/esm/object-table/ObjectTableApi.js.map +1 -1
  49. package/build/esm/util/UserAgent.js +1 -1
  50. package/build/esm/util/UserAgent.js.map +1 -1
  51. package/build/types/object-table/ObjectTableApi.d.ts +91 -91
  52. package/build/types/object-table/ObjectTableApi.d.ts.map +1 -1
  53. package/docs/ObjectTable.md +14 -14
  54. package/docs/ObjectTableOverview.md +131 -0
  55. package/package.json +7 -7
  56. package/build/cjs/chunk-3OPZKCH7.cjs +0 -11
  57. package/build/cjs/chunk-DVC36NGS.cjs +0 -11
  58. package/build/cjs/chunk-JWRNK62V.cjs +0 -11
  59. package/build/cjs/chunk-KTPZ5SKZ.cjs +0 -11
  60. package/build/cjs/chunk-S3ITMFF3.cjs.map +0 -1
  61. package/build/cjs/chunk-XXYKJGWB.cjs +0 -11
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @osdk/react-components
2
2
 
3
+ ## 0.43.1-main-eab07502700f00fae33f4d3d60a4e457d68f5e69
4
+
5
+ ### Patch Changes
6
+
7
+ - 0fcdfd2: Add an `ObjectTableOverview.md` one-pager (usage, a direct `ObjectTableProps` props reference, and the styling/`Style API` token table) rendered by the Storybook ObjectTable Docs page, and reorder `ObjectTableProps` so the props reference reads `objectType`, `objectSet`, `columnDefinitions` first and then groups the remaining props by feature (data source, filtering, columns, sorting, selection, focus, editing, interactions, display).
8
+ - @osdk/api@2.51.1-main-eab07502700f00fae33f4d3d60a4e457d68f5e69
9
+ - @osdk/client@2.51.1-main-eab07502700f00fae33f4d3d60a4e457d68f5e69
10
+ - @osdk/react@2.51.1-main-eab07502700f00fae33f4d3d60a4e457d68f5e69
11
+
3
12
  ## 0.43.0
4
13
 
5
14
  ### Minor Changes
@@ -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 CompileTimeMetadata,\n DerivedProperty,\n ObjectOrInterfaceDefinition,\n ObjectSet,\n Osdk,\n PrimaryKeyType,\n PropertyKeys,\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 { ObjectTableLabels } from \"./ObjectTableLabels.js\";\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> = Record<string, never>,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> =\n | EditableColumnDefinition<Q, RDPs, FunctionColumns>\n | ReadonlyColumnDefinition<Q, RDPs, FunctionColumns>;\n\ninterface SharedColumnDefinition<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> {\n /**\n * Defines what the column shows:\n * an object/interface property, a linked object property (derived property), a function\n * column, or a custom column — and carries that locator's configuration.\n */\n locator: ColumnDefinitionLocator<Q, RDPs, FunctionColumns>;\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 * 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 renderCell?: (\n object: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n locator: ColumnDefinitionLocator<Q, RDPs, FunctionColumns>\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 EditableColumnDefinition<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> extends SharedColumnDefinition<Q, RDPs, FunctionColumns> {\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\n/**\n * Column definition for a read-only column (default).\n * `editFieldConfig` and `validateEdit` are not available.\n */\ninterface ReadonlyColumnDefinition<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> extends SharedColumnDefinition<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> = Record<string, never>,\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> = Record<string, never>,\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> = Record<string, never>,\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> = Record<string, never>,\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 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 * 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 /**\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 table is sortable by the user.\n *\n * @default true\n */\n enableOrdering?: 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 * 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 * 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 * 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 * 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 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 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 * 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 * 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 * 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 * 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 * 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 * The height of each row in pixels.\n *\n * @default 40\n */\n rowHeight?: number;\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 * Overrides for the table's user-facing strings. Provide any subset; unset keys fall\n * back to the built-in English defaults. Use this to localize the table or\n * adjust wording. See {@link ObjectTableLabels}.\n *\n * @default undefined (built-in English strings)\n */\n labels?: Partial<ObjectTableLabels>;\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> = Record<string, never>,\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, Excel, 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> = Record<string, never>,\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> = Record<string, never>,\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> = Record<string, never>,\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 CompileTimeMetadata,\n DerivedProperty,\n ObjectOrInterfaceDefinition,\n ObjectSet,\n Osdk,\n PrimaryKeyType,\n PropertyKeys,\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 { ObjectTableLabels } from \"./ObjectTableLabels.js\";\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> = Record<string, never>,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> =\n | EditableColumnDefinition<Q, RDPs, FunctionColumns>\n | ReadonlyColumnDefinition<Q, RDPs, FunctionColumns>;\n\ninterface SharedColumnDefinition<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> {\n /**\n * Defines what the column shows:\n * an object/interface property, a linked object property (derived property), a function\n * column, or a custom column — and carries that locator's configuration.\n */\n locator: ColumnDefinitionLocator<Q, RDPs, FunctionColumns>;\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 * 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 renderCell?: (\n object: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n locator: ColumnDefinitionLocator<Q, RDPs, FunctionColumns>\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 EditableColumnDefinition<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> extends SharedColumnDefinition<Q, RDPs, FunctionColumns> {\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\n/**\n * Column definition for a read-only column (default).\n * `editFieldConfig` and `validateEdit` are not available.\n */\ninterface ReadonlyColumnDefinition<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> extends SharedColumnDefinition<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> = Record<string, never>,\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> = Record<string, never>,\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> = Record<string, never>,\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> = Record<string, never>,\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 * Overrides for the table's user-facing strings. Provide any subset; unset keys fall\n * back to the built-in English defaults. Use this to localize the table or\n * adjust wording. See {@link ObjectTableLabels}.\n *\n * @default undefined (built-in English strings)\n */\n labels?: Partial<ObjectTableLabels>;\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> = Record<string, never>,\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, Excel, 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> = Record<string, never>,\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> = Record<string, never>,\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> = Record<string, never>,\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":[]}
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- const PACKAGE_USER_AGENT = `osdk-react-components/${"0.43.0"}`;
17
+ const PACKAGE_USER_AGENT = `osdk-react-components/${"0.43.1-main-eab07502700f00fae33f4d3d60a4e457d68f5e69"}`;
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,mCAAsD;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,iFAAsD;AAEjF,OAAO,SAASC,kBAAkBA,CAACC,aAAqB,EAAU;EAChE,OAAO,GAAGF,kBAAkB,IAAIE,aAAa,EAAE;AACjD","ignoreList":[]}
@@ -5,7 +5,7 @@ var chunkC6IPNPMZ_cjs = require('./chunk-C6IPNPMZ.cjs');
5
5
  var chunkHNBSGCSZ_cjs = require('./chunk-HNBSGCSZ.cjs');
6
6
  var chunk7LXS66DW_cjs = require('./chunk-7LXS66DW.cjs');
7
7
  var chunkQP2LHBCZ_cjs = require('./chunk-QP2LHBCZ.cjs');
8
- var chunkS3ITMFF3_cjs = require('./chunk-S3ITMFF3.cjs');
8
+ var chunk76KDF3JW_cjs = require('./chunk-76KDF3JW.cjs');
9
9
  var platformApis = require('@osdk/react/platform-apis');
10
10
  var React = require('react');
11
11
  var popover = require('@base-ui/react/popover');
@@ -1059,7 +1059,7 @@ function CbacPicker({
1059
1059
  }
1060
1060
 
1061
1061
  // src/public/experimental/cbac-picker.ts
1062
- var CbacPicker2 = chunkS3ITMFF3_cjs.withOsdkMetrics(CbacPicker, "CbacPicker");
1062
+ var CbacPicker2 = chunk76KDF3JW_cjs.withOsdkMetrics(CbacPicker, "CbacPicker");
1063
1063
 
1064
1064
  exports.BaseCbacPicker = BaseCbacPicker;
1065
1065
  exports.BaseCbacPickerDialog = BaseCbacPickerDialog;
@@ -1070,5 +1070,5 @@ exports.MaxClassificationField = MaxClassificationField;
1070
1070
  exports.computeMarkingStates = computeMarkingStates;
1071
1071
  exports.groupMarkingsByCategory = groupMarkingsByCategory2;
1072
1072
  exports.toggleMarking = toggleMarking;
1073
- //# sourceMappingURL=chunk-KZINCUSO.cjs.map
1074
- //# sourceMappingURL=chunk-KZINCUSO.cjs.map
1073
+ //# sourceMappingURL=chunk-4RHYSLOF.cjs.map
1074
+ //# sourceMappingURL=chunk-4RHYSLOF.cjs.map