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

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 (86) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +39 -22
  3. package/build/browser/object-table/DefaultCellRenderer.js +43 -0
  4. package/build/browser/object-table/DefaultCellRenderer.js.map +1 -0
  5. package/build/browser/object-table/EditableCell.js +91 -0
  6. package/build/browser/object-table/EditableCell.js.map +1 -0
  7. package/build/browser/object-table/EditableCell.module.css +3 -0
  8. package/build/browser/object-table/EditableCell.module.css.js +6 -0
  9. package/build/browser/object-table/ObjectTable.js +29 -2
  10. package/build/browser/object-table/ObjectTable.js.map +1 -1
  11. package/build/browser/object-table/ObjectTableApi.js.map +1 -1
  12. package/build/browser/object-table/Table.js +18 -3
  13. package/build/browser/object-table/Table.js.map +1 -1
  14. package/build/browser/object-table/Table.module.css +17 -1
  15. package/build/browser/object-table/Table.module.css.js +3 -1
  16. package/build/browser/object-table/TableBody.module.css +2 -0
  17. package/build/browser/object-table/TableCell.module.css +11 -1
  18. package/build/browser/object-table/TableHeader.module.css +4 -2
  19. package/build/browser/object-table/TableRow.module.css +2 -0
  20. package/build/browser/object-table/__tests__/useEditableTable.test.js +197 -0
  21. package/build/browser/object-table/__tests__/useEditableTable.test.js.map +1 -0
  22. package/build/browser/object-table/hooks/__tests__/useColumnDefs.test.js +13 -1
  23. package/build/browser/object-table/hooks/__tests__/useColumnDefs.test.js.map +1 -1
  24. package/build/browser/object-table/hooks/useColumnDefs.js +10 -2
  25. package/build/browser/object-table/hooks/useColumnDefs.js.map +1 -1
  26. package/build/browser/object-table/hooks/useEditableTable.js +57 -0
  27. package/build/browser/object-table/hooks/useEditableTable.js.map +1 -0
  28. package/build/browser/object-table/utils/getCellId.js +27 -0
  29. package/build/browser/object-table/utils/getCellId.js.map +1 -0
  30. package/build/browser/object-table/utils/types.js.map +1 -1
  31. package/build/browser/public/experimental.js.map +1 -1
  32. package/build/browser/styles.css +42 -4
  33. package/build/cjs/public/experimental.cjs +485 -289
  34. package/build/cjs/public/experimental.cjs.map +1 -1
  35. package/build/cjs/public/experimental.css +78 -48
  36. package/build/cjs/public/experimental.css.map +1 -1
  37. package/build/cjs/public/experimental.d.cts +44 -10
  38. package/build/esm/object-table/DefaultCellRenderer.js +43 -0
  39. package/build/esm/object-table/DefaultCellRenderer.js.map +1 -0
  40. package/build/esm/object-table/EditableCell.js +91 -0
  41. package/build/esm/object-table/EditableCell.js.map +1 -0
  42. package/build/esm/object-table/EditableCell.module.css +3 -0
  43. package/build/esm/object-table/ObjectTable.js +29 -2
  44. package/build/esm/object-table/ObjectTable.js.map +1 -1
  45. package/build/esm/object-table/ObjectTableApi.js.map +1 -1
  46. package/build/esm/object-table/Table.js +18 -3
  47. package/build/esm/object-table/Table.js.map +1 -1
  48. package/build/esm/object-table/Table.module.css +17 -1
  49. package/build/esm/object-table/TableBody.module.css +2 -0
  50. package/build/esm/object-table/TableCell.module.css +11 -1
  51. package/build/esm/object-table/TableHeader.module.css +4 -2
  52. package/build/esm/object-table/TableRow.module.css +2 -0
  53. package/build/esm/object-table/__tests__/useEditableTable.test.js +197 -0
  54. package/build/esm/object-table/__tests__/useEditableTable.test.js.map +1 -0
  55. package/build/esm/object-table/hooks/__tests__/useColumnDefs.test.js +13 -1
  56. package/build/esm/object-table/hooks/__tests__/useColumnDefs.test.js.map +1 -1
  57. package/build/esm/object-table/hooks/useColumnDefs.js +10 -2
  58. package/build/esm/object-table/hooks/useColumnDefs.js.map +1 -1
  59. package/build/esm/object-table/hooks/useEditableTable.js +57 -0
  60. package/build/esm/object-table/hooks/useEditableTable.js.map +1 -0
  61. package/build/esm/object-table/utils/getCellId.js +27 -0
  62. package/build/esm/object-table/utils/getCellId.js.map +1 -0
  63. package/build/esm/object-table/utils/types.js.map +1 -1
  64. package/build/esm/public/experimental.js.map +1 -1
  65. package/build/types/object-table/DefaultCellRenderer.d.ts +3 -0
  66. package/build/types/object-table/DefaultCellRenderer.d.ts.map +1 -0
  67. package/build/types/object-table/EditableCell.d.ts +10 -0
  68. package/build/types/object-table/EditableCell.d.ts.map +1 -0
  69. package/build/types/object-table/ObjectTable.d.ts +1 -1
  70. package/build/types/object-table/ObjectTable.d.ts.map +1 -1
  71. package/build/types/object-table/ObjectTableApi.d.ts +15 -0
  72. package/build/types/object-table/ObjectTableApi.d.ts.map +1 -1
  73. package/build/types/object-table/Table.d.ts +17 -3
  74. package/build/types/object-table/Table.d.ts.map +1 -1
  75. package/build/types/object-table/__tests__/useEditableTable.test.d.ts +1 -0
  76. package/build/types/object-table/__tests__/useEditableTable.test.d.ts.map +1 -0
  77. package/build/types/object-table/hooks/useColumnDefs.d.ts.map +1 -1
  78. package/build/types/object-table/hooks/useEditableTable.d.ts +22 -0
  79. package/build/types/object-table/hooks/useEditableTable.d.ts.map +1 -0
  80. package/build/types/object-table/utils/getCellId.d.ts +3 -0
  81. package/build/types/object-table/utils/getCellId.d.ts.map +1 -0
  82. package/build/types/object-table/utils/types.d.ts +9 -0
  83. package/build/types/object-table/utils/types.d.ts.map +1 -1
  84. package/build/types/public/experimental.d.ts +1 -0
  85. package/build/types/public/experimental.d.ts.map +1 -1
  86. package/package.json +5 -5
