@1771technologies/lytenyte-pro 0.0.40 → 0.0.41

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/dist/index.js CHANGED
@@ -289,27 +289,24 @@ function useHeaderCells(api) {
289
289
  }
290
290
  function useResizeDivider(api, column) {
291
291
  const isResizable = api.columnIsResizable(column);
292
- const timeOutRef = useRef(null);
293
- const dragStarted = useRef(false);
292
+ const [active, setActive] = useState(false);
294
293
  const resizeProps = useMemo(() => {
295
294
  if (!isResizable) return {};
296
295
  const onPointerDown = (e) => {
297
- e.preventDefault();
296
+ if (e.pointerType === "mouse" && e.button !== 0) return;
298
297
  const startWidth = api.columnVisualWidth(column);
299
298
  const isRtl = api.getState().rtl.peek();
300
299
  let startX = null;
301
300
  let anim = null;
302
301
  let delta = 0;
303
- if (timeOutRef.current) clearTimeout(timeOutRef.current);
304
- timeOutRef.current = setTimeout(() => {
305
- dragStarted.current = true;
306
- timeOutRef.current = null;
307
- }, 100);
302
+ e.preventDefault();
303
+ e.stopPropagation();
304
+ document.body.classList.add("lng1771-column-resize-active");
305
+ setActive(true);
308
306
  const controller = new AbortController();
309
307
  document.addEventListener(
310
308
  "pointermove",
311
309
  (ev) => {
312
- if (dragStarted.current === false) return;
313
310
  if (startX === null) {
314
311
  startX = getClientX(ev);
315
312
  return;
@@ -327,9 +324,9 @@ function useResizeDivider(api, column) {
327
324
  window.addEventListener(
328
325
  "pointerup",
329
326
  () => {
330
- if (timeOutRef.current) clearTimeout(timeOutRef.current);
331
327
  if (anim) cancelAnimationFrame(anim);
332
- dragStarted.current = false;
328
+ setActive(false);
329
+ document.body.classList.remove("lng1771-column-resize-active");
333
330
  const newWidth = startWidth + delta;
334
331
  api.columnResize(column, newWidth);
335
332
  api.getState().internal.columnWidthDeltas.set(null);
@@ -340,7 +337,7 @@ function useResizeDivider(api, column) {
340
337
  };
341
338
  return { onPointerDown };
342
339
  }, [api, column, isResizable]);
343
- return resizeProps;
340
+ return { ...resizeProps, active };
344
341
  }
345
342
  function HeaderDivider({
346
343
  api,
@@ -358,7 +355,7 @@ function HeaderDivider({
358
355
  const isLastStart = startCount > 0 && columnIndex === startCount - 1;
359
356
  const isFirstEnd = endCount > 0 && startCount + centerCount === columnIndex;
360
357
  const isLast = startCount + centerCount + endCount - 1 === columnIndex;
361
- const resizeProps = useResizeDivider(api, column);
358
+ const { onPointerDown, active: resizeActive } = useResizeDivider(api, column);
362
359
  const rtl = api.getState().rtl.use();
363
360
  const style = useMemo(() => {
364
361
  const isStart = column.pin === "start";
@@ -397,7 +394,8 @@ function HeaderDivider({
397
394
  return /* @__PURE__ */ jsx(
398
395
  "div",
399
396
  {
400
- ...resizeProps,
397
+ onPointerDown,
398
+ "data-resize-active": resizeActive,
401
399
  onDoubleClick: () => {
402
400
  const autosize = api.getState().autosizeDoubleClickHeader.peek();
403
401
  if (autosize) api.autosizeColumn(column, { includeHeader: true });
@@ -324,6 +324,14 @@ INPUT
324
324
  &:hover div {
325
325
  background-color: var(--lng1771-primary-50);
326
326
  }
327
+
328
+ &[data-resize-active="true"] {
329
+ background-color: var(--lng1771-primary-50);
330
+ }
331
+ }
332
+
333
+ .lng1771-column-resize-active {
334
+ cursor: col-resize;
327
335
  }
328
336
  .lng1771-header__group {
329
337
  grid-column-start: 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1771technologies/lytenyte-pro",
3
- "version": "0.0.40",
3
+ "version": "0.0.41",
4
4
  "license": "COMMERCIAL",
5
5
  "type": "module",
6
6
  "files": [
@@ -70,20 +70,20 @@
70
70
  "react-dom": "^18.0.0 || ^19.0.0"
71
71
  },
72
72
  "dependencies": {
73
- "@1771technologies/grid-client-data-source-pro": "0.0.40",
74
- "@1771technologies/grid-core": "0.0.40",
75
- "@1771technologies/grid-design": "0.0.40",
76
- "@1771technologies/grid-provider": "0.0.40",
77
- "@1771technologies/grid-store-pro": "0.0.40",
78
- "@1771technologies/grid-tree-data-source": "0.0.40",
79
- "@1771technologies/grid-types": "0.0.40",
80
- "@1771technologies/js-utils": "0.0.40",
81
- "@1771technologies/lytenyte-core": "0.0.40",
82
- "@1771technologies/react-cascada": "0.0.40",
83
- "@1771technologies/react-dragon": "0.0.40",
84
- "@1771technologies/react-sizer": "0.0.40",
85
- "@1771technologies/react-split-pane": "0.0.40",
86
- "@1771technologies/react-utils": "0.0.40",
73
+ "@1771technologies/grid-client-data-source-pro": "0.0.41",
74
+ "@1771technologies/grid-core": "0.0.41",
75
+ "@1771technologies/grid-design": "0.0.41",
76
+ "@1771technologies/grid-provider": "0.0.41",
77
+ "@1771technologies/grid-store-pro": "0.0.41",
78
+ "@1771technologies/grid-tree-data-source": "0.0.41",
79
+ "@1771technologies/grid-types": "0.0.41",
80
+ "@1771technologies/js-utils": "0.0.41",
81
+ "@1771technologies/lytenyte-core": "0.0.41",
82
+ "@1771technologies/react-cascada": "0.0.41",
83
+ "@1771technologies/react-dragon": "0.0.41",
84
+ "@1771technologies/react-sizer": "0.0.41",
85
+ "@1771technologies/react-split-pane": "0.0.41",
86
+ "@1771technologies/react-utils": "0.0.41",
87
87
  "@base-ui-components/react": "1.0.0-alpha.7"
88
88
  },
89
89
  "devDependencies": {