@osdk/react-components 0.2.0-beta.11 → 0.2.0-beta.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/AGENTS.md +105 -0
  2. package/CHANGELOG.md +16 -0
  3. package/package.json +6 -5
  4. package/build/browser/filter-list/__tests__/LinkedPropertyInput.test.js +0 -202
  5. package/build/browser/filter-list/__tests__/LinkedPropertyInput.test.js.map +0 -1
  6. package/build/browser/filter-list/__tests__/dateUtils.test.js +0 -55
  7. package/build/browser/filter-list/__tests__/dateUtils.test.js.map +0 -1
  8. package/build/browser/filter-list/__tests__/filterStateToWhereClause.test.js +0 -296
  9. package/build/browser/filter-list/__tests__/filterStateToWhereClause.test.js.map +0 -1
  10. package/build/browser/filter-list/__tests__/getFilterKey.test.js +0 -53
  11. package/build/browser/filter-list/__tests__/getFilterKey.test.js.map +0 -1
  12. package/build/browser/filter-list/__tests__/testUtils.js +0 -203
  13. package/build/browser/filter-list/__tests__/testUtils.js.map +0 -1
  14. package/build/browser/filter-list/hooks/__tests__/useFilterListState.test.js +0 -128
  15. package/build/browser/filter-list/hooks/__tests__/useFilterListState.test.js.map +0 -1
  16. package/build/browser/object-table/hooks/__tests__/useCellContextMenu.test.js +0 -147
  17. package/build/browser/object-table/hooks/__tests__/useCellContextMenu.test.js.map +0 -1
  18. package/build/browser/object-table/hooks/__tests__/useColumnDefs.test.js +0 -520
  19. package/build/browser/object-table/hooks/__tests__/useColumnDefs.test.js.map +0 -1
  20. package/build/browser/object-table/hooks/__tests__/useColumnPinning.test.js +0 -266
  21. package/build/browser/object-table/hooks/__tests__/useColumnPinning.test.js.map +0 -1
  22. package/build/browser/object-table/hooks/__tests__/useColumnVisibility.test.js +0 -200
  23. package/build/browser/object-table/hooks/__tests__/useColumnVisibility.test.js.map +0 -1
  24. package/build/browser/object-table/hooks/__tests__/useEditableTable.test.js +0 -292
  25. package/build/browser/object-table/hooks/__tests__/useEditableTable.test.js.map +0 -1
  26. package/build/browser/object-table/hooks/__tests__/useObjectTableData.test.js +0 -315
  27. package/build/browser/object-table/hooks/__tests__/useObjectTableData.test.js.map +0 -1
  28. package/build/browser/object-table/hooks/__tests__/useRowSelection.test.js +0 -596
  29. package/build/browser/object-table/hooks/__tests__/useRowSelection.test.js.map +0 -1
  30. package/build/browser/object-table/hooks/__tests__/useSelectionColumn.test.js +0 -220
  31. package/build/browser/object-table/hooks/__tests__/useSelectionColumn.test.js.map +0 -1
  32. package/build/browser/object-table/hooks/__tests__/useTableSorting.test.js +0 -501
  33. package/build/browser/object-table/hooks/__tests__/useTableSorting.test.js.map +0 -1
  34. package/build/esm/filter-list/__tests__/LinkedPropertyInput.test.js +0 -202
  35. package/build/esm/filter-list/__tests__/LinkedPropertyInput.test.js.map +0 -1
  36. package/build/esm/filter-list/__tests__/dateUtils.test.js +0 -55
  37. package/build/esm/filter-list/__tests__/dateUtils.test.js.map +0 -1
  38. package/build/esm/filter-list/__tests__/filterStateToWhereClause.test.js +0 -296
  39. package/build/esm/filter-list/__tests__/filterStateToWhereClause.test.js.map +0 -1
  40. package/build/esm/filter-list/__tests__/getFilterKey.test.js +0 -53
  41. package/build/esm/filter-list/__tests__/getFilterKey.test.js.map +0 -1
  42. package/build/esm/filter-list/__tests__/testUtils.js +0 -203
  43. package/build/esm/filter-list/__tests__/testUtils.js.map +0 -1
  44. package/build/esm/filter-list/hooks/__tests__/useFilterListState.test.js +0 -128
  45. package/build/esm/filter-list/hooks/__tests__/useFilterListState.test.js.map +0 -1
  46. package/build/esm/object-table/hooks/__tests__/useCellContextMenu.test.js +0 -147
  47. package/build/esm/object-table/hooks/__tests__/useCellContextMenu.test.js.map +0 -1
  48. package/build/esm/object-table/hooks/__tests__/useColumnDefs.test.js +0 -520
  49. package/build/esm/object-table/hooks/__tests__/useColumnDefs.test.js.map +0 -1
  50. package/build/esm/object-table/hooks/__tests__/useColumnPinning.test.js +0 -266
  51. package/build/esm/object-table/hooks/__tests__/useColumnPinning.test.js.map +0 -1
  52. package/build/esm/object-table/hooks/__tests__/useColumnVisibility.test.js +0 -200
  53. package/build/esm/object-table/hooks/__tests__/useColumnVisibility.test.js.map +0 -1
  54. package/build/esm/object-table/hooks/__tests__/useEditableTable.test.js +0 -292
  55. package/build/esm/object-table/hooks/__tests__/useEditableTable.test.js.map +0 -1
  56. package/build/esm/object-table/hooks/__tests__/useObjectTableData.test.js +0 -315
  57. package/build/esm/object-table/hooks/__tests__/useObjectTableData.test.js.map +0 -1
  58. package/build/esm/object-table/hooks/__tests__/useRowSelection.test.js +0 -596
  59. package/build/esm/object-table/hooks/__tests__/useRowSelection.test.js.map +0 -1
  60. package/build/esm/object-table/hooks/__tests__/useSelectionColumn.test.js +0 -220
  61. package/build/esm/object-table/hooks/__tests__/useSelectionColumn.test.js.map +0 -1
  62. package/build/esm/object-table/hooks/__tests__/useTableSorting.test.js +0 -501
  63. package/build/esm/object-table/hooks/__tests__/useTableSorting.test.js.map +0 -1
  64. package/build/types/filter-list/__tests__/LinkedPropertyInput.test.d.ts +0 -1
  65. package/build/types/filter-list/__tests__/LinkedPropertyInput.test.d.ts.map +0 -1
  66. package/build/types/filter-list/__tests__/dateUtils.test.d.ts +0 -1
  67. package/build/types/filter-list/__tests__/dateUtils.test.d.ts.map +0 -1
  68. package/build/types/filter-list/__tests__/filterStateToWhereClause.test.d.ts +0 -1
  69. package/build/types/filter-list/__tests__/filterStateToWhereClause.test.d.ts.map +0 -1
  70. package/build/types/filter-list/__tests__/getFilterKey.test.d.ts +0 -1
  71. package/build/types/filter-list/__tests__/getFilterKey.test.d.ts.map +0 -1
  72. package/build/types/filter-list/__tests__/testUtils.d.ts +0 -65
  73. package/build/types/filter-list/__tests__/testUtils.d.ts.map +0 -1
  74. package/build/types/filter-list/hooks/__tests__/useFilterListState.test.d.ts +0 -1
  75. package/build/types/filter-list/hooks/__tests__/useFilterListState.test.d.ts.map +0 -1
  76. package/build/types/object-table/hooks/__tests__/useCellContextMenu.test.d.ts +0 -1
  77. package/build/types/object-table/hooks/__tests__/useCellContextMenu.test.d.ts.map +0 -1
  78. package/build/types/object-table/hooks/__tests__/useColumnDefs.test.d.ts +0 -1
  79. package/build/types/object-table/hooks/__tests__/useColumnDefs.test.d.ts.map +0 -1
  80. package/build/types/object-table/hooks/__tests__/useColumnPinning.test.d.ts +0 -1
  81. package/build/types/object-table/hooks/__tests__/useColumnPinning.test.d.ts.map +0 -1
  82. package/build/types/object-table/hooks/__tests__/useColumnVisibility.test.d.ts +0 -1
  83. package/build/types/object-table/hooks/__tests__/useColumnVisibility.test.d.ts.map +0 -1
  84. package/build/types/object-table/hooks/__tests__/useEditableTable.test.d.ts +0 -1
  85. package/build/types/object-table/hooks/__tests__/useEditableTable.test.d.ts.map +0 -1
  86. package/build/types/object-table/hooks/__tests__/useObjectTableData.test.d.ts +0 -1
  87. package/build/types/object-table/hooks/__tests__/useObjectTableData.test.d.ts.map +0 -1
  88. package/build/types/object-table/hooks/__tests__/useRowSelection.test.d.ts +0 -1
  89. package/build/types/object-table/hooks/__tests__/useRowSelection.test.d.ts.map +0 -1
  90. package/build/types/object-table/hooks/__tests__/useSelectionColumn.test.d.ts +0 -1
  91. package/build/types/object-table/hooks/__tests__/useSelectionColumn.test.d.ts.map +0 -1
  92. package/build/types/object-table/hooks/__tests__/useTableSorting.test.d.ts +0 -1
  93. package/build/types/object-table/hooks/__tests__/useTableSorting.test.d.ts.map +0 -1
