@osdk/react-components 0.2.0-beta.1 → 0.2.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (330) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +21 -5
  3. package/build/browser/base-components/action-button/ActionButton.js +31 -0
  4. package/build/browser/base-components/action-button/ActionButton.js.map +1 -0
  5. package/build/browser/base-components/action-button/ActionButton.module.css +70 -0
  6. package/build/browser/base-components/action-button/ActionButton.module.css.js +8 -0
  7. package/build/browser/base-components/checkbox/Checkbox.js +27 -32
  8. package/build/browser/base-components/checkbox/Checkbox.module.css +79 -0
  9. package/build/browser/base-components/checkbox/Checkbox.module.css.js +7 -0
  10. package/build/browser/base-components/combobox/Combobox.js +124 -0
  11. package/build/browser/base-components/combobox/Combobox.js.map +1 -0
  12. package/build/browser/base-components/combobox/Combobox.module.css +177 -0
  13. package/build/browser/base-components/combobox/Combobox.module.css.js +16 -0
  14. package/build/browser/base-components/dialog/Dialog.js +52 -0
  15. package/build/browser/base-components/dialog/Dialog.js.map +1 -0
  16. package/build/browser/base-components/dialog/Dialog.module.css +101 -0
  17. package/build/browser/base-components/dialog/Dialog.module.css.js +13 -0
  18. package/build/browser/base-components/draggable-list/DraggableList.js +155 -0
  19. package/build/browser/base-components/draggable-list/DraggableList.js.map +1 -0
  20. package/build/browser/base-components/draggable-list/DraggableList.module.css +108 -0
  21. package/build/browser/base-components/draggable-list/DraggableList.module.css.js +11 -0
  22. package/build/browser/base-components/search-bar/SearchBar.js +44 -0
  23. package/build/browser/base-components/search-bar/SearchBar.js.map +1 -0
  24. package/build/browser/base-components/search-bar/SearchBar.module.css +53 -0
  25. package/build/browser/base-components/search-bar/SearchBar.module.css.js +8 -0
  26. package/build/browser/base-components/select/Select.js +89 -0
  27. package/build/browser/base-components/select/Select.js.map +1 -0
  28. package/build/browser/base-components/select/Select.module.css +138 -0
  29. package/build/browser/base-components/select/Select.module.css.js +11 -0
  30. package/build/browser/base-components/switch/Switch.js +33 -0
  31. package/build/browser/base-components/switch/Switch.js.map +1 -0
  32. package/build/browser/base-components/switch/Switch.module.css +91 -0
  33. package/build/browser/base-components/switch/Switch.module.css.js +7 -0
  34. package/build/browser/filter-list/FilterListApi.js.map +1 -1
  35. package/build/browser/filter-list/FilterListItemApi.js.map +1 -1
  36. package/build/browser/filter-list/__tests__/filterStateToWhereClause.test.js +296 -0
  37. package/build/browser/filter-list/__tests__/filterStateToWhereClause.test.js.map +1 -0
  38. package/build/browser/filter-list/__tests__/getFilterKey.test.js +53 -0
  39. package/build/browser/filter-list/__tests__/getFilterKey.test.js.map +1 -0
  40. package/build/browser/filter-list/__tests__/testUtils.js +192 -0
  41. package/build/browser/filter-list/__tests__/testUtils.js.map +1 -0
  42. package/build/browser/filter-list/hooks/__tests__/useFilterListState.test.js +128 -0
  43. package/build/browser/filter-list/hooks/__tests__/useFilterListState.test.js.map +1 -0
  44. package/build/browser/filter-list/hooks/useDebouncedValue.js +52 -0
  45. package/build/browser/filter-list/hooks/useDebouncedValue.js.map +1 -0
  46. package/build/browser/filter-list/hooks/useFilterListState.js +119 -0
  47. package/build/browser/filter-list/hooks/useFilterListState.js.map +1 -0
  48. package/build/browser/filter-list/hooks/usePropertyAggregation.js +92 -0
  49. package/build/browser/filter-list/hooks/usePropertyAggregation.js.map +1 -0
  50. package/build/browser/filter-list/types/AddFilterMenuTypes.js +2 -0
  51. package/build/browser/filter-list/types/AddFilterMenuTypes.js.map +1 -0
  52. package/build/browser/filter-list/types/CustomRendererTypes.js +2 -0
  53. package/build/browser/filter-list/types/CustomRendererTypes.js.map +1 -0
  54. package/build/browser/filter-list/types/KeywordSearchTypes.js +2 -0
  55. package/build/browser/filter-list/types/KeywordSearchTypes.js.map +1 -0
  56. package/build/browser/filter-list/types/LinkedFilterTypes.js +2 -0
  57. package/build/browser/filter-list/types/LinkedFilterTypes.js.map +1 -0
  58. package/build/browser/filter-list/types/index.js +21 -0
  59. package/build/browser/filter-list/types/index.js.map +1 -0
  60. package/build/browser/filter-list/utils/assertUnreachable.js +25 -0
  61. package/build/browser/filter-list/utils/assertUnreachable.js.map +1 -0
  62. package/build/browser/filter-list/utils/coerceFilterValue.js +33 -0
  63. package/build/browser/filter-list/utils/coerceFilterValue.js.map +1 -0
  64. package/build/browser/filter-list/utils/filterStateToWhereClause.js +337 -0
  65. package/build/browser/filter-list/utils/filterStateToWhereClause.js.map +1 -0
  66. package/build/browser/filter-list/utils/filterValues.js +55 -0
  67. package/build/browser/filter-list/utils/filterValues.js.map +1 -0
  68. package/build/browser/filter-list/utils/getFilterKey.js +34 -0
  69. package/build/browser/filter-list/utils/getFilterKey.js.map +1 -0
  70. package/build/browser/object-table/CellContextMenu.js +23 -20
  71. package/build/browser/object-table/CellContextMenu.module.css +20 -0
  72. package/build/browser/object-table/CellContextMenu.module.css.js +6 -0
  73. package/build/browser/object-table/ColumnConfigDialog.js +259 -0
  74. package/build/browser/object-table/ColumnConfigDialog.js.map +1 -0
  75. package/build/browser/object-table/ColumnConfigDialog.module.css +247 -0
  76. package/build/browser/object-table/ColumnConfigDialog.module.css.js +29 -0
  77. package/build/browser/object-table/LoadingCell.js +24 -29
  78. package/build/browser/object-table/LoadingCell.module.css +48 -0
  79. package/build/browser/object-table/LoadingCell.module.css.js +8 -0
  80. package/build/browser/object-table/LoadingRow.js +24 -50
  81. package/build/browser/object-table/LoadingStateTable.js +49 -343
  82. package/build/browser/object-table/LoadingStateTable.js.map +1 -1
  83. package/build/browser/object-table/MultiColumnSortDialog.js +178 -0
  84. package/build/browser/object-table/MultiColumnSortDialog.js.map +1 -0
  85. package/build/browser/object-table/MultiColumnSortDialog.module.css +195 -0
  86. package/build/browser/object-table/MultiColumnSortDialog.module.css.js +22 -0
  87. package/build/browser/object-table/NonIdealState.js +23 -20
  88. package/build/browser/object-table/NonIdealState.module.css +27 -0
  89. package/build/browser/object-table/NonIdealState.module.css.js +7 -0
  90. package/build/browser/object-table/ObjectTable.js +43 -13
  91. package/build/browser/object-table/ObjectTable.js.map +1 -1
  92. package/build/browser/object-table/ObjectTableApi.js.map +1 -1
  93. package/build/browser/object-table/SortableItemsList.js +35 -0
  94. package/build/browser/object-table/SortableItemsList.js.map +1 -0
  95. package/build/browser/object-table/Table.js +54 -934
  96. package/build/browser/object-table/Table.js.map +1 -1
  97. package/build/browser/object-table/Table.module.css +29 -0
  98. package/build/browser/object-table/Table.module.css.js +6 -0
  99. package/build/browser/object-table/TableBody.js +36 -260
  100. package/build/browser/object-table/TableBody.module.css +20 -0
  101. package/build/browser/object-table/TableBody.module.css.js +6 -0
  102. package/build/browser/object-table/TableCell.js +31 -111
  103. package/build/browser/object-table/TableCell.module.css +73 -0
  104. package/build/browser/object-table/TableCell.module.css.js +8 -0
  105. package/build/browser/object-table/TableHeader.js +126 -216
  106. package/build/browser/object-table/TableHeader.js.map +1 -1
  107. package/build/browser/object-table/TableHeader.module.css +106 -0
  108. package/build/browser/object-table/TableHeader.module.css.js +10 -0
  109. package/build/browser/object-table/TableHeaderContent.js +21 -18
  110. package/build/browser/object-table/TableHeaderContent.module.css +30 -0
  111. package/build/browser/object-table/TableHeaderContent.module.css.js +6 -0
  112. package/build/browser/object-table/TableHeaderWithPopover.js +110 -93
  113. package/build/browser/object-table/TableHeaderWithPopover.js.map +1 -1
  114. package/build/browser/object-table/TableHeaderWithPopover.module.css +141 -0
  115. package/build/browser/object-table/TableHeaderWithPopover.module.css.js +17 -0
  116. package/build/browser/object-table/TableRow.js +26 -144
  117. package/build/browser/object-table/TableRow.module.css +60 -0
  118. package/build/browser/object-table/TableRow.module.css.js +6 -0
  119. package/build/browser/object-table/hooks/__tests__/useColumnVisibility.test.js +160 -138
  120. package/build/browser/object-table/hooks/__tests__/useColumnVisibility.test.js.map +1 -1
  121. package/build/browser/object-table/hooks/__tests__/useRowSelection.test.js +3 -0
  122. package/build/browser/object-table/hooks/__tests__/useRowSelection.test.js.map +1 -1
  123. package/build/browser/object-table/hooks/__tests__/useSelectionColumn.test.js +27 -82
  124. package/build/browser/object-table/hooks/__tests__/useSelectionColumn.test.js.map +1 -1
  125. package/build/browser/object-table/hooks/__tests__/useTableSorting.test.js +290 -0
  126. package/build/browser/object-table/hooks/__tests__/useTableSorting.test.js.map +1 -1
  127. package/build/browser/object-table/hooks/useColumnDefs.js +7 -2
  128. package/build/browser/object-table/hooks/useColumnDefs.js.map +1 -1
  129. package/build/browser/object-table/hooks/useColumnResize.js +45 -0
  130. package/build/browser/object-table/hooks/useColumnResize.js.map +1 -0
  131. package/build/browser/object-table/hooks/useColumnVisibility.js +52 -20
  132. package/build/browser/object-table/hooks/useColumnVisibility.js.map +1 -1
  133. package/build/browser/object-table/hooks/useRowSelection.js +8 -7
  134. package/build/browser/object-table/hooks/useRowSelection.js.map +1 -1
  135. package/build/browser/object-table/hooks/useSelectionColumn.js +15 -6
  136. package/build/browser/object-table/hooks/useSelectionColumn.js.map +1 -1
  137. package/build/browser/object-table/utils/types.js +2 -0
  138. package/build/browser/object-table/utils/types.js.map +1 -0
  139. package/build/browser/public/experimental.js +1 -0
  140. package/build/browser/public/experimental.js.map +1 -1
  141. package/build/browser/styles.css +1875 -0
  142. package/build/cjs/public/experimental.cjs +1036 -197
  143. package/build/cjs/public/experimental.cjs.map +1 -1
  144. package/build/cjs/public/experimental.css +659 -29
  145. package/build/cjs/public/experimental.css.map +1 -1
  146. package/build/cjs/public/experimental.d.cts +435 -44
  147. package/build/esm/base-components/action-button/ActionButton.js +31 -0
  148. package/build/esm/base-components/action-button/ActionButton.js.map +1 -0
  149. package/build/esm/base-components/action-button/ActionButton.module.css +70 -0
  150. package/build/esm/base-components/checkbox/Checkbox.module.css +1 -1
  151. package/build/esm/base-components/combobox/Combobox.js +124 -0
  152. package/build/esm/base-components/combobox/Combobox.js.map +1 -0
  153. package/build/esm/base-components/combobox/Combobox.module.css +177 -0
  154. package/build/esm/base-components/dialog/Dialog.js +52 -0
  155. package/build/esm/base-components/dialog/Dialog.js.map +1 -0
  156. package/build/esm/base-components/dialog/Dialog.module.css +101 -0
  157. package/build/esm/base-components/draggable-list/DraggableList.js +155 -0
  158. package/build/esm/base-components/draggable-list/DraggableList.js.map +1 -0
  159. package/build/esm/base-components/draggable-list/DraggableList.module.css +108 -0
  160. package/build/esm/base-components/search-bar/SearchBar.js +44 -0
  161. package/build/esm/base-components/search-bar/SearchBar.js.map +1 -0
  162. package/build/esm/base-components/search-bar/SearchBar.module.css +53 -0
  163. package/build/esm/base-components/select/Select.js +89 -0
  164. package/build/esm/base-components/select/Select.js.map +1 -0
  165. package/build/esm/base-components/select/Select.module.css +138 -0
  166. package/build/esm/base-components/switch/Switch.js +33 -0
  167. package/build/esm/base-components/switch/Switch.js.map +1 -0
  168. package/build/esm/base-components/switch/Switch.module.css +91 -0
  169. package/build/esm/filter-list/FilterListApi.js.map +1 -1
  170. package/build/esm/filter-list/FilterListItemApi.js.map +1 -1
  171. package/build/esm/filter-list/__tests__/filterStateToWhereClause.test.js +296 -0
  172. package/build/esm/filter-list/__tests__/filterStateToWhereClause.test.js.map +1 -0
  173. package/build/esm/filter-list/__tests__/getFilterKey.test.js +53 -0
  174. package/build/esm/filter-list/__tests__/getFilterKey.test.js.map +1 -0
  175. package/build/esm/filter-list/__tests__/testUtils.js +192 -0
  176. package/build/esm/filter-list/__tests__/testUtils.js.map +1 -0
  177. package/build/esm/filter-list/hooks/__tests__/useFilterListState.test.js +128 -0
  178. package/build/esm/filter-list/hooks/__tests__/useFilterListState.test.js.map +1 -0
  179. package/build/esm/filter-list/hooks/useDebouncedValue.js +52 -0
  180. package/build/esm/filter-list/hooks/useDebouncedValue.js.map +1 -0
  181. package/build/esm/filter-list/hooks/useFilterListState.js +119 -0
  182. package/build/esm/filter-list/hooks/useFilterListState.js.map +1 -0
  183. package/build/esm/filter-list/hooks/usePropertyAggregation.js +92 -0
  184. package/build/esm/filter-list/hooks/usePropertyAggregation.js.map +1 -0
  185. package/build/esm/filter-list/types/AddFilterMenuTypes.js +2 -0
  186. package/build/esm/filter-list/types/AddFilterMenuTypes.js.map +1 -0
  187. package/build/esm/filter-list/types/CustomRendererTypes.js +2 -0
  188. package/build/esm/filter-list/types/CustomRendererTypes.js.map +1 -0
  189. package/build/esm/filter-list/types/KeywordSearchTypes.js +2 -0
  190. package/build/esm/filter-list/types/KeywordSearchTypes.js.map +1 -0
  191. package/build/esm/filter-list/types/LinkedFilterTypes.js +2 -0
  192. package/build/esm/filter-list/types/LinkedFilterTypes.js.map +1 -0
  193. package/build/esm/filter-list/types/index.js +21 -0
  194. package/build/esm/filter-list/types/index.js.map +1 -0
  195. package/build/esm/filter-list/utils/assertUnreachable.js +25 -0
  196. package/build/esm/filter-list/utils/assertUnreachable.js.map +1 -0
  197. package/build/esm/filter-list/utils/coerceFilterValue.js +33 -0
  198. package/build/esm/filter-list/utils/coerceFilterValue.js.map +1 -0
  199. package/build/esm/filter-list/utils/filterStateToWhereClause.js +337 -0
  200. package/build/esm/filter-list/utils/filterStateToWhereClause.js.map +1 -0
  201. package/build/esm/filter-list/utils/filterValues.js +55 -0
  202. package/build/esm/filter-list/utils/filterValues.js.map +1 -0
  203. package/build/esm/filter-list/utils/getFilterKey.js +34 -0
  204. package/build/esm/filter-list/utils/getFilterKey.js.map +1 -0
  205. package/build/esm/object-table/ColumnConfigDialog.js +259 -0
  206. package/build/esm/object-table/ColumnConfigDialog.js.map +1 -0
  207. package/build/esm/object-table/ColumnConfigDialog.module.css +247 -0
  208. package/build/esm/object-table/LoadingStateTable.js +4 -4
  209. package/build/esm/object-table/LoadingStateTable.js.map +1 -1
  210. package/build/esm/object-table/MultiColumnSortDialog.js +178 -0
  211. package/build/esm/object-table/MultiColumnSortDialog.js.map +1 -0
  212. package/build/esm/object-table/MultiColumnSortDialog.module.css +195 -0
  213. package/build/esm/object-table/NonIdealState.module.css +2 -3
  214. package/build/esm/object-table/ObjectTable.js +43 -13
  215. package/build/esm/object-table/ObjectTable.js.map +1 -1
  216. package/build/esm/object-table/ObjectTableApi.js.map +1 -1
  217. package/build/esm/object-table/SortableItemsList.js +35 -0
  218. package/build/esm/object-table/SortableItemsList.js.map +1 -0
  219. package/build/esm/object-table/Table.js +9 -7
  220. package/build/esm/object-table/Table.js.map +1 -1
  221. package/build/esm/object-table/Table.module.css +9 -2
  222. package/build/esm/object-table/TableCell.module.css +11 -0
  223. package/build/esm/object-table/TableHeader.js +93 -6
  224. package/build/esm/object-table/TableHeader.js.map +1 -1
  225. package/build/esm/object-table/TableHeader.module.css +7 -2
  226. package/build/esm/object-table/TableHeaderWithPopover.js +53 -22
  227. package/build/esm/object-table/TableHeaderWithPopover.js.map +1 -1
  228. package/build/esm/object-table/TableHeaderWithPopover.module.css +54 -23
  229. package/build/esm/object-table/hooks/__tests__/useColumnVisibility.test.js +160 -138
  230. package/build/esm/object-table/hooks/__tests__/useColumnVisibility.test.js.map +1 -1
  231. package/build/esm/object-table/hooks/__tests__/useRowSelection.test.js +3 -0
  232. package/build/esm/object-table/hooks/__tests__/useRowSelection.test.js.map +1 -1
  233. package/build/esm/object-table/hooks/__tests__/useSelectionColumn.test.js +27 -82
  234. package/build/esm/object-table/hooks/__tests__/useSelectionColumn.test.js.map +1 -1
  235. package/build/esm/object-table/hooks/__tests__/useTableSorting.test.js +290 -0
  236. package/build/esm/object-table/hooks/__tests__/useTableSorting.test.js.map +1 -1
  237. package/build/esm/object-table/hooks/useColumnDefs.js +7 -2
  238. package/build/esm/object-table/hooks/useColumnDefs.js.map +1 -1
  239. package/build/esm/object-table/hooks/useColumnResize.js +45 -0
  240. package/build/esm/object-table/hooks/useColumnResize.js.map +1 -0
  241. package/build/esm/object-table/hooks/useColumnVisibility.js +52 -20
  242. package/build/esm/object-table/hooks/useColumnVisibility.js.map +1 -1
  243. package/build/esm/object-table/hooks/useRowSelection.js +8 -7
  244. package/build/esm/object-table/hooks/useRowSelection.js.map +1 -1
  245. package/build/esm/object-table/hooks/useSelectionColumn.js +15 -6
  246. package/build/esm/object-table/hooks/useSelectionColumn.js.map +1 -1
  247. package/build/esm/object-table/utils/types.js +2 -0
  248. package/build/esm/object-table/utils/types.js.map +1 -0
  249. package/build/esm/public/experimental.js +1 -0
  250. package/build/esm/public/experimental.js.map +1 -1
  251. package/build/types/base-components/action-button/ActionButton.d.ts +5 -0
  252. package/build/types/base-components/action-button/ActionButton.d.ts.map +1 -0
  253. package/build/types/base-components/combobox/Combobox.d.ts +52 -0
  254. package/build/types/base-components/combobox/Combobox.d.ts.map +1 -0
  255. package/build/types/base-components/dialog/Dialog.d.ts +10 -0
  256. package/build/types/base-components/dialog/Dialog.d.ts.map +1 -0
  257. package/build/types/base-components/draggable-list/DraggableList.d.ts +17 -0
  258. package/build/types/base-components/draggable-list/DraggableList.d.ts.map +1 -0
  259. package/build/types/base-components/search-bar/SearchBar.d.ts +11 -0
  260. package/build/types/base-components/search-bar/SearchBar.d.ts.map +1 -0
  261. package/build/types/base-components/select/Select.d.ts +34 -0
  262. package/build/types/base-components/select/Select.d.ts.map +1 -0
  263. package/build/types/base-components/switch/Switch.d.ts +10 -0
  264. package/build/types/base-components/switch/Switch.d.ts.map +1 -0
  265. package/build/types/filter-list/FilterListApi.d.ts +63 -12
  266. package/build/types/filter-list/FilterListApi.d.ts.map +1 -1
  267. package/build/types/filter-list/FilterListItemApi.d.ts +101 -53
  268. package/build/types/filter-list/FilterListItemApi.d.ts.map +1 -1
  269. package/build/types/filter-list/__tests__/filterStateToWhereClause.test.d.ts +1 -0
  270. package/build/types/filter-list/__tests__/filterStateToWhereClause.test.d.ts.map +1 -0
  271. package/build/types/filter-list/__tests__/getFilterKey.test.d.ts +1 -0
  272. package/build/types/filter-list/__tests__/getFilterKey.test.d.ts.map +1 -0
  273. package/build/types/filter-list/__tests__/testUtils.d.ts +59 -0
  274. package/build/types/filter-list/__tests__/testUtils.d.ts.map +1 -0
  275. package/build/types/filter-list/hooks/__tests__/useFilterListState.test.d.ts +1 -0
  276. package/build/types/filter-list/hooks/__tests__/useFilterListState.test.d.ts.map +1 -0
  277. package/build/types/filter-list/hooks/useDebouncedValue.d.ts +11 -0
  278. package/build/types/filter-list/hooks/useDebouncedValue.d.ts.map +1 -0
  279. package/build/types/filter-list/hooks/useFilterListState.d.ts +11 -0
  280. package/build/types/filter-list/hooks/useFilterListState.d.ts.map +1 -0
  281. package/build/types/filter-list/hooks/usePropertyAggregation.d.ts +20 -0
  282. package/build/types/filter-list/hooks/usePropertyAggregation.d.ts.map +1 -0
  283. package/build/types/filter-list/types/AddFilterMenuTypes.d.ts +61 -0
  284. package/build/types/filter-list/types/AddFilterMenuTypes.d.ts.map +1 -0
  285. package/build/types/filter-list/types/CustomRendererTypes.d.ts +76 -0
  286. package/build/types/filter-list/types/CustomRendererTypes.d.ts.map +1 -0
  287. package/build/types/filter-list/types/KeywordSearchTypes.d.ts +56 -0
  288. package/build/types/filter-list/types/KeywordSearchTypes.d.ts.map +1 -0
  289. package/build/types/filter-list/types/LinkedFilterTypes.d.ts +70 -0
  290. package/build/types/filter-list/types/LinkedFilterTypes.d.ts.map +1 -0
  291. package/build/types/filter-list/types/index.d.ts +4 -0
  292. package/build/types/filter-list/types/index.d.ts.map +1 -0
  293. package/build/types/filter-list/utils/assertUnreachable.d.ts +6 -0
  294. package/build/types/filter-list/utils/assertUnreachable.d.ts.map +1 -0
  295. package/build/types/filter-list/utils/coerceFilterValue.d.ts +11 -0
  296. package/build/types/filter-list/utils/coerceFilterValue.d.ts.map +1 -0
  297. package/build/types/filter-list/utils/filterStateToWhereClause.d.ts +16 -0
  298. package/build/types/filter-list/utils/filterStateToWhereClause.d.ts.map +1 -0
  299. package/build/types/filter-list/utils/filterValues.d.ts +5 -0
  300. package/build/types/filter-list/utils/filterValues.d.ts.map +1 -0
  301. package/build/types/filter-list/utils/getFilterKey.d.ts +3 -0
  302. package/build/types/filter-list/utils/getFilterKey.d.ts.map +1 -0
  303. package/build/types/object-table/ColumnConfigDialog.d.ts +18 -0
  304. package/build/types/object-table/ColumnConfigDialog.d.ts.map +1 -0
  305. package/build/types/object-table/LoadingStateTable.d.ts.map +1 -1
  306. package/build/types/object-table/MultiColumnSortDialog.d.ts +15 -0
  307. package/build/types/object-table/MultiColumnSortDialog.d.ts.map +1 -0
  308. package/build/types/object-table/ObjectTable.d.ts +1 -1
  309. package/build/types/object-table/ObjectTable.d.ts.map +1 -1
  310. package/build/types/object-table/ObjectTableApi.d.ts +41 -6
  311. package/build/types/object-table/ObjectTableApi.d.ts.map +1 -1
  312. package/build/types/object-table/SortableItemsList.d.ts +13 -0
  313. package/build/types/object-table/SortableItemsList.d.ts.map +1 -0
  314. package/build/types/object-table/Table.d.ts +12 -1
  315. package/build/types/object-table/Table.d.ts.map +1 -1
  316. package/build/types/object-table/TableHeader.d.ts +3 -1
  317. package/build/types/object-table/TableHeader.d.ts.map +1 -1
  318. package/build/types/object-table/TableHeaderWithPopover.d.ts +30 -6
  319. package/build/types/object-table/TableHeaderWithPopover.d.ts.map +1 -1
  320. package/build/types/object-table/hooks/useColumnResize.d.ts +10 -0
  321. package/build/types/object-table/hooks/useColumnResize.d.ts.map +1 -0
  322. package/build/types/object-table/hooks/useColumnVisibility.d.ts +18 -7
  323. package/build/types/object-table/hooks/useColumnVisibility.d.ts.map +1 -1
  324. package/build/types/object-table/hooks/useRowSelection.d.ts +5 -4
  325. package/build/types/object-table/hooks/useRowSelection.d.ts.map +1 -1
  326. package/build/types/object-table/utils/types.d.ts +5 -0
  327. package/build/types/object-table/utils/types.d.ts.map +1 -0
  328. package/build/types/public/experimental.d.ts +2 -0
  329. package/build/types/public/experimental.d.ts.map +1 -1
  330. package/package.json +16 -8
