GithubHelp home page GithubHelp logo

qmhc / grid-layout-plus Goto Github PK

View Code? Open in Web Editor NEW
271.0 7.0 32.0 240 KB

A draggable and resizable grid layout, for Vue 3.

Home Page: https://grid-layout-plus.netlify.app/

License: MIT License

JavaScript 1.23% Vue 45.07% HTML 0.48% TypeScript 50.54% SCSS 2.25% Shell 0.44%
drag-and-drop grid-layout javascript typescript vue vue3 widget vite vue-component

grid-layout-plus's Introduction

Grid Layout Plus

npm version

What is Grid Layout Plus?

Grid Layout Plus comes from Vue Grid Layout and is migrated to Vue 3.

It is constructed with <script setup> and normalized TypeScript.

About Vue Grid Layout

What is Vue Grid Layout?

Vue Grid Layout is a grid layout system for Vue 2, like Gridster.

Heavily inspired by React Grid Layout.

Features

  • Draggable widgets
  • Resizable widgets
  • Static widgets
  • Bounds checking for dragging and resizing
  • Widgets may be added or removed without rebuilding grid
  • Layout can be serialized and restored
  • Automatic RTL support
  • Responsive

Documentation

Check out the online documentation here.

License

All in MIT license.

grid-layout-plus's People

Contributors

kingyue737 avatar qmhc avatar sweeeeetch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

grid-layout-plus's Issues

Shadow dislocation

image

When I move items frequently, sometimes the shadows don't disappear and are misplaced

Can you help me

内存占用一直在涨

复现过程:在文档示例页面,控制台性能tab录制,然后切换几个例子,可以看到阶梯式增长

我拉到本地测试了一下,把tryInteract内容注释掉就正常了,推测应该是interactjs的问题

vexip报错

in ./node_modules/@vexip-ui/utils/dist/index.cjs
Module parse failed: Unexpected token

如何实现从一个GridLayout中拖放到另一个GridLayout

尝试过在GridItem移动事件中,删除源GridLayout中的layout数组中的item,再插入到目标GridLayout的layout数组中,但这样会引发handleDrag中的异常:

  if (!mouseInGrid) {
    let draggingIndex = layoutData.value[0].findIndex(ele => ele.i === itemId)
    let removed = layoutData.value[0].splice(draggingIndex, 1)
    console.log(layoutData.value[0], removed)
  }

大概可以模仿drag-from-outside例子,但先要解决拖少源GridItem时从源数组上删除该项引发异常?

嵌套拖拽无效

微信截图_20240406204003

拖拽组件内部嵌套,内部元素能布局,但是不能拖动resize

作者有没有想过做堆叠功能

作者有没有想过做堆叠功能 ,使模块之间能重叠。具体使用案例👇
image
想在这下面添加按钮但元素内不能添加元素

Resize past lower limit does nothing.

Setting a minH on a widget entry does not prevent the widget from resizing below that level. I was able to do this via the resized event, checking for the height and setting after nextTick but it seems the minH does nothing.

This assignment will throw because "layout" is a constant

Seeing this warning on my app build:

vite v4.5.2 building for prod...
[plugin:vite:esbuild] This assignment will throw because "layout" is a constant
109|      _createVNode(_unref(GridLayout), {
110|        layout: layout,
111|        "onUpdate:layout": _cache[0] || (_cache[0] = ($event: any) => ((layout) = $event)),
   |                                                                        ^
112|        "row-height": 200,
113|        "is-draggable": draggable.value,

Internal server error: Codegen node is missing for element/if/for node. Apply appropriate transforms first.

Thanks for porting grid-layout to vue 3.

Sadly, I receive the following error when trying any of the examples:

  Plugin: vite:vue
  File: E:/ALADIN_Orga/_workspace/CARPET/src/views/ComponentTest.vue
      at assert (E:\ALADIN_Orga\_workspace\CARPET\node_modules\@vue\compiler-core\dist\compiler-core.cjs.js:496:11)
      at genNode (E:\ALADIN_Orga\_workspace\CARPET\node_modules\@vue\compiler-core\dist\compiler-core.cjs.js:2474:7)
      at genNodeList (E:\ALADIN_Orga\_workspace\CARPET\node_modules\@vue\compiler-core\dist\compiler-core.cjs.js:2449:7)
      at genNodeListAsArray (E:\ALADIN_Orga\_workspace\CARPET\node_modules\@vue\compiler-core\dist\compiler-core.cjs.js:2436:3)
      at genNodeList (E:\ALADIN_Orga\_workspace\CARPET\node_modules\@vue\compiler-core\dist\compiler-core.cjs.js:2447:7)
      at genVNodeCall (E:\ALADIN_Orga\_workspace\CARPET\node_modules\@vue\compiler-core\dist\compiler-core.cjs.js:2616:3)
      at genNode (E:\ALADIN_Orga\_workspace\CARPET\node_modules\@vue\compiler-core\dist\compiler-core.cjs.js:2499:7)
      at genNode (E:\ALADIN_Orga\_workspace\CARPET\node_modules\@vue\compiler-core\dist\compiler-core.cjs.js:2478:7)
      at genNodeList (E:\ALADIN_Orga\_workspace\CARPET\node_modules\@vue\compiler-core\dist\compiler-core.cjs.js:2449:7)
      at genNodeListAsArray (E:\ALADIN_Orga\_workspace\CARPET\node_modules\@vue\compiler-core\dist\compiler-core.cjs.js:2436:3)

When cloning the repository and installing locally, the devserver is working though.
I've seen this and this, but have not managed to get it up and running.

The vue documentation states it might be related to default slots, that are used in combination with named slots, but I've not come up with a way to solve this yet.

Any idea on what causes the issue?

style cannot be post-processed

CSS in this project is injected by js via vite-plugin-css-injected-by-js, and thus it cannot be post-processed by PostCSS or lightningCSS on the user end.

For example, this project injects prefixes that may not be needed by users targeting the latest browsers. If the styles can be post-processed on the user end, those unnecessary styles will be removed by PostCSS to reduce bundle size.

On the other hand, this project uses some features that are not supported on old browsers like inset and percentage in opacity, both of which have a global usage of less than 95% https://caniuse.com/mdn-css_properties_inset. The users that target older browsers will need PostCSS to transpile them.

As a library, I think it would be better to build styles into a .css dist file instead of a js string.

npx only allow pnpm

why would you make it only run pnpm or yarn but withoout allowing to install plugin with npm?

scaling of grid not correct(?) on resize

Hi

I've created a user custom dashboard with grid-layout-plus. However I encounter a problem. When the users designs a custom dashboard and the resizes the window, the grid scales wrong. If we open the dashboard on any screen (whichever resolution) the dashboard only scales correct if the window is being displayed full screen.
So it's like the calculation of screen-pixel-per-grid-pixel uses the full screen width instead of the width of the container in which it is being displayed. I'm not sure if this is intended behavior or a bug. Is there any way to make the grid depending on the container-div?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.