@sio-group/ui-datatable 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/index.cjs +4 -5
- package/dist/index.js +4 -5
- package/dist/styles/index.css +1 -1
- package/package.json +1 -1
- package/src/assets/scss/index.scss +1 -1
- package/src/components/ActionCell.tsx +5 -5
package/CHANGELOG.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -205,13 +205,15 @@ var ActionCell = ({
|
|
|
205
205
|
if (dropdownRef.current && triggerRef.current) {
|
|
206
206
|
const rect = triggerRef.current.getBoundingClientRect();
|
|
207
207
|
dropdownRef.current.style.left = `${rect.left}px`;
|
|
208
|
-
dropdownRef.current.style.top = `${rect.
|
|
208
|
+
dropdownRef.current.style.top = `${rect.bottom}px`;
|
|
209
209
|
}
|
|
210
210
|
};
|
|
211
211
|
(0, import_react2.useEffect)(() => {
|
|
212
212
|
if (!isOpen) return;
|
|
213
|
+
positionDropdown();
|
|
213
214
|
const handleOutside = (e) => {
|
|
214
215
|
if (dropdownRef.current?.contains(e.target)) return;
|
|
216
|
+
if (triggerRef.current?.contains(e.target)) return;
|
|
215
217
|
setIsOpen(false);
|
|
216
218
|
};
|
|
217
219
|
document.addEventListener("mousedown", handleOutside, false);
|
|
@@ -248,10 +250,7 @@ var ActionCell = ({
|
|
|
248
250
|
"aria-label": "Acties",
|
|
249
251
|
"aria-expanded": isOpen,
|
|
250
252
|
"aria-haspopup": "menu",
|
|
251
|
-
onClick: () =>
|
|
252
|
-
setIsOpen(!isOpen);
|
|
253
|
-
positionDropdown();
|
|
254
|
-
},
|
|
253
|
+
onClick: () => setIsOpen(!isOpen),
|
|
255
254
|
children: renderMenuIcon ? renderMenuIcon() : "\u22EE"
|
|
256
255
|
}
|
|
257
256
|
),
|
package/dist/index.js
CHANGED
|
@@ -179,13 +179,15 @@ var ActionCell = ({
|
|
|
179
179
|
if (dropdownRef.current && triggerRef.current) {
|
|
180
180
|
const rect = triggerRef.current.getBoundingClientRect();
|
|
181
181
|
dropdownRef.current.style.left = `${rect.left}px`;
|
|
182
|
-
dropdownRef.current.style.top = `${rect.
|
|
182
|
+
dropdownRef.current.style.top = `${rect.bottom}px`;
|
|
183
183
|
}
|
|
184
184
|
};
|
|
185
185
|
useEffect(() => {
|
|
186
186
|
if (!isOpen) return;
|
|
187
|
+
positionDropdown();
|
|
187
188
|
const handleOutside = (e) => {
|
|
188
189
|
if (dropdownRef.current?.contains(e.target)) return;
|
|
190
|
+
if (triggerRef.current?.contains(e.target)) return;
|
|
189
191
|
setIsOpen(false);
|
|
190
192
|
};
|
|
191
193
|
document.addEventListener("mousedown", handleOutside, false);
|
|
@@ -222,10 +224,7 @@ var ActionCell = ({
|
|
|
222
224
|
"aria-label": "Acties",
|
|
223
225
|
"aria-expanded": isOpen,
|
|
224
226
|
"aria-haspopup": "menu",
|
|
225
|
-
onClick: () =>
|
|
226
|
-
setIsOpen(!isOpen);
|
|
227
|
-
positionDropdown();
|
|
228
|
-
},
|
|
227
|
+
onClick: () => setIsOpen(!isOpen),
|
|
229
228
|
children: renderMenuIcon ? renderMenuIcon() : "\u22EE"
|
|
230
229
|
}
|
|
231
230
|
),
|
package/dist/styles/index.css
CHANGED
package/package.json
CHANGED
|
@@ -15,15 +15,18 @@ export const ActionCell = <T extends { id: string | number }> ({
|
|
|
15
15
|
if (dropdownRef.current && triggerRef.current) {
|
|
16
16
|
const rect: DOMRect = triggerRef.current.getBoundingClientRect();
|
|
17
17
|
dropdownRef.current.style.left = `${rect.left}px`;
|
|
18
|
-
dropdownRef.current.style.top = `${rect.
|
|
18
|
+
dropdownRef.current.style.top = `${rect.bottom}px`;
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
useEffect(() => {
|
|
23
23
|
if (!isOpen) return;
|
|
24
24
|
|
|
25
|
+
positionDropdown();
|
|
26
|
+
|
|
25
27
|
const handleOutside = (e: MouseEvent | Event) => {
|
|
26
28
|
if (dropdownRef.current?.contains(e.target as Node)) return;
|
|
29
|
+
if (triggerRef.current?.contains(e.target as Node)) return;
|
|
27
30
|
setIsOpen(false);
|
|
28
31
|
}
|
|
29
32
|
|
|
@@ -65,10 +68,7 @@ export const ActionCell = <T extends { id: string | number }> ({
|
|
|
65
68
|
aria-label="Acties"
|
|
66
69
|
aria-expanded={isOpen}
|
|
67
70
|
aria-haspopup="menu"
|
|
68
|
-
onClick={() =>
|
|
69
|
-
setIsOpen(!isOpen);
|
|
70
|
-
positionDropdown();
|
|
71
|
-
}}
|
|
71
|
+
onClick={() => setIsOpen(!isOpen)}
|
|
72
72
|
>
|
|
73
73
|
{renderMenuIcon ? renderMenuIcon() : '⋮'}
|
|
74
74
|
</button>
|