@@ -1,55 +1,201 @@
1
- import { ObjectTypeDefinition, PropertyKeys, WirePropertyTypes, CompileTimeMetadata, ObjectSet, WhereClause, ObjectOrInterfaceDefinition, SimplePropertyDef, QueryDefinition, DerivedProperty, Osdk, PrimaryKeyType } from '@osdk/api';
1
+ import { ObjectTypeDefinition, ObjectSet, WhereClause, PropertyKeys, LinkNames, LinkedType, WirePropertyTypes, CompileTimeMetadata, ObjectOrInterfaceDefinition, SimplePropertyDef, QueryDefinition, DerivedProperty, Osdk, PrimaryKeyType } from '@osdk/api';
2
2
  import * as React from 'react';
3
- import React__default, { ReactElement } from 'react';
4
- import { RowData, Table, Cell } from '@tanstack/react-table';
3
+ import React__default, { ReactNode, ReactElement } from 'react';
4
+ import { RowData, Table, Cell, VisibilityState, ColumnOrderState } from '@tanstack/react-table';
5
5
 
6
6
  /**
7
- * Props for a single filter list item component
7
+ * State for custom filter
8
8
  */
9
- interface FilterListItemProps<Q extends ObjectTypeDefinition, K extends PropertyKeys<Q> = PropertyKeys<Q>, C extends ValidComponentsForPropertyType<PropertyTypeFromKey<Q, K>> = ValidComponentsForPropertyType<PropertyTypeFromKey<Q, K>>> extends FilterDefinition<Q, K, C> {
9
+ interface CustomFilterState<T = Record<string, unknown>> extends BaseFilterState {
10
+ type: "custom";
11
+ customState: T;
12
+ }
13
+ /**
14
+ * Props passed to custom filter input renderer
15
+ */
16
+ interface CustomFilterInputRendererProps<Q extends ObjectTypeDefinition, State extends BaseFilterState> {
10
17
  objectSet: ObjectSet<Q>;
18
+ filterState: State;
19
+ onFilterStateChanged: (newState: State) => void;
20
+ }
21
+ /**
22
+ * Props passed to custom filter item renderer
23
+ * Includes full item context in addition to input renderer props
24
+ */
25
+ interface CustomFilterItemRendererProps<Q extends ObjectTypeDefinition, State extends BaseFilterState> extends CustomFilterInputRendererProps<Q, State> {
26
+ label: string;
27
+ onRemove?: () => void;
28
+ }
29
+ /**
30
+ * Filter definition for custom filters
31
+ * Provides full control over rendering and filter logic
32
+ */
33
+ interface CustomFilterDefinition<Q extends ObjectTypeDefinition, State extends BaseFilterState = CustomFilterState> {
34
+ type: "CUSTOM";
11
35
  /**
12
- * Called when the state of the filter changes.
13
- * Required in controlled mode.
36
+ * Optional unique identifier for stable keying across filter reorders.
37
+ * If provided, takes precedence over `key` for state keying.
14
38
  */
15
- onFilterStateChanged: (state: FilterStateByComponentType[C]) => void;
16
- onFilterRemoved?: (key: PropertyKeys<Q>) => void;
39
+ id?: string;
40
+ /**
41
+ * Unique key for this custom filter
42
+ */
43
+ key: string;
44
+ label?: string;
45
+ filterComponent: "CUSTOM";
46
+ filterState: State;
47
+ defaultFilterState?: State;
48
+ /**
49
+ * Render the input portion of the filter
50
+ * Used when rendering within a filter item wrapper
51
+ */
52
+ renderInput?: (props: CustomFilterInputRendererProps<Q, State>) => ReactNode;
53
+ /**
54
+ * Render the complete filter item
55
+ * Used when you need full control over the item appearance
56
+ */
57
+ renderItem?: (props: CustomFilterItemRendererProps<Q, State>) => ReactNode;
58
+ /**
59
+ * Convert filter state to a WhereClause for filtering
60
+ * Required for the filter to affect the object set
61
+ */
62
+ toWhereClause: (state: State) => WhereClause<Q> | undefined;
63
+ /**
64
+ * Controls whether this filter is rendered.
65
+ * When false, the filter is hidden but its state is preserved.
66
+ * @default true
67
+ */
68
+ isVisible?: boolean;
17
69
  }
70
+
18
71
  /**
19
- * A filter definition specifies configuration for a single filter
20
- *
21
- * The component type C must be compatible with the property type derived from the key.
22
- * For example, boolean properties can only use LISTOGRAM,
23
- * while string properties can use LISTOGRAM, TEXT_TAGS, or CONTAINS_TEXT.
72
+ * Keys of string properties on an object type
24
73
  */
25
- interface FilterDefinition<Q extends ObjectTypeDefinition, K extends PropertyKeys<Q> = PropertyKeys<Q>, C extends ValidComponentsForPropertyType<PropertyTypeFromKey<Q, K>> = ValidComponentsForPropertyType<PropertyTypeFromKey<Q, K>>> {
74
+ type StringPropertyKeys<Q extends ObjectTypeDefinition> = PropertyKeys.Filtered<Q, "string">;
75
+ /**
76
+ * State for keyword search filter
77
+ */
78
+ interface KeywordSearchFilterState extends BaseFilterState {
79
+ type: "keywordSearch";
80
+ searchTerm: string;
26
81
  /**
27
- * The property key to filter on
82
+ * How multiple terms are combined
83
+ * - "AND": All terms must match
84
+ * - "OR": Any term must match
28
85
  */
29
- key: K;
86
+ operator: "AND" | "OR";
87
+ }
88
+ /**
89
+ * Filter definition for keyword search across string properties
90
+ */
91
+ interface KeywordSearchFilterDefinition<Q extends ObjectTypeDefinition, K extends StringPropertyKeys<Q> = StringPropertyKeys<Q>> {
92
+ type: "KEYWORD_SEARCH";
30
93
  /**
31
- * Display label for the filter
94
+ * Optional unique identifier for stable keying across filter reorders.
95
+ */
96
+ id?: string;
97
+ /**
98
+ * Properties to search within
99
+ * - "all": Search all string properties
100
+ * - K[]: Search specific string properties
32
101
  */
102
+ properties: "all" | K[];
33
103
  label?: string;
34
104
  /**
35
- * The filter component type to render
36
- * Must be compatible with the property type derived from the key, see ValidComponentsForPropertyType
105
+ * Controlled state for the filter.
106
+ * When provided, the filter becomes controlled and changes should be
107
+ * handled via onFilterStateChanged callback.
37
108
  */
38
- filterComponent: C;
109
+ filterState?: KeywordSearchFilterState;
39
110
  /**
40
- * The current state of the filter.
41
- * If provided, the filter is controlled.
111
+ * Default state for uncontrolled mode.
112
+ * Used when filterState is not provided.
42
113
  */
43
- filterState: FilterStateByComponentType[C];
114
+ defaultFilterState?: KeywordSearchFilterState;
115
+ /**
116
+ * Controls whether this filter is rendered.
117
+ * When false, the filter is hidden but its state is preserved.
118
+ * @default true
119
+ */
120
+ isVisible?: boolean;
44
121
  }
122
+
123
+ /**
124
+ * State for "has link" filter
125
+ */
126
+ interface HasLinkFilterState extends BaseFilterState {
127
+ type: "hasLink";
128
+ hasLink: boolean;
129
+ }
130
+ /**
131
+ * State for linked property filter
132
+ * Wraps the filter state of the linked property
133
+ */
134
+ interface LinkedPropertyFilterState<S extends FilterState = FilterState> extends BaseFilterState {
135
+ type: "linkedProperty";
136
+ linkedFilterState: S;
137
+ }
138
+ /**
139
+ * Filter definition for "Has Link" filter
140
+ * Filters objects based on whether they have any linked objects of the specified type
141
+ */
142
+ interface HasLinkFilterDefinition<Q extends ObjectTypeDefinition, L extends LinkNames<Q> = LinkNames<Q>> {
143
+ type: "HAS_LINK";
144
+ /**
145
+ * Optional unique identifier for stable keying across filter reorders.
146
+ */
147
+ id?: string;
148
+ linkName: L;
149
+ label?: string;
150
+ filterState: HasLinkFilterState;
151
+ defaultFilterState?: HasLinkFilterState;
152
+ /**
153
+ * Controls whether this filter is rendered.
154
+ * When false, the filter is hidden but its state is preserved.
155
+ * @default true
156
+ */
157
+ isVisible?: boolean;
158
+ }
159
+ /**
160
+ * Filter definition for filtering on a property of linked objects
161
+ */
162
+ interface LinkedPropertyFilterDefinition<Q extends ObjectTypeDefinition, L extends LinkNames<Q>, LinkedQ extends ObjectTypeDefinition = LinkedType<Q, L>, LinkedK extends PropertyKeys<LinkedQ> = PropertyKeys<LinkedQ>, LinkedC extends ValidComponentsForPropertyType<PropertyTypeFromKey<LinkedQ, LinkedK>> = ValidComponentsForPropertyType<PropertyTypeFromKey<LinkedQ, LinkedK>>> {
163
+ type: "LINKED_PROPERTY";
164
+ /**
165
+ * Optional unique identifier for stable keying across filter reorders.
166
+ */
167
+ id?: string;
168
+ linkName: L;
169
+ linkedPropertyKey: LinkedK;
170
+ linkedFilterComponent: LinkedC;
171
+ linkedFilterState: FilterStateByComponentType[LinkedC];
172
+ defaultLinkedFilterState?: FilterStateByComponentType[LinkedC];
173
+ filterState: LinkedPropertyFilterState<FilterStateByComponentType[LinkedC]>;
174
+ label?: string;
175
+ /**
176
+ * Controls whether this filter is rendered.
177
+ * When false, the filter is hidden but its state is preserved.
178
+ * @default true
179
+ */
180
+ isVisible?: boolean;
181
+ }
182
+
45
183
  /**
46
184
  * Helper type to extract the property type from an ObjectTypeDefinition given a property key
47
185
  */
48
186
  type PropertyTypeFromKey<Q extends ObjectTypeDefinition, K extends PropertyKeys<Q>> = CompileTimeMetadata<Q>["properties"][K]["type"];
187
+ /**
188
+ * All available filter component types
189
+ */
190
+ type FilterComponentType = "LISTOGRAM" | "DATE_RANGE" | "NUMBER_RANGE" | "TEXT_TAGS" | "CONTAINS_TEXT" | "SINGLE_SELECT" | "MULTI_SELECT" | "SINGLE_DATE" | "MULTI_DATE" | "TIMELINE" | "CHECKBOX_LIST" | "TOGGLE";
49
191
  /**
50
192
  * Gets valid component types for a given property type
51
193
  */
52
- type ValidComponentsForPropertyType<P extends WirePropertyTypes> = P extends "boolean" ? "LISTOGRAM" : P extends "string" ? "LISTOGRAM" | "TEXT_TAGS" | "CONTAINS_TEXT" : P extends "datetime" | "timestamp" ? "DATE_RANGE" : P extends "double" | "integer" | "long" | "float" | "short" | "byte" | "decimal" ? "NUMBER_RANGE" : never;
194
+ type ValidComponentsForPropertyType<P extends WirePropertyTypes> = P extends "boolean" ? "LISTOGRAM" | "CHECKBOX_LIST" | "SINGLE_SELECT" | "TOGGLE" : P extends "string" ? "LISTOGRAM" | "TEXT_TAGS" | "CONTAINS_TEXT" | "SINGLE_SELECT" | "MULTI_SELECT" | "CHECKBOX_LIST" : P extends "datetime" | "timestamp" ? "DATE_RANGE" | "SINGLE_DATE" | "MULTI_DATE" | "TIMELINE" : P extends "double" | "integer" | "long" | "float" | "short" | "byte" | "decimal" ? "NUMBER_RANGE" | "SINGLE_SELECT" | "MULTI_SELECT" : never;
195
+ /**
196
+ * Union of all possible filter states
197
+ */
198
+ type FilterState = ExactMatchFilterState<string | boolean> | DateRangeFilterState | ContainsTextFilterState | NumberRangeFilterState | SelectFilterState<string | boolean | number> | SelectFilterState<Date> | TimelineFilterState | ToggleFilterState | HasLinkFilterState | LinkedPropertyFilterState | KeywordSearchFilterState | CustomFilterState;
53
199
  /**
54
200
  * Maps component types to their corresponding state types
55
201
  */
@@ -59,8 +205,18 @@ interface FilterStateByComponentType {
59
205
  TEXT_TAGS: ExactMatchFilterState<string>;
60
206
  CONTAINS_TEXT: ContainsTextFilterState;
61
207
  NUMBER_RANGE: NumberRangeFilterState;
208
+ SINGLE_SELECT: SelectFilterState<string | boolean | number>;
209
+ MULTI_SELECT: SelectFilterState<string | boolean | number>;
210
+ SINGLE_DATE: SelectFilterState<Date>;
211
+ MULTI_DATE: SelectFilterState<Date>;
212
+ TIMELINE: TimelineFilterState;
213
+ CHECKBOX_LIST: SelectFilterState<string>;
214
+ TOGGLE: ToggleFilterState;
62
215
  }
63
- type FilterStateType = "EXACT_MATCH" | "DATE_RANGE" | "NUMBER_RANGE" | "CONTAINS_TEXT";
216
+ /**
217
+ * All filter state discriminator types
218
+ */
219
+ type FilterStateType = "EXACT_MATCH" | "DATE_RANGE" | "NUMBER_RANGE" | "CONTAINS_TEXT" | "SELECT" | "TIMELINE" | "TOGGLE" | "hasLink" | "linkedProperty" | "keywordSearch" | "custom";
64
220
  /**
65
221
  * Base interface for all filter states
66
222
  * Contains common properties shared across all filter types
@@ -111,7 +267,130 @@ interface NumberRangeFilterState extends BaseFilterState {
111
267
  */
112
268
  maxValue?: number;
113
269
  }
270
+ /**
271
+ * Consolidated state type for select-based filters.
272
+ * Used by SINGLE_SELECT, MULTI_SELECT, SINGLE_DATE, MULTI_DATE, and CHECKBOX_LIST.
273
+ */
274
+ interface SelectFilterState<T = string | boolean | number | Date> extends BaseFilterState {
275
+ type: "SELECT";
276
+ selectedValues: T[];
277
+ }
278
+ interface TimelineFilterState extends BaseFilterState {
279
+ type: "TIMELINE";
280
+ startDate?: Date;
281
+ endDate?: Date;
282
+ granularity?: "day" | "week" | "month" | "quarter" | "year";
283
+ }
284
+ interface ToggleFilterState extends BaseFilterState {
285
+ type: "TOGGLE";
286
+ enabled: boolean;
287
+ }
288
+ /**
289
+ * A property filter definition specifies configuration for filtering on a single property
290
+ *
291
+ * The component type C must be compatible with the property type derived from the key.
292
+ * For example, boolean properties can only use LISTOGRAM, CHECKBOX_LIST, or SINGLE_SELECT,
293
+ * while string properties can use LISTOGRAM, TEXT_TAGS, CONTAINS_TEXT, SINGLE_SELECT, MULTI_SELECT, or CHECKBOX_LIST.
294
+ */
295
+ interface PropertyFilterDefinition<Q extends ObjectTypeDefinition, K extends PropertyKeys<Q> = PropertyKeys<Q>, C extends ValidComponentsForPropertyType<PropertyTypeFromKey<Q, K>> = ValidComponentsForPropertyType<PropertyTypeFromKey<Q, K>>> {
296
+ /**
297
+ * Discriminator for filter definition type
298
+ */
299
+ type: "PROPERTY";
300
+ /**
301
+ * Optional unique identifier for stable keying across filter reorders.
302
+ */
303
+ id?: string;
304
+ /**
305
+ * The property key to filter on
306
+ */
307
+ key: K;
308
+ /**
309
+ * Display label for the filter
310
+ */
311
+ label?: string;
312
+ /**
313
+ * The filter component type to render
314
+ * Must be compatible with the property type derived from the key, see ValidComponentsForPropertyType
315
+ */
316
+ filterComponent: C;
317
+ /**
318
+ * The current state of the filter.
319
+ * If provided, the filter is controlled.
320
+ */
321
+ filterState: FilterStateByComponentType[C];
322
+ /**
323
+ * Controls whether this filter is rendered.
324
+ * When false, the filter is hidden but its state is preserved.
325
+ * @default true
326
+ */
327
+ isVisible?: boolean;
328
+ }
329
+ /**
330
+ * Props for a single filter list item component.
331
+ * Extends PropertyFilterDefinition with runtime props for rendering.
332
+ */
333
+ interface FilterListItemProps<Q extends ObjectTypeDefinition, K extends PropertyKeys<Q> = PropertyKeys<Q>, C extends ValidComponentsForPropertyType<PropertyTypeFromKey<Q, K>> = ValidComponentsForPropertyType<PropertyTypeFromKey<Q, K>>> extends PropertyFilterDefinition<Q, K, C> {
334
+ objectSet: ObjectSet<Q>;
335
+ /**
336
+ * Called when the state of the filter changes.
337
+ * Required in controlled mode.
338
+ */
339
+ onFilterStateChanged: (state: FilterStateByComponentType[C]) => void;
340
+ onFilterRemoved?: (key: PropertyKeys<Q>) => void;
341
+ }
114
342
 
343
+ /**
344
+ * Category for organizing filters in the add filter menu
345
+ */
346
+ type FilterCategory = "ALL_PROPERTIES" | "SINGLE_PROPERTY" | "LINKED_OBJECT";
347
+ /**
348
+ * Template for a filter that can be added via the add filter menu
349
+ */
350
+ interface FilterTemplate {
351
+ /**
352
+ * Unique identifier for the template
353
+ */
354
+ id: string;
355
+ /**
356
+ * Display label for the filter
357
+ */
358
+ label: string;
359
+ /**
360
+ * Property key this filter applies to
361
+ */
362
+ key: string;
363
+ /**
364
+ * The type of filter component to use
365
+ */
366
+ filterComponent: FilterComponentType;
367
+ /**
368
+ * Icon to display next to the filter label.
369
+ * Can be a string (icon name) or a ReactNode for custom icons.
370
+ */
371
+ icon: string | ReactNode;
372
+ /**
373
+ * Whether multiple instances of this filter can be added
374
+ */
375
+ allowMultiple: boolean;
376
+ /**
377
+ * Category for grouping in the add filter menu
378
+ */
379
+ category: FilterCategory;
380
+ }
381
+
382
+ /**
383
+ * Union type of all filter definition types
384
+ */
385
+ type FilterDefinitionUnion<Q extends ObjectTypeDefinition> = PropertyFilterDefinition<Q> | HasLinkFilterDefinition<Q> | LinkedPropertyFilterDefinition<Q, LinkNames<Q>> | KeywordSearchFilterDefinition<Q> | CustomFilterDefinition<Q>;
386
+ /**
387
+ * Extract the key from a filter definition union
388
+ */
389
+ type FilterKey<Q extends ObjectTypeDefinition> = FilterDefinitionUnion<Q> extends infer D ? D extends {
390
+ key: infer K;
391
+ } ? K : D extends {
392
+ linkName: infer L;
393
+ } ? L : never : never;
115
394
  interface FilterListProps<Q extends ObjectTypeDefinition> {
116
395
  /**
117
396
  * The set of objects to be filtered
@@ -121,7 +400,7 @@ interface FilterListProps<Q extends ObjectTypeDefinition> {
121
400
  * The definition for all supported filter items in the list
122
401
  * If not supplied, all filterable properties will be available
123
402
  */
124
- filterDefinitions?: Array<FilterDefinition<Q>>;
403
+ filterDefinitions?: Array<FilterDefinitionUnion<Q>>;
125
404
  /**
126
405
  * The current where clause to filter the objectSet.
127
406
  * If provided, the filter clause is controlled.
@@ -142,12 +421,12 @@ interface FilterListProps<Q extends ObjectTypeDefinition> {
142
421
  */
143
422
  filterOperator?: "and" | "or";
144
423
  /**
145
- * Called when filter state change
424
+ * Called when filter state changes
146
425
  *
147
- * @param filterKey The key of the updated filter
426
+ * @param definition The filter definition whose state changed
148
427
  * @param newState The updated filter state
149
428
  */
150
- onFilterStateChanged?: (filterKey: FilterKey<Q>, newState: FilterState<Q>) => void;
429
+ onFilterStateChanged?: (definition: FilterDefinitionUnion<Q>, newState: FilterState) => void;
151
430
  /**
152
431
  * Called when a filter is added
153
432
  * If provided, user will be allowed to add filters
@@ -155,7 +434,7 @@ interface FilterListProps<Q extends ObjectTypeDefinition> {
155
434
  * @param filterKey The key of the added filter
156
435
  * @param newDefinitions The filter list with the new filter added
157
436
  */
158
- onFilterAdded?: (filterKey: FilterKey<Q>, newDefinitions: Array<FilterDefinition<Q>>) => void;
437
+ onFilterAdded?: (filterKey: FilterKey<Q>, newDefinitions: Array<FilterDefinitionUnion<Q>>) => void;
159
438
  /**
160
439
  * Called when a filter is removed
161
440
  * If provided, user will be allowed to remove filters
@@ -163,17 +442,42 @@ interface FilterListProps<Q extends ObjectTypeDefinition> {
163
442
  * @param filterKey The key of the removed filter
164
443
  * @param newDefinitions The updated filter list with the filter removed
165
444
  */
166
- onFilterRemoved?: (filterKey: FilterKey<Q>, newDefinitions: Array<FilterDefinition<Q>>) => void;
445
+ onFilterRemoved?: (filterKey: FilterKey<Q>, newDefinitions: Array<FilterDefinitionUnion<Q>>) => void;
167
446
  /**
168
447
  * Called when filters are reordered
169
448
  * If provided, the filter list becomes sortable
170
449
  *
171
450
  * @param newOrder The updated filter definitions in new order
172
451
  */
173
- onFiltersReordered?: (newOrder: ReadonlyArray<FilterDefinition<Q>>) => void;
452
+ onFiltersReordered?: (newOrder: ReadonlyArray<FilterDefinitionUnion<Q>>) => void;
453
+ /**
454
+ * Show reset filters button in header
455
+ */
456
+ showResetButton?: boolean;
457
+ /**
458
+ * Called when reset button is clicked
459
+ */
460
+ onReset?: () => void;
461
+ /**
462
+ * Available filter templates for the "Add filter" menu.
463
+ * When provided along with onFilterAdded, clicking the add button
464
+ * shows a popover with these templates organized by category.
465
+ */
466
+ filterTemplates?: FilterTemplate[];
467
+ /**
468
+ * Called when a filter template is selected from the add filter menu.
469
+ * The consumer should create a new filter definition and add it to filterDefinitions.
470
+ */
471
+ onFilterTemplateSelected?: (template: FilterTemplate) => void;
472
+ /**
473
+ * Show count of active filters in header
474
+ */
475
+ showActiveFilterCount?: boolean;
476
+ /**
477
+ * Additional CSS class name
478
+ */
479
+ className?: string;
174
480
  }
175
- type FilterKey<Q extends ObjectTypeDefinition> = FilterDefinition<Q>["key"];
176
- type FilterState<Q extends ObjectTypeDefinition> = FilterDefinition<Q>["filterState"];
177
481
 
178
482
  type ColumnDefinition<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef> = Record<string, never>, FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<string, never>> = {
179
483
  locator: ColumnDefinitionLocator<Q, RDPs, FunctionColumns>;
@@ -192,6 +496,20 @@ type ColumnDefinition<Q extends ObjectOrInterfaceDefinition, RDPs extends Record
192
496
  orderable?: boolean;
193
497
  filterable?: boolean;
194
498
  renderCell?: (object: Osdk.Instance<Q, "$allBaseProperties", PropertyKeys<Q>, RDPs>, locator: ColumnDefinitionLocator<Q, RDPs, FunctionColumns>) => React.ReactNode;
499
+ /**
500
+ * If provided, this will be used in the column header.
501
+ * If both columnName and renderHeader are provided, renderHeader will take precedence in the table header.
502
+ * columnName will still be used in other parts where the column name is displayed.
503
+ *
504
+ * If not provided,
505
+ * for a property column, the property displayName will be used
506
+ * for other columns, the id will be used.
507
+ */
508
+ columnName?: string;
509
+ /**
510
+ * If provided, this will be used to render the header component.
511
+ * When both columnName and renderHeader are provided, renderHeader will take precedence in the table header.
512
+ */
195
513
  renderHeader?: () => React.ReactNode;
196
514
  };
197
515
  type ColumnDefinitionLocator<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef> = Record<string, never>, FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<string, never>> = {
@@ -204,6 +522,9 @@ type ColumnDefinitionLocator<Q extends ObjectOrInterfaceDefinition, RDPs extends
204
522
  type: "rdp";
205
523
  id: keyof RDPs;
206
524
  creator: DerivedProperty.Creator<Q, RDPs[keyof RDPs]>;
525
+ } | {
526
+ type: "custom";
527
+ id: string;
207
528
  };
208
529
  interface ObjectTableProps<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef> = Record<string, never>, FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<string, never>> {
209
530
  /**
@@ -221,7 +542,7 @@ interface ObjectTableProps<Q extends ObjectOrInterfaceDefinition, RDPs extends R
221
542
  *
222
543
  * @default true
223
544
  */
224
- filterable?: boolean;
545
+ enableFiltering?: boolean;
225
546
  /**
226
547
  * The current where clause to filter the objects in the table.
227
548
  * If provided, the filter is controlled.
@@ -239,7 +560,25 @@ interface ObjectTableProps<Q extends ObjectOrInterfaceDefinition, RDPs extends R
239
560
  *
240
561
  * @default true
241
562
  */
242
- orderable?: boolean;
563
+ enableOrdering?: boolean;
564
+ /**
565
+ * Whether columns can be pinned by the user.
566
+ *
567
+ * @default true
568
+ */
569
+ enableColumnPinning?: boolean;
570
+ /**
571
+ * Whether columns can be resized by the user.
572
+ *
573
+ * @default true
574
+ */
575
+ enableColumnResizing?: boolean;
576
+ /**
577
+ * Whether the column configuration dialog for column visibility and ordering is available to the user.
578
+ *
579
+ * @default true
580
+ */
581
+ enableColumnConfig?: boolean;
243
582
  /**
244
583
  * The default order by clause to sort the objects in the table.
245
584
  * If provided without orderBy prop, the sorting is uncontrolled.
@@ -269,11 +608,11 @@ interface ObjectTableProps<Q extends ObjectOrInterfaceDefinition, RDPs extends R
269
608
  direction: "asc" | "desc";
270
609
  }>) => void;
271
610
  /**
272
- * Called when the visible columns change.
611
+ * Called when the column visibility or ordering changed.
273
612
  *
274
613
  * If provided, the table will allow the user to show/hide columns.
275
614
  *
276
- * @param newStates The new list of column visibility states
615
+ * @param newStates The columns sorted in their display order in the table and their visibility state.
277
616
  */
278
617
  onColumnVisibilityChanged?: (newStates: Array<{
279
618
  columnId: PropertyKeys<Q> | keyof RDPs | keyof FunctionColumns;
@@ -294,9 +633,9 @@ interface ObjectTableProps<Q extends ObjectOrInterfaceDefinition, RDPs extends R
294
633
  * Called when a column is resized.
295
634
  *
296
635
  * @param columnId The ID of the resized column
297
- * @param newWidth The new width of the column
636
+ * @param newWidth The new width of the column. When newWidth = null, the column size is reset.
298
637
  */
299
- onColumnResize?: (columnId: PropertyKeys<Q> | keyof RDPs | keyof FunctionColumns, newWidth: number) => void;
638
+ onColumnResize?: (columnId: PropertyKeys<Q> | keyof RDPs | keyof FunctionColumns, newWidth: number | null) => void;
300
639
  /**
301
640
  * Called when a row is clicked.
302
641
  *
@@ -345,8 +684,43 @@ interface ObjectTableProps<Q extends ObjectOrInterfaceDefinition, RDPs extends R
345
684
  * <ObjectTable objectType={MyObjectType} />
346
685
  * ```
347
686
  */
348
- declare function ObjectTable<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef> = Record<string, never>, FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<string, never>>({ objectType, columnDefinitions, filter, orderBy, defaultOrderBy, onOrderByChanged, onColumnsPinnedChanged, onRowSelection, renderCellContextMenu, selectionMode, selectedRows, ...props }: ObjectTableProps<Q, RDPs, FunctionColumns>): React__default.ReactElement;
687
+ declare function ObjectTable<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef> = Record<string, never>, FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<string, never>>({ objectType, columnDefinitions, filter, orderBy, defaultOrderBy, onOrderByChanged, onColumnsPinnedChanged, onColumnResize, onRowSelection, renderCellContextMenu, selectionMode, selectedRows, onColumnVisibilityChanged, enableOrdering, enableColumnPinning, enableColumnResizing, enableColumnConfig, ...props }: ObjectTableProps<Q, RDPs, FunctionColumns>): React__default.ReactElement;
688
+
689
+ interface ColumnOption {
690
+ id: string;
691
+ name: string;
692
+ canSort: boolean;
693
+ }
349
694
 
695
+ interface HeaderMenuFeatureFlags {
696
+ /**
697
+ * Whether sorting menu items should be shown.
698
+ * When false, hides "Sort ascending", "Sort descending", "Sort on multiple columns", and "Clear all sorts".
699
+ */
700
+ showSortingItems?: boolean;
701
+ /**
702
+ * Whether pinning menu items should be shown.
703
+ * When false, hides "Pin column" and "Unpin Column".
704
+ */
705
+ showPinningItems?: boolean;
706
+ /**
707
+ * Whether resize menu item should be shown.
708
+ * When false, hides "Reset Column Size".
709
+ */
710
+ showResizeItem?: boolean;
711
+ /**
712
+ * Whether column config menu item should be shown.
713
+ * When false, hides "Configure Columns".
714
+ */
715
+ showConfigItem?: boolean;
716
+ }
717
+
718
+ declare module "@tanstack/react-table" {
719
+ interface ColumnMeta<TData extends RowData, TValue> {
720
+ columnName?: string;
721
+ isVisible?: boolean;
722
+ }
723
+ }
350
724
  interface BaseTableProps<TData extends RowData> {
351
725
  table: Table<TData>;
352
726
  isLoading?: boolean;
@@ -356,7 +730,24 @@ interface BaseTableProps<TData extends RowData> {
356
730
  renderCellContextMenu?: (row: TData, cell: Cell<TData, unknown>) => React__default.ReactNode;
357
731
  className?: string;
358
732
  error?: Error;
733
+ headerMenuFeatureFlags?: HeaderMenuFeatureFlags;
734
+ }
735
+ declare function BaseTable<TData extends RowData>({ table, isLoading, fetchNextPage, onRowClick, rowHeight, renderCellContextMenu, className, error, headerMenuFeatureFlags, }: BaseTableProps<TData>): ReactElement;
736
+
737
+ interface ColumnConfig {
738
+ columnId: string;
739
+ isVisible: boolean;
740
+ }
741
+ type ColumnConfigOptions = Array<Pick<ColumnOption, "id" | "name">>;
742
+ interface ColumnConfigDialogProps {
743
+ isOpen: boolean;
744
+ onClose: () => void;
745
+ columnOptions: ColumnConfigOptions;
746
+ currentVisibility?: VisibilityState;
747
+ currentColumnOrder?: ColumnOrderState;
748
+ onApply: (columns: ColumnConfig[]) => void;
749
+ isValidConfig?: (columns: ColumnConfig[]) => boolean;
359
750
  }
360
- declare function BaseTable<TData extends RowData>({ table, isLoading, fetchNextPage, onRowClick, rowHeight, renderCellContextMenu, className, error, }: BaseTableProps<TData>): ReactElement;
751
+ declare function ColumnConfigDialog({ isOpen, onClose, columnOptions, currentVisibility, currentColumnOrder, onApply, isValidConfig, }: ColumnConfigDialogProps): React__default.ReactElement | null;
361
752
 
362
- export { BaseTable, type BaseTableProps, type ColumnDefinition, type ColumnDefinitionLocator, type FilterListItemProps, type FilterListProps, ObjectTable, type ObjectTableProps };
753
+ export { BaseTable, type BaseTableProps, ColumnConfigDialog, type ColumnConfigDialogProps, type ColumnConfigOptions, type ColumnDefinition, type ColumnDefinitionLocator, type FilterListItemProps, type FilterListProps, ObjectTable, type ObjectTableProps };
@@ -0,0 +1,31 @@
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); }
2
+ /*
3
+ * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ import { Button } from "@base-ui/react/button";
19
+ import classNames from "classnames";
20
+ import React from "react";
21
+ import styles from "./ActionButton.module.css";
22
+ export function ActionButton({
23
+ variant = "secondary",
24
+ className,
25
+ ...rest
26
+ }) {
27
+ return /*#__PURE__*/React.createElement(Button, _extends({
28
+ className: classNames(styles.button, variant === "primary" ? styles.primaryButton : styles.secondaryButton, className)
29
+ }, rest));
30
+ }
31
+ //# sourceMappingURL=ActionButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ActionButton.js","names":["Button","classNames","React","styles","ActionButton","variant","className","rest","createElement","_extends","button","primaryButton","secondaryButton"],"sources":["ActionButton.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 { Button } from \"@base-ui/react/button\";\nimport classNames from \"classnames\";\nimport React from \"react\";\nimport styles from \"./ActionButton.module.css\";\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>\n{\n variant?: \"primary\" | \"secondary\";\n}\n\nexport function ActionButton({\n variant = \"secondary\",\n className,\n ...rest\n}: ButtonProps): React.ReactElement {\n return (\n <Button\n className={classNames(\n styles.button,\n variant === \"primary\" ? styles.primaryButton : styles.secondaryButton,\n className,\n )}\n {...rest}\n />\n );\n}\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,MAAM,QAAQ,uBAAuB;AAC9C,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAOC,MAAM,MAAM,2BAA2B;AAQ9C,OAAO,SAASC,YAAYA,CAAC;EAC3BC,OAAO,GAAG,WAAW;EACrBC,SAAS;EACT,GAAGC;AACQ,CAAC,EAAsB;EAClC,oBACEL,KAAA,CAAAM,aAAA,CAACR,MAAM,EAAAS,QAAA;IACLH,SAAS,EAAEL,UAAU,CACnBE,MAAM,CAACO,MAAM,EACbL,OAAO,KAAK,SAAS,GAAGF,MAAM,CAACQ,aAAa,GAAGR,MAAM,CAACS,eAAe,EACrEN,SACF;EAAE,GACEC,IAAI,CACT,CAAC;AAEN","ignoreList":[]}