@@ -1,53 +0,0 @@
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
- import { describe, expect, it } from "vitest";
18
- import { getFilterKey } from "../utils/getFilterKey.js";
19
- import { createCustomFilterDef, createHasLinkFilterDef, createKeywordSearchFilterDef, createLinkedPropertyFilterDef, createPropertyFilterDef, createSelectState } from "./testUtils.js";
20
- describe("getFilterKey", () => {
21
- it("returns key for property filter", () => {
22
- const definition = createPropertyFilterDef("name", "CHECKBOX_LIST", createSelectState([]));
23
- expect(getFilterKey(definition)).toBe("name");
24
- });
25
- it("returns id over key for property filter when id is set", () => {
26
- const definition = {
27
- ...createPropertyFilterDef("name", "CHECKBOX_LIST", createSelectState([])),
28
- id: "name-filter-1"
29
- };
30
- expect(getFilterKey(definition)).toBe("name-filter-1");
31
- });
32
- it("returns hasLink:{linkName} for hasLink filter", () => {
33
- const definition = createHasLinkFilterDef("employees");
34
- expect(getFilterKey(definition)).toBe("hasLink:employees");
35
- });
36
- it("returns linkedProperty:{link}:{prop} for linkedProperty filter", () => {
37
- const definition = createLinkedPropertyFilterDef("department", "name");
38
- expect(getFilterKey(definition)).toBe("linkedProperty:department:name");
39
- });
40
- it("returns keywordSearch-{props} for array properties", () => {
41
- const definition = createKeywordSearchFilterDef(["name", "email"]);
42
- expect(getFilterKey(definition)).toBe("keywordSearch-name-email");
43
- });
44
- it("returns keywordSearch-all for 'all' properties", () => {
45
- const definition = createKeywordSearchFilterDef("all");
46
- expect(getFilterKey(definition)).toBe("keywordSearch-all");
47
- });
48
- it("returns key for custom filter", () => {
49
- const definition = createCustomFilterDef("myCustomFilter");
50
- expect(getFilterKey(definition)).toBe("myCustomFilter");
51
- });
52
- });
53
- //# sourceMappingURL=getFilterKey.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getFilterKey.test.js","names":["describe","expect","it","getFilterKey","createCustomFilterDef","createHasLinkFilterDef","createKeywordSearchFilterDef","createLinkedPropertyFilterDef","createPropertyFilterDef","createSelectState","definition","toBe","id"],"sources":["getFilterKey.test.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 { describe, expect, it } from \"vitest\";\nimport type { FilterDefinitionUnion } from \"../FilterListApi.js\";\nimport { getFilterKey } from \"../utils/getFilterKey.js\";\nimport type { MockObjectType } from \"./testUtils.js\";\nimport {\n createCustomFilterDef,\n createHasLinkFilterDef,\n createKeywordSearchFilterDef,\n createLinkedPropertyFilterDef,\n createPropertyFilterDef,\n createSelectState,\n} from \"./testUtils.js\";\n\ndescribe(\"getFilterKey\", () => {\n it(\"returns key for property filter\", () => {\n const definition = createPropertyFilterDef(\n \"name\",\n \"CHECKBOX_LIST\",\n createSelectState([]),\n );\n expect(getFilterKey(definition)).toBe(\"name\");\n });\n\n it(\"returns id over key for property filter when id is set\", () => {\n const definition = {\n ...createPropertyFilterDef(\n \"name\",\n \"CHECKBOX_LIST\",\n createSelectState([]),\n ),\n id: \"name-filter-1\",\n } as FilterDefinitionUnion<typeof MockObjectType>;\n expect(getFilterKey(definition)).toBe(\"name-filter-1\");\n });\n\n it(\"returns hasLink:{linkName} for hasLink filter\", () => {\n const definition = createHasLinkFilterDef(\"employees\");\n expect(getFilterKey(definition)).toBe(\"hasLink:employees\");\n });\n\n it(\"returns linkedProperty:{link}:{prop} for linkedProperty filter\", () => {\n const definition = createLinkedPropertyFilterDef(\"department\", \"name\");\n expect(getFilterKey(definition)).toBe(\"linkedProperty:department:name\");\n });\n\n it(\"returns keywordSearch-{props} for array properties\", () => {\n const definition = createKeywordSearchFilterDef([\"name\", \"email\"]);\n expect(getFilterKey(definition)).toBe(\"keywordSearch-name-email\");\n });\n\n it(\"returns keywordSearch-all for 'all' properties\", () => {\n const definition = createKeywordSearchFilterDef(\"all\");\n expect(getFilterKey(definition)).toBe(\"keywordSearch-all\");\n });\n\n it(\"returns key for custom filter\", () => {\n const definition = createCustomFilterDef(\"myCustomFilter\");\n expect(getFilterKey(definition)).toBe(\"myCustomFilter\");\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAE7C,SAASC,YAAY,QAAQ,0BAA0B;AAEvD,SACEC,qBAAqB,EACrBC,sBAAsB,EACtBC,4BAA4B,EAC5BC,6BAA6B,EAC7BC,uBAAuB,EACvBC,iBAAiB,QACZ,gBAAgB;AAEvBT,QAAQ,CAAC,cAAc,EAAE,MAAM;EAC7BE,EAAE,CAAC,iCAAiC,EAAE,MAAM;IAC1C,MAAMQ,UAAU,GAAGF,uBAAuB,CACxC,MAAM,EACN,eAAe,EACfC,iBAAiB,CAAC,EAAE,CACtB,CAAC;IACDR,MAAM,CAACE,YAAY,CAACO,UAAU,CAAC,CAAC,CAACC,IAAI,CAAC,MAAM,CAAC;EAC/C,CAAC,CAAC;EAEFT,EAAE,CAAC,wDAAwD,EAAE,MAAM;IACjE,MAAMQ,UAAU,GAAG;MACjB,GAAGF,uBAAuB,CACxB,MAAM,EACN,eAAe,EACfC,iBAAiB,CAAC,EAAE,CACtB,CAAC;MACDG,EAAE,EAAE;IACN,CAAiD;IACjDX,MAAM,CAACE,YAAY,CAACO,UAAU,CAAC,CAAC,CAACC,IAAI,CAAC,eAAe,CAAC;EACxD,CAAC,CAAC;EAEFT,EAAE,CAAC,+CAA+C,EAAE,MAAM;IACxD,MAAMQ,UAAU,GAAGL,sBAAsB,CAAC,WAAW,CAAC;IACtDJ,MAAM,CAACE,YAAY,CAACO,UAAU,CAAC,CAAC,CAACC,IAAI,CAAC,mBAAmB,CAAC;EAC5D,CAAC,CAAC;EAEFT,EAAE,CAAC,gEAAgE,EAAE,MAAM;IACzE,MAAMQ,UAAU,GAAGH,6BAA6B,CAAC,YAAY,EAAE,MAAM,CAAC;IACtEN,MAAM,CAACE,YAAY,CAACO,UAAU,CAAC,CAAC,CAACC,IAAI,CAAC,gCAAgC,CAAC;EACzE,CAAC,CAAC;EAEFT,EAAE,CAAC,oDAAoD,EAAE,MAAM;IAC7D,MAAMQ,UAAU,GAAGJ,4BAA4B,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClEL,MAAM,CAACE,YAAY,CAACO,UAAU,CAAC,CAAC,CAACC,IAAI,CAAC,0BAA0B,CAAC;EACnE,CAAC,CAAC;EAEFT,EAAE,CAAC,gDAAgD,EAAE,MAAM;IACzD,MAAMQ,UAAU,GAAGJ,4BAA4B,CAAC,KAAK,CAAC;IACtDL,MAAM,CAACE,YAAY,CAACO,UAAU,CAAC,CAAC,CAACC,IAAI,CAAC,mBAAmB,CAAC;EAC5D,CAAC,CAAC;EAEFT,EAAE,CAAC,+BAA+B,EAAE,MAAM;IACxC,MAAMQ,UAAU,GAAGN,qBAAqB,CAAC,gBAAgB,CAAC;IAC1DH,MAAM,CAACE,YAAY,CAACO,UAAU,CAAC,CAAC,CAACC,IAAI,CAAC,gBAAgB,CAAC;EACzD,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -1,203 +0,0 @@
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 const MockObjectType = {
18
- apiName: "TestObject",
19
- type: "object",
20
- __DefinitionMetadata: {
21
- primaryKeyApiName: "id",
22
- primaryKeyType: "string",
23
- properties: {
24
- id: {
25
- type: "string",
26
- multiplicity: false
27
- },
28
- name: {
29
- type: "string",
30
- multiplicity: false
31
- },
32
- age: {
33
- type: "integer",
34
- multiplicity: false
35
- },
36
- active: {
37
- type: "boolean",
38
- multiplicity: false
39
- },
40
- createdAt: {
41
- type: "timestamp",
42
- multiplicity: false
43
- },
44
- score: {
45
- type: "double",
46
- multiplicity: false
47
- }
48
- }
49
- }
50
- };
51
-
52
- /**
53
- * Create a property filter definition for testing
54
- */
55
- export function createPropertyFilterDef(key, filterComponent, filterState) {
56
- return {
57
- type: "PROPERTY",
58
- key,
59
- filterComponent,
60
- filterState
61
- };
62
- }
63
-
64
- /**
65
- * Create a hasLink filter definition for testing
66
- */
67
- export function createHasLinkFilterDef(linkName) {
68
- return {
69
- type: "HAS_LINK",
70
- linkName,
71
- filterState: {
72
- type: "hasLink",
73
- hasLink: false
74
- }
75
- };
76
- }
77
-
78
- /**
79
- * Create a linkedProperty filter definition for testing.
80
- * Cast required because LinkedPropertyFilterDefinition has complex generic constraints
81
- * that can't be satisfied with literal link names.
82
- */
83
- export function createLinkedPropertyFilterDef(linkName, linkedPropertyKey) {
84
- return {
85
- type: "LINKED_PROPERTY",
86
- linkName,
87
- linkedPropertyKey,
88
- linkedFilterComponent: "CHECKBOX_LIST",
89
- linkedFilterState: {
90
- type: "SELECT",
91
- selectedValues: []
92
- },
93
- filterState: {
94
- type: "linkedProperty",
95
- linkedFilterState: {
96
- type: "SELECT",
97
- selectedValues: []
98
- }
99
- }
100
- };
101
- }
102
-
103
- /**
104
- * Create a keywordSearch filter definition for testing
105
- */
106
- export function createKeywordSearchFilterDef(properties) {
107
- return {
108
- type: "KEYWORD_SEARCH",
109
- properties,
110
- filterState: {
111
- type: "keywordSearch",
112
- searchTerm: "",
113
- operator: "AND"
114
- }
115
- };
116
- }
117
-
118
- /**
119
- * Create a custom filter definition for testing.
120
- * Cast required because CustomFilterDefinition expects specific callback signatures.
121
- */
122
- export function createCustomFilterDef(key) {
123
- return {
124
- type: "CUSTOM",
125
- key,
126
- filterComponent: "CUSTOM",
127
- filterState: {
128
- type: "custom",
129
- customState: {}
130
- },
131
- renderInput: () => null,
132
- toWhereClause: () => ({})
133
- };
134
- }
135
-
136
- /**
137
- * Helper to create a SelectFilterState
138
- */
139
- export function createSelectState(selectedValues, options) {
140
- return {
141
- type: "SELECT",
142
- selectedValues,
143
- isExcluding: options?.isExcluding,
144
- includeNull: options?.includeNull
145
- };
146
- }
147
-
148
- /**
149
- * Helper to create a ContainsTextFilterState
150
- */
151
- export function createContainsTextState(value, options) {
152
- return {
153
- type: "CONTAINS_TEXT",
154
- value,
155
- isExcluding: options?.isExcluding
156
- };
157
- }
158
-
159
- /**
160
- * Helper to create a ToggleFilterState
161
- */
162
- export function createToggleState(enabled) {
163
- return {
164
- type: "TOGGLE",
165
- enabled
166
- };
167
- }
168
-
169
- /**
170
- * Helper to create a NumberRangeFilterState
171
- */
172
- export function createNumberRangeState(minValue, maxValue, options) {
173
- return {
174
- type: "NUMBER_RANGE",
175
- minValue,
176
- maxValue,
177
- includeNull: options?.includeNull
178
- };
179
- }
180
-
181
- /**
182
- * Helper to create a DateRangeFilterState
183
- */
184
- export function createDateRangeState(minValue, maxValue, options) {
185
- return {
186
- type: "DATE_RANGE",
187
- minValue,
188
- maxValue,
189
- includeNull: options?.includeNull
190
- };
191
- }
192
-
193
- /**
194
- * Helper to create an ExactMatchFilterState
195
- */
196
- export function createExactMatchState(values, options) {
197
- return {
198
- type: "EXACT_MATCH",
199
- values,
200
- isExcluding: options?.isExcluding
201
- };
202
- }
203
- //# sourceMappingURL=testUtils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"testUtils.js","names":["MockObjectType","apiName","type","__DefinitionMetadata","primaryKeyApiName","primaryKeyType","properties","id","multiplicity","name","age","active","createdAt","score","createPropertyFilterDef","key","filterComponent","filterState","createHasLinkFilterDef","linkName","hasLink","createLinkedPropertyFilterDef","linkedPropertyKey","linkedFilterComponent","linkedFilterState","selectedValues","createKeywordSearchFilterDef","searchTerm","operator","createCustomFilterDef","customState","renderInput","toWhereClause","createSelectState","options","isExcluding","includeNull","createContainsTextState","value","createToggleState","enabled","createNumberRangeState","minValue","maxValue","createDateRangeState","createExactMatchState","values"],"sources":["testUtils.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 { ObjectTypeDefinition } from \"@osdk/api\";\nimport type { FilterDefinitionUnion } from \"../FilterListApi.js\";\nimport type {\n ContainsTextFilterState,\n DateRangeFilterState,\n ExactMatchFilterState,\n FilterComponentType,\n FilterState,\n NumberRangeFilterState,\n SelectFilterState,\n ToggleFilterState,\n} from \"../FilterListItemApi.js\";\n\nexport const MockObjectType = {\n apiName: \"TestObject\",\n type: \"object\",\n __DefinitionMetadata: {\n primaryKeyApiName: \"id\",\n primaryKeyType: \"string\",\n properties: {\n id: { type: \"string\", multiplicity: false },\n name: { type: \"string\", multiplicity: false },\n age: { type: \"integer\", multiplicity: false },\n active: { type: \"boolean\", multiplicity: false },\n createdAt: { type: \"timestamp\", multiplicity: false },\n score: { type: \"double\", multiplicity: false },\n },\n },\n} as unknown as ObjectTypeDefinition;\n\n/**\n * Create a property filter definition for testing\n */\nexport function createPropertyFilterDef<\n K extends string = string,\n C extends FilterComponentType = FilterComponentType,\n>(\n key: K,\n filterComponent: C,\n filterState: FilterState,\n): FilterDefinitionUnion<typeof MockObjectType> {\n return {\n type: \"PROPERTY\",\n key,\n filterComponent,\n filterState,\n } as FilterDefinitionUnion<typeof MockObjectType>;\n}\n\n/**\n * Create a hasLink filter definition for testing\n */\nexport function createHasLinkFilterDef(\n linkName: string,\n): FilterDefinitionUnion<typeof MockObjectType> {\n return {\n type: \"HAS_LINK\",\n linkName,\n filterState: { type: \"hasLink\", hasLink: false },\n } as FilterDefinitionUnion<typeof MockObjectType>;\n}\n\n/**\n * Create a linkedProperty filter definition for testing.\n * Cast required because LinkedPropertyFilterDefinition has complex generic constraints\n * that can't be satisfied with literal link names.\n */\nexport function createLinkedPropertyFilterDef(\n linkName: string,\n linkedPropertyKey: string,\n): FilterDefinitionUnion<typeof MockObjectType> {\n return {\n type: \"LINKED_PROPERTY\",\n linkName,\n linkedPropertyKey,\n linkedFilterComponent: \"CHECKBOX_LIST\",\n linkedFilterState: { type: \"SELECT\", selectedValues: [] },\n filterState: {\n type: \"linkedProperty\",\n linkedFilterState: { type: \"SELECT\", selectedValues: [] },\n },\n } as FilterDefinitionUnion<typeof MockObjectType>;\n}\n\n/**\n * Create a keywordSearch filter definition for testing\n */\nexport function createKeywordSearchFilterDef(\n properties: string[] | \"all\",\n): FilterDefinitionUnion<typeof MockObjectType> {\n return {\n type: \"KEYWORD_SEARCH\",\n properties,\n filterState: { type: \"keywordSearch\", searchTerm: \"\", operator: \"AND\" },\n } as FilterDefinitionUnion<typeof MockObjectType>;\n}\n\n/**\n * Create a custom filter definition for testing.\n * Cast required because CustomFilterDefinition expects specific callback signatures.\n */\nexport function createCustomFilterDef(\n key: string,\n): FilterDefinitionUnion<typeof MockObjectType> {\n return {\n type: \"CUSTOM\",\n key,\n filterComponent: \"CUSTOM\",\n filterState: { type: \"custom\", customState: {} },\n renderInput: () => null,\n toWhereClause: () => ({}),\n } as FilterDefinitionUnion<typeof MockObjectType>;\n}\n\n/**\n * Helper to create a SelectFilterState\n */\nexport function createSelectState<T = string>(\n selectedValues: T[],\n options?: {\n isExcluding?: boolean;\n includeNull?: boolean;\n },\n): SelectFilterState<T> {\n return {\n type: \"SELECT\",\n selectedValues,\n isExcluding: options?.isExcluding,\n includeNull: options?.includeNull,\n };\n}\n\n/**\n * Helper to create a ContainsTextFilterState\n */\nexport function createContainsTextState(\n value?: string,\n options?: { isExcluding?: boolean },\n): ContainsTextFilterState {\n return {\n type: \"CONTAINS_TEXT\",\n value,\n isExcluding: options?.isExcluding,\n };\n}\n\n/**\n * Helper to create a ToggleFilterState\n */\nexport function createToggleState(enabled: boolean): ToggleFilterState {\n return {\n type: \"TOGGLE\",\n enabled,\n };\n}\n\n/**\n * Helper to create a NumberRangeFilterState\n */\nexport function createNumberRangeState(\n minValue?: number,\n maxValue?: number,\n options?: { includeNull?: boolean },\n): NumberRangeFilterState {\n return {\n type: \"NUMBER_RANGE\",\n minValue,\n maxValue,\n includeNull: options?.includeNull,\n };\n}\n\n/**\n * Helper to create a DateRangeFilterState\n */\nexport function createDateRangeState(\n minValue?: Date,\n maxValue?: Date,\n options?: { includeNull?: boolean },\n): DateRangeFilterState {\n return {\n type: \"DATE_RANGE\",\n minValue,\n maxValue,\n includeNull: options?.includeNull,\n };\n}\n\n/**\n * Helper to create an ExactMatchFilterState\n */\nexport function createExactMatchState(\n values: Array<string | boolean>,\n options?: { isExcluding?: boolean },\n): ExactMatchFilterState<string | boolean> {\n return {\n type: \"EXACT_MATCH\",\n values,\n isExcluding: options?.isExcluding,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAeA,OAAO,MAAMA,cAAc,GAAG;EAC5BC,OAAO,EAAE,YAAY;EACrBC,IAAI,EAAE,QAAQ;EACdC,oBAAoB,EAAE;IACpBC,iBAAiB,EAAE,IAAI;IACvBC,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE;MACVC,EAAE,EAAE;QAAEL,IAAI,EAAE,QAAQ;QAAEM,YAAY,EAAE;M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,OAAO,EAAEE;EACxB,CAAC;AACH;;AAEA;AACA;AACA;AACA,OAAO,SAASQ,oBAAoBA,CAClCF,QAAe,EACfC,QAAe,EACfT,OAAmC,EACb;EACtB,OAAO;IACLhC,IAAI,EAAE,YAAY;IAClBwC,QAAQ;IACRC,QAAQ;IACRP,WAAW,EAAEF,OAAO,EAAEE;EACxB,CAAC;AACH;;AAEA;AACA;AACA;AACA,OAAO,SAASS,qBAAqBA,CACnCC,MAA+B,EAC/BZ,OAAmC,EACM;EACzC,OAAO;IACLhC,IAAI,EAAE,aAAa;IACnB4C,MAAM;IACNX,WAAW,EAAED,OAAO,EAAEC;EACxB,CAAC;AACH","ignoreList":[]}
@@ -1,128 +0,0 @@
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
- import { act, renderHook } from "@testing-library/react";
18
- import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
19
- import { createPropertyFilterDef, createSelectState, createToggleState, MockObjectType } from "../../__tests__/testUtils.js";
20
- import { getFilterKey } from "../../utils/getFilterKey.js";
21
- import { useFilterListState } from "../useFilterListState.js";
22
- function createMockObjectSet() {
23
- return {
24
- $objectSetInternals: {
25
- def: MockObjectType
26
- }
27
- };
28
- }
29
- function createProps(overrides = {}) {
30
- return {
31
- objectSet: createMockObjectSet(),
32
- ...overrides
33
- };
34
- }
35
- describe("useFilterListState", () => {
36
- beforeEach(() => {
37
- vi.clearAllMocks();
38
- });
39
- afterEach(() => {
40
- vi.clearAllMocks();
41
- });
42
- it("initializes with empty filter states when no definitions", () => {
43
- const props = createProps({
44
- filterDefinitions: undefined
45
- });
46
- const {
47
- result
48
- } = renderHook(() => useFilterListState(props));
49
- expect(result.current.filterStates.size).toBe(0);
50
- });
51
- it("initializes filter states from filterState for property filters", () => {
52
- const initialState = createSelectState([]);
53
- const nameDef = createPropertyFilterDef("name", "CHECKBOX_LIST", initialState);
54
- const props = createProps({
55
- filterDefinitions: [nameDef]
56
- });
57
- const {
58
- result
59
- } = renderHook(() => useFilterListState(props));
60
- expect(result.current.filterStates.get(getFilterKey(nameDef))).toEqual(initialState);
61
- });
62
- it("updates filter state via setFilterState", () => {
63
- const nameDef = createPropertyFilterDef("name", "CHECKBOX_LIST", createSelectState([]));
64
- const props = createProps({
65
- filterDefinitions: [nameDef]
66
- });
67
- const {
68
- result
69
- } = renderHook(() => useFilterListState(props));
70
- act(() => {
71
- result.current.setFilterState(getFilterKey(nameDef), createSelectState(["selected"]));
72
- });
73
- expect(result.current.filterStates.get(getFilterKey(nameDef))).toEqual(createSelectState(["selected"]));
74
- });
75
- it("calls onFilterStateChanged callback", () => {
76
- const onFilterStateChanged = vi.fn();
77
- const nameDef = createPropertyFilterDef("name", "CHECKBOX_LIST", createSelectState([]));
78
- const props = createProps({
79
- filterDefinitions: [nameDef],
80
- onFilterStateChanged
81
- });
82
- const {
83
- result
84
- } = renderHook(() => useFilterListState(props));
85
- const newState = createSelectState(["selected"]);
86
- act(() => {
87
- result.current.setFilterState(getFilterKey(nameDef), newState);
88
- });
89
- expect(onFilterStateChanged).toHaveBeenCalledWith(nameDef, newState);
90
- });
91
- it("builds whereClause from filter states", () => {
92
- const nameDef = createPropertyFilterDef("name", "CHECKBOX_LIST", createSelectState([]));
93
- const props = createProps({
94
- filterDefinitions: [nameDef]
95
- });
96
- const {
97
- result
98
- } = renderHook(() => useFilterListState(props));
99
- act(() => {
100
- result.current.setFilterState(getFilterKey(nameDef), createSelectState(["John"]));
101
- });
102
- expect(result.current.whereClause).toEqual({
103
- name: "John"
104
- });
105
- });
106
- it("handles multiple filter definitions", () => {
107
- const nameDef = createPropertyFilterDef("name", "CHECKBOX_LIST", createSelectState([]));
108
- const activeDef = createPropertyFilterDef("active", "TOGGLE", createToggleState(false));
109
- const props = createProps({
110
- filterDefinitions: [nameDef, activeDef]
111
- });
112
- const {
113
- result
114
- } = renderHook(() => useFilterListState(props));
115
- act(() => {
116
- result.current.setFilterState(getFilterKey(nameDef), createSelectState(["John"]));
117
- result.current.setFilterState(getFilterKey(activeDef), createToggleState(true));
118
- });
119
- expect(result.current.whereClause).toEqual({
120
- $and: [{
121
- name: "John"
122
- }, {
123
- active: true
124
- }]
125
- });
126
- });
127
- });
128
- //# sourceMappingURL=useFilterListState.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useFilterListState.test.js","names":["act","renderHook","afterEach","beforeEach","describe","expect","it","vi","createPropertyFilterDef","createSelectState","createToggleState","MockObjectType","getFilterKey","useFilterListState","createMockObjectSet","$objectSetInternals","def","createProps","overrides","objectSet","clearAllMocks","props","filterDefinitions","undefined","result","current","filterStates","size","toBe","initialState","nameDef","get","toEqual","setFilterState","onFilterStateChanged","fn","newState","toHaveBeenCalledWith","whereClause","name","activeDef","$and","active"],"sources":["useFilterListState.test.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 { ObjectSet } from \"@osdk/api\";\nimport { act, renderHook } from \"@testing-library/react\";\nimport { afterEach, beforeEach, describe, expect, it, vi } from \"vitest\";\nimport {\n createPropertyFilterDef,\n createSelectState,\n createToggleState,\n MockObjectType,\n} from \"../../__tests__/testUtils.js\";\nimport type { FilterListProps } from \"../../FilterListApi.js\";\nimport { getFilterKey } from \"../../utils/getFilterKey.js\";\nimport { useFilterListState } from \"../useFilterListState.js\";\n\nfunction createMockObjectSet(): ObjectSet<typeof MockObjectType> {\n return {\n $objectSetInternals: {\n def: MockObjectType,\n },\n } as ObjectSet<typeof MockObjectType>;\n}\n\nfunction createProps(\n overrides: Partial<FilterListProps<typeof MockObjectType>> = {},\n): FilterListProps<typeof MockObjectType> {\n return {\n objectSet: createMockObjectSet(),\n ...overrides,\n };\n}\n\ndescribe(\"useFilterListState\", () => {\n beforeEach(() => {\n vi.clearAllMocks();\n });\n\n afterEach(() => {\n vi.clearAllMocks();\n });\n\n it(\"initializes with empty filter states when no definitions\", () => {\n const props = createProps({ filterDefinitions: undefined });\n const { result } = renderHook(() => useFilterListState(props));\n expect(result.current.filterStates.size).toBe(0);\n });\n\n it(\"initializes filter states from filterState for property filters\", () => {\n const initialState = createSelectState([]);\n const nameDef = createPropertyFilterDef(\n \"name\",\n \"CHECKBOX_LIST\",\n initialState,\n );\n const props = createProps({\n filterDefinitions: [nameDef],\n });\n const { result } = renderHook(() => useFilterListState(props));\n expect(result.current.filterStates.get(getFilterKey(nameDef))).toEqual(\n initialState,\n );\n });\n\n it(\"updates filter state via setFilterState\", () => {\n const nameDef = createPropertyFilterDef(\n \"name\",\n \"CHECKBOX_LIST\",\n createSelectState([]),\n );\n const props = createProps({\n filterDefinitions: [nameDef],\n });\n const { result } = renderHook(() => useFilterListState(props));\n act(() => {\n result.current.setFilterState(\n getFilterKey(nameDef),\n createSelectState([\"selected\"]),\n );\n });\n expect(result.current.filterStates.get(getFilterKey(nameDef))).toEqual(\n createSelectState([\"selected\"]),\n );\n });\n\n it(\"calls onFilterStateChanged callback\", () => {\n const onFilterStateChanged = vi.fn();\n const nameDef = createPropertyFilterDef(\n \"name\",\n \"CHECKBOX_LIST\",\n createSelectState([]),\n );\n const props = createProps({\n filterDefinitions: [nameDef],\n onFilterStateChanged,\n });\n const { result } = renderHook(() => useFilterListState(props));\n const newState = createSelectState([\"selected\"]);\n act(() => {\n result.current.setFilterState(getFilterKey(nameDef), newState);\n });\n expect(onFilterStateChanged).toHaveBeenCalledWith(nameDef, newState);\n });\n\n it(\"builds whereClause from filter states\", () => {\n const nameDef = createPropertyFilterDef(\n \"name\",\n \"CHECKBOX_LIST\",\n createSelectState([]),\n );\n const props = createProps({\n filterDefinitions: [nameDef],\n });\n const { result } = renderHook(() => useFilterListState(props));\n act(() => {\n result.current.setFilterState(\n getFilterKey(nameDef),\n createSelectState([\"John\"]),\n );\n });\n expect(result.current.whereClause).toEqual({ name: \"John\" });\n });\n\n it(\"handles multiple filter definitions\", () => {\n const nameDef = createPropertyFilterDef(\n \"name\",\n \"CHECKBOX_LIST\",\n createSelectState([]),\n );\n const activeDef = createPropertyFilterDef(\n \"active\",\n \"TOGGLE\",\n createToggleState(false),\n );\n const props = createProps({\n filterDefinitions: [nameDef, activeDef],\n });\n const { result } = renderHook(() => useFilterListState(props));\n act(() => {\n result.current.setFilterState(\n getFilterKey(nameDef),\n createSelectState([\"John\"]),\n );\n result.current.setFilterState(\n getFilterKey(activeDef),\n createToggleState(true),\n );\n });\n expect(result.current.whereClause).toEqual({\n $and: [{ name: \"John\" }, { active: true }],\n });\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,GAAG,EAAEC,UAAU,QAAQ,wBAAwB;AACxD,SAASC,SAAS,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,EAAEC,EAAE,QAAQ,QAAQ;AACxE,SACEC,uBAAuB,EACvBC,iBAAiB,EACjBC,iBAAiB,EACjBC,cAAc,QACT,8BAA8B;AAErC,SAASC,YAAY,QAAQ,6BAA6B;AAC1D,SAASC,kBAAkB,QAAQ,0BAA0B;AAE7D,SAASC,mBAAmBA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BAAkB,CAACQ,KAAK,CAAC,CAAC;IAC9DrB,GAAG,CAAC,MAAM;MACRwB,MAAM,CAACC,OAAO,CAACQ,cAAc,CAC3BrB,YAAY,CAACkB,OAAO,CAAC,EACrBrB,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAC5B,CAAC;MACDe,MAAM,CAACC,OAAO,CAACQ,cAAc,CAC3BrB,YAAY,CAAC4B,SAAS,CAAC,EACvB9B,iBAAiB,CAAC,IAAI,CACxB,CAAC;IACH,CAAC,CAAC;IACFL,MAAM,CAACmB,MAAM,CAACC,OAAO,CAACa,WAAW,CAAC,CAACN,OAAO,CAAC;MACzCS,IAAI,EAAE,CAAC;QAAEF,IAAI,EAAE;MAAO,CAAC,EAAE;QAAEG,MAAM,EAAE;MAAK,CAAC;IAC3C,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -1,147 +0,0 @@
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
- import { act, renderHook } from "@testing-library/react";
18
- import { beforeEach, describe, expect, it, vi } from "vitest";
19
- import { useCellContextMenu } from "../useCellContextMenu.js";
20
- describe("useCellContextMenu", () => {
21
- let mockElement;
22
- beforeEach(() => {
23
- // Create a mock table cell element with getBoundingClientRect
24
- mockElement = document.createElement("td");
25
- vi.spyOn(mockElement, "getBoundingClientRect").mockReturnValue({
26
- left: 100,
27
- top: 200,
28
- bottom: 240,
29
- width: 150,
30
- height: 40,
31
- right: 250,
32
- x: 100,
33
- y: 200,
34
- toJSON: () => ({})
35
- });
36
- });
37
- describe("initial state", () => {
38
- it("returns closed context menu state by default", () => {
39
- const tdRef = {
40
- current: mockElement
41
- };
42
- const {
43
- result
44
- } = renderHook(() => useCellContextMenu({
45
- tdRef
46
- }));
47
- expect(result.current.isContextMenuOpen).toBe(false);
48
- expect(result.current.popoverPosition).toBeNull();
49
- });
50
- });
51
- describe("handleOpenContextMenu", () => {
52
- it("opens context menu and use position from bounding client rect", () => {
53
- const tdRef = {
54
- current: mockElement
55
- };
56
- const {
57
- result
58
- } = renderHook(() => useCellContextMenu({
59
- tdRef
60
- }));
61
- const mockEvent = {
62
- preventDefault: vi.fn(),
63
- stopPropagation: vi.fn()
64
- };
65
- act(() => {
66
- result.current.handleOpenContextMenu(mockEvent);
67
- });
68
- expect(mockEvent.preventDefault).toHaveBeenCalled();
69
- expect(mockEvent.stopPropagation).toHaveBeenCalled();
70
- expect(result.current.isContextMenuOpen).toBe(true);
71
- expect(result.current.popoverPosition).toEqual({
72
- left: 100,
73
- top: 240,
74
- width: 150
75
- });
76
- });
77
- it("does not open context menu if tdRef.current is null", () => {
78
- const tdRef = {
79
- current: null
80
- };
81
- const {
82
- result
83
- } = renderHook(() => useCellContextMenu({
84
- tdRef
85
- }));
86
- const mockEvent = {
87
- preventDefault: vi.fn(),
88
- stopPropagation: vi.fn()
89
- };
90
- act(() => {
91
- result.current.handleOpenContextMenu(mockEvent);
92
- });
93
- expect(mockEvent.preventDefault).toHaveBeenCalled();
94
- expect(mockEvent.stopPropagation).toHaveBeenCalled();
95
- expect(result.current.isContextMenuOpen).toBe(false);
96
- expect(result.current.popoverPosition).toBeNull();
97
- });
98
- });
99
- describe("handleCloseContextMenu", () => {
100
- it("closes context menu and clears position", () => {
101
- const tdRef = {
102
- current: mockElement
103
- };
104
- const {
105
- result
106
- } = renderHook(() => useCellContextMenu({
107
- tdRef
108
- }));
109
- const mockEvent = {
110
- preventDefault: vi.fn(),
111
- stopPropagation: vi.fn()
112
- };
113
-
114
- // Open first
115
- act(() => {
116
- result.current.handleOpenContextMenu(mockEvent);
117
- });
118
- expect(result.current.isContextMenuOpen).toBe(true);
119
- expect(result.current.popoverPosition).not.toBeNull();
120
-
121
- // Close
122
- act(() => {
123
- result.current.handleCloseContextMenu();
124
- });
125
- expect(result.current.isContextMenuOpen).toBe(false);
126
- expect(result.current.popoverPosition).toBeNull();
127
- });
128
- it("is safe to call when already closed", () => {
129
- const tdRef = {
130
- current: mockElement
131
- };
132
- const {
133
- result
134
- } = renderHook(() => useCellContextMenu({
135
- tdRef
136
- }));
137
-
138
- // Close without opening
139
- act(() => {
140
- result.current.handleCloseContextMenu();
141
- });
142
- expect(result.current.isContextMenuOpen).toBe(false);
143
- expect(result.current.popoverPosition).toBeNull();
144
- });
145
- });
146
- });
147
- //# sourceMappingURL=useCellContextMenu.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useCellContextMenu.test.js","names":["act","renderHook","beforeEach","describe","expect","it","vi","useCellContextMenu","mockElement","document","createElement","spyOn","mockReturnValue","left","top","bottom","width","height","right","x","y","toJSON","tdRef","current","result","isContextMenuOpen","toBe","popoverPosition","toBeNull","mockEvent","preventDefault","fn","stopPropagation","handleOpenContextMenu","toHaveBeenCalled","toEqual","not","handleCloseContextMenu"],"sources":["useCellContextMenu.test.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 { act, renderHook } from \"@testing-library/react\";\nimport { beforeEach, describe, expect, it, vi } from \"vitest\";\nimport type { PopoverPosition } from \"../useCellContextMenu.js\";\nimport { useCellContextMenu } from \"../useCellContextMenu.js\";\n\ndescribe(\"useCellContextMenu\", () => {\n let mockElement: HTMLTableCellElement;\n\n beforeEach(() => {\n // Create a mock table cell element with getBoundingClientRect\n mockElement = document.createElement(\"td\");\n\n vi.spyOn(mockElement, \"getBoundingClientRect\").mockReturnValue({\n left: 100,\n top: 200,\n bottom: 240,\n width: 150,\n height: 40,\n right: 250,\n x: 100,\n y: 200,\n toJSON: () => ({}),\n });\n });\n\n describe(\"initial state\", () => {\n it(\"returns closed context menu state by default\", () => {\n const tdRef = { current: mockElement };\n const { result } = renderHook(() => useCellContextMenu({ tdRef }));\n\n expect(result.current.isContextMenuOpen).toBe(false);\n expect(result.current.popoverPosition).toBeNull();\n });\n });\n\n describe(\"handleOpenContextMenu\", () => {\n it(\"opens context menu and use position from bounding client rect\", () => {\n const tdRef = { current: mockElement };\n const { result } = renderHook(() => useCellContextMenu({ tdRef }));\n\n const mockEvent = {\n preventDefault: vi.fn(),\n stopPropagation: vi.fn(),\n } as unknown as React.MouseEvent<HTMLTableCellElement>;\n\n act(() => {\n result.current.handleOpenContextMenu(mockEvent);\n });\n\n expect(mockEvent.preventDefault).toHaveBeenCalled();\n expect(mockEvent.stopPropagation).toHaveBeenCalled();\n expect(result.current.isContextMenuOpen).toBe(true);\n expect(result.current.popoverPosition).toEqual({\n left: 100,\n top: 240,\n width: 150,\n } as PopoverPosition);\n });\n\n it(\"does not open context menu if tdRef.current is null\", () => {\n const tdRef = { current: null };\n const { result } = renderHook(() => useCellContextMenu({ tdRef }));\n\n const mockEvent = {\n preventDefault: vi.fn(),\n stopPropagation: vi.fn(),\n } as unknown as React.MouseEvent<HTMLTableCellElement>;\n\n act(() => {\n result.current.handleOpenContextMenu(mockEvent);\n });\n\n expect(mockEvent.preventDefault).toHaveBeenCalled();\n expect(mockEvent.stopPropagation).toHaveBeenCalled();\n expect(result.current.isContextMenuOpen).toBe(false);\n expect(result.current.popoverPosition).toBeNull();\n });\n });\n\n describe(\"handleCloseContextMenu\", () => {\n it(\"closes context menu and clears position\", () => {\n const tdRef = { current: mockElement };\n const { result } = renderHook(() => useCellContextMenu({ tdRef }));\n\n const mockEvent = {\n preventDefault: vi.fn(),\n stopPropagation: vi.fn(),\n } as unknown as React.MouseEvent<HTMLTableCellElement>;\n\n // Open first\n act(() => {\n result.current.handleOpenContextMenu(mockEvent);\n });\n\n expect(result.current.isContextMenuOpen).toBe(true);\n expect(result.current.popoverPosition).not.toBeNull();\n\n // Close\n act(() => {\n result.current.handleCloseContextMenu();\n });\n\n expect(result.current.isContextMenuOpen).toBe(false);\n expect(result.current.popoverPosition).toBeNull();\n });\n\n it(\"is safe to call when already closed\", () => {\n const tdRef = { current: mockElement };\n const { result } = renderHook(() => useCellContextMenu({ tdRef }));\n\n // Close without opening\n act(() => {\n result.current.handleCloseContextMenu();\n });\n\n expect(result.current.isContextMenuOpen).toBe(false);\n expect(result.current.popoverPosition).toBeNull();\n });\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,GAAG,EAAEC,UAAU,QAAQ,wBAAwB;AACxD,SAASC,UAAU,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,EAAEC,EAAE,QAAQ,QAAQ;AAE7D,SAASC,kBAAkB,QAAQ,0BAA0B;AAE7DJ,QAAQ,CAAC,oBAAoB,EAAE,MAAM;EACnC,IAAIK,WAAiC;EAErCN,UAAU,CAAC,MAAM;IACf;IACAM,WAAW,GAAGC,QAAQ,CAACC,aAAa,CAAC,IAAI,CAAC;IAE1CJ,EAAE,CAACK,KAAK,CAACH,WAAW,EAAE,uBAAuB,CAAC,CAACI,eAAe,CAAC;MAC7DC,IAAI,EAAE,GAAG;MACTC,GAAG,EAAE,GAAG;MACRC,MAAM,EAAE,GAAG;MACXC,KAAK,EAAE,GAAG;MACVC,MAAM,EAAE,EAAE;MACVC,KAAK,EAAE,GAAG;MACVC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