@@ -0,0 +1,27 @@
1
+ /*
2
+ * Copyright 2025 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
+ export function getCellId(cellIdentifier) {
18
+ return JSON.stringify(cellIdentifier);
19
+ }
20
+ export function getCellIdentifier(cellId) {
21
+ const parsed = JSON.parse(cellId);
22
+ if (typeof parsed === "object" && parsed != null && "rowId" in parsed && "columnId" in parsed) {
23
+ return parsed;
24
+ }
25
+ throw new Error("Parsed cellId does not have required properties");
26
+ }
27
+ //# sourceMappingURL=getCellId.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getCellId.js","names":["getCellId","cellIdentifier","JSON","stringify","getCellIdentifier","cellId","parsed","parse","Error"],"sources":["getCellId.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 { CellIdentifier } from \"./types.js\";\n\nexport function getCellId(cellIdentifier: CellIdentifier): string {\n return JSON.stringify(cellIdentifier);\n}\n\nexport function getCellIdentifier(cellId: string): CellIdentifier {\n const parsed = JSON.parse(cellId);\n if (\n typeof parsed === \"object\" && parsed != null && \"rowId\" in parsed\n && \"columnId\" in parsed\n ) {\n return parsed as CellIdentifier;\n }\n throw new Error(\"Parsed cellId does not have required properties\");\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,OAAO,SAASA,SAASA,CAACC,cAA8B,EAAU;EAChE,OAAOC,IAAI,CAACC,SAAS,CAACF,cAAc,CAAC;AACvC;AAEA,OAAO,SAASG,iBAAiBA,CAACC,MAAc,EAAkB;EAChE,MAAMC,MAAM,GAAGJ,IAAI,CAACK,KAAK,CAACF,MAAM,CAAC;EACjC,IACE,OAAOC,MAAM,KAAK,QAAQ,IAAIA,MAAM,IAAI,IAAI,IAAI,OAAO,IAAIA,MAAM,IAC9D,UAAU,IAAIA,MAAM,EACvB;IACA,OAAOA,MAAM;EACf;EACA,MAAM,IAAIE,KAAK,CAAC,iDAAiD,CAAC;AACpE","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\nexport interface ColumnOption {\n id: string;\n name: string;\n canSort: boolean;\n}\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 CellValueState<TData extends RowData = unknown> {\n newValue?: TData;\n oldValue?: TData;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"experimental.js","names":["ObjectTable","BaseTable","ColumnConfigDialog"],"sources":["experimental.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\nexport type { FilterListProps } from \"../filter-list/FilterListApi.js\";\nexport type { FilterListItemProps } from \"../filter-list/FilterListItemApi.js\";\n\n// ObjectTable that loads and displays data for a given objectSet\nexport { ObjectTable } from \"../object-table/ObjectTable.js\";\nexport type {\n ColumnDefinition,\n ColumnDefinitionLocator,\n ObjectTableProps,\n} from \"../object-table/ObjectTableApi.js\";\n\n// BaseTable that does not handle data fetching\nexport type { BaseTableProps } from \"../object-table/Table.js\";\nexport { BaseTable } from \"../object-table/Table.js\";\n\nexport { ColumnConfigDialog } from \"../object-table/ColumnConfigDialog.js\";\nexport type {\n ColumnConfigDialogProps,\n ColumnConfigOptions,\n} from \"../object-table/ColumnConfigDialog.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACA,SAASA,WAAW,QAAQ,gCAAgC;;AAO5D;;AAEA,SAASC,SAAS,QAAQ,0BAA0B;AAEpD,SAASC,kBAAkB,QAAQ,uCAAuC","ignoreList":[]}
1
+ {"version":3,"file":"experimental.js","names":["ObjectTable","BaseTable","ColumnConfigDialog"],"sources":["experimental.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\nexport type { FilterListProps } from \"../filter-list/FilterListApi.js\";\nexport type { FilterListItemProps } from \"../filter-list/FilterListItemApi.js\";\n\n// ObjectTable that loads and displays data for a given objectSet\nexport { ObjectTable } from \"../object-table/ObjectTable.js\";\nexport type {\n ColumnDefinition,\n ColumnDefinitionLocator,\n ObjectTableProps,\n} from \"../object-table/ObjectTableApi.js\";\nexport type {\n CellIdentifier,\n CellValueState,\n} from \"../object-table/utils/types.js\";\n\n// BaseTable that does not handle data fetching\nexport type { BaseTableProps } from \"../object-table/Table.js\";\nexport { BaseTable } from \"../object-table/Table.js\";\n\nexport { ColumnConfigDialog } from \"../object-table/ColumnConfigDialog.js\";\nexport type {\n ColumnConfigDialogProps,\n ColumnConfigOptions,\n} from \"../object-table/ColumnConfigDialog.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACA,SAASA,WAAW,QAAQ,gCAAgC;;AAW5D;;AAEA,SAASC,SAAS,QAAQ,0BAA0B;AAEpD,SAASC,kBAAkB,QAAQ,uCAAuC","ignoreList":[]}
@@ -1114,6 +1114,12 @@
1114
1114
  }
1115
1115
 
1116
1116
 
1117
+ /* object-table/EditableCell.module.css */
1118
+ .EditableCell-module__osdkEditableInput___2BjN5Q4P:focus {
1119
+ outline: none;
1120
+ }
1121
+
1122
+
1117
1123
  /* object-table/LoadingCell.module.css */
