Giter Club home page Giter Club logo

egjs-grid's Issues

TypeError TS2322: is missing the following properties from type - Vue 3 - TypeScript

Description

TypeError when run 'type check' command

error TS2322: Type '{ gap: number; defaultDirection: string; columnRange: number[]; rowRange: number; sizeRange: number[]; isCroppedSize: boolean; displayedRow: number; autoResize: true; class: string; }' is not assignable to type 'ComponentProps<VueGridInterface<typeof JustifiedGrid>>'.
  Type '{ gap: number; defaultDirection: string; columnRange: number[]; rowRange: number; sizeRange: number[]; isCroppedSize: boolean; displayedRow: number; autoResize: true; class: string; }' is missing the following properties from type 'VueGridInterface<typeof JustifiedGrid>': $el, $_grid, $props, syncElements, and 6 more.

76     <JustifiedGrid


Steps to check or reproduce

"@egjs/vue-grid": "^1.11.2",
"vue": "^3.2.45"
"typescript": "^4.9.4",
"vite": "^4.0.4",
"vue-tsc": "^1.0.24"

FrameGrid: relationship of frame property to resulting layout is not obvious

Description

Trying to work this out through playing with it.

https://naver.github.io/egjs-grid/storybook/?path=/story/examples-framegrid--frame-grid-template
image

  • default says 1,1,2,2,3,3,2,2,4,4,4,5 but when i put that in, there's a storybook form validation error (the input field is red) and nothing is rendered
  • when i change it to [[1,1,2,2,3,3],[2,2,4,4,4,5]] then it renders

Looking at the resulting output
image

edit it just dawned on my that you're using frame to define named grid slots:

https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template


Steps to check or reproduce

Sveltekit: <MasonryGrid> is not a valid SSR component

Description

Does not work with Sveltekit (via Vite).

Steps to check or reproduce

Install it on a fresh Sveltekit starter.

I tried adding as a devDep and an dep to no avail. I also tried adding the package to the vite's optimizeDeps in the sveltekit config, to no avail.

image

add `weightPriority` for simple weight preset

The priority that determines the weight of the item.

  • weightPriority: "custom"
    • sizeWeight: 1,
    • ratioWeight: 1,
  • weightPriority: "size"
    • sizeWeight: 100
    • ratioWeight: 1
  • weightPriority: "ratio"
    • sizeWeight: 1
    • ratioWeight: 100

No event occurs in react.

Description

No event occurs in react.

<MasonryGrid onRenderComplete={e => {
    console.log(e);
}} />

Steps to check or reproduce

Can isEqualSize be used when there are two or more size groups?

Description

<!--item1 has the same size.-->
<div class="item item1" data-grid-size-group="1"></div>
<div class="item item1" data-grid-size-group="1"></div>
<!--item2 has the same size.-->
<div class="item item2" data-grid-size-group="2"></div>
<div class="item item2" data-grid-size-group="2"></div>

Steps to check or reproduce

I want to limit the number of rows displayed on the screen.

Description

<div class="container" style="overflow: hidden;">
<!-- row 1 -->
    <div class="item"></div>
    <div class="item"></div>
<!-- row 2 -->
    <div class="item"></div>
<!-- row 3 -->
    <div class="item"></div>
</div>

I want to display only row 2 on the screen.

Steps to check or reproduce

TypeError: Cannot read property 'destroy' of undefined

Description

Running a toy example of egjs-grid for svelte, and I'm getting the error in the title.

