@osdk/react-components 0.12.0 → 0.13.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 (328) hide show
  1. package/AGENTS.md +4 -0
  2. package/CHANGELOG.md +11 -0
  3. package/build/browser/action-form/ActionForm.js +19 -11
  4. package/build/browser/action-form/ActionForm.js.map +1 -1
  5. package/build/browser/action-form/ActionFormApi.js.map +1 -1
  6. package/build/browser/action-form/BaseForm.js +19 -13
  7. package/build/browser/action-form/BaseForm.js.map +1 -1
  8. package/build/browser/action-form/BaseForm.module.css +7 -7
  9. package/build/browser/action-form/FormField.js +5 -2
  10. package/build/browser/action-form/FormField.js.map +1 -1
  11. package/build/browser/action-form/FormField.module.css +6 -1
  12. package/build/browser/action-form/FormField.module.css.js +1 -0
  13. package/build/browser/action-form/FormFieldApi.js +7 -1
  14. package/build/browser/action-form/FormFieldApi.js.map +1 -1
  15. package/build/browser/action-form/FormHeader.module.css +2 -2
  16. package/build/browser/action-form/fields/DateCalendar.js +41 -3
  17. package/build/browser/action-form/fields/DateCalendar.js.map +1 -1
  18. package/build/browser/action-form/fields/DateCalendar.module.css +59 -10
  19. package/build/browser/action-form/fields/DateCalendar.module.css.js +5 -1
  20. package/build/browser/action-form/fields/DateRangeCalendar.js +8 -5
  21. package/build/browser/action-form/fields/DateRangeCalendar.js.map +1 -1
  22. package/build/browser/action-form/fields/DateRangeInputField.js +76 -61
  23. package/build/browser/action-form/fields/DateRangeInputField.js.map +1 -1
  24. package/build/browser/action-form/fields/DateRangeInputField.module.css +0 -15
  25. package/build/browser/action-form/fields/DateRangeInputField.module.css.js +1 -2
  26. package/build/browser/action-form/fields/DatetimePickerField.js +74 -40
  27. package/build/browser/action-form/fields/DatetimePickerField.js.map +1 -1
  28. package/build/browser/action-form/fields/DatetimePickerField.module.css +2 -9
  29. package/build/browser/action-form/fields/FieldBridge.js +1 -1
  30. package/build/browser/action-form/fields/FieldBridge.js.map +1 -1
  31. package/build/browser/action-form/fields/FilePickerField.js +47 -39
  32. package/build/browser/action-form/fields/FilePickerField.js.map +1 -1
  33. package/build/browser/action-form/fields/FilePickerField.module.css +43 -31
  34. package/build/browser/action-form/fields/FilePickerField.module.css.js +2 -2
  35. package/build/browser/action-form/fields/FormFieldRenderer.js +9 -0
  36. package/build/browser/action-form/fields/FormFieldRenderer.js.map +1 -1
  37. package/build/browser/action-form/fields/RadioButtonsField.module.css +3 -3
  38. package/build/browser/action-form/fields/SwitchField.js +34 -0
  39. package/build/browser/action-form/fields/SwitchField.js.map +1 -0
  40. package/build/browser/action-form/fields/TimePicker.js +165 -26
  41. package/build/browser/action-form/fields/TimePicker.js.map +1 -1
  42. package/build/browser/action-form/fields/TimePicker.module.css +27 -2
  43. package/build/browser/action-form/fields/TimePicker.module.css.js +3 -1
  44. package/build/browser/action-form/fields/calendarShared.js +5 -0
  45. package/build/browser/action-form/fields/calendarShared.js.map +1 -1
  46. package/build/browser/action-form/fields/useDateEditState.js +3 -4
  47. package/build/browser/action-form/fields/useDateEditState.js.map +1 -1
  48. package/build/browser/base-components/action-button/ActionButton.js +2 -1
  49. package/build/browser/base-components/action-button/ActionButton.js.map +1 -1
  50. package/build/browser/base-components/action-button/ActionButton.module.css +19 -0
  51. package/build/browser/base-components/action-button/ActionButton.module.css.js +2 -1
  52. package/build/browser/base-components/combobox/Combobox.module.css +31 -3
  53. package/build/browser/base-components/select/Select.module.css +18 -0
  54. package/build/browser/base-components/switch/Switch.module.css +18 -6
  55. package/build/browser/filter-list/base/inputs/ListogramInput.js +34 -6
  56. package/build/browser/filter-list/base/inputs/ListogramInput.js.map +1 -1
  57. package/build/browser/filter-list/base/inputs/ListogramInput.module.css +11 -5
  58. package/build/browser/filter-list/base/inputs/ListogramInput.module.css.js +1 -1
  59. package/build/browser/filter-list/base/inputs/MultiSelectInput.js +20 -12
  60. package/build/browser/filter-list/base/inputs/MultiSelectInput.js.map +1 -1
  61. package/build/browser/filter-list/base/inputs/NoValueLabel.js +36 -0
  62. package/build/browser/filter-list/base/inputs/NoValueLabel.js.map +1 -0
  63. package/build/browser/filter-list/base/inputs/NoValueLabel.module.css +20 -0
  64. package/build/browser/filter-list/base/inputs/NoValueLabel.module.css.js +6 -0
  65. package/build/browser/filter-list/base/inputs/NullValueWrapper.js +4 -3
  66. package/build/browser/filter-list/base/inputs/NullValueWrapper.js.map +1 -1
  67. package/build/browser/filter-list/base/inputs/NullValueWrapper.module.css +10 -7
  68. package/build/browser/filter-list/base/inputs/NullValueWrapper.module.css.js +1 -1
  69. package/build/browser/filter-list/base/inputs/SingleSelectInput.js +13 -8
  70. package/build/browser/filter-list/base/inputs/SingleSelectInput.js.map +1 -1
  71. package/build/browser/filter-list/base/inputs/TextTagsInput.js +6 -2
  72. package/build/browser/filter-list/base/inputs/TextTagsInput.js.map +1 -1
  73. package/build/browser/filter-list/hooks/useFilterListState.js +7 -6
  74. package/build/browser/filter-list/hooks/useFilterListState.js.map +1 -1
  75. package/build/browser/filter-list/hooks/useStableMapEntries.js +35 -0
  76. package/build/browser/filter-list/hooks/useStableMapEntries.js.map +1 -0
  77. package/build/browser/filter-list/utils/filterValues.js +13 -0
  78. package/build/browser/filter-list/utils/filterValues.js.map +1 -1
  79. package/build/browser/object-table/DefaultCellRenderer.js +12 -2
  80. package/build/browser/object-table/DefaultCellRenderer.js.map +1 -1
  81. package/build/browser/object-table/EditableCell.js +14 -4
  82. package/build/browser/object-table/EditableCell.js.map +1 -1
  83. package/build/browser/object-table/EditableCell.module.css +4 -0
  84. package/build/browser/object-table/EditableCell.module.css.js +1 -0
  85. package/build/browser/object-table/ObjectTable.js +3 -1
  86. package/build/browser/object-table/ObjectTable.js.map +1 -1
  87. package/build/browser/object-table/ObjectTableApi.js.map +1 -1
  88. package/build/browser/object-table/Table.js +8 -4
  89. package/build/browser/object-table/Table.js.map +1 -1
  90. package/build/browser/object-table/TableBody.js +4 -2
  91. package/build/browser/object-table/TableBody.js.map +1 -1
  92. package/build/browser/object-table/TableRow.js +12 -4
  93. package/build/browser/object-table/TableRow.js.map +1 -1
  94. package/build/browser/object-table/hooks/useColumnDefs.js.map +1 -1
  95. package/build/browser/object-table/utils/editableUtils.js +39 -0
  96. package/build/browser/object-table/utils/editableUtils.js.map +1 -0
  97. package/build/browser/object-table/utils/shouldShowEditableCell.js +1 -1
  98. package/build/browser/object-table/utils/shouldShowEditableCell.js.map +1 -1
  99. package/build/browser/object-table/utils/types.js.map +1 -1
  100. package/build/browser/styles.css +331 -130
  101. package/build/browser/tokens/component-tokens/button.css +15 -0
  102. package/build/browser/tokens/component-tokens/combobox.css +9 -0
  103. package/build/browser/tokens/component-tokens/datetime-picker.css +2 -2
  104. package/build/browser/tokens/component-tokens/file-picker.css +0 -10
  105. package/build/browser/tokens/component-tokens/filter-list.css +9 -6
  106. package/build/browser/tokens/component-tokens/form-section.css +1 -1
  107. package/build/browser/tokens/component-tokens/form.css +9 -5
  108. package/build/browser/tokens/component-tokens/table.css +3 -5
  109. package/build/browser/tokens.css +1 -0
  110. package/build/browser/util/UserAgent.js +1 -1
  111. package/build/cjs/{DateCalendar-2W4QHEEI.css → DateCalendar-G7RC2FCG.css} +105 -8
  112. package/build/cjs/DateCalendar-G7RC2FCG.css.map +1 -0
  113. package/build/cjs/DateCalendar-RX7HP2XP.cjs +26 -0
  114. package/build/cjs/{DateCalendar-QGSYBWJB.cjs.map → DateCalendar-RX7HP2XP.cjs.map} +1 -1
  115. package/build/cjs/{DateRangeCalendar-M63S2LLG.css → DateRangeCalendar-JBVYJDBJ.css} +105 -8
  116. package/build/cjs/DateRangeCalendar-JBVYJDBJ.css.map +1 -0
  117. package/build/cjs/DateRangeCalendar-OHT4IUWQ.cjs +54 -0
  118. package/build/cjs/DateRangeCalendar-OHT4IUWQ.cjs.map +1 -0
  119. package/build/cjs/{chunk-T7I6O43T.cjs → chunk-6SPXSFPI.cjs} +237 -85
  120. package/build/cjs/chunk-6SPXSFPI.cjs.map +1 -0
  121. package/build/cjs/{chunk-SZXVBDSA.cjs → chunk-6UDBHYSO.cjs} +3 -3
  122. package/build/cjs/{chunk-SZXVBDSA.cjs.map → chunk-6UDBHYSO.cjs.map} +1 -1
  123. package/build/cjs/{chunk-YBDS5WQP.cjs → chunk-7H6WXQ35.cjs} +4 -4
  124. package/build/cjs/{chunk-YBDS5WQP.cjs.map → chunk-7H6WXQ35.cjs.map} +1 -1
  125. package/build/cjs/{chunk-VVJFMOZI.cjs → chunk-I3OSD6CF.cjs} +19 -45
  126. package/build/cjs/chunk-I3OSD6CF.cjs.map +1 -0
  127. package/build/cjs/chunk-MD4KDE44.cjs +41 -0
  128. package/build/cjs/chunk-MD4KDE44.cjs.map +1 -0
  129. package/build/cjs/{chunk-YPXTSEE7.cjs → chunk-MLFMSZJQ.cjs} +85 -38
  130. package/build/cjs/chunk-MLFMSZJQ.cjs.map +1 -0
  131. package/build/cjs/chunk-MQYOHGPY.cjs +52 -0
  132. package/build/cjs/chunk-MQYOHGPY.cjs.map +1 -0
  133. package/build/cjs/{chunk-BJDCC446.cjs → chunk-PTTCWNZZ.cjs} +417 -364
  134. package/build/cjs/chunk-PTTCWNZZ.cjs.map +1 -0
  135. package/build/cjs/{chunk-B2GRQRWU.cjs → chunk-TOJSJN3L.cjs} +44 -8
  136. package/build/cjs/chunk-TOJSJN3L.cjs.map +1 -0
  137. package/build/cjs/{chunk-JLESWL47.cjs → chunk-V7XWTJV7.cjs} +4 -2
  138. package/build/cjs/chunk-V7XWTJV7.cjs.map +1 -0
  139. package/build/cjs/{chunk-L5LPFCXT.cjs → chunk-W2IASYE4.cjs} +163 -125
  140. package/build/cjs/chunk-W2IASYE4.cjs.map +1 -0
  141. package/build/cjs/chunk-X337DNCW.cjs +45 -0
  142. package/build/cjs/chunk-X337DNCW.cjs.map +1 -0
  143. package/build/cjs/{chunk-SB2VTP67.cjs → chunk-Z7VHLTKD.cjs} +2 -64
  144. package/build/cjs/chunk-Z7VHLTKD.cjs.map +1 -0
  145. package/build/cjs/public/experimental/action-form.cjs +11 -9
  146. package/build/cjs/public/experimental/action-form.css +223 -68
  147. package/build/cjs/public/experimental/action-form.css.map +1 -1
  148. package/build/cjs/public/experimental/action-form.d.cts +83 -74
  149. package/build/cjs/public/experimental/filter-list.cjs +9 -8
  150. package/build/cjs/public/experimental/filter-list.css +38 -19
  151. package/build/cjs/public/experimental/filter-list.css.map +1 -1
  152. package/build/cjs/public/experimental/object-table.cjs +14 -12
  153. package/build/cjs/public/experimental/object-table.css +152 -59
  154. package/build/cjs/public/experimental/object-table.css.map +1 -1
  155. package/build/cjs/public/experimental/object-table.d.cts +39 -20
  156. package/build/cjs/public/experimental/pdf-viewer.cjs +24 -24
  157. package/build/cjs/public/experimental.cjs +46 -44
  158. package/build/cjs/public/experimental.css +242 -139
  159. package/build/cjs/public/experimental.css.map +1 -1
  160. package/build/cjs/public/primitives.cjs +8 -7
  161. package/build/cjs/public/primitives.css +15 -0
  162. package/build/cjs/public/primitives.css.map +1 -1
  163. package/build/cjs/public/primitives.d.cts +1 -0
  164. package/build/esm/action-form/ActionForm.js +19 -11
  165. package/build/esm/action-form/ActionForm.js.map +1 -1
  166. package/build/esm/action-form/ActionFormApi.js.map +1 -1
  167. package/build/esm/action-form/BaseForm.js +19 -13
  168. package/build/esm/action-form/BaseForm.js.map +1 -1
  169. package/build/esm/action-form/BaseForm.module.css +7 -7
  170. package/build/esm/action-form/FormField.js +5 -2
  171. package/build/esm/action-form/FormField.js.map +1 -1
  172. package/build/esm/action-form/FormField.module.css +6 -1
  173. package/build/esm/action-form/FormFieldApi.js +7 -1
  174. package/build/esm/action-form/FormFieldApi.js.map +1 -1
  175. package/build/esm/action-form/FormHeader.module.css +2 -2
  176. package/build/esm/action-form/fields/DateCalendar.js +41 -3
  177. package/build/esm/action-form/fields/DateCalendar.js.map +1 -1
  178. package/build/esm/action-form/fields/DateCalendar.module.css +59 -10
  179. package/build/esm/action-form/fields/DateRangeCalendar.js +8 -5
  180. package/build/esm/action-form/fields/DateRangeCalendar.js.map +1 -1
  181. package/build/esm/action-form/fields/DateRangeInputField.js +76 -61
  182. package/build/esm/action-form/fields/DateRangeInputField.js.map +1 -1
  183. package/build/esm/action-form/fields/DateRangeInputField.module.css +0 -15
  184. package/build/esm/action-form/fields/DatetimePickerField.js +74 -40
  185. package/build/esm/action-form/fields/DatetimePickerField.js.map +1 -1
  186. package/build/esm/action-form/fields/DatetimePickerField.module.css +2 -9
  187. package/build/esm/action-form/fields/FieldBridge.js +1 -1
  188. package/build/esm/action-form/fields/FieldBridge.js.map +1 -1
  189. package/build/esm/action-form/fields/FilePickerField.js +47 -39
  190. package/build/esm/action-form/fields/FilePickerField.js.map +1 -1
  191. package/build/esm/action-form/fields/FilePickerField.module.css +43 -31
  192. package/build/esm/action-form/fields/FormFieldRenderer.js +9 -0
  193. package/build/esm/action-form/fields/FormFieldRenderer.js.map +1 -1
  194. package/build/esm/action-form/fields/RadioButtonsField.module.css +3 -3
  195. package/build/esm/action-form/fields/SwitchField.js +34 -0
  196. package/build/esm/action-form/fields/SwitchField.js.map +1 -0
  197. package/build/esm/action-form/fields/TimePicker.js +165 -26
  198. package/build/esm/action-form/fields/TimePicker.js.map +1 -1
  199. package/build/esm/action-form/fields/TimePicker.module.css +27 -2
  200. package/build/esm/action-form/fields/calendarShared.js +5 -0
  201. package/build/esm/action-form/fields/calendarShared.js.map +1 -1
  202. package/build/esm/action-form/fields/useDateEditState.js +3 -4
  203. package/build/esm/action-form/fields/useDateEditState.js.map +1 -1
  204. package/build/esm/base-components/action-button/ActionButton.js +2 -1
  205. package/build/esm/base-components/action-button/ActionButton.js.map +1 -1
  206. package/build/esm/base-components/action-button/ActionButton.module.css +19 -0
  207. package/build/esm/base-components/combobox/Combobox.module.css +31 -3
  208. package/build/esm/base-components/select/Select.module.css +18 -0
  209. package/build/esm/base-components/switch/Switch.module.css +18 -6
  210. package/build/esm/filter-list/base/inputs/ListogramInput.js +34 -6
  211. package/build/esm/filter-list/base/inputs/ListogramInput.js.map +1 -1
  212. package/build/esm/filter-list/base/inputs/ListogramInput.module.css +11 -5
  213. package/build/esm/filter-list/base/inputs/MultiSelectInput.js +20 -12
  214. package/build/esm/filter-list/base/inputs/MultiSelectInput.js.map +1 -1
  215. package/build/esm/filter-list/base/inputs/NoValueLabel.js +36 -0
  216. package/build/esm/filter-list/base/inputs/NoValueLabel.js.map +1 -0
  217. package/build/esm/filter-list/base/inputs/NoValueLabel.module.css +20 -0
  218. package/build/esm/filter-list/base/inputs/NullValueWrapper.js +4 -3
  219. package/build/esm/filter-list/base/inputs/NullValueWrapper.js.map +1 -1
  220. package/build/esm/filter-list/base/inputs/NullValueWrapper.module.css +10 -7
  221. package/build/esm/filter-list/base/inputs/SingleSelectInput.js +13 -8
  222. package/build/esm/filter-list/base/inputs/SingleSelectInput.js.map +1 -1
  223. package/build/esm/filter-list/base/inputs/TextTagsInput.js +6 -2
  224. package/build/esm/filter-list/base/inputs/TextTagsInput.js.map +1 -1
  225. package/build/esm/filter-list/hooks/useFilterListState.js +7 -6
  226. package/build/esm/filter-list/hooks/useFilterListState.js.map +1 -1
  227. package/build/esm/filter-list/hooks/useStableMapEntries.js +35 -0
  228. package/build/esm/filter-list/hooks/useStableMapEntries.js.map +1 -0
  229. package/build/esm/filter-list/utils/filterValues.js +13 -0
  230. package/build/esm/filter-list/utils/filterValues.js.map +1 -1
  231. package/build/esm/object-table/DefaultCellRenderer.js +12 -2
  232. package/build/esm/object-table/DefaultCellRenderer.js.map +1 -1
  233. package/build/esm/object-table/EditableCell.js +14 -4
  234. package/build/esm/object-table/EditableCell.js.map +1 -1
  235. package/build/esm/object-table/EditableCell.module.css +4 -0
  236. package/build/esm/object-table/ObjectTable.js +3 -1
  237. package/build/esm/object-table/ObjectTable.js.map +1 -1
  238. package/build/esm/object-table/ObjectTableApi.js.map +1 -1
  239. package/build/esm/object-table/Table.js +8 -4
  240. package/build/esm/object-table/Table.js.map +1 -1
  241. package/build/esm/object-table/TableBody.js +4 -2
  242. package/build/esm/object-table/TableBody.js.map +1 -1
  243. package/build/esm/object-table/TableRow.js +12 -4
  244. package/build/esm/object-table/TableRow.js.map +1 -1
  245. package/build/esm/object-table/hooks/useColumnDefs.js.map +1 -1
  246. package/build/esm/object-table/utils/editableUtils.js +39 -0
  247. package/build/esm/object-table/utils/editableUtils.js.map +1 -0
  248. package/build/esm/object-table/utils/shouldShowEditableCell.js +1 -1
  249. package/build/esm/object-table/utils/shouldShowEditableCell.js.map +1 -1
  250. package/build/esm/object-table/utils/types.js.map +1 -1
  251. package/build/esm/tokens/component-tokens/button.css +15 -0
  252. package/build/esm/tokens/component-tokens/combobox.css +9 -0
  253. package/build/esm/tokens/component-tokens/datetime-picker.css +2 -2
  254. package/build/esm/tokens/component-tokens/file-picker.css +0 -10
  255. package/build/esm/tokens/component-tokens/filter-list.css +9 -6
  256. package/build/esm/tokens/component-tokens/form-section.css +1 -1
  257. package/build/esm/tokens/component-tokens/form.css +9 -5
  258. package/build/esm/tokens/component-tokens/table.css +3 -5
  259. package/build/esm/tokens.css +1 -0
  260. package/build/esm/util/UserAgent.js +1 -1
  261. package/build/types/action-form/ActionFormApi.d.ts +8 -8
  262. package/build/types/action-form/ActionFormApi.d.ts.map +1 -1
  263. package/build/types/action-form/BaseForm.d.ts.map +1 -1
  264. package/build/types/action-form/FormFieldApi.d.ts +29 -22
  265. package/build/types/action-form/FormFieldApi.d.ts.map +1 -1
  266. package/build/types/action-form/fields/DateCalendar.d.ts +6 -1
  267. package/build/types/action-form/fields/DateCalendar.d.ts.map +1 -1
  268. package/build/types/action-form/fields/DateRangeCalendar.d.ts.map +1 -1
  269. package/build/types/action-form/fields/DateRangeInputField.d.ts.map +1 -1
  270. package/build/types/action-form/fields/DatetimePickerField.d.ts.map +1 -1
  271. package/build/types/action-form/fields/FieldBridge.d.ts.map +1 -1
  272. package/build/types/action-form/fields/FilePickerField.d.ts.map +1 -1
  273. package/build/types/action-form/fields/FormFieldRenderer.d.ts.map +1 -1
  274. package/build/types/action-form/fields/SwitchField.d.ts +7 -0
  275. package/build/types/action-form/fields/SwitchField.d.ts.map +1 -0
  276. package/build/types/action-form/fields/TimePicker.d.ts +4 -5
  277. package/build/types/action-form/fields/TimePicker.d.ts.map +1 -1
  278. package/build/types/action-form/fields/useDateEditState.d.ts +2 -2
  279. package/build/types/base-components/action-button/ActionButton.d.ts +1 -0
  280. package/build/types/base-components/action-button/ActionButton.d.ts.map +1 -1
  281. package/build/types/filter-list/base/inputs/ListogramInput.d.ts.map +1 -1
  282. package/build/types/filter-list/base/inputs/MultiSelectInput.d.ts.map +1 -1
  283. package/build/types/filter-list/base/inputs/NoValueLabel.d.ts +15 -0
  284. package/build/types/filter-list/base/inputs/NoValueLabel.d.ts.map +1 -0
  285. package/build/types/filter-list/base/inputs/NullValueWrapper.d.ts.map +1 -1
  286. package/build/types/filter-list/base/inputs/SingleSelectInput.d.ts.map +1 -1
  287. package/build/types/filter-list/base/inputs/TextTagsInput.d.ts.map +1 -1
  288. package/build/types/filter-list/hooks/useFilterListState.d.ts.map +1 -1
  289. package/build/types/filter-list/hooks/useStableMapEntries.d.ts +9 -0
  290. package/build/types/filter-list/hooks/useStableMapEntries.d.ts.map +1 -0
  291. package/build/types/filter-list/utils/filterValues.d.ts +7 -0
  292. package/build/types/filter-list/utils/filterValues.d.ts.map +1 -1
  293. package/build/types/object-table/DefaultCellRenderer.d.ts.map +1 -1
  294. package/build/types/object-table/EditableCell.d.ts +1 -1
  295. package/build/types/object-table/EditableCell.d.ts.map +1 -1
  296. package/build/types/object-table/ObjectTableApi.d.ts +26 -7
  297. package/build/types/object-table/ObjectTableApi.d.ts.map +1 -1
  298. package/build/types/object-table/Table.d.ts +9 -2
  299. package/build/types/object-table/Table.d.ts.map +1 -1
  300. package/build/types/object-table/TableBody.d.ts +2 -1
  301. package/build/types/object-table/TableBody.d.ts.map +1 -1
  302. package/build/types/object-table/TableRow.d.ts +2 -1
  303. package/build/types/object-table/TableRow.d.ts.map +1 -1
  304. package/build/types/object-table/utils/editableUtils.d.ts +16 -0
  305. package/build/types/object-table/utils/editableUtils.d.ts.map +1 -0
  306. package/build/types/object-table/utils/shouldShowEditableCell.d.ts +2 -1
  307. package/build/types/object-table/utils/shouldShowEditableCell.d.ts.map +1 -1
  308. package/build/types/object-table/utils/types.d.ts +4 -11
  309. package/build/types/object-table/utils/types.d.ts.map +1 -1
  310. package/docs/ActionForm.md +176 -0
  311. package/docs/CSSVariables.md +31 -30
  312. package/docs/ObjectTable.md +141 -16
  313. package/package.json +6 -5
  314. package/build/cjs/DateCalendar-2W4QHEEI.css.map +0 -1
  315. package/build/cjs/DateCalendar-QGSYBWJB.cjs +0 -24
  316. package/build/cjs/DateRangeCalendar-JHO2BF3Z.cjs +0 -48
  317. package/build/cjs/DateRangeCalendar-JHO2BF3Z.cjs.map +0 -1
  318. package/build/cjs/DateRangeCalendar-M63S2LLG.css.map +0 -1
  319. package/build/cjs/chunk-B2GRQRWU.cjs.map +0 -1
  320. package/build/cjs/chunk-BJDCC446.cjs.map +0 -1
  321. package/build/cjs/chunk-JLESWL47.cjs.map +0 -1
  322. package/build/cjs/chunk-L5LPFCXT.cjs.map +0 -1
  323. package/build/cjs/chunk-SB2VTP67.cjs.map +0 -1
  324. package/build/cjs/chunk-T7I6O43T.cjs.map +0 -1
  325. package/build/cjs/chunk-UCTQICPR.cjs +0 -10
  326. package/build/cjs/chunk-UCTQICPR.cjs.map +0 -1
  327. package/build/cjs/chunk-VVJFMOZI.cjs.map +0 -1
  328. package/build/cjs/chunk-YPXTSEE7.cjs.map +0 -1