1118
1124
  /*
1119
1125
  * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
@@ -1410,9 +1416,15 @@
1410
1416
  * limitations under the License.
1411
1417
  */
1412
1418
 
1419
+ .Table-module__osdkTableWrapper___qNSuMAE2 {
1420
+ display: flex;
1421
+ flex-direction: column;
1422
+ height: 100%;
1423
+ position: relative;
1424
+ }
1425
+
1413
1426
  .Table-module__osdkTableContainer___QBj68RD- {
1414
1427
  flex: 1;
1415
- height: 100%;
1416
1428
  min-height: 0;
1417
1429
  overflow: auto;
1418
1430
  position: relative;
@@ -1422,6 +1434,16 @@
1422
1434
  border-collapse: collapse;
1423
1435
  display: grid;
1424
1436
  table-layout: fixed;
1437
+ width: max-content;
1438
+ min-width: 100%;
1439
+ }
1440
+
1441
+ .Table-module__submitButtonContainer___2UgcHhXl {
1442
+ background-color: var(--osdk-surface-background-color-default-rest);
1443
+ border-top: var(--osdk-table-border);
1444
+ padding: var(--osdk-table-button-container-padding);
1445
+ display: flex;
1446
+ justify-content: flex-end;
1425
1447
  }
1426
1448
 
