@osdk/react-components 0.17.0 → 0.18.0-main-ca8ef7c5d52f3369478e1d4c5b7eded97eb73215
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 +6 -0
- package/build/browser/object-table/ObjectTable.js +4 -4
- 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/hooks/useRowSelection.js +5 -4
- package/build/browser/object-table/hooks/useRowSelection.js.map +1 -1
- package/build/browser/util/UserAgent.js +1 -1
- package/build/browser/util/UserAgent.js.map +1 -1
- package/build/cjs/chunk-2BLJCM7D.cjs +11 -0
- package/build/cjs/{chunk-DVE44R2H.cjs.map → chunk-2BLJCM7D.cjs.map} +1 -1
- package/build/cjs/{chunk-QOKXBBSR.cjs → chunk-2QDWXDLC.cjs} +204 -236
- package/build/cjs/chunk-2QDWXDLC.cjs.map +1 -0
- package/build/cjs/{chunk-ONBWRKWJ.cjs → chunk-3P75JCUA.cjs} +14 -14
- package/build/cjs/chunk-3P75JCUA.cjs.map +1 -0
- package/build/cjs/chunk-6SWH5XK7.cjs +11 -0
- package/build/cjs/{chunk-HHVL4RYG.cjs.map → chunk-6SWH5XK7.cjs.map} +1 -1
- package/build/cjs/{chunk-25R5WVUR.cjs → chunk-7N22MOQP.cjs} +4 -4
- package/build/cjs/{chunk-25R5WVUR.cjs.map → chunk-7N22MOQP.cjs.map} +1 -1
- package/build/cjs/{chunk-JNFOPEN2.cjs → chunk-DDIMME5J.cjs} +4 -4
- package/build/cjs/{chunk-JNFOPEN2.cjs.map → chunk-DDIMME5J.cjs.map} +1 -1
- package/build/cjs/{chunk-6HVKQP7I.cjs → chunk-DSBCDOFJ.cjs} +4 -4
- package/build/cjs/{chunk-6HVKQP7I.cjs.map → chunk-DSBCDOFJ.cjs.map} +1 -1
- package/build/cjs/{chunk-ZBJEZKOD.cjs → chunk-FRSIMUPL.cjs} +90 -59
- package/build/cjs/chunk-FRSIMUPL.cjs.map +1 -0
- package/build/cjs/{chunk-R4M6VGVD.cjs → chunk-IEF4VCDI.cjs} +3 -3
- package/build/cjs/chunk-IEF4VCDI.cjs.map +1 -0
- package/build/cjs/chunk-M3FP4G7N.cjs +11 -0
- package/build/cjs/{chunk-AL43X5RI.cjs.map → chunk-M3FP4G7N.cjs.map} +1 -1
- package/build/cjs/chunk-XJ5TTKHA.cjs +11 -0
- package/build/cjs/{chunk-U2JT7LIS.cjs.map → chunk-XJ5TTKHA.cjs.map} +1 -1
- package/build/cjs/{chunk-BKLX3JZ5.cjs → chunk-YD76TX23.cjs} +4 -4
- package/build/cjs/{chunk-BKLX3JZ5.cjs.map → chunk-YD76TX23.cjs.map} +1 -1
- package/build/cjs/{chunk-BGTMZNYD.cjs → chunk-YNPAQDMC.cjs} +4 -4
- package/build/cjs/{chunk-BGTMZNYD.cjs.map → chunk-YNPAQDMC.cjs.map} +1 -1
- package/build/cjs/chunk-Z7VYBF3X.cjs +11 -0
- package/build/cjs/{chunk-VICC2NSA.cjs.map → chunk-Z7VYBF3X.cjs.map} +1 -1
- package/build/cjs/public/experimental/action-form.cjs +5 -5
- package/build/cjs/public/experimental/document-viewer.cjs +4 -4
- package/build/cjs/public/experimental/email-viewer.cjs +3 -3
- package/build/cjs/public/experimental/excel-viewer.cjs +3 -3
- package/build/cjs/public/experimental/filter-list.cjs +13 -13
- package/build/cjs/public/experimental/image-viewer.cjs +3 -3
- package/build/cjs/public/experimental/markdown-renderer.cjs +3 -3
- package/build/cjs/public/experimental/object-table.cjs +9 -9
- package/build/cjs/public/experimental/object-table.d.cts +11 -14
- package/build/cjs/public/experimental/pdf-viewer.cjs +7 -7
- package/build/cjs/public/experimental/tiff-renderer.cjs +3 -3
- package/build/cjs/public/experimental/video-viewer.cjs +3 -3
- package/build/cjs/public/experimental/xml-viewer.cjs +3 -3
- package/build/cjs/public/experimental.cjs +47 -47
- package/build/esm/object-table/ObjectTable.js +4 -4
- 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/hooks/useRowSelection.js +5 -4
- package/build/esm/object-table/hooks/useRowSelection.js.map +1 -1
- package/build/esm/util/UserAgent.js +1 -1
- package/build/esm/util/UserAgent.js.map +1 -1
- package/build/types/object-table/ObjectTable.d.ts.map +1 -1
- package/build/types/object-table/ObjectTableApi.d.ts +11 -14
- package/build/types/object-table/ObjectTableApi.d.ts.map +1 -1
- package/build/types/object-table/hooks/useRowSelection.d.ts +0 -1
- package/build/types/object-table/hooks/useRowSelection.d.ts.map +1 -1
- package/docs/ObjectTable.md +17 -17
- package/package.json +4 -4
- package/build/cjs/chunk-AL43X5RI.cjs +0 -11
- package/build/cjs/chunk-DVE44R2H.cjs +0 -11
- package/build/cjs/chunk-HHVL4RYG.cjs +0 -11
- package/build/cjs/chunk-ONBWRKWJ.cjs.map +0 -1
- package/build/cjs/chunk-QOKXBBSR.cjs.map +0 -1
- package/build/cjs/chunk-R4M6VGVD.cjs.map +0 -1
- package/build/cjs/chunk-U2JT7LIS.cjs +0 -11
- package/build/cjs/chunk-VICC2NSA.cjs +0 -11
- package/build/cjs/chunk-ZBJEZKOD.cjs.map +0 -1
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkDSBCDOFJ_cjs = require('../../chunk-DSBCDOFJ.cjs');
|
|
4
4
|
var chunkYWTXTRW3_cjs = require('../../chunk-YWTXTRW3.cjs');
|
|
5
|
-
require('../../chunk-
|
|
5
|
+
require('../../chunk-IEF4VCDI.cjs');
|
|
6
6
|
require('../../chunk-Q2W6GYRK.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
Object.defineProperty(exports, "PdfViewer", {
|
|
11
11
|
enumerable: true,
|
|
12
|
-
get: function () { return
|
|
12
|
+
get: function () { return chunkDSBCDOFJ_cjs.PdfViewer; }
|
|
13
13
|
});
|
|
14
14
|
Object.defineProperty(exports, "PdfViewerContent", {
|
|
15
15
|
enumerable: true,
|
|
16
|
-
get: function () { return
|
|
16
|
+
get: function () { return chunkDSBCDOFJ_cjs.PdfViewerContent; }
|
|
17
17
|
});
|
|
18
18
|
Object.defineProperty(exports, "PdfViewerProvider", {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: function () { return
|
|
20
|
+
get: function () { return chunkDSBCDOFJ_cjs.PdfViewerProvider; }
|
|
21
21
|
});
|
|
22
22
|
Object.defineProperty(exports, "usePdfViewerContext", {
|
|
23
23
|
enumerable: true,
|
|
24
|
-
get: function () { return
|
|
24
|
+
get: function () { return chunkDSBCDOFJ_cjs.usePdfViewerContext; }
|
|
25
25
|
});
|
|
26
26
|
Object.defineProperty(exports, "usePdfViewerInstance", {
|
|
27
27
|
enumerable: true,
|
|
28
|
-
get: function () { return
|
|
28
|
+
get: function () { return chunkDSBCDOFJ_cjs.usePdfViewerInstance; }
|
|
29
29
|
});
|
|
30
30
|
Object.defineProperty(exports, "BasePdfViewer", {
|
|
31
31
|
enumerable: true,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkYNPAQDMC_cjs = require('../../chunk-YNPAQDMC.cjs');
|
|
4
4
|
var chunkIISDOJPR_cjs = require('../../chunk-IISDOJPR.cjs');
|
|
5
5
|
require('../../chunk-MVQKV5BJ.cjs');
|
|
6
|
-
require('../../chunk-
|
|
6
|
+
require('../../chunk-IEF4VCDI.cjs');
|
|
7
7
|
require('../../chunk-Q2W6GYRK.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
Object.defineProperty(exports, "TiffViewerMedia", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkYNPAQDMC_cjs.TiffViewerMedia; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "TiffRenderer", {
|
|
16
16
|
enumerable: true,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk2BLJCM7D_cjs = require('../../chunk-2BLJCM7D.cjs');
|
|
4
4
|
var chunkKHMOMROL_cjs = require('../../chunk-KHMOMROL.cjs');
|
|
5
5
|
require('../../chunk-MVQKV5BJ.cjs');
|
|
6
|
-
require('../../chunk-
|
|
6
|
+
require('../../chunk-IEF4VCDI.cjs');
|
|
7
7
|
require('../../chunk-Q2W6GYRK.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
Object.defineProperty(exports, "VideoViewer", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunk2BLJCM7D_cjs.VideoViewer; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "BaseVideoViewer", {
|
|
16
16
|
enumerable: true,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkM3FP4G7N_cjs = require('../../chunk-M3FP4G7N.cjs');
|
|
4
4
|
var chunkOUJQJQ7N_cjs = require('../../chunk-OUJQJQ7N.cjs');
|
|
5
5
|
require('../../chunk-MVQKV5BJ.cjs');
|
|
6
|
-
require('../../chunk-
|
|
6
|
+
require('../../chunk-IEF4VCDI.cjs');
|
|
7
7
|
require('../../chunk-Q2W6GYRK.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
Object.defineProperty(exports, "XmlViewer", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkM3FP4G7N_cjs.XmlViewer; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "BaseXmlViewer", {
|
|
16
16
|
enumerable: true,
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
3
|
+
var chunk7N22MOQP_cjs = require('../chunk-7N22MOQP.cjs');
|
|
4
|
+
var chunk6SWH5XK7_cjs = require('../chunk-6SWH5XK7.cjs');
|
|
5
|
+
var chunkYD76TX23_cjs = require('../chunk-YD76TX23.cjs');
|
|
6
|
+
var chunk3P75JCUA_cjs = require('../chunk-3P75JCUA.cjs');
|
|
7
7
|
require('../chunk-EWLPXTKT.cjs');
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
8
|
+
var chunkDSBCDOFJ_cjs = require('../chunk-DSBCDOFJ.cjs');
|
|
9
|
+
var chunkYNPAQDMC_cjs = require('../chunk-YNPAQDMC.cjs');
|
|
10
|
+
var chunk2BLJCM7D_cjs = require('../chunk-2BLJCM7D.cjs');
|
|
11
|
+
var chunkM3FP4G7N_cjs = require('../chunk-M3FP4G7N.cjs');
|
|
12
12
|
require('../chunk-O5EUACSV.cjs');
|
|
13
|
-
var
|
|
13
|
+
var chunk2QDWXDLC_cjs = require('../chunk-2QDWXDLC.cjs');
|
|
14
14
|
require('../chunk-SFQMJMTV.cjs');
|
|
15
|
-
require('../chunk-
|
|
15
|
+
require('../chunk-FRSIMUPL.cjs');
|
|
16
16
|
require('../chunk-Z4JDLERD.cjs');
|
|
17
17
|
require('../chunk-LBWASTWS.cjs');
|
|
18
18
|
require('../chunk-JBRNNWYC.cjs');
|
|
19
19
|
require('../chunk-I3OSD6CF.cjs');
|
|
20
20
|
require('../chunk-7LXS66DW.cjs');
|
|
21
21
|
require('../chunk-MD4KDE44.cjs');
|
|
22
|
-
var
|
|
22
|
+
var chunkDDIMME5J_cjs = require('../chunk-DDIMME5J.cjs');
|
|
23
23
|
var chunkVOROB7KJ_cjs = require('../chunk-VOROB7KJ.cjs');
|
|
24
24
|
var chunkIYJOHKJE_cjs = require('../chunk-IYJOHKJE.cjs');
|
|
25
25
|
var chunkYWTXTRW3_cjs = require('../chunk-YWTXTRW3.cjs');
|
|
@@ -27,139 +27,139 @@ var chunkIISDOJPR_cjs = require('../chunk-IISDOJPR.cjs');
|
|
|
27
27
|
var chunkKHMOMROL_cjs = require('../chunk-KHMOMROL.cjs');
|
|
28
28
|
var chunkOUJQJQ7N_cjs = require('../chunk-OUJQJQ7N.cjs');
|
|
29
29
|
require('../chunk-UCTQICPR.cjs');
|
|
30
|
-
var
|
|
30
|
+
var chunkXJ5TTKHA_cjs = require('../chunk-XJ5TTKHA.cjs');
|
|
31
31
|
var chunkPKJFOG2Z_cjs = require('../chunk-PKJFOG2Z.cjs');
|
|
32
|
-
var
|
|
32
|
+
var chunkZ7VYBF3X_cjs = require('../chunk-Z7VYBF3X.cjs');
|
|
33
33
|
var chunk4VJIPB7R_cjs = require('../chunk-4VJIPB7R.cjs');
|
|
34
34
|
require('../chunk-MVQKV5BJ.cjs');
|
|
35
|
-
require('../chunk-
|
|
35
|
+
require('../chunk-IEF4VCDI.cjs');
|
|
36
36
|
require('../chunk-Q2W6GYRK.cjs');
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
Object.defineProperty(exports, "BaseFilterList", {
|
|
41
41
|
enumerable: true,
|
|
42
|
-
get: function () { return
|
|
42
|
+
get: function () { return chunk7N22MOQP_cjs.BaseFilterList; }
|
|
43
43
|
});
|
|
44
44
|
Object.defineProperty(exports, "FilterInput", {
|
|
45
45
|
enumerable: true,
|
|
46
|
-
get: function () { return
|
|
46
|
+
get: function () { return chunk7N22MOQP_cjs.FilterInput; }
|
|
47
47
|
});
|
|
48
48
|
Object.defineProperty(exports, "FilterList", {
|
|
49
49
|
enumerable: true,
|
|
50
|
-
get: function () { return
|
|
50
|
+
get: function () { return chunk7N22MOQP_cjs.FilterList; }
|
|
51
51
|
});
|
|
52
52
|
Object.defineProperty(exports, "FilterPopover", {
|
|
53
53
|
enumerable: true,
|
|
54
|
-
get: function () { return
|
|
54
|
+
get: function () { return chunk7N22MOQP_cjs.FilterPopover; }
|
|
55
55
|
});
|
|
56
56
|
Object.defineProperty(exports, "deserializeFilterStates", {
|
|
57
57
|
enumerable: true,
|
|
58
|
-
get: function () { return
|
|
58
|
+
get: function () { return chunk7N22MOQP_cjs.deserializeFilterStates; }
|
|
59
59
|
});
|
|
60
60
|
Object.defineProperty(exports, "filterHasActiveState", {
|
|
61
61
|
enumerable: true,
|
|
62
|
-
get: function () { return
|
|
62
|
+
get: function () { return chunk7N22MOQP_cjs.filterHasActiveState; }
|
|
63
63
|
});
|
|
64
64
|
Object.defineProperty(exports, "getFilterKey", {
|
|
65
65
|
enumerable: true,
|
|
66
|
-
get: function () { return
|
|
66
|
+
get: function () { return chunk7N22MOQP_cjs.getFilterKey; }
|
|
67
67
|
});
|
|
68
68
|
Object.defineProperty(exports, "getFilterLabel", {
|
|
69
69
|
enumerable: true,
|
|
70
|
-
get: function () { return
|
|
70
|
+
get: function () { return chunk7N22MOQP_cjs.getFilterLabel; }
|
|
71
71
|
});
|
|
72
72
|
Object.defineProperty(exports, "serializeFilterStates", {
|
|
73
73
|
enumerable: true,
|
|
74
|
-
get: function () { return
|
|
74
|
+
get: function () { return chunk7N22MOQP_cjs.serializeFilterStates; }
|
|
75
75
|
});
|
|
76
76
|
Object.defineProperty(exports, "summarizeFilterValue", {
|
|
77
77
|
enumerable: true,
|
|
78
|
-
get: function () { return
|
|
78
|
+
get: function () { return chunk7N22MOQP_cjs.summarizeFilterValue; }
|
|
79
79
|
});
|
|
80
80
|
Object.defineProperty(exports, "useFilterListState", {
|
|
81
81
|
enumerable: true,
|
|
82
|
-
get: function () { return
|
|
82
|
+
get: function () { return chunk7N22MOQP_cjs.useFilterListState; }
|
|
83
83
|
});
|
|
84
84
|
Object.defineProperty(exports, "ImageViewer", {
|
|
85
85
|
enumerable: true,
|
|
86
|
-
get: function () { return
|
|
86
|
+
get: function () { return chunk6SWH5XK7_cjs.ImageViewer; }
|
|
87
87
|
});
|
|
88
88
|
Object.defineProperty(exports, "MarkdownViewerMedia", {
|
|
89
89
|
enumerable: true,
|
|
90
|
-
get: function () { return
|
|
90
|
+
get: function () { return chunkYD76TX23_cjs.MarkdownViewerMedia; }
|
|
91
91
|
});
|
|
92
92
|
Object.defineProperty(exports, "BaseTable", {
|
|
93
93
|
enumerable: true,
|
|
94
|
-
get: function () { return
|
|
94
|
+
get: function () { return chunk3P75JCUA_cjs.BaseTable; }
|
|
95
95
|
});
|
|
96
96
|
Object.defineProperty(exports, "ColumnConfigDialog", {
|
|
97
97
|
enumerable: true,
|
|
98
|
-
get: function () { return
|
|
98
|
+
get: function () { return chunk3P75JCUA_cjs.ColumnConfigDialog; }
|
|
99
99
|
});
|
|
100
100
|
Object.defineProperty(exports, "LoadingCell", {
|
|
101
101
|
enumerable: true,
|
|
102
|
-
get: function () { return
|
|
102
|
+
get: function () { return chunk3P75JCUA_cjs.LoadingCell; }
|
|
103
103
|
});
|
|
104
104
|
Object.defineProperty(exports, "LoadingCellContent", {
|
|
105
105
|
enumerable: true,
|
|
106
|
-
get: function () { return
|
|
106
|
+
get: function () { return chunk3P75JCUA_cjs.LoadingCellContent; }
|
|
107
107
|
});
|
|
108
108
|
Object.defineProperty(exports, "MultiColumnSortDialog", {
|
|
109
109
|
enumerable: true,
|
|
110
|
-
get: function () { return
|
|
110
|
+
get: function () { return chunk3P75JCUA_cjs.MultiColumnSortDialog; }
|
|
111
111
|
});
|
|
112
112
|
Object.defineProperty(exports, "ObjectTable", {
|
|
113
113
|
enumerable: true,
|
|
114
|
-
get: function () { return
|
|
114
|
+
get: function () { return chunk3P75JCUA_cjs.ObjectTable; }
|
|
115
115
|
});
|
|
116
116
|
Object.defineProperty(exports, "PdfViewer", {
|
|
117
117
|
enumerable: true,
|
|
118
|
-
get: function () { return
|
|
118
|
+
get: function () { return chunkDSBCDOFJ_cjs.PdfViewer; }
|
|
119
119
|
});
|
|
120
120
|
Object.defineProperty(exports, "PdfViewerContent", {
|
|
121
121
|
enumerable: true,
|
|
122
|
-
get: function () { return
|
|
122
|
+
get: function () { return chunkDSBCDOFJ_cjs.PdfViewerContent; }
|
|
123
123
|
});
|
|
124
124
|
Object.defineProperty(exports, "PdfViewerProvider", {
|
|
125
125
|
enumerable: true,
|
|
126
|
-
get: function () { return
|
|
126
|
+
get: function () { return chunkDSBCDOFJ_cjs.PdfViewerProvider; }
|
|
127
127
|
});
|
|
128
128
|
Object.defineProperty(exports, "usePdfViewerContext", {
|
|
129
129
|
enumerable: true,
|
|
130
|
-
get: function () { return
|
|
130
|
+
get: function () { return chunkDSBCDOFJ_cjs.usePdfViewerContext; }
|
|
131
131
|
});
|
|
132
132
|
Object.defineProperty(exports, "usePdfViewerInstance", {
|
|
133
133
|
enumerable: true,
|
|
134
|
-
get: function () { return
|
|
134
|
+
get: function () { return chunkDSBCDOFJ_cjs.usePdfViewerInstance; }
|
|
135
135
|
});
|
|
136
136
|
Object.defineProperty(exports, "TiffViewerMedia", {
|
|
137
137
|
enumerable: true,
|
|
138
|
-
get: function () { return
|
|
138
|
+
get: function () { return chunkYNPAQDMC_cjs.TiffViewerMedia; }
|
|
139
139
|
});
|
|
140
140
|
Object.defineProperty(exports, "VideoViewer", {
|
|
141
141
|
enumerable: true,
|
|
142
|
-
get: function () { return
|
|
142
|
+
get: function () { return chunk2BLJCM7D_cjs.VideoViewer; }
|
|
143
143
|
});
|
|
144
144
|
Object.defineProperty(exports, "XmlViewer", {
|
|
145
145
|
enumerable: true,
|
|
146
|
-
get: function () { return
|
|
146
|
+
get: function () { return chunkM3FP4G7N_cjs.XmlViewer; }
|
|
147
147
|
});
|
|
148
148
|
Object.defineProperty(exports, "ActionForm", {
|
|
149
149
|
enumerable: true,
|
|
150
|
-
get: function () { return
|
|
150
|
+
get: function () { return chunk2QDWXDLC_cjs.ActionForm; }
|
|
151
151
|
});
|
|
152
152
|
Object.defineProperty(exports, "BaseForm", {
|
|
153
153
|
enumerable: true,
|
|
154
|
-
get: function () { return
|
|
154
|
+
get: function () { return chunk2QDWXDLC_cjs.BaseForm; }
|
|
155
155
|
});
|
|
156
156
|
Object.defineProperty(exports, "DocumentViewer", {
|
|
157
157
|
enumerable: true,
|
|
158
|
-
get: function () { return
|
|
158
|
+
get: function () { return chunkDDIMME5J_cjs.DocumentViewer; }
|
|
159
159
|
});
|
|
160
160
|
Object.defineProperty(exports, "ViewerType", {
|
|
161
161
|
enumerable: true,
|
|
162
|
-
get: function () { return
|
|
162
|
+
get: function () { return chunkDDIMME5J_cjs.ViewerType; }
|
|
163
163
|
});
|
|
164
164
|
Object.defineProperty(exports, "BaseImageViewer", {
|
|
165
165
|
enumerable: true,
|
|
@@ -251,7 +251,7 @@ Object.defineProperty(exports, "BaseXmlViewer", {
|
|
|
251
251
|
});
|
|
252
252
|
Object.defineProperty(exports, "EmailViewer", {
|
|
253
253
|
enumerable: true,
|
|
254
|
-
get: function () { return
|
|
254
|
+
get: function () { return chunkXJ5TTKHA_cjs.EmailViewer; }
|
|
255
255
|
});
|
|
256
256
|
Object.defineProperty(exports, "BaseEmailViewer", {
|
|
257
257
|
enumerable: true,
|
|
@@ -259,7 +259,7 @@ Object.defineProperty(exports, "BaseEmailViewer", {
|
|
|
259
259
|
});
|
|
260
260
|
Object.defineProperty(exports, "ExcelViewer", {
|
|
261
261
|
enumerable: true,
|
|
262
|
-
get: function () { return
|
|
262
|
+
get: function () { return chunkZ7VYBF3X_cjs.ExcelViewer; }
|
|
263
263
|
});
|
|
264
264
|
Object.defineProperty(exports, "BaseExcelViewer", {
|
|
265
265
|
enumerable: true,
|
|
@@ -50,6 +50,7 @@ export function ObjectTable({
|
|
|
50
50
|
onOrderByChanged,
|
|
51
51
|
onColumnsPinnedChanged,
|
|
52
52
|
onColumnResize,
|
|
53
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated -- intentional pass-through to fire alongside onRowSelectionChanged for backwards compatibility
|
|
53
54
|
onRowSelection,
|
|
54
55
|
onRowSelectionChanged,
|
|
55
56
|
onColumnHeaderClick,
|
|
@@ -98,17 +99,16 @@ export function ObjectTable({
|
|
|
98
99
|
let derivedObjectSet;
|
|
99
100
|
if (resultingObjectSet) {
|
|
100
101
|
if (primaryKeyApiName) {
|
|
101
|
-
derivedObjectSet = change.isSelectAll && change.
|
|
102
|
+
derivedObjectSet = change.isSelectAll && change.selectedRows.length > 0 ? resultingObjectSet : resultingObjectSet.where({
|
|
102
103
|
[primaryKeyApiName]: {
|
|
103
|
-
$in: change.
|
|
104
|
+
$in: change.selectedRows.map(r => r.$primaryKey)
|
|
104
105
|
}
|
|
105
106
|
});
|
|
106
|
-
} else if (change.isSelectAll && change.
|
|
107
|
+
} else if (change.isSelectAll && change.selectedRows.length > 0) {
|
|
107
108
|
derivedObjectSet = resultingObjectSet;
|
|
108
109
|
}
|
|
109
110
|
}
|
|
110
111
|
onRowSelectionChanged({
|
|
111
|
-
selectedRowIds: change.selectedRowIds,
|
|
112
112
|
selectedRows: change.selectedRows,
|
|
113
113
|
isSelectAll: change.isSelectAll,
|
|
114
114
|
objectSet: derivedObjectSet
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectTable.js","names":["getCoreRowModel","useReactTable","React","useCallback","useMemo","useColumnDefs","useColumnPinning","useColumnResize","useColumnVisibility","useEditableTable","useObjectTableData","useRowSelection","useSelectionColumn","useTableSorting","BaseTable","getRowId","EMPTY_ARRAY","ObjectTable","objectType","objectSet","columnDefinitions","filter","objectSetOptions","dedupeIntervalMs","pageSize","orderBy","defaultOrderBy","onOrderByChanged","onColumnsPinnedChanged","onColumnResize","onRowSelection","onRowSelectionChanged","onColumnHeaderClick","renderCellContextMenu","selectionMode","selectedRows","isAllSelected","isAllSelectedProp","onColumnVisibilityChanged","onCellValueChanged","onSubmitEdits","enableOrdering","enableColumnPinning","enableColumnResizing","enableColumnConfig","editMode","props","columnSizing","onColumnSizingChange","sorting","onSortingChange","data","fetchMore","isLoading","error","resultingObjectSet","columns","loading","isColumnsLoading","primaryKeyApiName","type","undefined","handleRowSelectionChanged","change","derivedObjectSet","isSelectAll","selectedRowIds","length","where","$in","rowSelection","hasSelection","onToggleAll","onToggleRow","enableRowSelection","selectionColumn","columnVisibility","onColumnVisibilityChange","columnOrder","onColumnOrderChange","allColumns","columnPinning","onColumnPinningChange","hasSelectionColumn","editableConfig","table","state","enableSorting","columnResizeMode","columnResizeDirection","manualSorting","defaultColumn","minSize","meta","onCellEdit","onCellValidationError","clearCellValidationError","cellEdits","isInEditMode","editModeState","isActive","validationErrors","onRenderCellContextMenu","row","cell","getValue","handleColumnHeaderClick","columnId","headerMenuFeatureFlags","showSortingItems","showPinningItems","showResizeItem","showConfigItem","createElement","fetchNextPage","onRowClick","rowHeight","renderEmptyState","className","getRowAttributes","showEditFooter"],"sources":["ObjectTable.tsx"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ObjectOrInterfaceDefinition,\n ObjectSet,\n Osdk,\n PropertyKeys,\n QueryDefinition,\n SimplePropertyDef,\n WhereClause,\n} from \"@osdk/api\";\nimport type { Cell } from \"@tanstack/react-table\";\nimport { getCoreRowModel, useReactTable } from \"@tanstack/react-table\";\nimport React, { useCallback, useMemo } from \"react\";\nimport { useColumnDefs } from \"./hooks/useColumnDefs.js\";\nimport { useColumnPinning } from \"./hooks/useColumnPinning.js\";\nimport { useColumnResize } from \"./hooks/useColumnResize.js\";\nimport { useColumnVisibility } from \"./hooks/useColumnVisibility.js\";\nimport { useEditableTable } from \"./hooks/useEditableTable.js\";\nimport { useObjectTableData } from \"./hooks/useObjectTableData.js\";\nimport type { UseRowSelectionChange } from \"./hooks/useRowSelection.js\";\nimport { useRowSelection } from \"./hooks/useRowSelection.js\";\nimport { useSelectionColumn } from \"./hooks/useSelectionColumn.js\";\nimport { useTableSorting } from \"./hooks/useTableSorting.js\";\nimport type { ObjectTableProps } from \"./ObjectTableApi.js\";\nimport { BaseTable } from \"./Table.js\";\nimport type { HeaderMenuFeatureFlags } from \"./TableHeaderWithPopover.js\";\nimport { getRowId } from \"./utils/getRowId.js\";\n\nconst EMPTY_ARRAY: [] = [];\nimport type { EditableConfig } from \"./utils/types.js\";\n\n/**\n * ObjectTable - A headless table component for displaying OSDK object sets\n *\n * @example\n * ```tsx\n * <ObjectTable objectType={MyObjectType} />\n * ```\n */\n\nexport function ObjectTable<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<\n string,\n never\n >,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n>({\n objectType,\n objectSet,\n columnDefinitions,\n filter,\n objectSetOptions,\n dedupeIntervalMs,\n pageSize,\n orderBy,\n defaultOrderBy,\n onOrderByChanged,\n onColumnsPinnedChanged,\n onColumnResize,\n onRowSelection,\n onRowSelectionChanged,\n onColumnHeaderClick,\n renderCellContextMenu,\n selectionMode = \"none\",\n selectedRows,\n isAllSelected: isAllSelectedProp,\n onColumnVisibilityChanged,\n onCellValueChanged,\n onSubmitEdits,\n enableOrdering = true,\n enableColumnPinning = true,\n enableColumnResizing = true,\n enableColumnConfig = true,\n editMode = \"manual\",\n ...props\n}: ObjectTableProps<Q, RDPs, FunctionColumns>): React.ReactElement {\n const { columnSizing, onColumnSizingChange } = useColumnResize({\n onColumnResize,\n });\n\n const { sorting, onSortingChange } = useTableSorting<\n Q,\n RDPs,\n FunctionColumns\n >(\n {\n orderBy,\n defaultOrderBy,\n onOrderByChanged,\n },\n );\n\n const { data, fetchMore, isLoading, error, objectSet: resultingObjectSet } =\n useObjectTableData<\n Q,\n RDPs,\n FunctionColumns\n >(\n objectType,\n columnDefinitions,\n filter,\n sorting,\n objectSet,\n objectSetOptions,\n dedupeIntervalMs,\n pageSize,\n );\n\n const { columns, loading: isColumnsLoading } = useColumnDefs<\n Q,\n RDPs,\n FunctionColumns\n >(\n objectType,\n columnDefinitions,\n );\n\n const primaryKeyApiName = objectType.type === \"object\"\n ? objectType.primaryKeyApiName\n : undefined;\n\n const handleRowSelectionChanged = useCallback(\n (change: UseRowSelectionChange<Q, RDPs>) => {\n if (!onRowSelectionChanged) return;\n\n let derivedObjectSet: ObjectSet<Q, RDPs> | undefined;\n if (resultingObjectSet) {\n if (primaryKeyApiName) {\n derivedObjectSet =\n change.isSelectAll && change.selectedRowIds.length > 0\n ? resultingObjectSet\n : resultingObjectSet.where({\n [primaryKeyApiName]: { $in: change.selectedRowIds },\n } as WhereClause<Q, RDPs>);\n } else if (change.isSelectAll && change.selectedRowIds.length > 0) {\n derivedObjectSet = resultingObjectSet;\n }\n }\n\n onRowSelectionChanged({\n selectedRowIds: change.selectedRowIds,\n selectedRows: change.selectedRows,\n isSelectAll: change.isSelectAll,\n objectSet: derivedObjectSet,\n });\n },\n [\n onRowSelectionChanged,\n resultingObjectSet,\n primaryKeyApiName,\n ],\n );\n\n const {\n rowSelection,\n isAllSelected,\n hasSelection,\n onToggleAll,\n onToggleRow,\n enableRowSelection,\n } = useRowSelection<Q, RDPs>({\n selectionMode,\n selectedRows,\n isAllSelected: isAllSelectedProp,\n onRowSelection,\n onRowSelectionChanged: handleRowSelectionChanged,\n data,\n });\n\n const selectionColumn = useSelectionColumn<Q, RDPs>(\n {\n selectionMode,\n isAllSelected,\n hasSelection,\n onToggleAll,\n onToggleRow,\n },\n );\n\n const {\n columnVisibility,\n onColumnVisibilityChange,\n columnOrder,\n onColumnOrderChange,\n } = useColumnVisibility({\n allColumns: columns,\n onColumnVisibilityChanged,\n });\n\n const { columnPinning, onColumnPinningChange } = useColumnPinning({\n columnDefinitions,\n hasSelectionColumn: enableRowSelection,\n onColumnsPinnedChanged,\n });\n\n const allColumns = useMemo(() => {\n return selectionColumn ? [selectionColumn, ...columns] : columns;\n }, [selectionColumn, columns]);\n\n const editableConfig: EditableConfig<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n unknown\n > = useEditableTable({\n editMode,\n onCellValueChanged,\n onSubmitEdits,\n });\n\n const table = useReactTable<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>\n >({\n data: data ?? EMPTY_ARRAY,\n columns: allColumns,\n getCoreRowModel: getCoreRowModel(),\n state: {\n columnVisibility,\n columnOrder,\n rowSelection,\n sorting,\n columnSizing,\n columnPinning,\n },\n onSortingChange,\n onColumnSizingChange,\n onColumnPinningChange,\n onColumnVisibilityChange,\n onColumnOrderChange,\n enableRowSelection,\n enableSorting: enableOrdering,\n columnResizeMode: \"onChange\",\n columnResizeDirection: \"ltr\",\n manualSorting: true, // Enable manual sorting to indicate server-side sorting\n defaultColumn: {\n minSize: 80,\n },\n getRowId,\n meta: {\n onCellEdit: editableConfig.onCellEdit,\n onCellValidationError: editableConfig.onCellValidationError,\n clearCellValidationError: editableConfig.clearCellValidationError,\n cellEdits: editableConfig.cellEdits,\n isInEditMode: editableConfig.editModeState.isActive,\n validationErrors: editableConfig.validationErrors,\n },\n });\n\n const onRenderCellContextMenu = useCallback(\n (\n row: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n cell: Cell<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n unknown\n >,\n ) => {\n return renderCellContextMenu?.(row, cell.getValue());\n },\n [renderCellContextMenu],\n );\n\n const handleColumnHeaderClick = useMemo(\n () =>\n onColumnHeaderClick\n ? (columnId: string) =>\n onColumnHeaderClick(\n columnId as\n | PropertyKeys<Q>\n | keyof RDPs\n | keyof FunctionColumns,\n )\n : undefined,\n [onColumnHeaderClick],\n );\n\n const isTableLoading = isLoading || isColumnsLoading;\n\n const headerMenuFeatureFlags: HeaderMenuFeatureFlags = useMemo(() => ({\n showSortingItems: enableOrdering,\n showPinningItems: enableColumnPinning,\n showResizeItem: enableColumnResizing,\n showConfigItem: enableColumnConfig,\n }), [\n enableOrdering,\n enableColumnPinning,\n enableColumnResizing,\n enableColumnConfig,\n ]);\n\n return (\n <BaseTable<Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>>\n table={table}\n isLoading={isTableLoading}\n fetchNextPage={fetchMore}\n onRowClick={props.onRowClick}\n onColumnHeaderClick={handleColumnHeaderClick}\n rowHeight={props.rowHeight}\n renderCellContextMenu={onRenderCellContextMenu}\n renderEmptyState={props.renderEmptyState}\n className={props.className}\n error={error}\n headerMenuFeatureFlags={headerMenuFeatureFlags}\n editableConfig={editableConfig}\n getRowAttributes={props.getRowAttributes}\n showEditFooter={props.showEditFooter}\n />\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYA,SAASA,eAAe,EAAEC,aAAa,QAAQ,uBAAuB;AACtE,OAAOC,KAAK,IAAIC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AACnD,SAASC,aAAa,QAAQ,0BAA0B;AACxD,SAASC,gBAAgB,QAAQ,6BAA6B;AAC9D,SAASC,eAAe,QAAQ,4BAA4B;AAC5D,SAASC,mBAAmB,QAAQ,gCAAgC;AACpE,SAASC,gBAAgB,QAAQ,6BAA6B;AAC9D,SAASC,kBAAkB,QAAQ,+BAA+B;AAElE,SAASC,eAAe,QAAQ,4BAA4B;AAC5D,SAASC,kBAAkB,QAAQ,+BAA+B;AAClE,SAASC,eAAe,QAAQ,4BAA4B;AAE5D,SAASC,SAAS,QAAQ,YAAY;AAEtC,SAASC,QAAQ,QAAQ,qBAAqB;AAE9C,MAAMC,WAAe,GAAG,EAAE;AAG1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,SAASC,WAAWA,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
|
1
|
+
{"version":3,"file":"ObjectTable.js","names":["getCoreRowModel","useReactTable","React","useCallback","useMemo","useColumnDefs","useColumnPinning","useColumnResize","useColumnVisibility","useEditableTable","useObjectTableData","useRowSelection","useSelectionColumn","useTableSorting","BaseTable","getRowId","EMPTY_ARRAY","ObjectTable","objectType","objectSet","columnDefinitions","filter","objectSetOptions","dedupeIntervalMs","pageSize","orderBy","defaultOrderBy","onOrderByChanged","onColumnsPinnedChanged","onColumnResize","onRowSelection","onRowSelectionChanged","onColumnHeaderClick","renderCellContextMenu","selectionMode","selectedRows","isAllSelected","isAllSelectedProp","onColumnVisibilityChanged","onCellValueChanged","onSubmitEdits","enableOrdering","enableColumnPinning","enableColumnResizing","enableColumnConfig","editMode","props","columnSizing","onColumnSizingChange","sorting","onSortingChange","data","fetchMore","isLoading","error","resultingObjectSet","columns","loading","isColumnsLoading","primaryKeyApiName","type","undefined","handleRowSelectionChanged","change","derivedObjectSet","isSelectAll","length","where","$in","map","r","$primaryKey","rowSelection","hasSelection","onToggleAll","onToggleRow","enableRowSelection","selectionColumn","columnVisibility","onColumnVisibilityChange","columnOrder","onColumnOrderChange","allColumns","columnPinning","onColumnPinningChange","hasSelectionColumn","editableConfig","table","state","enableSorting","columnResizeMode","columnResizeDirection","manualSorting","defaultColumn","minSize","meta","onCellEdit","onCellValidationError","clearCellValidationError","cellEdits","isInEditMode","editModeState","isActive","validationErrors","onRenderCellContextMenu","row","cell","getValue","handleColumnHeaderClick","columnId","headerMenuFeatureFlags","showSortingItems","showPinningItems","showResizeItem","showConfigItem","createElement","fetchNextPage","onRowClick","rowHeight","renderEmptyState","className","getRowAttributes","showEditFooter"],"sources":["ObjectTable.tsx"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ObjectOrInterfaceDefinition,\n ObjectSet,\n Osdk,\n PropertyKeys,\n QueryDefinition,\n SimplePropertyDef,\n WhereClause,\n} from \"@osdk/api\";\nimport type { Cell } from \"@tanstack/react-table\";\nimport { getCoreRowModel, useReactTable } from \"@tanstack/react-table\";\nimport React, { useCallback, useMemo } from \"react\";\nimport { useColumnDefs } from \"./hooks/useColumnDefs.js\";\nimport { useColumnPinning } from \"./hooks/useColumnPinning.js\";\nimport { useColumnResize } from \"./hooks/useColumnResize.js\";\nimport { useColumnVisibility } from \"./hooks/useColumnVisibility.js\";\nimport { useEditableTable } from \"./hooks/useEditableTable.js\";\nimport { useObjectTableData } from \"./hooks/useObjectTableData.js\";\nimport type { UseRowSelectionChange } from \"./hooks/useRowSelection.js\";\nimport { useRowSelection } from \"./hooks/useRowSelection.js\";\nimport { useSelectionColumn } from \"./hooks/useSelectionColumn.js\";\nimport { useTableSorting } from \"./hooks/useTableSorting.js\";\nimport type { ObjectTableProps } from \"./ObjectTableApi.js\";\nimport { BaseTable } from \"./Table.js\";\nimport type { HeaderMenuFeatureFlags } from \"./TableHeaderWithPopover.js\";\nimport { getRowId } from \"./utils/getRowId.js\";\n\nconst EMPTY_ARRAY: [] = [];\nimport type { EditableConfig } from \"./utils/types.js\";\n\n/**\n * ObjectTable - A headless table component for displaying OSDK object sets\n *\n * @example\n * ```tsx\n * <ObjectTable objectType={MyObjectType} />\n * ```\n */\n\nexport function ObjectTable<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<\n string,\n never\n >,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n>({\n objectType,\n objectSet,\n columnDefinitions,\n filter,\n objectSetOptions,\n dedupeIntervalMs,\n pageSize,\n orderBy,\n defaultOrderBy,\n onOrderByChanged,\n onColumnsPinnedChanged,\n onColumnResize,\n // eslint-disable-next-line @typescript-eslint/no-deprecated -- intentional pass-through to fire alongside onRowSelectionChanged for backwards compatibility\n onRowSelection,\n onRowSelectionChanged,\n onColumnHeaderClick,\n renderCellContextMenu,\n selectionMode = \"none\",\n selectedRows,\n isAllSelected: isAllSelectedProp,\n onColumnVisibilityChanged,\n onCellValueChanged,\n onSubmitEdits,\n enableOrdering = true,\n enableColumnPinning = true,\n enableColumnResizing = true,\n enableColumnConfig = true,\n editMode = \"manual\",\n ...props\n}: ObjectTableProps<Q, RDPs, FunctionColumns>): React.ReactElement {\n const { columnSizing, onColumnSizingChange } = useColumnResize({\n onColumnResize,\n });\n\n const { sorting, onSortingChange } = useTableSorting<\n Q,\n RDPs,\n FunctionColumns\n >(\n {\n orderBy,\n defaultOrderBy,\n onOrderByChanged,\n },\n );\n\n const { data, fetchMore, isLoading, error, objectSet: resultingObjectSet } =\n useObjectTableData<\n Q,\n RDPs,\n FunctionColumns\n >(\n objectType,\n columnDefinitions,\n filter,\n sorting,\n objectSet,\n objectSetOptions,\n dedupeIntervalMs,\n pageSize,\n );\n\n const { columns, loading: isColumnsLoading } = useColumnDefs<\n Q,\n RDPs,\n FunctionColumns\n >(\n objectType,\n columnDefinitions,\n );\n\n const primaryKeyApiName = objectType.type === \"object\"\n ? objectType.primaryKeyApiName\n : undefined;\n\n const handleRowSelectionChanged = useCallback(\n (change: UseRowSelectionChange<Q, RDPs>) => {\n if (!onRowSelectionChanged) return;\n\n let derivedObjectSet: ObjectSet<Q, RDPs> | undefined;\n if (resultingObjectSet) {\n if (primaryKeyApiName) {\n derivedObjectSet =\n change.isSelectAll && change.selectedRows.length > 0\n ? resultingObjectSet\n : resultingObjectSet.where({\n [primaryKeyApiName]: {\n $in: change.selectedRows.map(r => r.$primaryKey),\n },\n } as WhereClause<Q, RDPs>);\n } else if (change.isSelectAll && change.selectedRows.length > 0) {\n derivedObjectSet = resultingObjectSet;\n }\n }\n\n onRowSelectionChanged({\n selectedRows: change.selectedRows,\n isSelectAll: change.isSelectAll,\n objectSet: derivedObjectSet,\n });\n },\n [\n onRowSelectionChanged,\n resultingObjectSet,\n primaryKeyApiName,\n ],\n );\n\n const {\n rowSelection,\n isAllSelected,\n hasSelection,\n onToggleAll,\n onToggleRow,\n enableRowSelection,\n } = useRowSelection<Q, RDPs>({\n selectionMode,\n selectedRows,\n isAllSelected: isAllSelectedProp,\n onRowSelection,\n onRowSelectionChanged: handleRowSelectionChanged,\n data,\n });\n\n const selectionColumn = useSelectionColumn<Q, RDPs>(\n {\n selectionMode,\n isAllSelected,\n hasSelection,\n onToggleAll,\n onToggleRow,\n },\n );\n\n const {\n columnVisibility,\n onColumnVisibilityChange,\n columnOrder,\n onColumnOrderChange,\n } = useColumnVisibility({\n allColumns: columns,\n onColumnVisibilityChanged,\n });\n\n const { columnPinning, onColumnPinningChange } = useColumnPinning({\n columnDefinitions,\n hasSelectionColumn: enableRowSelection,\n onColumnsPinnedChanged,\n });\n\n const allColumns = useMemo(() => {\n return selectionColumn ? [selectionColumn, ...columns] : columns;\n }, [selectionColumn, columns]);\n\n const editableConfig: EditableConfig<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n unknown\n > = useEditableTable({\n editMode,\n onCellValueChanged,\n onSubmitEdits,\n });\n\n const table = useReactTable<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>\n >({\n data: data ?? EMPTY_ARRAY,\n columns: allColumns,\n getCoreRowModel: getCoreRowModel(),\n state: {\n columnVisibility,\n columnOrder,\n rowSelection,\n sorting,\n columnSizing,\n columnPinning,\n },\n onSortingChange,\n onColumnSizingChange,\n onColumnPinningChange,\n onColumnVisibilityChange,\n onColumnOrderChange,\n enableRowSelection,\n enableSorting: enableOrdering,\n columnResizeMode: \"onChange\",\n columnResizeDirection: \"ltr\",\n manualSorting: true, // Enable manual sorting to indicate server-side sorting\n defaultColumn: {\n minSize: 80,\n },\n getRowId,\n meta: {\n onCellEdit: editableConfig.onCellEdit,\n onCellValidationError: editableConfig.onCellValidationError,\n clearCellValidationError: editableConfig.clearCellValidationError,\n cellEdits: editableConfig.cellEdits,\n isInEditMode: editableConfig.editModeState.isActive,\n validationErrors: editableConfig.validationErrors,\n },\n });\n\n const onRenderCellContextMenu = useCallback(\n (\n row: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n cell: Cell<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n unknown\n >,\n ) => {\n return renderCellContextMenu?.(row, cell.getValue());\n },\n [renderCellContextMenu],\n );\n\n const handleColumnHeaderClick = useMemo(\n () =>\n onColumnHeaderClick\n ? (columnId: string) =>\n onColumnHeaderClick(\n columnId as\n | PropertyKeys<Q>\n | keyof RDPs\n | keyof FunctionColumns,\n )\n : undefined,\n [onColumnHeaderClick],\n );\n\n const isTableLoading = isLoading || isColumnsLoading;\n\n const headerMenuFeatureFlags: HeaderMenuFeatureFlags = useMemo(() => ({\n showSortingItems: enableOrdering,\n showPinningItems: enableColumnPinning,\n showResizeItem: enableColumnResizing,\n showConfigItem: enableColumnConfig,\n }), [\n enableOrdering,\n enableColumnPinning,\n enableColumnResizing,\n enableColumnConfig,\n ]);\n\n return (\n <BaseTable<Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>>\n table={table}\n isLoading={isTableLoading}\n fetchNextPage={fetchMore}\n onRowClick={props.onRowClick}\n onColumnHeaderClick={handleColumnHeaderClick}\n rowHeight={props.rowHeight}\n renderCellContextMenu={onRenderCellContextMenu}\n renderEmptyState={props.renderEmptyState}\n className={props.className}\n error={error}\n headerMenuFeatureFlags={headerMenuFeatureFlags}\n editableConfig={editableConfig}\n getRowAttributes={props.getRowAttributes}\n showEditFooter={props.showEditFooter}\n />\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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Ac,EACdC,mBAAmB,EACnBC,oBAAoB,EACpBC,kBAAkB,CACnB,CAAC;EAEF,oBACE1C,KAAA,CAAAiH,aAAA,CAACrG,SAAS;IACRyE,KAAK,EAAEA,KAAM;IACblC,SAAS,EAjBUA,SAAS,IAAIK,gBAiBN;IAC1B0D,aAAa,EAAEhE,SAAU;IACzBiE,UAAU,EAAEvE,KAAK,CAACuE,UAAW;IAC7BrF,mBAAmB,EAAE4E,uBAAwB;IAC7CU,SAAS,EAAExE,KAAK,CAACwE,SAAU;IAC3BrF,qBAAqB,EAAEuE,uBAAwB;IAC/Ce,gBAAgB,EAAEzE,KAAK,CAACyE,gBAAiB;IACzCC,SAAS,EAAE1E,KAAK,CAAC0E,SAAU;IAC3BlE,KAAK,EAAEA,KAAM;IACbwD,sBAAsB,EAAEA,sBAAuB;IAC/CxB,cAAc,EAAEA,cAAe;IAC/BmC,gBAAgB,EAAE3E,KAAK,CAAC2E,gBAAiB;IACzCC,cAAc,EAAE5E,KAAK,CAAC4E;EAAe,CACtC,CAAC;AAEN","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectTableApi.js","names":[],"sources":["ObjectTableApi.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n CompileTimeMetadata,\n DerivedProperty,\n ObjectOrInterfaceDefinition,\n ObjectSet,\n Osdk,\n PrimaryKeyType,\n PropertyKeys,\n QueryDefinition,\n SimplePropertyDef,\n WhereClause,\n} from \"@osdk/api\";\nimport type { QueryParameterType } from \"@osdk/client/observable\";\nimport type * as React from \"react\";\nimport type { CellEditInfo, EditFieldConfig } from \"./utils/types.js\";\n\nexport type { EditFieldConfig } from \"./utils/types.js\";\n\nexport type ColumnDefinition<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> =\n | EditableColumnDefinition<Q, RDPs, FunctionColumns>\n | ReadonlyColumnDefinition<Q, RDPs, FunctionColumns>;\n\ninterface SharedColumnDefinition<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> {\n locator: ColumnDefinitionLocator<Q, RDPs, FunctionColumns>;\n\n /**\n * @default true\n */\n isVisible?: boolean;\n\n /**\n * @default none\n */\n pinned?: \"left\" | \"right\" | \"none\";\n width?: number;\n minWidth?: number;\n maxWidth?: number;\n resizable?: boolean;\n orderable?: boolean;\n filterable?: boolean;\n\n /**\n * Custom renderer for the cell value.\n *\n * Interaction with `editable` columns:\n * - When `editMode: \"manual\"` (default), `renderCell` is used while the\n * table is read-only (Edit Table button visible) and the editable cell\n * takes over once the user enters edit mode.\n * - When `editMode: \"always\"`, the editable cell always wins on editable\n * columns and `renderCell` is ignored — `editMode: \"always\"` opts the\n * column into a permanently-editable surface, leaving no read-only\n * state for `renderCell` to render. Use `editMode: \"manual\"` if you\n * need a custom display alongside editing.\n */\n renderCell?: (\n object: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n locator: ColumnDefinitionLocator<Q, RDPs, FunctionColumns>,\n ) => React.ReactNode;\n\n /**\n * If provided, this will be used in the column header.\n * If both columnName and renderHeader are provided, renderHeader will take precedence in the table header.\n * columnName will still be used in other parts where the column name is displayed.\n *\n * If not provided,\n * for a property column, the property displayName will be used\n * for other columns, the id will be used.\n */\n columnName?: string;\n\n /**\n * If provided, this will be used to render the header component.\n * When both columnName and renderHeader are provided, renderHeader will take precedence in the table header.\n */\n renderHeader?: () => React.ReactNode;\n}\n\ninterface EditableColumnDefinition<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> extends SharedColumnDefinition<Q, RDPs, FunctionColumns> {\n /**\n * `editable` can be a boolean or a predicate that receives the row's object\n * and returns whether the cell is editable\n */\n editable:\n | true\n | ((\n object: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n ) => boolean);\n\n /**\n * Configuration for the cell editor component.\n *\n * When provided, the column uses the specified field component\n * (e.g. dropdown) instead of the default auto-detected text/number input.\n *\n * `getFieldComponentProps` receives the row's object and a map of any\n * pending edits for that row (keyed by column id), and returns the props to\n * pass to the field component. Editor configuration can depend on the\n * current row or on other in-progress edits within the row.\n */\n editFieldConfig?: EditFieldConfig<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>\n >;\n\n /**\n * Additional function to validate the cell value during edit.\n *\n * @param value the current cell value\n * @returns a promise that resolves to an error message string if validation fails, or undefined if validation succeeds\n */\n validateEdit?: (\n value: unknown,\n ) => Promise<string | undefined>;\n}\n\n/**\n * Column definition for a read-only column (default).\n * `editFieldConfig` and `validateEdit` are not available.\n */\ninterface ReadonlyColumnDefinition<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> extends SharedColumnDefinition<Q, RDPs, FunctionColumns> {\n editable?: false;\n}\n\nexport type ExtractQueryParameters<\n Q extends QueryDefinition,\n> = CompileTimeMetadata<Q>[\"parameters\"] extends Record<string, never>\n ? undefined\n : QueryParameterType<CompileTimeMetadata<Q>[\"parameters\"]>;\n\nexport interface PropertyColumnLocator<Q extends ObjectOrInterfaceDefinition> {\n type: \"property\";\n id: PropertyKeys<Q>;\n}\n\n/**\n * Concrete function column locator for a single key K.\n * Correlates the id, queryDefinition, and getFunctionParams types.\n */\ninterface FunctionColumnLocatorForKey<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef>,\n FunctionColumns extends Record<string, QueryDefinition<{}>>,\n K extends keyof FunctionColumns,\n> {\n /**\n * This is equivalent to workshop's function-backed columns.\n * The function needs to meet the specifications stated in https://www.palantir.com/docs/foundry/workshop/widgets-object-table/#function-backed-columns\n */\n type: \"function\";\n id: K;\n queryDefinition: FunctionColumns[K];\n\n /**\n * The function will be called with the current object set to get the input parameters for the function query.\n * @param objectSet - The current object set.\n * @returns - The function's input parameters including the object set.\n */\n getFunctionParams: (\n objectSet: ObjectSet<Q, RDPs>,\n ) => ExtractQueryParameters<FunctionColumns[K]>;\n\n /**\n * Function to generate keys for looking up results in the FunctionsMap.\n * @param object - The object instance\n * @returns - The key to use for looking up this object's result in the FunctionsMap\n */\n getKey: (\n object: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n ) => string;\n\n /**\n * Function to extract the cell value from the raw cell data returned by the function.\n * This is useful when functions return custom types with multiple properties.\n * @param cellData - The raw data returned by the function for this object\n * @returns - The value to display in the cell\n */\n getValue?: (cellData?: unknown) => unknown;\n\n /**\n * Minimum time between re-fetches of the same function with the same parameters, in milliseconds.\n * Defaults to 5 minutes as it is expensive to fetch function columns for a large object set\n * and they are expected to be relatively static in the context of an object table\n *\n * @default 300_000 (5 minutes)\n */\n dedupeIntervalMs?: number;\n\n /**\n * Object type apiNames the function reads but doesn't take as a parameter (e.g.\n * linked object types the function traverses internally). The column auto-revalidates\n * when an action edits an object of any of these types. Param-derived types are\n * tracked automatically and don't need to be listed here.\n */\n dependsOn?: string[];\n}\n\n/**\n * Distributes over each key in FunctionColumns so that id, queryDefinition,\n * and getFunctionParams are correlated per key.\n */\nexport type FunctionColumnLocator<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> = keyof FunctionColumns extends infer K\n ? K extends keyof FunctionColumns\n ? FunctionColumnLocatorForKey<Q, RDPs, FunctionColumns, K>\n : never\n : never;\n\nexport interface RdpColumnLocator<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n> {\n type: \"rdp\";\n id: keyof RDPs;\n creator: DerivedProperty.Creator<Q, RDPs[keyof RDPs]>;\n}\n\nexport interface CustomColumnLocator {\n type: \"custom\";\n id: string;\n}\n\nexport type ColumnDefinitionLocator<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> =\n | PropertyColumnLocator<Q>\n | FunctionColumnLocator<Q, RDPs, FunctionColumns>\n | RdpColumnLocator<Q, RDPs>\n | CustomColumnLocator;\n\nexport interface ObjectTableProps<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> {\n /**\n * The object or interface type of the object\n * If objectSet is not provided, objects will be fetched based on this type.\n */\n objectType: Q;\n\n /**\n * The set of objects to show in the table.\n * If provided and the objectType is not an interface, the table will use objectSet to fetch objects instead of fetching based on objectType.\n */\n objectSet?: ObjectSet<Q>;\n\n objectSetOptions?: ObjectSetOptions<Q>;\n\n /**\n * Minimum time between fetch requests in milliseconds.\n * Increasing this value reduces redundant network calls when the same data\n * is requested multiple times in quick succession.\n *\n * @default 60_000 1 minute\n */\n dedupeIntervalMs?: number;\n\n /**\n * Number of objects to fetch per page.\n *\n * @default 50\n */\n pageSize?: number;\n\n /**\n * Ordered list of column definitions to show in the table\n *\n * If not provided, all of the properties of the object type will be shown in default order.\n */\n columnDefinitions?: Array<ColumnDefinition<Q, RDPs, FunctionColumns>>;\n\n /**\n * Whether the table is filterable by the user.\n *\n * @default true\n */\n enableFiltering?: boolean;\n\n /**\n * The current where clause to filter the objects in the table.\n * If provided, the filter is controlled.\n */\n filter?: WhereClause<Q, RDPs>;\n\n /**\n * Called when the where clause is changed.\n * Required when filter is controlled.\n *\n * @param newWhere The new where clause\n */\n onFilterChanged?: (newWhere: WhereClause<Q, RDPs>) => void;\n\n /**\n * Whether the table is sortable by the user.\n *\n * @default true\n */\n enableOrdering?: boolean;\n\n /**\n * Whether columns can be pinned by the user.\n *\n * @default true\n */\n enableColumnPinning?: boolean;\n\n /**\n * Whether columns can be resized by the user.\n *\n * @default true\n */\n enableColumnResizing?: boolean;\n\n /**\n * Whether the column configuration dialog for column visibility and ordering is available to the user.\n *\n * @default true\n */\n enableColumnConfig?: boolean;\n\n /**\n * Controls the edit mode behavior of the table.\n * - \"always\": Editable cells are immediately in edit mode on row clicked.\n * - \"manual\": User can toggle edit mode on/off via the Edit Table button.\n *\n * @default \"manual\"\n */\n editMode?: \"always\" | \"manual\";\n\n /**\n * Whether to render the bottom edit footer that hosts the\n * \"Edit Table\" / \"Cancel\" / \"Submit Edits\" buttons and the edit-state\n * indicators (modification count, validation errors).\n *\n * @default true whenever the table has at least one column declared\n * editable (i.e. any column with `editable: true` or `editable: (object) => boolean`).\n * When `false`, the \"Edit Table\" and \"Submit Edits\" buttons will not be shown.\n */\n showEditFooter?: boolean;\n\n /**\n * The default order by clause to sort the objects in the table.\n * If provided without orderBy prop, the sorting is uncontrolled.\n * If both orderBy and defaultOrderBy are provided, orderBy takes precedence.\n */\n defaultOrderBy?: Array<{\n property: PropertyKeys<Q> | keyof RDPs;\n direction: \"asc\" | \"desc\";\n }>;\n\n /**\n * The current order by clause to sort the objects in the table.\n * If provided, the sorting is controlled.\n * If both orderBy and defaultOrderBy are provided, orderBy takes precedence.\n */\n orderBy?: Array<{\n property: PropertyKeys<Q> | keyof RDPs;\n direction: \"asc\" | \"desc\";\n }>;\n\n /**\n * Called when the order by clause is changed.\n * Required when sorting is controlled.\n *\n * @param newOrderBy The new order by clause\n */\n onOrderByChanged?: (\n newOrderBy: Array<{\n property: PropertyKeys<Q> | keyof RDPs;\n direction: \"asc\" | \"desc\";\n }>,\n ) => void;\n\n /**\n * Called after the value of a cell is edited and committed by the user.\n *\n * @param info An object containing details about the cell that was edited,\n * including the rowId, columnId, new and old values, and the row data before the edit\n */\n onCellValueChanged?: (\n info: CellEditInfo<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n unknown\n >,\n ) => void;\n\n /**\n * If provided, the \"Submit Edits\" button will be shown in the edit footer.\n *\n * @param edits an array of edit info containing details about the edited cells\n * including the rowId, columnId, new and old values, and the row data before the edit\n * @return a promise that resolves to true if the edits were successfully submitted\n */\n onSubmitEdits?: (edits: CellEditInfo<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n unknown\n >[]) => Promise<boolean>;\n\n /**\n * Called when the column visibility or ordering changed.\n *\n * If provided, the table will allow the user to show/hide columns.\n *\n * @param newStates The columns sorted in their display order in the table and their visibility state.\n */\n onColumnVisibilityChanged?: (\n newStates: Array<{\n columnId: PropertyKeys<Q> | keyof RDPs | keyof FunctionColumns;\n isVisible: boolean;\n }>,\n ) => void;\n\n /**\n * Called when the pinned columns change.\n *\n * If provided, the table will allow the user to pin/unpin columns.\n *\n * @param newStates The new list of column pin states\n */\n onColumnsPinnedChanged?: (\n newStates: Array<{\n columnId: PropertyKeys<Q> | keyof RDPs | keyof FunctionColumns;\n pinned: \"left\" | \"right\" | \"none\";\n }>,\n ) => void;\n\n /**\n * Called when a column is resized.\n *\n * @param columnId The ID of the resized column\n * @param newWidth The new width of the column. When newWidth = null, the column size is reset.\n */\n onColumnResize?: (\n columnId: PropertyKeys<Q> | keyof RDPs | keyof FunctionColumns,\n newWidth: number | null,\n ) => void;\n\n /**\n * Called when a row is clicked.\n *\n * @param object The object representing the clicked row\n */\n onRowClick?: (\n object: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n ) => void;\n\n /**\n * Called when a column header is clicked.\n *\n * The columnId matches the `locator.id` configured on the column definition.\n * The dropdown menu trigger is excluded — clicking the chevron opens the\n * header menu instead of firing this callback.\n *\n * @param columnId The id of the clicked column\n */\n onColumnHeaderClick?: (\n columnId: PropertyKeys<Q> | keyof RDPs | keyof FunctionColumns,\n ) => void;\n\n /**\n * Selection mode for the table rows.\n *\n * If multiple, a checkbox will be shown for each row to allow selecting multiple rows\n * as well as a top-level checkbox in the header to select all rows.\n *\n * @default \"none\"\n */\n selectionMode?: \"single\" | \"multiple\" | \"none\";\n\n /**\n * The currently selected rows in the table.\n * If provided, the row selection is controlled.\n */\n selectedRows?: PrimaryKeyType<Q>[];\n\n /**\n * Indicates whether all rows are selected in controlled mode.\n * When true, the table will show all rows as selected regardless of the selectedRows array.\n */\n isAllSelected?: boolean;\n\n /**\n * Called when the row selection changes.\n *\n * @deprecated Use {@link onRowSelectionChanged} instead. The new callback\n * delivers a {@link RowSelectionChange} object with `selectedRowIds`,\n * `selectedRows`, `isSelectAll`, and a derived `objectSet`. This legacy\n * callback continues to fire alongside the new one for backwards\n * compatibility.\n *\n * @param selectedRowIds The primary keys of currently selected rows\n * @param isSelectAll Whether the change was triggered by a \"select all\" action. Defaults to false\n */\n onRowSelection?: (\n selectedRowIds: PrimaryKeyType<Q>[],\n isSelectAll?: boolean,\n ) => void;\n\n /**\n * Called when the row selection changes, with a {@link RowSelectionChange}\n * payload describing the new state.\n *\n * @param change The new selection state. See {@link RowSelectionChange}.\n */\n onRowSelectionChanged?: (\n change: RowSelectionChange<Q, RDPs>,\n ) => void;\n /**\n * If provided, will render this context menu when right clicking on a cell\n */\n renderCellContextMenu?: (\n row: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n cellValue: unknown,\n ) => React.ReactNode;\n\n /**\n * Render override for the empty state. Called when the table has no\n * rows and no error. When omitted, a default \"No Data\" indicator is\n * rendered.\n */\n renderEmptyState?: () => React.ReactNode;\n\n /**\n * The height of each row in pixels.\n *\n * @default 40\n */\n rowHeight?: number;\n\n /**\n * Returns extra HTML attributes (typically `data-*`) to apply to each\n * row element. Use this to drive conditional row styling\n */\n getRowAttributes?: (\n object: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n ) => Record<string, string | undefined>;\n\n className?: string;\n}\n\n/**\n * Payload for {@link ObjectTableProps.onRowSelectionChanged}. Consolidates\n * the primary-key list, loaded row instances, the `isSelectAll` semantic\n * intent, and an `ObjectSet` covering the selection.\n */\nexport interface RowSelectionChange<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n> {\n /** Primary keys of currently selected rows. */\n selectedRowIds: PrimaryKeyType<Q>[];\n\n /**\n * Loaded row instances corresponding to `selectedRowIds`. When\n * `isSelectAll` is true, this reflects only the rows currently in the\n * table — pages not yet fetched are absent. Use `objectSet` for the\n * cross-page view.\n */\n selectedRows: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>[];\n\n /**\n * True when the user invoked \"select all\" (header checkbox) or when\n * controlled mode supplies `isAllSelected={true}`. Distinct from \"every\n * loaded row happens to be selected\" — that condition is reflected by\n * `selectedRowIds.length` matching the visible row count but does not set\n * this flag.\n */\n isSelectAll: boolean;\n\n /**\n * An `ObjectSet` representing the selection.\n *\n * - \"Select all\" → the underlying `ObjectSet` (`objectSet` prop if\n * provided, otherwise derived from `objectType` via `client(...)`).\n * This includes rows not yet loaded into the table.\n * - Partial selection → the underlying `ObjectSet` narrowed to\n * `{ [primaryKeyApiName]: { $in: selectedRowIds } }`.\n * - \"Deselect all\" → an empty `ObjectSet` (`$in: []`).\n *\n * `undefined` for interface types without a resolvable\n * `primaryKeyApiName` when the selection is partial or empty (a\n * `$primaryKey`-style filter can't be expressed). For \"select all\" on\n * those types the underlying `ObjectSet` is still emitted.\n */\n objectSet: ObjectSet<Q, RDPs> | undefined;\n}\n\nexport interface ObjectSetOptions<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Object sets to union with\n */\n union?: ObjectSet<Q>[];\n\n /**\n * Object sets to intersect with\n */\n intersect?: ObjectSet<Q>[];\n\n /**\n * Object sets to subtract from\n */\n subtract?: ObjectSet<Q>[];\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ObjectTableApi.js","names":[],"sources":["ObjectTableApi.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n CompileTimeMetadata,\n DerivedProperty,\n ObjectOrInterfaceDefinition,\n ObjectSet,\n Osdk,\n PrimaryKeyType,\n PropertyKeys,\n QueryDefinition,\n SimplePropertyDef,\n WhereClause,\n} from \"@osdk/api\";\nimport type { QueryParameterType } from \"@osdk/client/observable\";\nimport type * as React from \"react\";\nimport type { CellEditInfo, EditFieldConfig } from \"./utils/types.js\";\n\nexport type { EditFieldConfig } from \"./utils/types.js\";\n\nexport type ColumnDefinition<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> =\n | EditableColumnDefinition<Q, RDPs, FunctionColumns>\n | ReadonlyColumnDefinition<Q, RDPs, FunctionColumns>;\n\ninterface SharedColumnDefinition<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> {\n locator: ColumnDefinitionLocator<Q, RDPs, FunctionColumns>;\n\n /**\n * @default true\n */\n isVisible?: boolean;\n\n /**\n * @default none\n */\n pinned?: \"left\" | \"right\" | \"none\";\n width?: number;\n minWidth?: number;\n maxWidth?: number;\n resizable?: boolean;\n orderable?: boolean;\n filterable?: boolean;\n\n /**\n * Custom renderer for the cell value.\n *\n * Interaction with `editable` columns:\n * - When `editMode: \"manual\"` (default), `renderCell` is used while the\n * table is read-only (Edit Table button visible) and the editable cell\n * takes over once the user enters edit mode.\n * - When `editMode: \"always\"`, the editable cell always wins on editable\n * columns and `renderCell` is ignored — `editMode: \"always\"` opts the\n * column into a permanently-editable surface, leaving no read-only\n * state for `renderCell` to render. Use `editMode: \"manual\"` if you\n * need a custom display alongside editing.\n */\n renderCell?: (\n object: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n locator: ColumnDefinitionLocator<Q, RDPs, FunctionColumns>,\n ) => React.ReactNode;\n\n /**\n * If provided, this will be used in the column header.\n * If both columnName and renderHeader are provided, renderHeader will take precedence in the table header.\n * columnName will still be used in other parts where the column name is displayed.\n *\n * If not provided,\n * for a property column, the property displayName will be used\n * for other columns, the id will be used.\n */\n columnName?: string;\n\n /**\n * If provided, this will be used to render the header component.\n * When both columnName and renderHeader are provided, renderHeader will take precedence in the table header.\n */\n renderHeader?: () => React.ReactNode;\n}\n\ninterface EditableColumnDefinition<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> extends SharedColumnDefinition<Q, RDPs, FunctionColumns> {\n /**\n * `editable` can be a boolean or a predicate that receives the row's object\n * and returns whether the cell is editable\n */\n editable:\n | true\n | ((\n object: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n ) => boolean);\n\n /**\n * Configuration for the cell editor component.\n *\n * When provided, the column uses the specified field component\n * (e.g. dropdown) instead of the default auto-detected text/number input.\n *\n * `getFieldComponentProps` receives the row's object and a map of any\n * pending edits for that row (keyed by column id), and returns the props to\n * pass to the field component. Editor configuration can depend on the\n * current row or on other in-progress edits within the row.\n */\n editFieldConfig?: EditFieldConfig<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>\n >;\n\n /**\n * Additional function to validate the cell value during edit.\n *\n * @param value the current cell value\n * @returns a promise that resolves to an error message string if validation fails, or undefined if validation succeeds\n */\n validateEdit?: (\n value: unknown,\n ) => Promise<string | undefined>;\n}\n\n/**\n * Column definition for a read-only column (default).\n * `editFieldConfig` and `validateEdit` are not available.\n */\ninterface ReadonlyColumnDefinition<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> extends SharedColumnDefinition<Q, RDPs, FunctionColumns> {\n editable?: false;\n}\n\nexport type ExtractQueryParameters<\n Q extends QueryDefinition,\n> = CompileTimeMetadata<Q>[\"parameters\"] extends Record<string, never>\n ? undefined\n : QueryParameterType<CompileTimeMetadata<Q>[\"parameters\"]>;\n\nexport interface PropertyColumnLocator<Q extends ObjectOrInterfaceDefinition> {\n type: \"property\";\n id: PropertyKeys<Q>;\n}\n\n/**\n * Concrete function column locator for a single key K.\n * Correlates the id, queryDefinition, and getFunctionParams types.\n */\ninterface FunctionColumnLocatorForKey<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef>,\n FunctionColumns extends Record<string, QueryDefinition<{}>>,\n K extends keyof FunctionColumns,\n> {\n /**\n * This is equivalent to workshop's function-backed columns.\n * The function needs to meet the specifications stated in https://www.palantir.com/docs/foundry/workshop/widgets-object-table/#function-backed-columns\n */\n type: \"function\";\n id: K;\n queryDefinition: FunctionColumns[K];\n\n /**\n * The function will be called with the current object set to get the input parameters for the function query.\n * @param objectSet - The current object set.\n * @returns - The function's input parameters including the object set.\n */\n getFunctionParams: (\n objectSet: ObjectSet<Q, RDPs>,\n ) => ExtractQueryParameters<FunctionColumns[K]>;\n\n /**\n * Function to generate keys for looking up results in the FunctionsMap.\n * @param object - The object instance\n * @returns - The key to use for looking up this object's result in the FunctionsMap\n */\n getKey: (\n object: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n ) => string;\n\n /**\n * Function to extract the cell value from the raw cell data returned by the function.\n * This is useful when functions return custom types with multiple properties.\n * @param cellData - The raw data returned by the function for this object\n * @returns - The value to display in the cell\n */\n getValue?: (cellData?: unknown) => unknown;\n\n /**\n * Minimum time between re-fetches of the same function with the same parameters, in milliseconds.\n * Defaults to 5 minutes as it is expensive to fetch function columns for a large object set\n * and they are expected to be relatively static in the context of an object table\n *\n * @default 300_000 (5 minutes)\n */\n dedupeIntervalMs?: number;\n\n /**\n * Object type apiNames the function reads but doesn't take as a parameter (e.g.\n * linked object types the function traverses internally). The column auto-revalidates\n * when an action edits an object of any of these types. Param-derived types are\n * tracked automatically and don't need to be listed here.\n */\n dependsOn?: string[];\n}\n\n/**\n * Distributes over each key in FunctionColumns so that id, queryDefinition,\n * and getFunctionParams are correlated per key.\n */\nexport type FunctionColumnLocator<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> = keyof FunctionColumns extends infer K\n ? K extends keyof FunctionColumns\n ? FunctionColumnLocatorForKey<Q, RDPs, FunctionColumns, K>\n : never\n : never;\n\nexport interface RdpColumnLocator<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n> {\n type: \"rdp\";\n id: keyof RDPs;\n creator: DerivedProperty.Creator<Q, RDPs[keyof RDPs]>;\n}\n\nexport interface CustomColumnLocator {\n type: \"custom\";\n id: string;\n}\n\nexport type ColumnDefinitionLocator<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> =\n | PropertyColumnLocator<Q>\n | FunctionColumnLocator<Q, RDPs, FunctionColumns>\n | RdpColumnLocator<Q, RDPs>\n | CustomColumnLocator;\n\nexport interface ObjectTableProps<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> {\n /**\n * The object or interface type of the object\n * If objectSet is not provided, objects will be fetched based on this type.\n */\n objectType: Q;\n\n /**\n * The set of objects to show in the table.\n * If provided and the objectType is not an interface, the table will use objectSet to fetch objects instead of fetching based on objectType.\n */\n objectSet?: ObjectSet<Q>;\n\n objectSetOptions?: ObjectSetOptions<Q>;\n\n /**\n * Minimum time between fetch requests in milliseconds.\n * Increasing this value reduces redundant network calls when the same data\n * is requested multiple times in quick succession.\n *\n * @default 60_000 1 minute\n */\n dedupeIntervalMs?: number;\n\n /**\n * Number of objects to fetch per page.\n *\n * @default 50\n */\n pageSize?: number;\n\n /**\n * Ordered list of column definitions to show in the table\n *\n * If not provided, all of the properties of the object type will be shown in default order.\n */\n columnDefinitions?: Array<ColumnDefinition<Q, RDPs, FunctionColumns>>;\n\n /**\n * Whether the table is filterable by the user.\n *\n * @default true\n */\n enableFiltering?: boolean;\n\n /**\n * The current where clause to filter the objects in the table.\n * If provided, the filter is controlled.\n */\n filter?: WhereClause<Q, RDPs>;\n\n /**\n * Called when the where clause is changed.\n * Required when filter is controlled.\n *\n * @param newWhere The new where clause\n */\n onFilterChanged?: (newWhere: WhereClause<Q, RDPs>) => void;\n\n /**\n * Whether the table is sortable by the user.\n *\n * @default true\n */\n enableOrdering?: boolean;\n\n /**\n * Whether columns can be pinned by the user.\n *\n * @default true\n */\n enableColumnPinning?: boolean;\n\n /**\n * Whether columns can be resized by the user.\n *\n * @default true\n */\n enableColumnResizing?: boolean;\n\n /**\n * Whether the column configuration dialog for column visibility and ordering is available to the user.\n *\n * @default true\n */\n enableColumnConfig?: boolean;\n\n /**\n * Controls the edit mode behavior of the table.\n * - \"always\": Editable cells are immediately in edit mode on row clicked.\n * - \"manual\": User can toggle edit mode on/off via the Edit Table button.\n *\n * @default \"manual\"\n */\n editMode?: \"always\" | \"manual\";\n\n /**\n * Whether to render the bottom edit footer that hosts the\n * \"Edit Table\" / \"Cancel\" / \"Submit Edits\" buttons and the edit-state\n * indicators (modification count, validation errors).\n *\n * @default true whenever the table has at least one column declared\n * editable (i.e. any column with `editable: true` or `editable: (object) => boolean`).\n * When `false`, the \"Edit Table\" and \"Submit Edits\" buttons will not be shown.\n */\n showEditFooter?: boolean;\n\n /**\n * The default order by clause to sort the objects in the table.\n * If provided without orderBy prop, the sorting is uncontrolled.\n * If both orderBy and defaultOrderBy are provided, orderBy takes precedence.\n */\n defaultOrderBy?: Array<{\n property: PropertyKeys<Q> | keyof RDPs;\n direction: \"asc\" | \"desc\";\n }>;\n\n /**\n * The current order by clause to sort the objects in the table.\n * If provided, the sorting is controlled.\n * If both orderBy and defaultOrderBy are provided, orderBy takes precedence.\n */\n orderBy?: Array<{\n property: PropertyKeys<Q> | keyof RDPs;\n direction: \"asc\" | \"desc\";\n }>;\n\n /**\n * Called when the order by clause is changed.\n * Required when sorting is controlled.\n *\n * @param newOrderBy The new order by clause\n */\n onOrderByChanged?: (\n newOrderBy: Array<{\n property: PropertyKeys<Q> | keyof RDPs;\n direction: \"asc\" | \"desc\";\n }>,\n ) => void;\n\n /**\n * Called after the value of a cell is edited and committed by the user.\n *\n * @param info An object containing details about the cell that was edited,\n * including the rowId, columnId, new and old values, and the row data before the edit\n */\n onCellValueChanged?: (\n info: CellEditInfo<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n unknown\n >,\n ) => void;\n\n /**\n * If provided, the \"Submit Edits\" button will be shown in the edit footer.\n *\n * @param edits an array of edit info containing details about the edited cells\n * including the rowId, columnId, new and old values, and the row data before the edit\n * @return a promise that resolves to true if the edits were successfully submitted\n */\n onSubmitEdits?: (edits: CellEditInfo<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n unknown\n >[]) => Promise<boolean>;\n\n /**\n * Called when the column visibility or ordering changed.\n *\n * If provided, the table will allow the user to show/hide columns.\n *\n * @param newStates The columns sorted in their display order in the table and their visibility state.\n */\n onColumnVisibilityChanged?: (\n newStates: Array<{\n columnId: PropertyKeys<Q> | keyof RDPs | keyof FunctionColumns;\n isVisible: boolean;\n }>,\n ) => void;\n\n /**\n * Called when the pinned columns change.\n *\n * If provided, the table will allow the user to pin/unpin columns.\n *\n * @param newStates The new list of column pin states\n */\n onColumnsPinnedChanged?: (\n newStates: Array<{\n columnId: PropertyKeys<Q> | keyof RDPs | keyof FunctionColumns;\n pinned: \"left\" | \"right\" | \"none\";\n }>,\n ) => void;\n\n /**\n * Called when a column is resized.\n *\n * @param columnId The ID of the resized column\n * @param newWidth The new width of the column. When newWidth = null, the column size is reset.\n */\n onColumnResize?: (\n columnId: PropertyKeys<Q> | keyof RDPs | keyof FunctionColumns,\n newWidth: number | null,\n ) => void;\n\n /**\n * Called when a row is clicked.\n *\n * @param object The object representing the clicked row\n */\n onRowClick?: (\n object: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n ) => void;\n\n /**\n * Called when a column header is clicked.\n *\n * The columnId matches the `locator.id` configured on the column definition.\n * The dropdown menu trigger is excluded — clicking the chevron opens the\n * header menu instead of firing this callback.\n *\n * @param columnId The id of the clicked column\n */\n onColumnHeaderClick?: (\n columnId: PropertyKeys<Q> | keyof RDPs | keyof FunctionColumns,\n ) => void;\n\n /**\n * Selection mode for the table rows.\n *\n * If multiple, a checkbox will be shown for each row to allow selecting multiple rows\n * as well as a top-level checkbox in the header to select all rows.\n *\n * @default \"none\"\n */\n selectionMode?: \"single\" | \"multiple\" | \"none\";\n\n /**\n * The currently selected rows in the table.\n * If provided, the row selection is controlled.\n */\n selectedRows?: PrimaryKeyType<Q>[];\n\n /**\n * Indicates whether all rows are selected in controlled mode.\n * When true, the table will show all rows as selected regardless of the selectedRows array.\n */\n isAllSelected?: boolean;\n\n /**\n * Called when the row selection changes.\n *\n * @deprecated Use {@link onRowSelectionChanged} instead. The new callback\n * delivers a {@link RowSelectionChange} object with `selectedRows`,\n * `isSelectAll`, and a derived `objectSet`. This legacy callback\n * continues to fire alongside the new one for backwards compatibility.\n *\n * @param selectedRowIds The primary keys of currently selected rows\n * @param isSelectAll Whether the change was triggered by a \"select all\" action. Defaults to false\n */\n onRowSelection?: (\n selectedRowIds: PrimaryKeyType<Q>[],\n isSelectAll?: boolean,\n ) => void;\n\n /**\n * Called when the row selection changes, with a {@link RowSelectionChange}\n * payload describing the new state.\n *\n * @param change The new selection state. See {@link RowSelectionChange}.\n */\n onRowSelectionChanged?: (\n change: RowSelectionChange<Q, RDPs>,\n ) => void;\n /**\n * If provided, will render this context menu when right clicking on a cell\n */\n renderCellContextMenu?: (\n row: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n cellValue: unknown,\n ) => React.ReactNode;\n\n /**\n * Render override for the empty state. Called when the table has no\n * rows and no error. When omitted, a default \"No Data\" indicator is\n * rendered.\n */\n renderEmptyState?: () => React.ReactNode;\n\n /**\n * The height of each row in pixels.\n *\n * @default 40\n */\n rowHeight?: number;\n\n /**\n * Returns extra HTML attributes (typically `data-*`) to apply to each\n * row element. Use this to drive conditional row styling\n */\n getRowAttributes?: (\n object: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n ) => Record<string, string | undefined>;\n\n className?: string;\n}\n\n/**\n * Payload for {@link ObjectTableProps.onRowSelectionChanged}. Consolidates\n * the loaded row instances, the `isSelectAll` semantic intent, and an\n * `ObjectSet` covering the selection.\n */\nexport interface RowSelectionChange<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n> {\n /**\n * Loaded row instances currently selected. When `isSelectAll` is true,\n * this reflects only the rows currently in the table — pages not yet\n * fetched are absent. Use `objectSet` for the cross-page view, and\n * `selectedRows.map(r => r.$primaryKey)` if you need the primary keys.\n */\n selectedRows: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>[];\n\n /**\n * True when the user invoked \"select all\" (header checkbox) or when\n * controlled mode supplies `isAllSelected={true}`. Distinct from \"every\n * loaded row happens to be selected\" — that condition is reflected by\n * `selectedRows.length` matching the visible row count but does not set\n * this flag.\n */\n isSelectAll: boolean;\n\n /**\n * An `ObjectSet` representing the selection.\n *\n * - \"Select all\" → the underlying `ObjectSet` (`objectSet` prop if\n * provided, otherwise derived from `objectType` via `client(...)`).\n * This includes rows not yet loaded into the table.\n * - Partial selection → the underlying `ObjectSet` narrowed to\n * `{ [primaryKeyApiName]: { $in: selectedRows.map(r => r.$primaryKey) } }`.\n * - \"Deselect all\" → an empty `ObjectSet` (`$in: []`).\n *\n * `undefined` for interface types without a resolvable\n * `primaryKeyApiName` when the selection is partial or empty (a\n * `$primaryKey`-style filter can't be expressed). For \"select all\" on\n * those types the underlying `ObjectSet` is still emitted.\n */\n objectSet: ObjectSet<Q, RDPs> | undefined;\n}\n\nexport interface ObjectSetOptions<\n Q extends ObjectOrInterfaceDefinition,\n> {\n /**\n * Object sets to union with\n */\n union?: ObjectSet<Q>[];\n\n /**\n * Object sets to intersect with\n */\n intersect?: ObjectSet<Q>[];\n\n /**\n * Object sets to subtract from\n */\n subtract?: ObjectSet<Q>[];\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
18
|
+
import { useEventCallback } from "../../shared/hooks/useEventCallback.js";
|
|
18
19
|
import { getRowId, getRowIdFromPrimaryKey } from "../utils/getRowId.js";
|
|
19
20
|
|
|
20
21
|
/**
|
|
@@ -27,6 +28,7 @@ export function useRowSelection({
|
|
|
27
28
|
selectionMode = "none",
|
|
28
29
|
selectedRows,
|
|
29
30
|
isAllSelected: isAllSelectedProp,
|
|
31
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated -- intentional pass-through to fire alongside onRowSelectionChanged for backwards compatibility
|
|
30
32
|
onRowSelection,
|
|
31
33
|
onRowSelectionChanged,
|
|
32
34
|
data
|
|
@@ -54,18 +56,17 @@ export function useRowSelection({
|
|
|
54
56
|
const isAllSelected = deriveIsAllSelected(isControlled, isAllSelectedProp, internalIsAllSelected, selectedCount, totalCount);
|
|
55
57
|
// Dedupes refires when "select all" is active and data grows.
|
|
56
58
|
const lastFiredAllSelectedIdsRef = useRef(null);
|
|
57
|
-
const fireSelectionCallbacks =
|
|
59
|
+
const fireSelectionCallbacks = useEventCallback((ids, isSelectAll) => {
|
|
58
60
|
onRowSelection?.(ids, isSelectAll);
|
|
59
61
|
if (onRowSelectionChanged) {
|
|
60
62
|
const selectedKeySet = new Set(ids.map(id => String(id)));
|
|
61
63
|
const instances = (data ?? []).filter(item => selectedKeySet.has(String(item.$primaryKey)));
|
|
62
64
|
onRowSelectionChanged({
|
|
63
|
-
selectedRowIds: ids,
|
|
64
65
|
selectedRows: instances,
|
|
65
66
|
isSelectAll
|
|
66
67
|
});
|
|
67
68
|
}
|
|
68
|
-
}
|
|
69
|
+
});
|
|
69
70
|
const onToggleAll = useCallback(() => {
|
|
70
71
|
if (!enableRowSelection || !data) return;
|
|
71
72
|
const newIsAllSelected = !isAllSelected;
|
|
@@ -122,7 +123,7 @@ export function useRowSelection({
|
|
|
122
123
|
}, [enableRowSelection, data, selectionMode, isControlled, fireSelectionCallbacks, rowSelectionState, lastSelectedRowIndex]);
|
|
123
124
|
|
|
124
125
|
// Refire callbacks when uncontrolled "select all" is active and new rows arrive.
|
|
125
|
-
useEffect(()
|
|
126
|
+
useEffect(function () {
|
|
126
127
|
if (isControlled || !internalIsAllSelected || !data) {
|
|
127
128
|
if (!internalIsAllSelected) {
|
|
128
129
|
lastFiredAllSelectedIdsRef.current = null;
|