@@ -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\";\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 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 filterable?: 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\n/**\n * Column definition for an editable column. Setting `editable: true`\n * unlocks `editFieldConfig` and `validateEdit`.\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 editable: true;\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 editFieldConfig?: EditFieldConfig;\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?: (\n value: unknown,\n ) => 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<\n 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/**\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 and the objectType is not an interface, the table will use objectSet to fetch objects instead of fetching based on objectType.\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 * 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 * Whether the table is filterable by the user.\n *\n * @default true\n */\n enableFiltering?: boolean;\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 * Called when the where clause is changed.\n * Required when filter is controlled.\n *\n * @param newWhere The new where clause\n */\n onFilterChanged?: (newWhere: WhereClause<Q, RDPs>) => void;\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 * 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 button Submit Edits will be shown in the table\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?: (edits: CellEditInfo<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n unknown\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 * 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.\n * Required when row selection is controlled.\n *\n * @param selectedRowIds The primary keys of currently selected rows\n * @param isSelectAll Whether the change was triggered by a \"select all\" action. Defaults to false\n */\n onRowSelection?: (\n selectedRowIds: PrimaryKeyType<Q>[],\n isSelectAll?: boolean,\n ) => 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 * The height of each row in pixels.\n *\n * @default 40\n */\n rowHeight?: number;\n\n className?: string;\n}\n\nexport interface ObjectSetOptions<\n Q extends ObjectOrInterfaceDefinition,\n> {\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\";\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 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 filterable?: 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 returns the props\n * to pass to the field component, so editor configuration can depend on the\n * current 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?: (\n value: unknown,\n ) => 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<\n 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/**\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 and the objectType is not an interface, the table will use objectSet to fetch objects instead of fetching based on objectType.\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 * 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 * Whether the table is filterable by the user.\n *\n * @default true\n */\n enableFiltering?: boolean;\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 * Called when the where clause is changed.\n * Required when filter is controlled.\n *\n * @param newWhere The new where clause\n */\n onFilterChanged?: (newWhere: WhereClause<Q, RDPs>) => void;\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?: (edits: CellEditInfo<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n unknown\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 * 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.\n * Required when row selection is controlled.\n *\n * @param selectedRowIds The primary keys of currently selected rows\n * @param isSelectAll Whether the change was triggered by a \"select all\" action. Defaults to false\n */\n onRowSelection?: (\n selectedRowIds: PrimaryKeyType<Q>[],\n isSelectAll?: boolean,\n ) => 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 * 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 className?: string;\n}\n\nexport interface ObjectSetOptions<\n Q extends ObjectOrInterfaceDefinition,\n> {\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":[]}
@@ -23,6 +23,7 @@ import { TableBody } from "./TableBody.js";
23
23
  import { TableEditContainer } from "./TableEditContainer.js";