1427
1449
 
@@ -1445,6 +1467,8 @@
1445
1467
  .TableBody-module__osdkTableBody___YC9dMzce {
1446
1468
  display: grid;
1447
1469
  position: relative;
1470
+ width: max-content;
1471
+ min-width: 100%;
1448
1472
  }
1449
1473
 
1450
1474
 
@@ -1499,7 +1523,9 @@
1499
1523
  }
1500
1524
 
1501
1525
  /* First right-pinned column - no right-pinned siblings before it */
1502
- .TableCell-module__osdkTableCell___gVl6jToJ[data-pinned="right"]:not(:has(~ [data-pinned="right"]):nth-child(n+2)) {
1526
+ .TableCell-module__osdkTableCell___gVl6jToJ[data-pinned="right"]:not(
1527
+ :has(~ [data-pinned="right"]):nth-child(n + 2)
1528
+ ) {
1503
1529
  border-left: var(--osdk-table-pinned-column-border);
1504
1530
  }
1505
1531
 
@@ -1508,6 +1534,14 @@
1508
1534
  padding: 0;
1509
1535
  }
1510
1536
 
1537
+ /* Show focus state for editable cells */
1538
+ .TableCell-module__osdkTableCell___gVl6jToJ:not(:has([role="checkbox"])):has(input):focus-within {
1539
+ border: var(--osdk-emphasis-focus-width) solid
1540
+ var(--osdk-emphasis-focus-color);
1541
+ border-radius: var(--osdk-surface-border-radius);
1542
+ background-color: var(--osdk-table-cell-editable-bg);
1543
+ }
1544
+
1511
1545
  .TableCell-module__osdkTableCellContent___tcj6DRaU:not(:has([role="checkbox"])) {
1512
1546
  overflow: hidden;
1513
1547
  text-overflow: ellipsis;
@@ -1545,7 +1579,8 @@
1545
1579
  display: grid;
1546
1580
  position: sticky;
1547
1581
  top: 0;
1548
- width: 100%;
1582
+ width: max-content;
1583
+ min-width: 100%;
1549
1584
  height: var(--osdk-table-header-height);
1550
1585
  z-index: var(--osdk-surface-z-index-1);
1551
1586
  background-color: var(--osdk-table-header-bg);
@@ -1558,7 +1593,8 @@
1558
1593
 
1559
1594
  .TableHeader-module__osdkTableHeaderRow___lUjQpm91 {
1560
1595
  display: flex;
1561
- width: 100%;
1596
+ width: max-content;
1597
+ min-width: 100%;
1562
1598
  border-bottom: var(--osdk-table-border);
1563
1599
  }
1564
1600
 
@@ -1830,6 +1866,8 @@
1830
1866
  .TableRow-module__osdkTableRow___sjVwZnzA {
1831
1867
  position: absolute;
1832
1868
  display: flex;
1869
+ width: max-content;
1870
+ min-width: 100%;
1833
1871
  background-color: var(--osdk-table-row-bg-default);
1834
1872
  border-top: var(--osdk-table-row-divider);
1835
1873
  border-bottom: var(--osdk-table-border-width) solid transparent;