@neovici/cosmoz-omnitable 13.9.2 → 13.10.0

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.
@@ -1,38 +1,41 @@
1
1
  import { useEffect, component } from '@pionjs/pion';
2
2
  import { nothing } from 'lit-html';
3
3
 
4
- const
5
- ResizeNub = host => {
6
- useEffect(() => {
7
- let initial = 0,
8
- initialWidth = 0;
9
- const
10
- move = ev => {
11
- host.dispatchEvent(new CustomEvent('column-resize', {
4
+ const ResizeNub = (host) => {
5
+ const { column } = host;
6
+
7
+ useEffect(() => {
8
+ let initial = 0;
9
+ let initialWidth = 0;
10
+ const move = (ev) => {
11
+ host.dispatchEvent(
12
+ new CustomEvent('column-resize', {
12
13
  bubbles: true,
13
14
  composed: true,
14
15
  detail: {
15
16
  newWidth: Math.ceil(initialWidth + ev.pageX - initial),
16
- column: host.column
17
- }
18
- }));
19
- },
20
- stop = () => {
21
- document.removeEventListener('pointermove', move);
22
- document.removeEventListener('pointerup', stop);
23
- },
24
- start = ev => {
25
- initial = ev.pageX;
26
- initialWidth = host.previousElementSibling.getBoundingClientRect().width;
27
- document.addEventListener('pointermove', move);
28
- document.addEventListener('pointerup', stop);
29
- };
30
- host.addEventListener('pointerdown', start);
17
+ column,
18
+ },
19
+ }),
20
+ );
21
+ },
22
+ stop = () => {
23
+ document.removeEventListener('pointermove', move);
24
+ document.removeEventListener('pointerup', stop);
25
+ },
26
+ start = (ev) => {
27
+ initial = ev.pageX;
28
+ initialWidth =
29
+ host.previousElementSibling.getBoundingClientRect().width;
30
+ document.addEventListener('pointermove', move);
31
+ document.addEventListener('pointerup', stop);
32
+ };
33
+ host.addEventListener('pointerdown', start);
31
34
 
32
- return () => host.removeEventListener('pointerdown', start);
33
- }, [host.nextElementSibling]);
35
+ return () => host.removeEventListener('pointerdown', start);
36
+ }, [column]);
34
37
 
35
- return nothing;
36
- };
38
+ return nothing;
39
+ };
37
40
 
38
41
  customElements.define('cosmoz-omnitable-resize-nub', component(ResizeNub));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neovici/cosmoz-omnitable",
3
- "version": "13.9.2",
3
+ "version": "13.10.0",
4
4
  "description": "[![Build Status](https://travis-ci.org/Neovici/cosmoz-omnitable.svg?branch=master)](https://travis-ci.org/Neovici/cosmoz-omnitable)",
5
5
  "keywords": [
6
6
  "web-components"