@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.
- package/CHANGELOG.md +13 -0
- package/README.md +39 -22
- package/build/browser/object-table/DefaultCellRenderer.js +43 -0
- package/build/browser/object-table/DefaultCellRenderer.js.map +1 -0
- package/build/browser/object-table/EditableCell.js +91 -0
- package/build/browser/object-table/EditableCell.js.map +1 -0
- package/build/browser/object-table/EditableCell.module.css +3 -0
- package/build/browser/object-table/EditableCell.module.css.js +6 -0
- package/build/browser/object-table/ObjectTable.js +29 -2
- package/build/browser/object-table/ObjectTable.js.map +1 -1
- package/build/browser/object-table/ObjectTableApi.js.map +1 -1
- package/build/browser/object-table/Table.js +18 -3
- package/build/browser/object-table/Table.js.map +1 -1
- package/build/browser/object-table/Table.module.css +17 -1
- package/build/browser/object-table/Table.module.css.js +3 -1
- package/build/browser/object-table/TableBody.module.css +2 -0
- package/build/browser/object-table/TableCell.module.css +11 -1
- package/build/browser/object-table/TableHeader.module.css +4 -2
- package/build/browser/object-table/TableRow.module.css +2 -0
- package/build/browser/object-table/__tests__/useEditableTable.test.js +197 -0
- package/build/browser/object-table/__tests__/useEditableTable.test.js.map +1 -0
- package/build/browser/object-table/hooks/__tests__/useColumnDefs.test.js +13 -1
- package/build/browser/object-table/hooks/__tests__/useColumnDefs.test.js.map +1 -1
- package/build/browser/object-table/hooks/useColumnDefs.js +10 -2
- package/build/browser/object-table/hooks/useColumnDefs.js.map +1 -1
- package/build/browser/object-table/hooks/useEditableTable.js +57 -0
- package/build/browser/object-table/hooks/useEditableTable.js.map +1 -0
- package/build/browser/object-table/utils/getCellId.js +27 -0
- package/build/browser/object-table/utils/getCellId.js.map +1 -0
- package/build/browser/object-table/utils/types.js.map +1 -1
- package/build/browser/public/experimental.js.map +1 -1
- package/build/browser/styles.css +42 -4
- package/build/cjs/public/experimental.cjs +485 -289
- package/build/cjs/public/experimental.cjs.map +1 -1
- package/build/cjs/public/experimental.css +78 -48
- package/build/cjs/public/experimental.css.map +1 -1
- package/build/cjs/public/experimental.d.cts +44 -10
- package/build/esm/object-table/DefaultCellRenderer.js +43 -0
- package/build/esm/object-table/DefaultCellRenderer.js.map +1 -0
- package/build/esm/object-table/EditableCell.js +91 -0
- package/build/esm/object-table/EditableCell.js.map +1 -0
- package/build/esm/object-table/EditableCell.module.css +3 -0
- package/build/esm/object-table/ObjectTable.js +29 -2
- package/build/esm/object-table/ObjectTable.js.map +1 -1
- package/build/esm/object-table/ObjectTableApi.js.map +1 -1
- package/build/esm/object-table/Table.js +18 -3
- package/build/esm/object-table/Table.js.map +1 -1
- package/build/esm/object-table/Table.module.css +17 -1
- package/build/esm/object-table/TableBody.module.css +2 -0
- package/build/esm/object-table/TableCell.module.css +11 -1
- package/build/esm/object-table/TableHeader.module.css +4 -2
- package/build/esm/object-table/TableRow.module.css +2 -0
- package/build/esm/object-table/__tests__/useEditableTable.test.js +197 -0
- package/build/esm/object-table/__tests__/useEditableTable.test.js.map +1 -0
- package/build/esm/object-table/hooks/__tests__/useColumnDefs.test.js +13 -1
- package/build/esm/object-table/hooks/__tests__/useColumnDefs.test.js.map +1 -1
- package/build/esm/object-table/hooks/useColumnDefs.js +10 -2
- package/build/esm/object-table/hooks/useColumnDefs.js.map +1 -1
- package/build/esm/object-table/hooks/useEditableTable.js +57 -0
- package/build/esm/object-table/hooks/useEditableTable.js.map +1 -0
- package/build/esm/object-table/utils/getCellId.js +27 -0
- package/build/esm/object-table/utils/getCellId.js.map +1 -0
- package/build/esm/object-table/utils/types.js.map +1 -1
- package/build/esm/public/experimental.js.map +1 -1
- package/build/types/object-table/DefaultCellRenderer.d.ts +3 -0
- package/build/types/object-table/DefaultCellRenderer.d.ts.map +1 -0
- package/build/types/object-table/EditableCell.d.ts +10 -0
- package/build/types/object-table/EditableCell.d.ts.map +1 -0
- package/build/types/object-table/ObjectTable.d.ts +1 -1
- package/build/types/object-table/ObjectTable.d.ts.map +1 -1
- package/build/types/object-table/ObjectTableApi.d.ts +15 -0
- package/build/types/object-table/ObjectTableApi.d.ts.map +1 -1
- package/build/types/object-table/Table.d.ts +17 -3
- package/build/types/object-table/Table.d.ts.map +1 -1
- package/build/types/object-table/__tests__/useEditableTable.test.d.ts +1 -0
- package/build/types/object-table/__tests__/useEditableTable.test.d.ts.map +1 -0
- package/build/types/object-table/hooks/useColumnDefs.d.ts.map +1 -1
- package/build/types/object-table/hooks/useEditableTable.d.ts +22 -0
- package/build/types/object-table/hooks/useEditableTable.d.ts.map +1 -0
- package/build/types/object-table/utils/getCellId.d.ts +3 -0
- package/build/types/object-table/utils/getCellId.d.ts.map +1 -0
- package/build/types/object-table/utils/types.d.ts +9 -0
- package/build/types/object-table/utils/types.d.ts.map +1 -1
- package/build/types/public/experimental.d.ts +1 -0
- package/build/types/public/experimental.d.ts.map +1 -1
- 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;;
|
|
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":[]}
|
package/build/browser/styles.css
CHANGED
|
@@ -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(
|
|
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:
|
|
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:
|
|
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;
|