Skip to content

Commit 4541581

Browse files
committed
Added resize events to Demo App log
1 parent 10633df commit 4541581

File tree

5 files changed

+16
-110
lines changed

5 files changed

+16
-110
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ If you enjoyed this project — or just feeling generous, consider buying me a
7474
## Changelog
7575

7676

77+
### v: 1.2.10 (2024-02-xx)
78+
* __Demo App__ [Eventlog is not displaying any resize events.](https://github.com/gwinnem/vue-responsive-grid-layout/issues/46)
79+
80+
7781
### v: 1.2.9 (2024-02-03)
7882
* __Fixed Issue__ [Dynamic change columns, item will overlap](https://github.com/gwinnem/vue-responsive-grid-layout/issues/12)
7983

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-ts-responsive-grid-layout",
3-
"version": "1.2.9",
3+
"version": "1.2.10",
44
"type": "module",
55
"description": "Vue 3 Responsive & Dynamic Grid / Dashboard layout with drag, drop and resizable actions.",
66
"author": "Geirr Winnem <geirr@winnem.tech>",

sandbox/App.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -531,14 +531,14 @@ const movedEvent = (i: number | string, newX: number, newY: number): void => {
531531
};
532532
533533
const onResizeEndEvent = (i: number | string, newX: number, newY: number): void => {
534-
if (selected.value.includes('resizedEvent') || selected.value.includes('All')) {
535-
publishToEventLog(i, 'resizedEvent', newX, newY);
534+
if (selected.value.includes('resizedEndEvent') || selected.value.includes('All')) {
535+
publishToEventLog(i, 'Resize End', newX, newY);
536536
}
537537
};
538538
539539
const onResizeStartEvent = (i: number | string, newX: number, newY: number): void => {
540-
if (selected.value.includes('resizeEvent') || selected.value.includes('All')) {
541-
publishToEventLog(i, 'resizeEvent', newX, newY);
540+
if (selected.value.includes('resizeStartEvent') || selected.value.includes('All')) {
541+
publishToEventLog(i, 'Resize start', newX, newY);
542542
}
543543
};
544544

src/components/Grid/GridItem.vue

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -245,15 +245,6 @@ const classObj = computed(() => {
245245
};
246246
});
247247
248-
// TODO Maybe reuse this for the isMirrored change prop
249-
// Helper for generating the correct css class for resizing a GridItem
250-
// const resizableHandleClass = computed(() => {
251-
// if(renderRtl.value) {
252-
// return `vue-resizable-handle vue-rtl-resizable-handle`;
253-
// }
254-
// return `vue-resizable-handle`;
255-
// });
256-
257248
/**
258249
* Translate x and y coordinates from pixels to grid units.
259250
* @param {Number} top Top position (relative to parent) in pixels.
@@ -573,7 +564,7 @@ let edges: IInteractEdges = {
573564
};
574565
575566
const handleResize = (event: MouseEvent): void => {
576-
if (props.isStatic || !props.enableEditMode) {
567+
if (props.isStatic || !props.enableEditMode && props.isResizable) {
577568
return;
578569
}
579570
// Get the current drag point from the event. This is used as the offset.
@@ -594,14 +585,15 @@ const handleResize = (event: MouseEvent): void => {
594585
switch (event.type) {
595586
case `resizestart`: {
596587
tryMakeResizable();
588+
// (e: EGridItemEvent.RESIZE, i: number | string, h: number, w: number, height: number, width: number): void;
589+
emit(EGridItemEvent.RESIZE, props.i, innerH.value, innerW.value, innerH.value, innerW.value);
597590
previousW.value = innerW.value;
598591
previousH.value = innerH.value;
599592
pos = calcPosition(innerX.value, innerY.value, innerW.value, innerH.value);
600593
newSize.width = pos.width;
601594
newSize.height = pos.height;
602595
resizing.value = newSize;
603596
isResizing.value = true;
604-
// console.log(`START => innerX: ${innerX.value} innerY: ${innerY.value} 'innerW:'${innerW.value} innerH:${innerH.value} pos: ${JSON.stringify(pos)}`);
605597
// TODO strongly type event.edges
606598
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
607599
// @ts-ignore

vitepress-docs/guide/changelog.md

Lines changed: 4 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -5,80 +5,12 @@ page: true
55
title: Changelog
66
---
77

8-
<div style="text-align: center">
9-
10-
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat)](https://github.com/prettier/prettier)
11-
[![npm bundle size](https://img.shields.io/bundlephobia/min/vue-ts-responsive-grid-layout)](https://bundlephobia.com/result?p=vue-ts-responsive-grid-layout)
12-
[![npm](https://img.shields.io/npm/v/vue-ts-responsive-grid-layout)](https://www.npmjs.com/package/vue-ts-responsive-grid-layout)
13-
[![NPM](https://img.shields.io/npm/l/vue-ts-responsive-grid-layout)](https://github.com/gwinnem/vue-ts-responsive-grid-layout/blob/master/LICENSE)
14-
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
15-
16-
</div>
17-
18-
<p align="center">
19-
<img src="https://raw.githubusercontent.com/gwinnem/vue-responsive-grid-layout/main/docs/Data%20Grid.svg" height="200" alt="logo">
20-
</p>
21-
22-
<h1 align="center">vue-ts-responsive-grid-layout</h1>
23-
24-
<h2 align="center">
25-
<a href="https://vue-ts-responsive-grid-layout.winnem.tech" target="_blank">Documentation Website</a>
26-
</h2>
27-
28-
## What is vue-ts-responsive-grid-layout
29-
30-
VUE 3 responsive grid layout is based on the original work by [JBaysolution's vue-grid-layout](https://github.com/jbaysolutions/vue-grid-layout).
31-
32-
This new and refactored component has more features, typesafe Emits, Props and a strict linting rule setup.
33-
34-
A proper App developed for testing purposes.
35-
36-
Documentation website contains 13 examples. Will be updated when new features are added to the component.
37-
38-
<br/>
39-
40-
## Donate
41-
42-
If you enjoyed this project — or just feeling generous, consider buying me a 🍺. Cheers!
43-
44-
<br/>
45-
46-
<a href="https://paypal.me/gwinnem/">
47-
<img src="https://raw.githubusercontent.com/gwinnem/vue-responsive-grid-layout/dev/docs/paypal-images/blue.svg" height="40" alt="paypal">
48-
</a>
49-
50-
<br/>
51-
52-
### Features:
53-
54-
* Prop in GridLayout for distributing GridItem's equally.
55-
* GridLayout now has slot for GridItem.
56-
* Prop for displaying grid lines in GridLayout.
57-
* Prop for setting edit mode in GridLayout. Shortcuts the isDraggable and isResizable props.
58-
* Prop for adding border radius in GridLayout. Adds a 8px radius to each GridItem.
59-
* Prop in GridLayout for shifting GridItems horizontally when dragging instead of vertical.
60-
* Separated out style variables, so it is easier to restyle the component.
61-
* Added tab navigation support.
62-
* Close button in GridItem for removing the GridItem from the GridLayout.
63-
* Added more events to GridLayout and GridItem.
64-
* Support for resize Bottom, Bottom Right and Right in GridIem.
65-
* Draggable widgets
66-
* Resizable widgets
67-
* Static widgets
68-
* Bounds checking for dragging and resizing
69-
* Widgets may be added or removed without rebuilding grid
70-
* Layout can be serialized and restored
71-
* Automatic RTL support
72-
* Responsive using predefined layout's for different breakpoints.
73-
* GridItem automatically resizes when content change(Useful when displaying charts).
74-
75-
### Testing:
8+
## Changelog
769

77-
* __Unit tests__ [Using Vitest](https://vitest.dev/)
78-
* __Unit test console__ [Using Vitest UI](https://vitest.dev/guide/ui.html#vitest-ui)
79-
* __e2e tests__ [Using nightwatchjs](https://nightwatchjs.org/)
8010

81-
## Changelog
11+
### v: 1.2.10 (2024-02-xx)
12+
* __Demo App__ [Eventlog is not displaying any resize events.](https://github.com/gwinnem/vue-responsive-grid-layout/issues/46)
13+
*
8214

8315

8416
### v: 1.2.9 (2024-02-03)
@@ -142,25 +74,3 @@ Thanks to [UTing1119](https://github.com/UTing1119) for his contribution to this
14274

14375
* --Fixed Issue-- [Issue 7](https://github.com/gwinnem/vue-responsive-grid-layout/issues/7), thanks to [UTing1119](https://github.com/UTing1119)
14476
* --Fixed Issue-- [Issue 6](https://github.com/gwinnem/vue-responsive-grid-layout/issues/6), thanks to [UTing1119](https://github.com/UTing1119)
145-
146-
## Setting up vue-ts-responsive-grid-layout in your project
147-
148-
[Howto](https://github.com/gwinnem/vue-responsive-grid-layout/blob/main/docs/setup.md)
149-
150-
<br/>
151-
152-
#### Auditing the package
153-
154-
```
155-
npm audit --registry=https://registry.npmjs.org/
156-
```
157-
158-
<br/>
159-
160-
### References
161-
162-
* [Mini.css used in the sandbox](https://minicss.us/docs.htm#)
163-
* [Vue-Multiselect used in the sandbox](https://vue-multiselect.js.org/#sub-getting-started)
164-
* [Vitest](https://vitest.dev/)
165-
* [Vitest UI](https://vitest.dev/guide/ui.html#vitest-ui)
166-
* [nightwatchjs](https://nightwatchjs.org/)

0 commit comments

Comments
 (0)