24
24
  import { TableHeader } from "./TableHeader.js";
25
25
  import { SCROLL_FETCH_THRESHOLD } from "./utils/constants.js";
26
+ import { isColumnDeclaredEditable } from "./utils/editableUtils.js";
26
27
  import { PortalTrackerProvider, usePortalTracker } from "./utils/PortalTracker.js";
27
28
  export function BaseTable(props) {
28
29
  return /*#__PURE__*/React.createElement(PortalTrackerProvider, null, /*#__PURE__*/React.createElement(BaseTableInner, props));
@@ -38,7 +39,9 @@ function BaseTableInner({
38
39
  className,
39
40
  error,
40
41
  headerMenuFeatureFlags,
41
- editableConfig
42
+ editableConfig,
43
+ getRowAttributes,
44
+ showEditFooter = true
42
45
  }) {
43
46
  const tableContainerRef = useRef(null);
44
47
  const [isLoadingMore, setIsLoadingMore] = useState(false);
@@ -85,7 +88,7 @@ function BaseTableInner({
85
88
  const rows = table.getRowModel().rows;
86
89
  const headerGroups = table.getHeaderGroups();
87
90
  const hasData = rows.length > 0;
88
- const hasEditableColumns = table.getAllColumns().some(column => column.columnDef.meta?.editable === true);
91
+ const hasEditableColumns = table.getAllColumns().some(column => isColumnDeclaredEditable(column.columnDef.meta?.editable));
89
92
 
90
93
  // Use pointerdown instead of click to detect outside interactions.
91
94
  // base-ui's Select renders a full-screen backdrop that intercepts
@@ -131,12 +134,13 @@ function BaseTableInner({
131
134
  headerGroups: headerGroups,
132
135
  focusedRowId: focusedRowId,
133
136
  setFocusedRowId: setFocusedRowId,
134
- isInEditMode: editableConfig?.editModeState.isActive
137
+ isInEditMode: editableConfig?.editModeState.isActive,
138
+ getRowAttributes: getRowAttributes
135
139
  }))), !hasData && error == null && /*#__PURE__*/React.createElement(NonIdealState, {
136
140
  message: "No Data"
137
141
  }), error != null && /*#__PURE__*/React.createElement(NonIdealState, {
138
142
  message: `Error Loading Data: ${error.message}`
139
- })), hasEditableColumns && editableConfig && /*#__PURE__*/React.createElement(TableEditContainer, {
143
+ })), showEditFooter && hasEditableColumns && editableConfig && /*#__PURE__*/React.createElement(TableEditContainer, {
140
144
  editableConfig: editableConfig,
141
145
  focusedRowId: focusedRowId
142
146
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"Table.js","names":["classNames","React","useCallback","useEffect","useRef","useState","LoadingStateTable","NonIdealState","styles","TableBody","TableEditContainer","TableHeader","SCROLL_FETCH_THRESHOLD","PortalTrackerProvider","usePortalTracker","BaseTable","props","createElement","BaseTableInner","table","isLoading","fetchNextPage","onRowClick","onColumnHeaderClick","rowHeight","renderCellContextMenu","className","error","headerMenuFeatureFlags","editableConfig","tableContainerRef","isLoadingMore","setIsLoadingMore","focusedRowId","setFocusedRowId","portalTracker","options","meta","fetchingRef","fetchMoreOnEndReached","containerRefElement","current","scrollHeight","scrollTop","clientHeight","handleScroll","e","currentTarget","rows","getRowModel","headerGroups","getHeaderGroups","hasData","length","hasEditableColumns","getAllColumns","some","column","columnDef","editable","handleClickOutside","event","target","contains","containsElement","document","addEventListener","removeEventListener","osdkTableWrapper","ref","osdkTableContainer","onScroll","Fragment","isInEditMode","editModeState","isActive","message"],"sources":["Table.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 { Cell, RowData, Table } from \"@tanstack/react-table\";\nimport classNames from \"classnames\";\nimport React, {\n type ReactElement,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from \"react\";\nimport { LoadingStateTable } from \"./LoadingStateTable.js\";\nimport { NonIdealState } from \"./NonIdealState.js\";\nimport styles from \"./Table.module.css\";\nimport { TableBody } from \"./TableBody.js\";\nimport { TableEditContainer } from \"./TableEditContainer.js\";\nimport { TableHeader } from \"./TableHeader.js\";\nimport type { HeaderMenuFeatureFlags } from \"./TableHeaderWithPopover.js\";\nimport { SCROLL_FETCH_THRESHOLD } from \"./utils/constants.js\";\nimport {\n PortalTrackerProvider,\n usePortalTracker,\n} from \"./utils/PortalTracker.js\";\nimport type {\n CellEditInfo,\n EditableConfig,\n EditFieldConfig,\n} from \"./utils/types.js\";\n\ndeclare module \"@tanstack/react-table\" {\n interface ColumnMeta<TData extends RowData = unknown, TValue = unknown> {\n columnName?: string;\n isAsyncColumn?: boolean;\n isVisible?: boolean;\n editable?: boolean;\n dataType?: string;\n editFieldConfig?: EditFieldConfig;\n validateEdit?: (value: unknown) => Promise<string | undefined>;\n }\n interface TableMeta<TData extends RowData = unknown> {\n onCellEdit?: (\n cellId: string,\n info: CellEditInfo<TData, unknown>,\n ) => void;\n onCellValidationError?: (\n cellId: string,\n error: string,\n ) => void;\n clearCellValidationError?: (cellId: string) => void;\n cellEdits?: Record<string, CellEditInfo<TData, unknown>>;\n isInEditMode?: boolean;\n validationErrors?: Map<string, string>;\n focusedRowId?: string | null;\n }\n}\n\nexport interface BaseTableProps<\n TData extends RowData,\n> {\n table: Table<TData>;\n isLoading?: boolean;\n fetchNextPage?: () => Promise<void>;\n onRowClick?: (row: TData) => void;\n onColumnHeaderClick?: (columnId: string) => void;\n rowHeight?: number;\n renderCellContextMenu?: (\n row: TData,\n cell: Cell<TData, unknown>,\n ) => React.ReactNode;\n className?: string;\n error?: Error;\n headerMenuFeatureFlags?: HeaderMenuFeatureFlags;\n editableConfig?: EditableConfig<TData, unknown>;\n}\n\nexport function BaseTable<\n TData extends RowData,\n>(props: BaseTableProps<TData>): ReactElement {\n return (\n <PortalTrackerProvider>\n <BaseTableInner {...props} />\n </PortalTrackerProvider>\n );\n}\n\nfunction BaseTableInner<\n TData extends RowData,\n>(\n {\n table,\n isLoading,\n fetchNextPage,\n onRowClick,\n onColumnHeaderClick,\n rowHeight,\n renderCellContextMenu,\n className,\n error,\n headerMenuFeatureFlags,\n editableConfig,\n }: BaseTableProps<TData>,\n): ReactElement {\n const tableContainerRef = useRef<HTMLDivElement>(null);\n const [isLoadingMore, setIsLoadingMore] = useState(false);\n const [focusedRowId, setFocusedRowId] = useState<string | null>(null);\n const portalTracker = usePortalTracker();\n\n // Sync focusedRowId into table meta so cell renderers (which only\n // receive `table`) can read it without extra prop drilling.\n // Assigned synchronously so children see the current value in the\n // same render pass. This is safe because meta is a mutable bag that\n // TanStack Table never snapshots or shallow-compares.\n if (table.options.meta) {\n table.options.meta.focusedRowId = focusedRowId;\n }\n\n // Using a ref to prevent duplicate fetches from rapid scroll events while a fetch is in-flight\n const fetchingRef = useRef(false);\n\n useEffect(() => {\n if (!isLoading || fetchNextPage == null) {\n setIsLoadingMore(false);\n }\n }, [isLoading, fetchNextPage]);\n\n const fetchMoreOnEndReached = useCallback(\n async (containerRefElement?: HTMLDivElement | null) => {\n if (containerRefElement && !fetchingRef.current && !isLoadingMore) {\n const { scrollHeight, scrollTop, clientHeight } = containerRefElement;\n if (\n scrollHeight - scrollTop - clientHeight < SCROLL_FETCH_THRESHOLD\n && !isLoading && fetchNextPage != null\n ) {\n fetchingRef.current = true;\n setIsLoadingMore(true);\n try {\n await fetchNextPage();\n } finally {\n fetchingRef.current = false;\n }\n }\n }\n },\n [fetchNextPage, isLoading, isLoadingMore],\n );\n\n const handleScroll = useCallback(\n async (e: React.UIEvent<HTMLDivElement>) => {\n await fetchMoreOnEndReached(e.currentTarget);\n },\n [fetchMoreOnEndReached],\n );\n\n const rows = table.getRowModel().rows;\n const headerGroups = table.getHeaderGroups();\n const hasData = rows.length > 0;\n\n const hasEditableColumns = table\n .getAllColumns()\n .some(column => column.columnDef.meta?.editable === true);\n\n // Use pointerdown instead of click to detect outside interactions.\n // base-ui's Select renders a full-screen backdrop that intercepts\n // pointerdown to close the popup. By the time the click event fires,\n // the backdrop is unmounted and event.target falls through to <body>,\n // which would incorrectly trigger the outside-click handler.\n // At pointerdown time the backdrop is still in the DOM, so\n // portalTracker.containsElement correctly identifies it.\n useEffect(() => {\n const handleClickOutside = (event: PointerEvent) => {\n const target = event.target as Node;\n if (\n tableContainerRef.current\n && !tableContainerRef.current.contains(target)\n && !portalTracker?.containsElement(target)\n ) {\n setFocusedRowId(null);\n }\n };\n\n document.addEventListener(\"pointerdown\", handleClickOutside);\n return () => {\n document.removeEventListener(\"pointerdown\", handleClickOutside);\n };\n }, [portalTracker]);\n\n return (\n <div className={classNames(styles.osdkTableWrapper, className)}>\n <div\n ref={tableContainerRef}\n className={styles.osdkTableContainer}\n onScroll={handleScroll}\n >\n <table>\n {isLoading && !hasData\n ? (\n <LoadingStateTable\n table={table}\n headerGroups={headerGroups}\n rowHeight={rowHeight}\n tableContainerRef={tableContainerRef}\n />\n )\n : (\n <>\n <TableHeader\n table={table}\n headerMenuFeatureFlags={headerMenuFeatureFlags}\n onColumnHeaderClick={onColumnHeaderClick}\n />\n <TableBody\n rows={rows}\n tableContainerRef={tableContainerRef}\n onRowClick={onRowClick}\n rowHeight={rowHeight}\n renderCellContextMenu={renderCellContextMenu}\n isLoadingMore={isLoadingMore}\n headerGroups={headerGroups}\n focusedRowId={focusedRowId}\n setFocusedRowId={setFocusedRowId}\n isInEditMode={editableConfig?.editModeState.isActive}\n />\n </>\n )}\n </table>\n {!hasData && error == null && <NonIdealState message={\"No Data\"} />}\n {error != null && (\n <NonIdealState message={`Error Loading Data: ${error.message}`} />\n )}\n </div>\n {hasEditableColumns && editableConfig && (\n <TableEditContainer\n editableConfig={editableConfig}\n focusedRowId={focusedR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CAAAuE,QAAA,qBACEvE,KAAA,CAAAgB,aAAA,CAACN,WAAW;IACVQ,KAAK,EAAEA,KAAM;IACbS,sBAAsB,EAAEA,sBAAuB;IAC/CL,mBAAmB,EAAEA;EAAoB,CAC1C,CAAC,eACFtB,KAAA,CAAAgB,aAAA,CAACR,SAAS;IACRuC,IAAI,EAAEA,IAAK;IACXlB,iBAAiB,EAAEA,iBAAkB;IACrCR,UAAU,EAAEA,UAAW;IACvBE,SAAS,EAAEA,SAAU;IACrBC,qBAAqB,EAAEA,qBAAsB;IAC7CM,aAAa,EAAEA,aAAc;IAC7BmB,YAAY,EAAEA,YAAa;IAC3BjB,YAAY,EAAEA,YAAa;IAC3BC,eAAe,EAAEA,eAAgB;IACjCuC,YAAY,EAAE5C,cAAc,EAAE6C,aAAa,CAACC;EAAS,CACtD,CACD,CAED,CAAC,EACP,CAACvB,OAAO,IAAIzB,KAAK,IAAI,IAAI,iBAAI1B,KAAA,CAAAgB,aAAA,CAACV,aAAa;IAACqE,OAAO,EAAE;EAAU,CAAE,CAAC,EAClEjD,KAAK,IAAI,IAAI,iBACZ1B,KAAA,CAAAgB,aAAA,CAACV,aAAa;IAACqE,OAAO,EAAE,uBAAuBjD,KAAK,CAACiD,OAAO;EAAG,CAAE,CAEhE,CAAC,EACLtB,kBAAkB,IAAIzB,cAAc,iBACnC5B,KAAA,CAAAgB,aAAA,CAACP,kBAAkB;IACjBmB,cAAc,EAAEA,cAAe;IAC/BI,YAAY,EAAEA;EAAa,CAC5B,CAEA,CAAC;AAEV","ignoreList":[]}
1
+ {"version":3,"file":"Table.js","names":["classNames","React","useCallback","useEffect","useRef","useState","LoadingStateTable","NonIdealState","styles","TableBody","TableEditContainer","TableHeader","SCROLL_FETCH_THRESHOLD","isColumnDeclaredEditable","PortalTrackerProvider","usePortalTracker","BaseTable","props","createElement","BaseTableInner","table","isLoading","fetchNextPage","onRowClick","onColumnHeaderClick","rowHeight","renderCellContextMenu","className","error","headerMenuFeatureFlags","editableConfig","getRowAttributes","showEditFooter","tableContainerRef","isLoadingMore","setIsLoadingMore","focusedRowId","setFocusedRowId","portalTracker","options","meta","fetchingRef","fetchMoreOnEndReached","containerRefElement","current","scrollHeight","scrollTop","clientHeight","handleScroll","e","currentTarget","rows","getRowModel","headerGroups","getHeaderGroups","hasData","length","hasEditableColumns","getAllColumns","some","column","columnDef","editable","handleClickOutside","event","target","contains","containsElement","document","addEventListener","removeEventListener","osdkTableWrapper","ref","osdkTableContainer","onScroll","Fragment","isInEditMode","editModeState","isActive","message"],"sources":["Table.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 { Cell, RowData, Table } from \"@tanstack/react-table\";\nimport classNames from \"classnames\";\nimport React, {\n type ReactElement,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from \"react\";\nimport { LoadingStateTable } from \"./LoadingStateTable.js\";\nimport { NonIdealState } from \"./NonIdealState.js\";\nimport styles from \"./Table.module.css\";\nimport { TableBody } from \"./TableBody.js\";\nimport { TableEditContainer } from \"./TableEditContainer.js\";\nimport { TableHeader } from \"./TableHeader.js\";\nimport type { HeaderMenuFeatureFlags } from \"./TableHeaderWithPopover.js\";\nimport { SCROLL_FETCH_THRESHOLD } from \"./utils/constants.js\";\nimport { isColumnDeclaredEditable } from \"./utils/editableUtils.js\";\nimport {\n PortalTrackerProvider,\n usePortalTracker,\n} from \"./utils/PortalTracker.js\";\nimport type {\n CellEditInfo,\n EditableConfig,\n EditFieldConfig,\n} from \"./utils/types.js\";\n\ndeclare module \"@tanstack/react-table\" {\n interface ColumnMeta<TData extends RowData = unknown, TValue = unknown> {\n columnName?: string;\n isAsyncColumn?: boolean;\n isVisible?: boolean;\n editable?: boolean | ((object: TData) => boolean);\n dataType?: string;\n editFieldConfig?: EditFieldConfig<TData>;\n validateEdit?: (value: unknown) => Promise<string | undefined>;\n }\n interface TableMeta<TData extends RowData = unknown> {\n onCellEdit?: (\n cellId: string,\n info: CellEditInfo<TData, unknown>,\n ) => void;\n onCellValidationError?: (\n cellId: string,\n error: string,\n ) => void;\n clearCellValidationError?: (cellId: string) => void;\n cellEdits?: Record<string, CellEditInfo<TData, unknown>>;\n isInEditMode?: boolean;\n validationErrors?: Map<string, string>;\n focusedRowId?: string | null;\n }\n}\n\nexport interface BaseTableProps<\n TData extends RowData,\n> {\n table: Table<TData>;\n isLoading?: boolean;\n fetchNextPage?: () => Promise<void>;\n onRowClick?: (row: TData) => void;\n onColumnHeaderClick?: (columnId: string) => void;\n rowHeight?: number;\n renderCellContextMenu?: (\n row: TData,\n cell: Cell<TData, unknown>,\n ) => React.ReactNode;\n className?: string;\n error?: Error;\n headerMenuFeatureFlags?: HeaderMenuFeatureFlags;\n editableConfig?: EditableConfig<TData, unknown>;\n getRowAttributes?: (\n object: TData,\n ) => Record<string, string | undefined>;\n /**\n * Whether to render the bottom edit footer. Defaults to `true`; the\n * footer is only rendered when the table has at least one editable\n * column (`hasEditableColumns`).\n */\n showEditFooter?: boolean;\n}\n\nexport function BaseTable<\n TData extends RowData,\n>(props: BaseTableProps<TData>): ReactElement {\n return (\n <PortalTrackerProvider>\n <BaseTableInner {...props} />\n </PortalTrackerProvider>\n );\n}\n\nfunction BaseTableInner<\n TData extends RowData,\n>(\n {\n table,\n isLoading,\n fetchNextPage,\n onRowClick,\n onColumnHeaderClick,\n rowHeight,\n renderCellContextMenu,\n className,\n error,\n headerMenuFeatureFlags,\n editableConfig,\n getRowAttributes,\n showEditFooter = true,\n }: BaseTableProps<TData>,\n): ReactElement {\n const tableContainerRef = useRef<HTMLDivElement>(null);\n const [isLoadingMore, setIsLoadingMore] = useState(false);\n const [focusedRowId, setFocusedRowId] = useState<string | null>(null);\n const portalTracker = usePortalTracker();\n\n // Sync focusedRowId into table meta so cell renderers (which only\n // receive `table`) can read it without extra prop drilling.\n // Assigned synchronously so children see the current value in the\n // same render pass. This is safe because meta is a mutable bag that\n // TanStack Table never snapshots or shallow-compares.\n if (table.options.meta) {\n table.options.meta.focusedRowId = focusedRowId;\n }\n\n // Using a ref to prevent duplicate fetches from rapid scroll events while a fetch is in-flight\n const fetchingRef = useRef(false);\n\n useEffect(() => {\n if (!isLoading || fetchNextPage == null) {\n setIsLoadingMore(false);\n }\n }, [isLoading, fetchNextPage]);\n\n const fetchMoreOnEndReached = useCallback(\n async (containerRefElement?: HTMLDivElement | null) => {\n if (containerRefElement && !fetchingRef.current && !isLoadingMore) {\n const { scrollHeight, scrollTop, clientHeight } = containerRefElement;\n if (\n scrollHeight - scrollTop - clientHeight < SCROLL_FETCH_THRESHOLD\n && !isLoading && fetchNextPage != null\n ) {\n fetchingRef.current = true;\n setIsLoadingMore(true);\n try {\n await fetchNextPage();\n } finally {\n fetchingRef.current = false;\n }\n }\n }\n },\n [fetchNextPage, isLoading, isLoadingMore],\n );\n\n const handleScroll = useCallback(\n async (e: React.UIEvent<HTMLDivElement>) => {\n await fetchMoreOnEndReached(e.currentTarget);\n },\n [fetchMoreOnEndReached],\n );\n\n const rows = table.getRowModel().rows;\n const headerGroups = table.getHeaderGroups();\n const hasData = rows.length > 0;\n\n const hasEditableColumns = table\n .getAllColumns()\n .some((column) =>\n isColumnDeclaredEditable(column.columnDef.meta?.editable)\n );\n\n // Use pointerdown instead of click to detect outside interactions.\n // base-ui's Select renders a full-screen backdrop that intercepts\n // pointerdown to close the popup. By the time the click event fires,\n // the backdrop is unmounted and event.target falls through to <body>,\n // which would incorrectly trigger the outside-click handler.\n // At pointerdown time the backdrop is still in the DOM, so\n // portalTracker.containsElement correctly identifies it.\n useEffect(() => {\n const handleClickOutside = (event: PointerEvent) => {\n const target = event.target as Node;\n if (\n tableContainerRef.current\n && !tableContainerRef.current.contains(target)\n && !portalTracker?.containsElement(target)\n ) {\n setFocusedRowId(null);\n }\n };\n\n document.addEventListener(\"pointerdown\", handleClickOutside);\n return () => {\n document.removeEventListener(\"pointerdown\", handleClickOutside);\n };\n }, [portalTracker]);\n\n return (\n <div className={classNames(styles.osdkTableWrapper, className)}>\n <div\n ref={tableContainerRef}\n className={styles.osdkTableContainer}\n onScroll={handleScroll}\n >\n <table>\n {isLoading && !hasData\n ? (\n <LoadingStateTable\n table={table}\n headerGroups={headerGroups}\n rowHeight={rowHeight}\n tableContainerRef={tableContainerRef}\n />\n )\n : (\n <>\n <TableHeader\n table={table}\n headerMenuFeatureFlags={headerMenuFeatureFlags}\n onColumnHeaderClick={onColumnHeaderClick}\n />\n <TableBody\n rows={rows}\n tableContainerRef={tableContainerRef}\n onRowClick={onRowClick}\n rowHeight={rowHeight}\n renderCellContextMenu={renderCellContextMenu}\n isLoadingMore={isLoadingMore}\n headerGroups={headerGroups}\n focusedRowId={focusedRowId}\n setFocusedRowId={setFocusedRowId}\n isInEditMode={editableConfig?.editModeState.isActive}\n getRowAttributes={getRowAttributes}\n />\n </>\n )}\n </table>\n {!hasData && error == null && <NonIdealState message={\"No Data\"} />}\n {error != null && (\n <NonIdealState message={`Error Loading Data: ${error.message}`} />\n )}\n </div>\n {showEditFooter && hasEditableColumns && editableConfig && (\n <TableEditContainer\n editableConfig={editableConfig}\n focusedRowId={focusedRowId}\n />\n )}\n </div>\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,OAAOA,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,IAEVC,WAAW,EACXC,SAAS,EACTC,MAAM,EACNC,QAAQ,QACH,OAAO;AACd,SAASC,iBAAiB,QAAQ,wBAAwB;AAC1D,SAASC,aAAa,QAAQ,oBAAoB;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AAEA,IAAK;IACXlB,iBAAiB,EAAEA,iBAAkB;IACrCV,UAAU,EAAEA,UAAW;IACvBE,SAAS,EAAEA,SAAU;IACrBC,qBAAqB,EAAEA,qBAAsB;IAC7CQ,aAAa,EAAEA,aAAc;IAC7BmB,YAAY,EAAEA,YAAa;IAC3BjB,YAAY,EAAEA,YAAa;IAC3BC,eAAe,EAAEA,eAAgB;IACjCuC,YAAY,EAAE9C,cAAc,EAAE+C,aAAa,CAACC,QAAS;IACrD/C,gBAAgB,EAAEA;EAAiB,CACpC,CACD,CAED,CAAC,EACP,CAACwB,OAAO,IAAI3B,KAAK,IAAI,IAAI,iBAAI3B,KAAA,CAAAiB,aAAA,CAACX,aAAa;IAACwE,OAAO,EAAE;EAAU,CAAE,CAAC,EAClEnD,KAAK,IAAI,IAAI,iBACZ3B,KAAA,CAAAiB,aAAA,CAACX,aAAa;IAACwE,OAAO,EAAE,uBAAuBnD,KAAK,CAACmD,OAAO;EAAG,CAAE,CAEhE,CAAC,EACL/C,cAAc,IAAIyB,kBAAkB,IAAI3B,cAAc,iBACrD7B,KAAA,CAAAiB,aAAA,CAACR,kBAAkB;IACjBoB,cAAc,EAAEA,cAAe;IAC/BM,YAAY,EAAEA;EAAa,CAC5B,CAEA,CAAC;AAEV","ignoreList":[]}
@@ -30,7 +30,8 @@ export function TableBody({
30
30
  headerGroups = [],
31
31
  focusedRowId,
32
32
  setFocusedRowId,
33
- isInEditMode
33
+ isInEditMode,
34
+ getRowAttributes
34
35
  }) {
35
36
  // Important: Keep the row virtualizer in the lowest component possible to avoid unnecessary re-renders.
36
37
  const rowVirtualizer = useVirtualizer({
@@ -62,7 +63,8 @@ export function TableBody({
62
63
  renderCellContextMenu: renderCellContextMenu,
63
64
  isFocused: focusedRowId === row.id,
64
65
  setFocusedRowId: setFocusedRowId,
65
- isInEditMode: isInEditMode
66
+ isInEditMode: isInEditMode,
67
+ getRowAttributes: getRowAttributes
66
68
  });
67
69
  }), isLoadingMore && /*#__PURE__*/React.createElement(LoadingRow, {
68
70
  headers: headers,
@@ -1 +1 @@
1
- {"version":3,"file":"TableBody.js","names":["useVirtualizer","React","useLayoutEffect","LoadingRow","styles","TableRow","DEFAULT_ROW_HEIGHT","VIRTUALIZER_OVERSCAN","TableBody","rows","tableContainerRef","onRowClick","renderCellContextMenu","rowHeight","isLoadingMore","headerGroups","focusedRowId","setFocusedRowId","isInEditMode","rowVirtualizer","count","length","estimateSize","getScrollElement","current","overscan","measure","totalSize","getTotalSize","bodyHeight","headers","createElement","className","osdkTableBody","style","height","getVirtualItems","map","virtualRow","row","index","key","id","isFocused","translateY","columnCount"],"sources":["TableBody.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 { Cell, HeaderGroup, Row, RowData } from \"@tanstack/react-table\";\nimport { useVirtualizer } from \"@tanstack/react-virtual\";\nimport React, { useLayoutEffect } from \"react\";\nimport { LoadingRow } from \"./LoadingRow.js\";\nimport styles from \"./TableBody.module.css\";\nimport { TableRow } from \"./TableRow.js\";\nimport { DEFAULT_ROW_HEIGHT, VIRTUALIZER_OVERSCAN } from \"./utils/constants.js\";\n\ninterface TableBodyProps<TData extends RowData> {\n rows: Array<Row<TData>>;\n tableContainerRef: React.RefObject<HTMLDivElement>;\n onRowClick?: (row: TData) => void;\n rowHeight?: number;\n renderCellContextMenu?: (\n row: TData,\n cell: Cell<TData, unknown>,\n ) => React.ReactNode;\n isLoadingMore?: boolean;\n headerGroups?: Array<HeaderGroup<TData>>;\n focusedRowId?: string | null;\n setFocusedRowId?: (rowId: string | null) => void;\n isInEditMode?: boolean;\n}\n\nexport function TableBody<TData extends RowData>({\n rows,\n tableContainerRef,\n onRowClick,\n renderCellContextMenu,\n rowHeight = DEFAULT_ROW_HEIGHT,\n isLoadingMore = false,\n headerGroups = [],\n focusedRowId,\n setFocusedRowId,\n isInEditMode,\n}: TableBodyProps<TData>): React.ReactElement {\n // Important: Keep the row virtualizer in the lowest component possible to avoid unnecessary re-renders.\n const rowVirtualizer = useVirtualizer<HTMLDivElement, HTMLTableRowElement>({\n count: rows.length,\n estimateSize: () => rowHeight,\n getScrollElement: () => tableContainerRef.current,\n overscan: VIRTUALIZER_OVERSCAN,\n });\n\n // Measure the virtualizer after the DOM has been laid out to ensure proper dimensions\n useLayoutEffect(() => {\n rowVirtualizer.measure();\n }, [rowVirtualizer, rows.length]);\n\n const totalSize = rowVirtualizer.getTotalSize();\n const bodyHeight = isLoadingMore\n ? totalSize + rowHeight\n : totalSize;\n\n const headers = headerGroups[0]?.headers ?? [];\n\n return (\n <tbody\n className={styles.osdkTableBody}\n style={{\n height: `${bodyHeight}px`,\n }}\n >\n {rowVirtualizer.getVirtualItems().map((virtualRow) => {\n const row = rows[virtualRow.index];\n\n return (\n <TableRow\n key={row.id}\n row={row}\n virtualRow={virtualRow}\n onRowClick={onRowClick}\n renderCellContextMenu={renderCellContextMenu}\n isFocused={focusedRowId === row.id}\n setFocusedRowId={setFocusedRowId}\n isInEditMode={isInEditMode}\n />\n );\n })}\n {isLoadingMore && (\n <LoadingRow\n headers={headers}\n translateY={totalSize}\n rowHeight={rowHeight}\n columnCount={headers.length}\n />\n )}\n </tbody>\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,cAAc,QAAQ,yBAAyB;AACxD,OAAOC,KAAK,IAAIC,eAAe,QAAQ,OAAO;AAC9C,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,OAAOC,MAAM,MAAM,w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,GAAG,CAACG,EAAG;MACZH,GAAG,EAAEA,GAAI;MACTD,UAAU,EAAEA,UAAW;MACvB3B,UAAU,EAAEA,UAAW;MACvBC,qBAAqB,EAAEA,qBAAsB;MAC7C+B,SAAS,EAAE3B,YAAY,KAAKuB,GAAG,CAACG,EAAG;MACnCzB,eAAe,EAAEA,eAAgB;MACjCC,YAAY,EAAEA;IAAa,CAC5B,CAAC;EAEN,CAAC,CAAC,EACDJ,aAAa,iBACZb,KAAA,CAAA8B,aAAA,CAAC5B,UAAU;IACT2B,OAAO,EAAEA,OAAQ;IACjBc,UAAU,EAAEjB,SAAU;IACtBd,SAAS,EAAEA,SAAU;IACrBgC,WAAW,EAAEf,OAAO,CAACT;EAAO,CAC7B,CAEE,CAAC;AAEZ","ignoreList":[]}
1
+ {"version":3,"file":"TableBody.js","names":["useVirtualizer","React","useLayoutEffect","LoadingRow","styles","TableRow","DEFAULT_ROW_HEIGHT","VIRTUALIZER_OVERSCAN","TableBody","rows","tableContainerRef","onRowClick","renderCellContextMenu","rowHeight","isLoadingMore","headerGroups","focusedRowId","setFocusedRowId","isInEditMode","getRowAttributes","rowVirtualizer","count","length","estimateSize","getScrollElement","current","overscan","measure","totalSize","getTotalSize","bodyHeight","headers","createElement","className","osdkTableBody","style","height","getVirtualItems","map","virtualRow","row","index","key","id","isFocused","translateY","columnCount"],"sources":["TableBody.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 { Cell, HeaderGroup, Row, RowData } from \"@tanstack/react-table\";\nimport { useVirtualizer } from \"@tanstack/react-virtual\";\nimport React, { useLayoutEffect } from \"react\";\nimport { LoadingRow } from \"./LoadingRow.js\";\nimport styles from \"./TableBody.module.css\";\nimport { TableRow } from \"./TableRow.js\";\nimport { DEFAULT_ROW_HEIGHT, VIRTUALIZER_OVERSCAN } from \"./utils/constants.js\";\n\ninterface TableBodyProps<TData extends RowData> {\n rows: Array<Row<TData>>;\n tableContainerRef: React.RefObject<HTMLDivElement>;\n onRowClick?: (row: TData) => void;\n rowHeight?: number;\n renderCellContextMenu?: (\n row: TData,\n cell: Cell<TData, unknown>,\n ) => React.ReactNode;\n isLoadingMore?: boolean;\n headerGroups?: Array<HeaderGroup<TData>>;\n focusedRowId?: string | null;\n setFocusedRowId?: (rowId: string | null) => void;\n isInEditMode?: boolean;\n getRowAttributes?: (\n object: TData,\n ) => Record<string, string | undefined>;\n}\n\nexport function TableBody<TData extends RowData>({\n rows,\n tableContainerRef,\n onRowClick,\n renderCellContextMenu,\n rowHeight = DEFAULT_ROW_HEIGHT,\n isLoadingMore = false,\n headerGroups = [],\n focusedRowId,\n setFocusedRowId,\n isInEditMode,\n getRowAttributes,\n}: TableBodyProps<TData>): React.ReactElement {\n // Important: Keep the row virtualizer in the lowest component possible to avoid unnecessary re-renders.\n const rowVirtualizer = useVirtualizer<HTMLDivElement, HTMLTableRowElement>({\n count: rows.length,\n estimateSize: () => rowHeight,\n getScrollElement: () => tableContainerRef.current,\n overscan: VIRTUALIZER_OVERSCAN,\n });\n\n // Measure the virtualizer after the DOM has been laid out to ensure proper dimensions\n useLayoutEffect(() => {\n rowVirtualizer.measure();\n }, [rowVirtualizer, rows.length]);\n\n const totalSize = rowVirtualizer.getTotalSize();\n const bodyHeight = isLoadingMore\n ? totalSize + rowHeight\n : totalSize;\n\n const headers = headerGroups[0]?.headers ?? [];\n\n return (\n <tbody\n className={styles.osdkTableBody}\n style={{\n height: `${bodyHeight}px`,\n }}\n >\n {rowVirtualizer.getVirtualItems().map((virtualRow) => {\n const row = rows[virtualRow.index];\n\n return (\n <TableRow\n key={row.id}\n row={row}\n virtualRow={virtualRow}\n onRowClick={onRowClick}\n renderCellContextMenu={renderCellContextMenu}\n isFocused={focusedRowId === row.id}\n setFocusedRowId={setFocusedRowId}\n isInEditMode={isInEditMode}\n getRowAttributes={getRowAttributes}\n />\n );\n })}\n {isLoadingMore && (\n <LoadingRow\n headers={headers}\n translateY={totalSize}\n rowHeight={rowHeight}\n columnCount={headers.length}\n />\n )}\n </tbody>\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,cAAc,QAAQ,yBAAyB;AACxD,OAAOC,KAAK,IAAIC,eAAe,QAAQ,OAAO;AAC9C,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,OAAOC,MAAM,MAAM,wBAAwB;AAC3C,SAASC,QAAQ,QAAQ,eAAe;AACxC,SAASC,kBAAkB,EAAEC,oBAAoB,QAAQ,sBAAsB;AAqB/E,OAAO,SAASC,SAASA,CAAwB;EAC/CC,IAAI;EACJC,iBAAiB;EACjBC,UAAU;EACVC,qBAAqB;EACrBC,SAAS,GAAGP,kBAAkB;EAC9BQ,aAAa,GAAG,KAAK;EACrBC,YAAY,GAAG,EAAE;EACjBC,YAAY;EACZC,eAAe;EACfC,YAAY;EACZC;AACqB,CAAC,EAAsB;EAC5C;EACA,MAAMC,cAAc,GAAGpB,cAAc,CAAsC;IACzEqB,KAAK,EAAEZ,IAAI,CAACa,MAAM;IAClBC,YAAY,EAAEA,CAAA,KAAMV,SAAS;IAC7BW,gBAAgB,EAAEA,CAAA,KAAMd,iBAAiB,CAACe,OAAO;IACjDC,QAAQ,EAAEnB;EACZ,CAAC,CAAC;;EAEF;EACAL,eAAe,CAAC,MAAM;IACpBkB,cAAc,CAACO,OAAO,CAAC,CAAC;EAC1B,CAAC,EAAE,CAACP,cAAc,EAAEX,IAAI,CAACa,MAAM,CAAC,CAAC;EAEjC,MAAMM,SAAS,GAAGR,cAAc,CAACS,YAAY,CAAC,CAAC;EAC/C,MAAMC,UAAU,GAAGhB,aAAa,GAC5Bc,SAAS,GAAGf,SAAS,GACrBe,SAAS;EAEb,MAAMG,OAAO,GAAGhB,YAAY,CAAC,CAAC,CAAC,EAAEgB,OAAO,IAAI,EAAE;EAE9C,oBACE9B,KAAA,CAAA+B,aAAA;IACEC,SAAS,EAAE7B,MAAM,CAAC8B,aAAc;IAChCC,KAAK,EAAE;MACLC,MAAM,EAAE,GAAGN,UAAU;IACvB;EAAE,GAEDV,cAAc,CAACiB,eAAe,CAAC,CAAC,CAACC,GAAG,CAAEC,UAAU,IAAK;IACpD,MAAMC,GAAG,GAAG/B,IAAI,CAAC8B,UAAU,CAACE,KAAK,CAAC;IAElC,oBACExC,KAAA,CAAA+B,aAAA,CAAC3B,QAAQ;MACPqC,GAAG,EAAEF,GAAG,CAACG,EAAG;MACZH,GAAG,EAAEA,GAAI;MACTD,UAAU,EAAEA,UAAW;MACvB5B,UAAU,EAAEA,UAAW;MACvBC,qBAAqB,EAAEA,qBAAsB;MAC7CgC,SAAS,EAAE5B,YAAY,KAAKwB,GAAG,CAACG,EAAG;MACnC1B,eAAe,EAAEA,eAAgB;MACjCC,YAAY,EAAEA,YAAa;MAC3BC,gBAAgB,EAAEA;IAAiB,CACpC,CAAC;EAEN,CAAC,CAAC,EACDL,aAAa,iBACZb,KAAA,CAAA+B,aAAA,CAAC7B,UAAU;IACT4B,OAAO,EAAEA,OAAQ;IACjBc,UAAU,EAAEjB,SAAU;IACtBf,SAAS,EAAEA,SAAU;IACrBiC,WAAW,EAAEf,OAAO,CAACT;EAAO,CAC7B,CAEE,CAAC;AAEZ","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
1
2
  /*
2
3
  * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
3
4
  *
@@ -14,7 +15,7 @@
14
15
  * limitations under the License.
15
16
  */
16
17
 
17
- import React, { useCallback } from "react";
18
+ import React, { useCallback, useMemo } from "react";
18
19
  import { TableCell } from "./TableCell.js";
19
20
  import styles from "./TableRow.module.css";
20
21
  export function TableRow({
@@ -24,7 +25,8 @@ export function TableRow({
24
25
  renderCellContextMenu,
25
26
  isFocused,
26
27
  setFocusedRowId,
27
- isInEditMode
28
+ isInEditMode,
29
+ getRowAttributes
28
30
  }) {
29
31
  // Use the capture phase so row focus is set even when children call
30
32
  // stopPropagation on the click event (e.g. DatetimePickerField's input).
@@ -36,7 +38,13 @@ export function TableRow({
36
38
  onRowClick?.(row.original);
37
39
  }
38
40
  }, [isInEditMode, onRowClick, row.original]);
39
- return /*#__PURE__*/React.createElement("tr", {
41
+ const customRowAttributes = useMemo(() => {
42
+ if (!getRowAttributes) {
43
+ return;
44
+ }
45
+ return Object.fromEntries(Object.entries(getRowAttributes(row.original)).filter(entry => entry[1] != null));
46
+ }, [getRowAttributes, row.original]);
47
+ return /*#__PURE__*/React.createElement("tr", _extends({}, customRowAttributes, {
40
48
  "data-selected": row.getIsSelected(),
41
49
  "data-focused": isFocused,
42
50
  "data-row-parity": virtualRow.index % 2 === 0 ? "even" : "odd",
@@ -47,7 +55,7 @@ export function TableRow({
47
55
  },
48
56
  onClickCapture: handleClickCapture,
49
57
  onClick: handleClick
50
- }, row.getVisibleCells().map(cell => /*#__PURE__*/React.createElement(TableCell, {
58
+ }), row.getVisibleCells().map(cell => /*#__PURE__*/React.createElement(TableCell, {
51
59
  key: cell.id,
52
60
  cell: cell,
53
61
  renderCellContextMenu: renderCellContextMenu
@@ -1 +1 @@
1
- {"version":3,"file":"TableRow.js","names":["React","useCallback","TableCell","styles","TableRow","row","virtualRow","onRowClick","renderCellContextMenu","isFocused","setFocusedRowId","isInEditMode","handleClickCapture","id","handleClick","original","createElement","getIsSelected","index","className","osdkTableRow","style","height","size","transform","start","onClickCapture","onClick","getVisibleCells","map","cell","key"],"sources":["TableRow.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 { Cell, Row, RowData } from \"@tanstack/react-table\";\nimport type { VirtualItem } from \"@tanstack/react-virtual\";\nimport React, { useCallback } from \"react\";\nimport { TableCell } from \"./TableCell.js\";\nimport styles from \"./TableRow.module.css\";\n\ninterface TableRowProps<TData extends RowData> {\n row: Row<TData>;\n virtualRow: VirtualItem;\n onRowClick?: (row: TData) => void;\n renderCellContextMenu?: (\n row: TData,\n cell: Cell<TData, unknown>,\n ) => React.ReactNode;\n isFocused: boolean;\n setFocusedRowId?: (rowId: string | null) => void;\n isInEditMode?: boolean;\n}\n\nexport function TableRow<TData extends RowData>({\n row,\n virtualRow,\n onRowClick,\n renderCellContextMenu,\n isFocused,\n setFocusedRowId,\n isInEditMode,\n}: TableRowProps<TData>): React.ReactElement {\n // Use the capture phase so row focus is set even when children call\n // stopPropagation on the click event (e.g. DatetimePickerField's input).\n const handleClickCapture = useCallback(() => {\n setFocusedRowId?.(row.id);\n }, [row.id, setFocusedRowId]);\n\n const handleClick = useCallback(() => {\n if (!isInEditMode) {\n onRowClick?.(row.original);\n }\n }, [isInEditMode, onRowClick, row.original]);\n\n return (\n <tr\n data-selected={row.getIsSelected()}\n data-focused={isFocused}\n data-row-parity={virtualRow.index % 2 === 0 ? \"even\" : \"odd\"}\n className={styles.osdkTableRow}\n style={{\n height: `${virtualRow.size}px`,\n transform: `translateY(${virtualRow.start}px)`,\n }}\n onClickCapture={handleClickCapture}\n onClick={handleClick}\n >\n {row.getVisibleCells().map((cell) => (\n <TableCell\n key={cell.id}\n cell={cell}\n renderCellContextMenu={renderCellContextMenu}\n />\n ))}\n </tr>\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,OAAOA,KAAK,IAAIC,WAAW,QAAQ,OAAO;AAC1C,SAASC,SAAS,QAAQ,gBAAgB;AAC1C,OAAOC,MAAM,MAAM,uBAAuB;AAe1C,OAAO,SAASC,QAAQA,CAAwB;EAC9CC,GAAG;EACHC,UAAU;EACVC,UAAU;EACVC,qBAAqB;EACrBC,SAAS;EACTC,eAAe;EACfC;AACoB,CAAC,EAAsB;EAC3C;EACA;EACA,MAAMC,kBAAkB,GAAGX,WAAW,CAAC,MAAM;IAC3CS,eAAe,GAAGL,GAAG,CAACQ,EAAE,CAAC;EAC3B,CAAC,EAAE,CAACR,GAAG,CAACQ,EAAE,EAAEH,eAAe,CAAC,CAAC;EAE7B,MAAMI,WAAW,GAAGb,WAAW,CAAC,MAAM;IACpC,IAAI,CAACU,YAAY,EAAE;MACjBJ,UAAU,GAAGF,GAAG,CAACU,QAAQ,CAAC;IAC5B;EACF,CAAC,EAAE,CAACJ,YAAY,EAAEJ,UAAU,EAAEF,GAAG,CAACU,QAAQ,CAAC,CAAC;EAE5C,oBACEf,KAAA,CAAAgB,aAAA;IACE,iBAAeX,GAAG,CAACY,aAAa,CAAC,CAAE;IACnC,gBAAcR,SAAU;IACxB,mBAAiBH,UAAU,CAACY,KAAK,GAAG,CAAC,KAAK,CAAC,GAAG,MAAM,GAAG,KAAM;IAC7DC,SAAS,EAAEhB,MAAM,CAACiB,YAAa;IAC/BC,KAAK,EAAE;MACLC,MAAM,EAAE,GAAGhB,UAAU,CAACiB,IAAI,IAAI;MAC9BC,SAAS,EAAE,cAAclB,UAAU,CAACmB,KAAK;IAC3C,CAAE;IACFC,cAAc,EAAEd,kBAAmB;IACnCe,OAAO,EAAEb;EAAY,GAEpBT,GAAG,CAACuB,eAAe,CAAC,CAAC,CAACC,GAAG,CAAEC,IAAI,iBAC9B9B,KAAA,CAAAgB,aAAA,CAACd,SAAS;IACR6B,GAAG,EAAED,IAAI,CAACjB,EAAG;IACbiB,IAAI,EAAEA,IAAK;IACXtB,qBAAqB,EAAEA;EAAsB,CAC9C,CACF,CACC,CAAC;AAET","ignoreList":[]}
1
+ {"version":3,"file":"TableRow.js","names":["React","useCallback","useMemo","TableCell","styles","TableRow","row","virtualRow","onRowClick","renderCellContextMenu","isFocused","setFocusedRowId","isInEditMode","getRowAttributes","handleClickCapture","id","handleClick","original","customRowAttributes","Object","fromEntries","entries","filter","entry","createElement","_extends","getIsSelected","index","className","osdkTableRow","style","height","size","transform","start","onClickCapture","onClick","getVisibleCells","map","cell","key"],"sources":["TableRow.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 { Cell, Row, RowData } from \"@tanstack/react-table\";\nimport type { VirtualItem } from \"@tanstack/react-virtual\";\nimport React, { useCallback, useMemo } from \"react\";\nimport { TableCell } from \"./TableCell.js\";\nimport styles from \"./TableRow.module.css\";\n\ninterface TableRowProps<TData extends RowData> {\n row: Row<TData>;\n virtualRow: VirtualItem;\n onRowClick?: (row: TData) => void;\n renderCellContextMenu?: (\n row: TData,\n cell: Cell<TData, unknown>,\n ) => React.ReactNode;\n isFocused: boolean;\n setFocusedRowId?: (rowId: string | null) => void;\n isInEditMode?: boolean;\n getRowAttributes?: (\n object: TData,\n ) => Record<string, string | undefined>;\n}\n\nexport function TableRow<TData extends RowData>({\n row,\n virtualRow,\n onRowClick,\n renderCellContextMenu,\n isFocused,\n setFocusedRowId,\n isInEditMode,\n getRowAttributes,\n}: TableRowProps<TData>): React.ReactElement {\n // Use the capture phase so row focus is set even when children call\n // stopPropagation on the click event (e.g. DatetimePickerField's input).\n const handleClickCapture = useCallback(() => {\n setFocusedRowId?.(row.id);\n }, [row.id, setFocusedRowId]);\n\n const handleClick = useCallback(() => {\n if (!isInEditMode) {\n onRowClick?.(row.original);\n }\n }, [isInEditMode, onRowClick, row.original]);\n\n const customRowAttributes = useMemo(() => {\n if (!getRowAttributes) {\n return;\n }\n return Object.fromEntries(\n Object.entries(getRowAttributes(row.original))\n .filter((entry): entry is [string, string] => entry[1] != null),\n );\n }, [getRowAttributes, row.original]);\n\n return (\n <tr\n {...customRowAttributes}\n data-selected={row.getIsSelected()}\n data-focused={isFocused}\n data-row-parity={virtualRow.index % 2 === 0 ? \"even\" : \"odd\"}\n className={styles.osdkTableRow}\n style={{\n height: `${virtualRow.size}px`,\n transform: `translateY(${virtualRow.start}px)`,\n }}\n onClickCapture={handleClickCapture}\n onClick={handleClick}\n >\n {row.getVisibleCells().map((cell) => (\n <TableCell\n key={cell.id}\n cell={cell}\n renderCellContextMenu={renderCellContextMenu}\n />\n ))}\n </tr>\n );\n}\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AACnD,SAASC,SAAS,QAAQ,gBAAgB;AAC1C,OAAOC,MAAM,MAAM,uBAAuB;AAkB1C,OAAO,SAASC,QAAQA,CAAwB;EAC9CC,GAAG;EACHC,UAAU;EACVC,UAAU;EACVC,qBAAqB;EACrBC,SAAS;EACTC,eAAe;EACfC,YAAY;EACZC;AACoB,CAAC,EA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AACC,GAAG,CAAEC,IAAI,iBAC9BvC,KAAA,CAAAwB,aAAA,CAACrB,SAAS;IACRqC,GAAG,EAAED,IAAI,CAACxB,EAAG;IACbwB,IAAI,EAAEA,IAAK;IACX9B,qBAAqB,EAAEA;EAAsB,CAC9C,CACF,CACC,CAAC;AAET","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"useColumnDefs.js","names":["useOsdkMetadata","useMemo","renderDefaultCell","shouldShowEditableCell","useColumnDefs","objectType","columnDefinitions","metadata","loading","error","columns","objectProperties","properties","getColumnsFromColumnDefinitions","getDefaultColumns","map","col","locator","width","minWidth","maxWidth","resizable","orderable","filterable","editable","renderCell","renderHeader","columnName","editFieldConfig","undefined","validateEdit","propertyMetadata","type","id","colKey","dataType","colDef","accessorKey","header","displayName","meta","isAsyncColumn","isVisible","size","minSize","maxSize","enableResizing","enableSorting","enableColumnFilter","cell","cellContext","object","row","original","table","options","isEditable","onCellEdit","isInEditMode","Object","entries","key","property"],"sources":["useColumnDefs.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 ObjectMetadata,\n ObjectOrInterfaceDefinition,\n Osdk,\n PropertyKeys,\n QueryDefinition,\n SimplePropertyDef,\n} from \"@osdk/api\";\nimport { useOsdkMetadata } from \"@osdk/react\";\nimport type { AccessorColumnDef } from \"@tanstack/react-table\";\nimport { useMemo } from \"react\";\nimport { renderDefaultCell } from \"../DefaultCellRenderer.js\";\nimport type { ColumnDefinition } from \"../ObjectTableApi.js\";\nimport { shouldShowEditableCell } from \"../utils/shouldShowEditableCell.js\";\n\ninterface UseColumnDefsResult<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n> {\n columns: AccessorColumnDef<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>\n >[];\n\n loading: boolean;\n\n error: string | undefined;\n}\n\n/**\n * Hook which builds column definitions for tanstack-table given the objectSet\n */\nexport function useColumnDefs<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<\n string,\n never\n >,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n>(\n objectType: Q,\n columnDefinitions?: Array<ColumnDefinition<Q, RDPs, FunctionColumns>>,\n): UseColumnDefsResult<Q, RDPs> {\n const { metadata, loading, error } = useOsdkMetadata(objectType);\n\n const columns: AccessorColumnDef<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>\n >[] = useMemo(() => {\n const objectProperties = metadata?.properties;\n // If columnDefinitions is provided, construct colDefs with it\n if (columnDefinitions) {\n return getColumnsFromColumnDefinitions<Q, RDPs, FunctionColumns>(\n columnDefinitions,\n objectProperties,\n );\n }\n\n // If not, return the default columns from the object properties\n return getDefaultColumns<Q, RDPs>(objectProperties);\n }, [columnDefinitions, metadata?.properties]);\n\n return { columns, loading, error };\n}\n\nfunction getColumnsFromColumnDefinitions<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<\n string,\n never\n >,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n>(\n columnDefinitions: Array<ColumnDefinition<Q, RDPs, FunctionColumns>>,\n objectProperties?: Record<any, ObjectMetadata.Property>,\n): Array<\n AccessorColumnDef<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>\n >\n> {\n return columnDefinitions.map((col) => {\n const {\n locator,\n width,\n minWidth,\n maxWidth,\n resizable,\n orderable,\n filterable,\n editable,\n renderCell,\n renderHeader,\n columnName,\n } = col;\n\n const editFieldConfig = col.editable ? col.editFieldConfig : undefined;\n const validateEdit = col.editable ? col.validateEdit : undefined;\n\n const propertyMetadata = locator.type === \"property\"\n ? objectProperties?.[locator.id]\n : undefined;\n\n const colKey = locator.id as string;\n\n const dataType =\n propertyMetadata?.type && typeof propertyMetadata.type === \"string\"\n ? propertyMetadata.type\n : undefined;\n\n const colDef: AccessorColumnDef<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>\n > = {\n id: colKey,\n accessorKey: colKey,\n header: renderHeader ?? (columnName || propertyMetadata?.displayName),\n meta: {\n columnName: columnName || propertyMetadata?.displayName,\n isAsyncColumn: locator.type === \"function\",\n isVisible: col.isVisible !== false,\n editable,\n editFieldConfig,\n dataType,\n validateEdit,\n },\n size: width,\n ...(minWidth ? { minSize: minWidth } : {}),\n ...(maxWidth ? { maxSize: maxWidth } : {}),\n enableResizing: resizable,\n // Function-backed columns must be sorted on the frontend, so disable sorting for now\n enableSorting: locator.type === \"function\" ? false : orderable,\n enableColumnFilter: filterable,\n cell: (cellContext) => {\n const object: Osdk.Instance<\n Q,\n \"$allBaseProperties\",\n PropertyKeys<Q>,\n RDPs\n > = cellContext.row.original;\n\n const meta = cellContext.table.options.meta;\n const isEditable = shouldShowEditableCell(\n editable,\n meta?.onCellEdit,\n meta?.isInEditMode,\n );\n\n if (renderCell && !isEditable) {\n return renderCell(object, locator);\n }\n\n return renderDefaultCell(cellContext);\n },\n };\n\n return colDef;\n });\n}\n\nfunction getDefaultColumns<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<\n string,\n never\n >,\n>(\n objectProperties?: Record<any, ObjectMetadata.Property>,\n): Array<\n AccessorColumnDef<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>\n >\n> {\n if (!objectProperties) return [];\n\n return Object.entries(objectProperties).map(([key, property]) => {\n const colDef: AccessorColumnDef<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>\n > = {\n accessorKey: key,\n header: property.displayName ?? key,\n };\n return colDef;\n });\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA,SAASA,eAAe,QAAQ,aAAa;AAE7C,SAASC,OAAO,QAAQ,OAAO;AAC/B,SAASC,iBAAiB,QAAQ,2BAA2B;AAE7D,SAASC,sBAAsB,QAAQ,oCAAoC;AAe3E;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAW3BC,UAAa,EACbC,iBAAqE,EACvC;EAC9B,MAAM;IAAEC,QAAQ;IAAEC,OAAO;IAAEC;EAAM,CAAC,GAAGT,eAAe,CAACK,UAAU,CAAC;EAEhE,MAAMK,OAEH,GAAGT,OAAO,CAAC,MAAM;IAClB,MAAMU,gBAAgB,GAAGJ,QAAQ,EAAEK,UAAU;IAC7C;IACA,IAAIN,iBAAiB,EAAE;MACrB,OAAOO,+BAA+B,CACpCP,iBAAiB,EACjBK,gBACF,CAAC;IACH;;IAEA;IACA,OAAOG,iBAAiB,CAAUH,gBAAgB,CAAC;EACrD,CAAC,EAAE,CAACL,iBAAiB,EAAEC,QAAQ,EAAEK,UAAU,CAAC,CAAC;EAE7C,OAAO;IAAEF,OAAO;IAAEF,OAAO;IAAEC;EAAM,CAAC;AACpC;AAEA,SAASI,+BAA+BA,CAWtCP,iBAAoE,EACpEK,gBAAuD,EAKvD;EACA,OAAOL,iBAAiB,CAACS,GAAG,CAAEC,GAAG,IAAK;IACpC,MAAM;MACJC,OAAO;MACPC,KAAK;MACLC,QAAQ;MACRC,QAAQ;MACRC,SAAS;MACTC,SAAS;MACTC,UAAU;MACVC,QAAQ;MACRC,UAAU;MACVC,YAAY;MACZC;IACF,CAAC,GAAGX,GAAG;IAEP,MAAMY,eAAe,GAAGZ,GAAG,CAACQ,QAAQ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CAACE,GAAG,CAACC,QAAQ;QAE5B,MAAMb,IAAI,GAAGU,WAAW,CAACI,KAAK,CAACC,OAAO,CAACf,IAAI;QAC3C,MAAMgB,UAAU,GAAGrD,sBAAsB,CACvCqB,QAAQ,EACRgB,IAAI,EAAEiB,UAAU,EAChBjB,IAAI,EAAEkB,YACR,CAAC;QAED,IAAIjC,UAAU,IAAI,CAAC+B,UAAU,EAAE;UAC7B,OAAO/B,UAAU,CAAC0B,MAAM,EAAElC,OAAO,CAAC;QACpC;QAEA,OAAOf,iBAAiB,CAACgD,WAAW,CAAC;MACvC;IACF,CAAC;IAED,OAAOd,MAAM;EACf,CAAC,CAAC;AACJ;AAEA,SAAStB,iBAAiBA,CAOxBH,gBAAuD,EAKvD;EACA,IAAI,CAACA,gBAAgB,EAAE,OAAO,EAAE;EAEhC,OAAOgD,MAAM,CAACC,OAAO,CAACjD,gBAAgB,CAAC,CAACI,GAAG,CAAC,CAAC,CAAC8C,GAAG,EAAEC,QAAQ,CAAC,KAAK;IAC/D,MAAM1B,MAEL,GAAG;MACFC,WAAW,EAAEwB,GAAG;MAChBvB,MAAM,EAAEwB,QAAQ,CAACvB,WAAW,IAAIsB;IAClC,CAAC;IACD,OAAOzB,MAAM;EACf,CAAC,CAAC;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"useColumnDefs.js","names":["useOsdkMetadata","useMemo","renderDefaultCell","shouldShowEditableCell","useColumnDefs","objectType","columnDefinitions","metadata","loading","error","columns","objectProperties","properties","getColumnsFromColumnDefinitions","getDefaultColumns","map","col","locator","width","minWidth","maxWidth","resizable","orderable","filterable","editable","renderCell","renderHeader","columnName","editFieldConfig","undefined","validateEdit","propertyMetadata","type","id","colKey","dataType","colDef","accessorKey","header","displayName","meta","isAsyncColumn","isVisible","size","minSize","maxSize","enableResizing","enableSorting","enableColumnFilter","cell","cellContext","object","row","original","table","options","isEditable","onCellEdit","isInEditMode","Object","entries","key","property"],"sources":["useColumnDefs.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 ObjectMetadata,\n ObjectOrInterfaceDefinition,\n Osdk,\n PropertyKeys,\n QueryDefinition,\n SimplePropertyDef,\n} from \"@osdk/api\";\nimport { useOsdkMetadata } from \"@osdk/react\";\nimport type { AccessorColumnDef } from \"@tanstack/react-table\";\nimport { useMemo } from \"react\";\nimport { renderDefaultCell } from \"../DefaultCellRenderer.js\";\nimport type { ColumnDefinition } from \"../ObjectTableApi.js\";\nimport { shouldShowEditableCell } from \"../utils/shouldShowEditableCell.js\";\n\ninterface UseColumnDefsResult<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n> {\n columns: AccessorColumnDef<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>\n >[];\n\n loading: boolean;\n\n error: string | undefined;\n}\n\n/**\n * Hook which builds column definitions for tanstack-table given the objectSet\n */\nexport function useColumnDefs<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<\n string,\n never\n >,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n>(\n objectType: Q,\n columnDefinitions?: Array<ColumnDefinition<Q, RDPs, FunctionColumns>>,\n): UseColumnDefsResult<Q, RDPs> {\n const { metadata, loading, error } = useOsdkMetadata(objectType);\n\n const columns: AccessorColumnDef<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>\n >[] = useMemo(() => {\n const objectProperties = metadata?.properties;\n // If columnDefinitions is provided, construct colDefs with it\n if (columnDefinitions) {\n return getColumnsFromColumnDefinitions<Q, RDPs, FunctionColumns>(\n columnDefinitions,\n objectProperties,\n );\n }\n\n // If not, return the default columns from the object properties\n return getDefaultColumns<Q, RDPs>(objectProperties);\n }, [columnDefinitions, metadata?.properties]);\n\n return { columns, loading, error };\n}\n\nfunction getColumnsFromColumnDefinitions<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<\n string,\n never\n >,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n>(\n columnDefinitions: Array<ColumnDefinition<Q, RDPs, FunctionColumns>>,\n objectProperties?: Record<any, ObjectMetadata.Property>,\n): Array<\n AccessorColumnDef<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>\n >\n> {\n return columnDefinitions.map((col) => {\n const {\n locator,\n width,\n minWidth,\n maxWidth,\n resizable,\n orderable,\n filterable,\n editable,\n renderCell,\n renderHeader,\n columnName,\n } = col;\n\n const editFieldConfig = col.editable ? col.editFieldConfig : undefined;\n const validateEdit = col.editable ? col.validateEdit : undefined;\n\n const propertyMetadata = locator.type === \"property\"\n ? objectProperties?.[locator.id]\n : undefined;\n\n const colKey = locator.id as string;\n\n const dataType =\n propertyMetadata?.type && typeof propertyMetadata.type === \"string\"\n ? propertyMetadata.type\n : undefined;\n\n const colDef: AccessorColumnDef<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>\n > = {\n id: colKey,\n accessorKey: colKey,\n header: renderHeader ?? (columnName || propertyMetadata?.displayName),\n meta: {\n columnName: columnName || propertyMetadata?.displayName,\n isAsyncColumn: locator.type === \"function\",\n isVisible: col.isVisible !== false,\n editable,\n editFieldConfig,\n dataType,\n validateEdit,\n },\n size: width,\n ...(minWidth ? { minSize: minWidth } : {}),\n ...(maxWidth ? { maxSize: maxWidth } : {}),\n enableResizing: resizable,\n // Function-backed columns must be sorted on the frontend, so disable sorting for now\n enableSorting: locator.type === \"function\" ? false : orderable,\n enableColumnFilter: filterable,\n cell: (cellContext) => {\n const object: Osdk.Instance<\n Q,\n \"$allBaseProperties\",\n PropertyKeys<Q>,\n RDPs\n > = cellContext.row.original;\n\n const meta = cellContext.table.options.meta;\n const isEditable = shouldShowEditableCell<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>\n >(\n editable,\n meta?.onCellEdit,\n meta?.isInEditMode,\n );\n\n if (renderCell && !isEditable) {\n return renderCell(object, locator);\n }\n\n return renderDefaultCell(cellContext);\n },\n };\n\n return colDef;\n });\n}\n\nfunction getDefaultColumns<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<\n string,\n never\n >,\n>(\n objectProperties?: Record<any, ObjectMetadata.Property>,\n): Array<\n AccessorColumnDef<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>\n >\n> {\n if (!objectProperties) return [];\n\n return Object.entries(objectProperties).map(([key, property]) => {\n const colDef: AccessorColumnDef<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>\n > = {\n accessorKey: key,\n header: property.displayName ?? key,\n };\n return colDef;\n });\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA,SAASA,eAAe,QAAQ,aAAa;AAE7C,SAASC,OAAO,QAAQ,OAAO;AAC/B,SAASC,iBAAiB,QAAQ,2BAA2B;AAE7D,SAASC,sBAAsB,QAAQ,oCAAoC;AAe3E;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAW3BC,UAAa,EACbC,iBAAqE,EACvC;EAC9B,MAAM;IAAEC,QAAQ;IAAEC,OAAO;IAAEC;EAAM,CAAC,GAAGT,eAAe,CAACK,UAAU,CAAC;EAEhE,MAAMK,OAEH,GAAGT,OAAO,CAAC,MAAM;IAClB,MAAMU,gBAAg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C,GAAG,EAAEC,QAAQ,CAAC,KAAK;IAC/D,MAAM1B,MAEL,GAAG;MACFC,WAAW,EAAEwB,GAAG;MAChBvB,MAAM,EAAEwB,QAAQ,CAACvB,WAAW,IAAIsB;IAClC,CAAC;IACD,OAAOzB,MAAM;EACf,CAAC,CAAC;AACJ","ignoreList":[]}
@@ -0,0 +1,39 @@
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
+ /**
18
+ * Whether a column declares any editing behavior.
19
+ *
20
+ * Returns `true` when `editable` is `true` or a predicate function. The
21
+ * predicate may still return `false` for individual rows — that decision is
22
+ * made per-cell via {@link isCellEditable}. This function answers the
23
+ * column-level question used to drive table-wide UI like the bottom edit bar.
24
+ */
25
+ export function isColumnDeclaredEditable(editable) {
26
+ return editable === true || typeof editable === "function";
27
+ }
28
+
29
+ /**
30
+ * Whether a specific cell is editable, given the column's `editable` value
31
+ * and the row's object. Used at render time per cell.
32
+ */
33
+ export function isCellEditable(editable, object) {
34
+ if (typeof editable === "function") {
35
+ return editable(object);
36
+ }
37
+ return editable === true;
38
+ }
39
+ //# sourceMappingURL=editableUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editableUtils.js","names":["isColumnDeclaredEditable","editable","isCellEditable","object"],"sources":["editableUtils.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 { RowData } from \"@tanstack/react-table\";\n\nexport type EditablePredicate<TData extends RowData = RowData> =\n | boolean\n | ((object: TData) => boolean);\n\n/**\n * Whether a column declares any editing behavior.\n *\n * Returns `true` when `editable` is `true` or a predicate function. The\n * predicate may still return `false` for individual rows — that decision is\n * made per-cell via {@link isCellEditable}. This function answers the\n * column-level question used to drive table-wide UI like the bottom edit bar.\n */\nexport function isColumnDeclaredEditable<TData extends RowData>(\n editable: EditablePredicate<TData> | undefined,\n): boolean {\n return editable === true || typeof editable === \"function\";\n}\n\n/**\n * Whether a specific cell is editable, given the column's `editable` value\n * and the row's object. Used at render time per cell.\n */\nexport function isCellEditable<TData extends RowData>(\n editable: EditablePredicate<TData> | undefined,\n object: TData,\n): boolean {\n if (typeof editable === \"function\") {\n return editable(object);\n }\n return editable === true;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,wBAAwBA,CACtCC,QAA8C,EACrC;EACT,OAAOA,QAAQ,KAAK,IAAI,IAAI,OAAOA,QAAQ,KAAK,UAAU;AAC5D;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAC5BD,QAA8C,EAC9CE,MAAa,EACJ;EACT,IAAI,OAAOF,QAAQ,KAAK,UAAU,EAAE;IAClC,OAAOA,QAAQ,CAACE,MAAM,CAAC;EACzB;EACA,OAAOF,QAAQ,KAAK,IAAI;AAC1B","ignoreList":[]}
@@ -23,6 +23,6 @@
23
23
  * @returns true if the cell should be rendered with edit controls
24
24
  */
25
25
  export function shouldShowEditableCell(editable, onCellEdit, isInEditMode) {
26
- return editable === true && onCellEdit != null && isInEditMode === true;
26
+ return editable != null && editable !== false && onCellEdit != null && isInEditMode === true;
27
27
  }
28
28
  //# sourceMappingURL=shouldShowEditableCell.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shouldShowEditableCell.js","names":["shouldShowEditableCell","editable","onCellEdit","isInEditMode"],"sources":["shouldShowEditableCell.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/**\n * Determines if a cell should be rendered as editable\n *\n * @param editable - Whether the column is marked as editable\n * @param onCellEdit - The onCellEdit callback from table meta (indicates edit handlers exist)\n * @param isInEditMode - Whether the table is currently in edit mode\n * @returns true if the cell should be rendered with edit controls\n */\nexport function shouldShowEditableCell(\n editable: boolean | undefined,\n onCellEdit: unknown,\n isInEditMode: boolean | undefined,\n): boolean {\n return editable === true\n && onCellEdit != null\n && isInEditMode === true;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,sBAAsBA,CACpCC,QAA6B,EAC7BC,UAAmB,EACnBC,YAAiC,EACxB;EACT,OAAOF,QAAQ,KAAK,IAAI,IACnBC,UAAU,IAAI,IAAI,IAClBC,YAAY,KAAK,IAAI;AAC5B","ignoreList":[]}
1
+ {"version":3,"file":"shouldShowEditableCell.js","names":["shouldShowEditableCell","editable","onCellEdit","isInEditMode"],"sources":["shouldShowEditableCell.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 { EditablePredicate } from \"./editableUtils.js\";\n\n/**\n * Determines if a cell should be rendered as editable\n *\n * @param editable - Whether the column is marked as editable\n * @param onCellEdit - The onCellEdit callback from table meta (indicates edit handlers exist)\n * @param isInEditMode - Whether the table is currently in edit mode\n * @returns true if the cell should be rendered with edit controls\n */\nexport function shouldShowEditableCell<TData>(\n editable: EditablePredicate<TData> | undefined,\n onCellEdit: unknown,\n isInEditMode: boolean | undefined,\n): boolean {\n return editable != null\n && editable !== false\n && onCellEdit != null\n && isInEditMode === true;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,sBAAsBA,CACpCC,QAA8C,EAC9CC,UAAmB,EACnBC,YAAiC,EACxB;EACT,OAAOF,QAAQ,IAAI,IAAI,IAClBA,QAAQ,KAAK,KAAK,IAClBC,UAAU,IAAI,IAAI,IAClBC,YAAY,KAAK,IAAI;AAC5B","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["types.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 { RowData } from \"@tanstack/react-table\";\n\nexport interface ColumnOption {\n id: string;\n name: string;\n canSort: boolean;\n}\n\nexport interface CellIdentifier {\n rowId: string;\n columnId: string;\n}\n\nexport interface CellEditInfo<\n TData extends RowData = unknown,\n CellValue = unknown,\n> extends CellIdentifier {\n newValue: CellValue | null;\n oldValue: CellValue | null;\n originalRowData: TData;\n}\n\nexport type EditModeState =\n | { type: \"always\"; isActive: true }\n | { type: \"manual\"; isActive: boolean; setActive: (value: boolean) => void };\n\nexport interface EditableConfig<\n TData extends RowData = unknown,\n CellValue = unknown,\n> {\n cellEdits: Record<string, CellEditInfo<TData, CellValue>>;\n onCellEdit: (\n cellId: string,\n info: CellEditInfo<TData, CellValue>,\n ) => void;\n onSubmitEdits?: () => Promise<boolean>;\n clearEdits: () => void;\n editModeState: EditModeState;\n onCellValidationError: (\n cellId: string,\n error: string,\n ) => void;\n validationErrors: Map<string, string>;\n clearCellValidationError: (cellId: string) => void;\n}\n\n/**\n * User-facing configuration for a dropdown editor in a table cell.\n *\n * This is intentionally a standalone interface rather than re-exporting\n * `DropdownFieldProps` from ActionForm, so the table API doesn't break\n * when ActionForm's prop shape changes (e.g. adding form-specific fields).\n */\nexport interface DropdownEditConfig<V = unknown> {\n /**\n * Available items for the dropdown.\n */\n items: V[];\n\n /**\n * Converts an item to a display string. Defaults to `String()`.\n */\n itemToStringLabel?: (item: V) => string;\n\n /**\n * Returns a unique string key for a list item. Used as the React `key`.\n * Falls back to the item's index when not provided.\n */\n itemToKey?: (item: V) => string;\n\n /**\n * Custom equality check for item values. Defaults to `Object.is`.\n * Required when items are objects to ensure correct selection matching.\n */\n isItemEqual?: (a: V, b: V) => boolean;\n\n /**\n * Whether the dropdown allows searching/filtering.\n * When true, renders a Combobox with a search input.\n * When false (default), renders a Select dropdown.\n */\n isSearchable?: boolean;\n\n /**\n * Placeholder text shown when no value is selected.\n */\n placeholder?: string;\n\n /**\n * Whether multiple values can be selected.\n */\n isMultiple?: boolean;\n}\n\n/**\n * User-facing configuration for a date picker editor in a table cell.\n *\n * This is intentionally a standalone interface rather than re-exporting\n * `DatetimePickerFieldProps` from ActionForm, so the table API doesn't break\n * when ActionForm's prop shape changes.\n */\nexport interface DatePickerEditConfig {\n /**\n * The earliest date the user can select.\n */\n min?: Date;\n\n /**\n * The latest date the user can select.\n */\n max?: Date;\n\n /**\n * Whether to show a time picker alongside the calendar.\n */\n showTime?: boolean;\n\n /**\n * Whether to close the popover after selecting a date.\n * @default true when `showTime` is false, false when `showTime` is true\n */\n closeOnSelection?: boolean;\n\n /**\n * Placeholder text shown when no value is selected.\n */\n placeholder?: string;\n\n /**\n * Formats a Date for display in the input field when not editing.\n * Provide a matching `parseDate` if using a custom format.\n */\n formatDate?: (date: Date) => string;\n\n /**\n * Parses a user-typed string back into a Date.\n * Must be the inverse of `formatDate`.\n */\n parseDate?: (text: string) => Date | undefined;\n}\n\n/**\n * Maps each supported editable field component to its user-facing config.\n */\ninterface EditFieldPropsByType {\n DROPDOWN: DropdownEditConfig;\n DATE_PICKER: DatePickerEditConfig;\n}\n\ntype EditFieldComponent = keyof EditFieldPropsByType;\n\n/**\n * Configuration for an editable cell's field component.\n *\n * @example\n * ```ts\n * editFieldConfig: {\n * fieldComponent: \"DROPDOWN\",\n * fieldComponentProps: {\n * items: [\"Active\", \"Inactive\", \"Pending\"],\n * },\n * }\n * ```\n */\nexport type EditFieldConfig = {\n [K in EditFieldComponent]: {\n fieldComponent: K;\n fieldComponentProps: EditFieldPropsByType[K];\n };\n}[EditFieldComponent];\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["types.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 { RowData } from \"@tanstack/react-table\";\n\nexport interface ColumnOption {\n id: string;\n name: string;\n canSort: boolean;\n}\n\nexport interface CellIdentifier {\n rowId: string;\n columnId: string;\n}\n\nexport interface CellEditInfo<\n TData extends RowData = unknown,\n CellValue = unknown,\n> extends CellIdentifier {\n newValue: CellValue | null;\n oldValue: CellValue | null;\n originalRowData: TData;\n}\n\nexport type EditModeState =\n | { type: \"always\"; isActive: true }\n | { type: \"manual\"; isActive: boolean; setActive: (value: boolean) => void };\n\nexport interface EditableConfig<\n TData extends RowData = unknown,\n CellValue = unknown,\n> {\n cellEdits: Record<string, CellEditInfo<TData, CellValue>>;\n onCellEdit: (\n cellId: string,\n info: CellEditInfo<TData, CellValue>,\n ) => void;\n onSubmitEdits?: () => Promise<boolean>;\n clearEdits: () => void;\n editModeState: EditModeState;\n onCellValidationError: (\n cellId: string,\n error: string,\n ) => void;\n validationErrors: Map<string, string>;\n clearCellValidationError: (cellId: string) => void;\n}\n\n/**\n * User-facing configuration for a dropdown editor in a table cell.\n *\n * This is intentionally a standalone interface rather than re-exporting\n * `DropdownFieldProps` from ActionForm, so the table API doesn't break\n * when ActionForm's prop shape changes (e.g. adding form-specific fields).\n */\nexport interface DropdownEditConfig<V = unknown> {\n /**\n * Available items for the dropdown.\n */\n items: V[];\n\n /**\n * Converts an item to a display string. Defaults to `String()`.\n */\n itemToStringLabel?: (item: V) => string;\n\n /**\n * Returns a unique string key for a list item. Used as the React `key`.\n * Falls back to the item's index when not provided.\n */\n itemToKey?: (item: V) => string;\n\n /**\n * Custom equality check for item values. Defaults to `Object.is`.\n * Required when items are objects to ensure correct selection matching.\n */\n isItemEqual?: (a: V, b: V) => boolean;\n\n /**\n * Whether the dropdown allows searching/filtering.\n * When true, renders a Combobox with a search input.\n * When false (default), renders a Select dropdown.\n */\n isSearchable?: boolean;\n\n /**\n * Placeholder text shown when no value is selected.\n */\n placeholder?: string;\n\n /**\n * Whether multiple values can be selected.\n */\n isMultiple?: boolean;\n}\n\n/**\n * User-facing configuration for a date picker editor in a table cell.\n *\n * This is intentionally a standalone interface rather than re-exporting\n * `DatetimePickerFieldProps` from ActionForm, so the table API doesn't break\n * when ActionForm's prop shape changes.\n */\nexport interface DatePickerEditConfig {\n /**\n * The earliest date the user can select.\n */\n min?: Date;\n\n /**\n * The latest date the user can select.\n */\n max?: Date;\n\n /**\n * Whether to show a time picker alongside the calendar.\n */\n showTime?: boolean;\n\n /**\n * Whether to close the popover after selecting a date.\n * @default true when `showTime` is false, false when `showTime` is true\n */\n closeOnSelection?: boolean;\n\n /**\n * Placeholder text shown when no value is selected.\n */\n placeholder?: string;\n\n /**\n * Formats a Date for display in the input field when not editing.\n * Provide a matching `parseDate` if using a custom format.\n */\n formatDate?: (date: Date) => string;\n\n /**\n * Parses a user-typed string back into a Date.\n * Must be the inverse of `formatDate`.\n */\n parseDate?: (text: string) => Date | undefined;\n}\n\n/**\n * Maps each supported editable field component to its user-facing config.\n */\ninterface EditFieldPropsByType {\n DROPDOWN: DropdownEditConfig;\n DATE_PICKER: DatePickerEditConfig;\n}\n\ntype EditFieldComponent = keyof EditFieldPropsByType;\n\n/**\n * Configuration for an editable cell's field component.\n *\n * `getFieldComponentProps` is called with the row's object so the configuration\n * can vary per row (e.g. dropdown items that depend on row state).\n */\nexport type EditFieldConfig<TData = unknown> = {\n [K in EditFieldComponent]: {\n fieldComponent: K;\n getFieldComponentProps: (object: TData) => EditFieldPropsByType[K];\n };\n}[EditFieldComponent];\n"],"mappings":"","ignoreList":[]}
@@ -24,6 +24,21 @@
24
24
  );
25
25
  --osdk-button-secondary-border-color: var(--osdk-surface-border-color-default);
26
26
 
27
+ /* Minimal Button */
28
+ --osdk-button-minimal-bg: transparent;
29
+ --osdk-button-minimal-bg-hover: var(
30
+ --osdk-surface-background-color-default-hover
31
+ );
32
+ --osdk-button-minimal-bg-active: var(
33
+ --osdk-surface-background-color-default-active
34
+ );
35
+ --osdk-button-minimal-border: none;
36
+ --osdk-button-minimal-shadow: none;
37
+ --osdk-button-secondary-minimal-color: var(
38
+ --osdk-typography-color-default-rest
39
+ );
40
+ --osdk-button-primary-minimal-color: var(--osdk-button-primary-bg);
41
+
27
42
  /* Success Button */
28
43
  --osdk-button-success-color: var(--osdk-intent-success-foreground);
29
44
  --osdk-button-success-bg: var(--osdk-intent-success-rest);
@@ -0,0 +1,9 @@
1
+ :root {
2
+ /* Combobox popup: cap the dropdown's max-height so very long option lists
3
+ scroll inside the popup instead of forcing the popup to grow tall enough
4
+ to push other UI off-screen. The actual `max-height` rule uses
5
+ `min(this token, --available-height)` — `--available-height` is set
6
+ automatically by Base UI's `Combobox.Positioner` (same source as
7
+ `--anchor-width`) so the cap is automatically lowered on short viewports. */
8
+ --osdk-combobox-popup-max-height: 320px;
9
+ }
@@ -11,7 +11,7 @@
11
11
 
12
12
  /* Calendar */
13
13
  --osdk-datetime-calendar-font-family: var(--osdk-typography-family-default);
14
- --osdk-datetime-calendar-font-size: var(--osdk-typography-size-body-small);
14
+ --osdk-datetime-calendar-font-size: var(--osdk-input-font-size);
15
15
  --osdk-datetime-calendar-cell-size: calc(var(--osdk-surface-spacing) * 8);
16
16
  --osdk-datetime-calendar-gap: 2px;
17
17
 
@@ -26,7 +26,7 @@
26
26
  /* Calendar weekday header */
27
27
  --osdk-datetime-calendar-weekday-color: var(--osdk-typography-color-muted);
28
28
  --osdk-datetime-calendar-weekday-font-size: var(
29
- --osdk-typography-size-body-x-small
29
+ --osdk-datetime-calendar-font-size
30
30
  );
31
31
 
32
32
  --osdk-datetime-calendar-day-color: var(--osdk-typography-color-default);
@@ -38,14 +38,4 @@
38
38
  --osdk-file-picker-trigger-border-color-error: var(
39
39
  --osdk-input-border-color-error
40
40
  );
41
-
42
- /* Browse button */
43
- --osdk-file-picker-browse-bg: var(--osdk-button-secondary-bg);
44
- --osdk-file-picker-browse-bg-hover: var(--osdk-button-secondary-bg-hover);
45
- --osdk-file-picker-browse-bg-active: var(--osdk-button-secondary-bg-active);
46
- --osdk-file-picker-browse-color: var(--osdk-button-secondary-color);
47
- --osdk-file-picker-browse-padding: calc(var(--osdk-surface-spacing) * 1.5)
48
- calc(var(--osdk-surface-spacing) * 3);
49
- --osdk-file-picker-browse-border-left: var(--osdk-input-border-width) solid
50
- var(--osdk-input-border-color);
51
41
  }
@@ -207,8 +207,15 @@
207
207
  --osdk-filter-listogram-label-color: var(
208
208
  --osdk-typography-color-default-rest
209
209
  );
210
- --osdk-filter-listogram-empty-label-color: var(--osdk-typography-color-muted);
211
- --osdk-filter-listogram-empty-label-font-style: italic;
210
+
211
+ /* Canonical "No value" tokens. Used by NoValueLabel everywhere.
212
+ Legacy --osdk-filter-listogram-empty-label-* and
213
+ --osdk-filter-null-label-* tokens are honored as opt-in overrides
214
+ by the per-container className passed to NoValueLabel; they are
215
+ not declared here so that the cascade does not cycle through them. */
216
+ --osdk-filter-no-value-color: var(--osdk-typography-color-muted);
217
+ --osdk-filter-no-value-font-style: italic;
218
+
212
219
  --osdk-filter-listogram-bar-height: calc(var(--osdk-surface-spacing) * 2);
213
220
  --osdk-filter-listogram-bar-width: calc(var(--osdk-surface-spacing) * 12.5);
214
221
  --osdk-filter-listogram-bar-bg: var(--osdk-palette-gray-100);
@@ -286,10 +293,6 @@
286
293
  --osdk-filter-null-row-padding: calc(var(--osdk-surface-spacing) * 1) 0;
287
294
  --osdk-filter-null-row-border-top: none;
288
295
  --osdk-filter-null-label-gap: var(--osdk-surface-spacing);
289
- --osdk-filter-null-label-font-family: var(--osdk-typography-family-default);
290
- --osdk-filter-null-label-font-size: var(--osdk-typography-size-body-medium);
291
- --osdk-filter-null-label-line-height: 1.4;
292
- --osdk-filter-null-label-color: var(--osdk-typography-color-default-rest);
293
296
  --osdk-filter-null-count-font-family: var(--osdk-typography-family-default);
294
297
  --osdk-filter-null-count-font-size: var(--osdk-typography-size-body-small);
295
298
  --osdk-filter-null-count-color: var(--osdk-typography-color-muted);
@@ -48,7 +48,7 @@
48
48
  --osdk-form-section-content-padding-inline: calc(
49
49
  var(--osdk-surface-spacing) * 2.5
50
50
  );
51
- --osdk-form-section-field-gap: var(--osdk-form-field-gap);
51
+ --osdk-form-section-field-gap: var(--osdk-form-fields-gap);
52
52
  --osdk-form-section-grid-column-gap: calc(var(--osdk-surface-spacing) * 4);
53
53
 
54
54
  /* Minimal style */