Steps to check or reproduce

    import { JustifiedGrid } from "@egjs/svelte-grid";
  
    const gap = 5;
    const defaultDirection = "end";
    const rowRange = 0;
    const columnRange = [1,8];
    const sizeRange = [200,1000];
    const isCroppedSize = false;
    const displayedRow = -1;
  </script>
  
  <JustifiedGrid
    class="container"
    {defaultDirection}
    {gap}
    {rowRange}
    {columnRange}
    {sizeRange}
    {isCroppedSize}
    {displayedRow}
  >
    <div class="item">1</div>
    <div class="item">2</div>
    <div class="item">3</div>
    <div class="item">4</div>
    <div class="item">5</div>
    <div class="item">6</div>
    <div class="item">7</div>
    <div class="item">8</div>
    <div class="item">9</div>
    <div class="item">10</div>
  </JustifiedGrid>```

MasonryGrid is undefined

Description

Hey y'all. The issue I'm experiencing is that on first render MasonryGrid comes through undefined causing my app to crash. I've fixed the issue by adding a {Boolean(MasonryGrid) && ...(<MasonryGrid>.... where I'm using the library but that seems odd. I'm putting this here to see if anyone else is experiencing the issue or if this is a known problem.

Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

Steps to check or reproduce

I'm just importing MasonryGrid into my react component and using it with "gap" and "column" props.

The transition behavior in InfiniteGrid is strange.

Description

  1. InfiniteGrid's element is placed at left: -9999, top: -9999 with transition
  2. Set InfiniteGrid's element to Grid's poses.
  3. It is expressed as if the item is flying through the transition.

Steps to check or reproduce

svelte package does not work

Description

I am trying to implement a masonry layout using the svelte package but it doesn't align anything, it doesn't even modify the children

Steps to check or reproduce

<MasonryGrid column={4} columnSize={200} align={'end'}>
      {#each category.posters as card}
        <Card {card} />
      {/each}
    </MasonryGrid>

Vanilla Svelte renders images as list instead of a grid

Description

Images are rendered but as a list instead of a grid. Also, console gives some errors:

[HMR][Svelte] Unrecoverable HMR error in <App>: next update will trigger a full reload proxy.js:15:11
    logError http://localhost:5173/node_modules/svelte-hmr/runtime/proxy.js?v=1b726137:15
    Proxy<App> http://localhost:5173/node_modules/svelte-hmr/runtime/proxy.js?v=1b726137:380
    <anonymous> http://localhost:5173/src/main.js:4
Uncaught TypeError: options.props is undefined
    JustifiedGrid JustifiedGrid.js:11
    instance Grid.svelte:51
    run index.mjs:20
    mount_component index.mjs:1953
    flush index.mjs:1191
    init index.mjs:2048
    App App.svelte:426
    createProxiedComponent svelte-hooks.js:341
    ProxyComponent proxy.js:242
    Proxy<App> proxy.js:349
    <anonymous> main.js:4
Uncaught (in promise) TypeError: grid is undefined

Steps to check or reproduce

Using a clean svelte + vite project (no sveltekit)

1.- Create new svelte project with vite

npm create vite@latest

select vanilla svelte and javascript

2.- Replace App.svelte contents file with storybook example

Versions

Node: v18.12.1
Svelte: 3.54.0
egjs-grid: 1.11.2

vue-grid is not working in vue2

Description

Some of the APIs are Vue3.

function render(_ctx, _cache, $props, $setup, $data, $options) {
  return vue.openBlock(), vue.createBlock("div", _hoisted_1, [vue.renderSlot(_ctx.$slots, "default")], 512
  /* NEED_PATCH */
  );
}

Steps to check or reproduce

bug: the gap not work

Description

this is a bug?
desc: the gap now work when loading,only work when loaded completely
image
image

Steps to check or reproduce

use @egjs/react-grid package will show this problem

build failed with SvelteKit latest version

Description

It seems to be similar with naver/egjs-infinitegrid#505 (comment)

this is error log

/* empty css                                                    */import { MasonryGrid as MasonryGrid$1 } from "@egjs/grid";
                                                                           ^^^^^^^^^^^
SyntaxError: Named export 'MasonryGrid' not found. The requested module '@egjs/grid' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from '@egjs/grid';
const { MasonryGrid: MasonryGrid$1 } = pkg;

Steps to check or reproduce

update to svelte-kit latest version
and npm run build

DOESNT RE-RENDER - If children sizes change

Description

Justified grid doesn't re-render items if their sizes change.

Steps to check or reproduce

I fetch multiple images but the initial grid stays, how do I re-render the grid to dynamically resize every item if they change?

My code:

...
const [images, setImages] = useState<any[]>([])

...

<JustifiedGrid
  gap={5}
  defaultDirection={"end"}
  align={'justify'}
  columnRange={[1,4]}
  rowRange={0}
  sizeRange={[100,500]}
  isCroppedSize={false}
  displayedRow={-1}
  useResizeObserver={true}
  observeChildren={true}
  autoResize={true}
>
  {images.map((x: any, index: number) => (
    <div key={index} className='w-full overflow-hidden'>
      <Image src={x?.url} alt='' className='' />
    </div>
  ))}
</JustifiedGrid>

Here's the result:

aaaa.mov

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.