@egjs/svelte-infinitegrid 4.6.1-beta.0 → 4.7.1

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.
Files changed (36) hide show
  1. package/dist/infinitegrid.cjs.js +2 -2
  2. package/dist/infinitegrid.cjs.js.map +1 -1
  3. package/dist/infinitegrid.esm.js +2 -2
  4. package/dist/infinitegrid.esm.js.map +1 -1
  5. package/package.json +7 -2
  6. package/src/index.d.ts +1 -0
  7. package/.storybook/main.js +0 -32
  8. package/.storybook/manager.js +0 -5
  9. package/.storybook/preview.js +0 -25
  10. package/CHANGELOG.md +0 -47
  11. package/global.d.ts +0 -8
  12. package/public/favicon.png +0 -0
  13. package/public/global.css +0 -63
  14. package/public/index.html +0 -18
  15. package/rollup.build.config.js +0 -32
  16. package/rollup.config.js +0 -83
  17. package/stories/1-MasonryInfiniteGrid/0-MasonryInfiniteGrid.stories.ts +0 -4
  18. package/stories/1-MasonryInfiniteGrid/1-MasonryInfiniteGrid.stories.ts +0 -27
  19. package/stories/1-MasonryInfiniteGrid/apps/SvelteMasonryInfiniteGridApp.svelte +0 -42
  20. package/stories/2-JustifiedInfiniteGrid/0-JustifiedInfiniteGrid.stories.ts +0 -5
  21. package/stories/2-JustifiedInfiniteGrid/1-JustifiedInfiniteGrid.stories.ts +0 -10
  22. package/stories/2-JustifiedInfiniteGrid/apps/SvelteJustifiedInfiniteGridApp.svelte +0 -43
  23. package/stories/3-FrameInfiniteGrid/0-FrameInfiniteGrid.stories.ts +0 -5
  24. package/stories/3-FrameInfiniteGrid/1-FrameInfiniteGrid.stories.ts +0 -10
  25. package/stories/3-FrameInfiniteGrid/apps/SvelteFrameInfiniteGridApp.svelte +0 -44
  26. package/stories/4-PackingInfiniteGrid/0-PackingInfiniteGrid.stories.ts +0 -5
  27. package/stories/4-PackingInfiniteGrid/1-PackingInfiniteGrid.stories.ts +0 -10
  28. package/stories/4-PackingInfiniteGrid/apps/SveltePackingInfiniteGridApp.svelte +0 -40
  29. package/stories/5-DataLoading/0-DataLoading.stories.ts +0 -7
  30. package/stories/5-DataLoading/1-WaitNReady.stories.ts +0 -10
  31. package/stories/5-DataLoading/2-Placeholder.stories.ts +0 -10
  32. package/stories/5-DataLoading/3-Loading.stories.ts +0 -10
  33. package/stories/5-DataLoading/apps/SvelteLoadingApp.svelte +0 -54
  34. package/stories/5-DataLoading/apps/SveltePlaceholderApp.svelte +0 -54
  35. package/stories/5-DataLoading/apps/SvelteWaitNReadyApp.svelte +0 -47
  36. package/tsconfig.json +0 -6
@@ -4,7 +4,7 @@ name: @egjs/svelte-infinitegrid
4
4
  license: MIT
5
5
  author: NAVER Corp.
6
6
  repository: https://github.com/naver/egjs-infinitegrid
7
- version: 4.6.1-beta.0
7
+ version: 4.7.1
8
8
  */
9
9
  'use strict';
10
10
 
@@ -14,7 +14,7 @@ var infinitegrid = require('@egjs/infinitegrid');
14
14
 
15
15
  const SVELTE_INFINITEGRID_PROPS = ["status", "useFirstRender", "useLoading", "usePlaceholder", "items", "itemBy", "groupBy"];
16
16
 
17
- /* src/InfiniteGrid.svelte generated by Svelte v3.43.0 */
17
+ /* src/InfiniteGrid.svelte generated by Svelte v3.50.0 */
18
18
 
19
19
  const get_default_slot_changes_1 = dirty => ({
20
20
  visibleItems: dirty &
@@ -1 +1 @@
1
- {"version":3,"file":"infinitegrid.cjs.js","sources":["../src/consts.js","../src/InfiniteGrid.svelte","../src/InfiniteGrid.js","../src/grids/MasonryInfiniteGrid.js","../src/grids/JustifiedInfiniteGrid.js","../src/grids/FrameInfiniteGrid.js","../src/grids/PackingInfiniteGrid.js"],"sourcesContent":["export const SVELTE_INFINITEGRID_PROPS = [\n \"status\",\n \"useFirstRender\",\n \"useLoading\",\n \"usePlaceholder\",\n \"items\",\n \"itemBy\",\n \"groupBy\",\n];\n","<script>\n /**\n * egjs-infinitegrid\n * Copyright (c) 2021-present NAVER Corp.\n * MIT license\n */\n import {\n onMount,\n beforeUpdate,\n createEventDispatcher,\n onDestroy,\n afterUpdate,\n } from \"svelte\";\n import {\n INFINITEGRID_EVENTS,\n Renderer,\n CONTAINER_CLASS_NAME,\n getRenderingItems,\n mountRenderingItems,\n } from \"@egjs/infinitegrid\";\n import { SVELTE_INFINITEGRID_PROPS } from \"./consts\";\n export let GridClass;\n export let vanillaGrid = null;\n\n const dispatch = createEventDispatcher();\n const renderer = new Renderer();\n let wrapper;\n let container;\n let isFirstMount = false;\n let attributes = {};\n let visibleItems = [];\n\n function updateAttributes(props) {\n attributes = { ...props };\n\n const defaultOptions = GridClass.defaultOptions;\n\n delete attributes[\"GridClass\"];\n for (const name in defaultOptions) {\n delete attributes[name];\n }\n SVELTE_INFINITEGRID_PROPS.forEach((name) => {\n delete attributes[name];\n });\n }\n function getItemInfos() {\n const items = $$props.items || [];\n const itemBy = $$props.itemBy || ((item) => item.key);\n const groupBy = $$props.groupBy || ((item) => item.groupKey);\n\n return items.map((item, i) => {\n return {\n groupKey: groupBy(item, i),\n key: itemBy(item, i),\n data: item,\n };\n });\n }\n function updateVisibleChildren(props) {\n visibleItems = getRenderingItems(getItemInfos(), {\n grid: vanillaGrid,\n status: props.status,\n usePlaceholder: props.usePlaceholder,\n useFirstRender: props.useFirstRender,\n useLoading: props.useLoading,\n horizontal: props.horizontal,\n });\n }\n\n beforeUpdate(() => {\n updateAttributes($$props);\n updateVisibleChildren($$props);\n });\n\n onMount(() => {\n const defaultOptions = GridClass.defaultOptions;\n const options = {};\n\n for (const name in defaultOptions) {\n if (name in $$props) {\n options[name] = $$props[name];\n }\n }\n if (container) {\n options.container = container;\n }\n options.renderer = renderer;\n vanillaGrid = new GridClass(wrapper, options);\n\n for (const name in INFINITEGRID_EVENTS) {\n const eventName = INFINITEGRID_EVENTS[name];\n\n vanillaGrid.on(eventName, (e) => {\n dispatch(eventName, e);\n });\n }\n renderer.on(\"requestUpdate\", () => {\n updateVisibleChildren($$props);\n });\n\n mountRenderingItems(getItemInfos(), {\n grid: vanillaGrid,\n status: $$props.status,\n usePlaceholder: $$props.usePlaceholder,\n useFirstRender: $$props.useFirstRender,\n useLoading: $$props.useLoading,\n horizontal: $$props.horizontal,\n });\n renderer.updated();\n });\n afterUpdate(() => {\n if (isFirstMount) {\n isFirstMount = false;\n return;\n }\n const propertyTypes = GridClass.propertyTypes;\n\n for (const name in propertyTypes) {\n if (name in $$props) {\n vanillaGrid[name] = $$props[name];\n }\n }\n renderer.updated();\n });\n onDestroy(() => {\n vanillaGrid && vanillaGrid.destroy();\n });\n export function getInstance() {\n return vanillaGrid;\n }\n</script>\n\n<div bind:this={wrapper} {...attributes}>\n {#if $$props.container === true}\n <div class={CONTAINER_CLASS_NAME} bind:this={container}>\n <slot {visibleItems} />\n </div>\n {:else}\n <slot {visibleItems} />\n {/if}\n</div>\n","/**\n * egjs-infinitegrid\n * Copyright (c) 2021-present NAVER Corp.\n * MIT license\n */\nimport InfiniteGrid from \"./InfiniteGrid.svelte\";\nimport { INFINITEGRID_METHODS } from \"@egjs/infinitegrid\";\n\nexport default /*#__PURE__*/ (() => {\n const prototype = InfiniteGrid.prototype;\n\n if (prototype) {\n INFINITEGRID_METHODS.forEach(name => {\n if (name in prototype) {\n return;\n }\n prototype[name] = function (...args) {\n const self = this.getInstance();\n const result = self[name](...args);\n\n if (result === self) {\n return this;\n } else {\n return result;\n }\n };\n });\n }\n return InfiniteGrid;\n})();\n","import InfiniteGrid from \"../InfiniteGrid.js\";\nimport { MasonryInfiniteGrid as GridClass } from \"@egjs/infinitegrid\";\n\n\nlet MasonryInfiniteGrid;\n\nif (typeof InfiniteGrid === \"object\") {\n MasonryInfiniteGrid = InfiniteGrid;\n} else {\n MasonryInfiniteGrid = class MasonryInfiniteGrid extends InfiniteGrid {\n constructor(options) {\n options.props.GridClass = GridClass;\n super(options);\n }\n }\n}\nexport { MasonryInfiniteGrid };\n","import InfiniteGrid from \"../InfiniteGrid.js\";\nimport { JustifiedInfiniteGrid as GridClass } from \"@egjs/infinitegrid\";\n\n\nlet JustifiedInfiniteGrid;\n\nif (typeof InfiniteGrid === \"object\") {\n JustifiedInfiniteGrid = InfiniteGrid;\n} else {\n JustifiedInfiniteGrid = class JustifiedInfiniteGrid extends InfiniteGrid {\n constructor(options) {\n options.props.GridClass = GridClass;\n super(options);\n }\n }\n}\nexport { JustifiedInfiniteGrid };\n","import InfiniteGrid from \"../InfiniteGrid.js\";\nimport { FrameInfiniteGrid as GridClass } from \"@egjs/infinitegrid\";\n\n\nlet FrameInfiniteGrid;\n\nif (typeof InfiniteGrid === \"object\") {\n FrameInfiniteGrid = InfiniteGrid;\n} else {\n FrameInfiniteGrid = class FrameInfiniteGrid extends InfiniteGrid {\n constructor(options) {\n options.props.GridClass = GridClass;\n super(options);\n }\n }\n}\nexport { FrameInfiniteGrid };\n","import InfiniteGrid from \"../InfiniteGrid.js\";\nimport { PackingInfiniteGrid as GridClass } from \"@egjs/infinitegrid\";\n\n\nlet PackingInfiniteGrid;\n\nif (typeof InfiniteGrid === \"object\") {\n PackingInfiniteGrid = InfiniteGrid;\n} else {\n PackingInfiniteGrid = class PackingInfiniteGrid extends InfiniteGrid {\n constructor(options) {\n options.props.GridClass = GridClass;\n super(options);\n }\n }\n}\nexport { PackingInfiniteGrid };\n"],"names":["SVELTE_INFINITEGRID_PROPS","CONTAINER_CLASS_NAME","insert","ctx","container","GridClass","vanillaGrid","dispatch","createEventDispatcher","renderer","Renderer","wrapper","attributes","visibleItems","updateAttributes","props","defaultOptions","name","forEach","getItemInfos","items","$$props","itemBy","item","key","groupBy","groupKey","map","i","data","updateVisibleChildren","getRenderingItems","grid","status","usePlaceholder","useFirstRender","useLoading","horizontal","beforeUpdate","onMount","options","INFINITEGRID_EVENTS","eventName","on","e","mountRenderingItems","updated","afterUpdate","propertyTypes","onDestroy","destroy","getInstance","prototype","InfiniteGrid","INFINITEGRID_METHODS","args","self","result","MasonryInfiniteGrid","constructor","JustifiedInfiniteGrid","FrameInfiniteGrid","PackingInfiniteGrid"],"mappings":";;;;;;;;;;;;;;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AAGT,YAAtB;AACD,CAFD,MAEO;AACLS,EAAAA,mBAAmB,GAAG,MAAMA,mBAAN,SAAkCT,YAAlC,CAA+C;AACnEM,IAAAA,WAAW,CAACnB,OAAD,EAAU;AACnBA,MAAAA,OAAO,CAACzB,KAAR,CAAcV,SAAd,GAA0BA,gCAA1B;AACA,YAAMmC,OAAN;AACD;;AAJkE,GAArE;AAMD;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"infinitegrid.cjs.js","sources":["../src/consts.js","../src/InfiniteGrid.svelte","../src/InfiniteGrid.js","../src/grids/MasonryInfiniteGrid.js","../src/grids/JustifiedInfiniteGrid.js","../src/grids/FrameInfiniteGrid.js","../src/grids/PackingInfiniteGrid.js"],"sourcesContent":["export const SVELTE_INFINITEGRID_PROPS = [\n \"status\",\n \"useFirstRender\",\n \"useLoading\",\n \"usePlaceholder\",\n \"items\",\n \"itemBy\",\n \"groupBy\",\n];\n","<script>\n /**\n * egjs-infinitegrid\n * Copyright (c) 2021-present NAVER Corp.\n * MIT license\n */\n import {\n onMount,\n beforeUpdate,\n createEventDispatcher,\n onDestroy,\n afterUpdate,\n } from \"svelte\";\n import {\n INFINITEGRID_EVENTS,\n Renderer,\n CONTAINER_CLASS_NAME,\n getRenderingItems,\n mountRenderingItems,\n } from \"@egjs/infinitegrid\";\n import { SVELTE_INFINITEGRID_PROPS } from \"./consts\";\n export let GridClass;\n export let vanillaGrid = null;\n\n const dispatch = createEventDispatcher();\n const renderer = new Renderer();\n let wrapper;\n let container;\n let isFirstMount = false;\n let attributes = {};\n let visibleItems = [];\n\n function updateAttributes(props) {\n attributes = { ...props };\n\n const defaultOptions = GridClass.defaultOptions;\n\n delete attributes[\"GridClass\"];\n for (const name in defaultOptions) {\n delete attributes[name];\n }\n SVELTE_INFINITEGRID_PROPS.forEach((name) => {\n delete attributes[name];\n });\n }\n function getItemInfos() {\n const items = $$props.items || [];\n const itemBy = $$props.itemBy || ((item) => item.key);\n const groupBy = $$props.groupBy || ((item) => item.groupKey);\n\n return items.map((item, i) => {\n return {\n groupKey: groupBy(item, i),\n key: itemBy(item, i),\n data: item,\n };\n });\n }\n function updateVisibleChildren(props) {\n visibleItems = getRenderingItems(getItemInfos(), {\n grid: vanillaGrid,\n status: props.status,\n usePlaceholder: props.usePlaceholder,\n useFirstRender: props.useFirstRender,\n useLoading: props.useLoading,\n horizontal: props.horizontal,\n });\n }\n\n beforeUpdate(() => {\n updateAttributes($$props);\n updateVisibleChildren($$props);\n });\n\n onMount(() => {\n const defaultOptions = GridClass.defaultOptions;\n const options = {};\n\n for (const name in defaultOptions) {\n if (name in $$props) {\n options[name] = $$props[name];\n }\n }\n if (container) {\n options.container = container;\n }\n options.renderer = renderer;\n vanillaGrid = new GridClass(wrapper, options);\n\n for (const name in INFINITEGRID_EVENTS) {\n const eventName = INFINITEGRID_EVENTS[name];\n\n vanillaGrid.on(eventName, (e) => {\n dispatch(eventName, e);\n });\n }\n renderer.on(\"requestUpdate\", () => {\n updateVisibleChildren($$props);\n });\n\n mountRenderingItems(getItemInfos(), {\n grid: vanillaGrid,\n status: $$props.status,\n usePlaceholder: $$props.usePlaceholder,\n useFirstRender: $$props.useFirstRender,\n useLoading: $$props.useLoading,\n horizontal: $$props.horizontal,\n });\n renderer.updated();\n });\n afterUpdate(() => {\n if (isFirstMount) {\n isFirstMount = false;\n return;\n }\n const propertyTypes = GridClass.propertyTypes;\n\n for (const name in propertyTypes) {\n if (name in $$props) {\n vanillaGrid[name] = $$props[name];\n }\n }\n renderer.updated();\n });\n onDestroy(() => {\n vanillaGrid && vanillaGrid.destroy();\n });\n export function getInstance() {\n return vanillaGrid;\n }\n</script>\n\n<div bind:this={wrapper} {...attributes}>\n {#if $$props.container === true}\n <div class={CONTAINER_CLASS_NAME} bind:this={container}>\n <slot {visibleItems} />\n </div>\n {:else}\n <slot {visibleItems} />\n {/if}\n</div>\n","/**\n * egjs-infinitegrid\n * Copyright (c) 2021-present NAVER Corp.\n * MIT license\n */\nimport InfiniteGrid from \"./InfiniteGrid.svelte\";\nimport { INFINITEGRID_METHODS } from \"@egjs/infinitegrid\";\n\nexport default /*#__PURE__*/ (() => {\n const prototype = InfiniteGrid.prototype;\n\n if (prototype) {\n INFINITEGRID_METHODS.forEach(name => {\n if (name in prototype) {\n return;\n }\n prototype[name] = function (...args) {\n const self = this.getInstance();\n const result = self[name](...args);\n\n if (result === self) {\n return this;\n } else {\n return result;\n }\n };\n });\n }\n return InfiniteGrid;\n})();\n","import InfiniteGrid from \"../InfiniteGrid.js\";\nimport { MasonryInfiniteGrid as GridClass } from \"@egjs/infinitegrid\";\n\n\nlet MasonryInfiniteGrid;\n\nif (typeof InfiniteGrid === \"object\") {\n MasonryInfiniteGrid = InfiniteGrid;\n} else {\n MasonryInfiniteGrid = class MasonryInfiniteGrid extends InfiniteGrid {\n constructor(options) {\n options.props.GridClass = GridClass;\n super(options);\n }\n }\n}\nexport { MasonryInfiniteGrid };\n","import InfiniteGrid from \"../InfiniteGrid.js\";\nimport { JustifiedInfiniteGrid as GridClass } from \"@egjs/infinitegrid\";\n\n\nlet JustifiedInfiniteGrid;\n\nif (typeof InfiniteGrid === \"object\") {\n JustifiedInfiniteGrid = InfiniteGrid;\n} else {\n JustifiedInfiniteGrid = class JustifiedInfiniteGrid extends InfiniteGrid {\n constructor(options) {\n options.props.GridClass = GridClass;\n super(options);\n }\n }\n}\nexport { JustifiedInfiniteGrid };\n","import InfiniteGrid from \"../InfiniteGrid.js\";\nimport { FrameInfiniteGrid as GridClass } from \"@egjs/infinitegrid\";\n\n\nlet FrameInfiniteGrid;\n\nif (typeof InfiniteGrid === \"object\") {\n FrameInfiniteGrid = InfiniteGrid;\n} else {\n FrameInfiniteGrid = class FrameInfiniteGrid extends InfiniteGrid {\n constructor(options) {\n options.props.GridClass = GridClass;\n super(options);\n }\n }\n}\nexport { FrameInfiniteGrid };\n","import InfiniteGrid from \"../InfiniteGrid.js\";\nimport { PackingInfiniteGrid as GridClass } from \"@egjs/infinitegrid\";\n\n\nlet PackingInfiniteGrid;\n\nif (typeof InfiniteGrid === \"object\") {\n PackingInfiniteGrid = InfiniteGrid;\n} else {\n PackingInfiniteGrid = class PackingInfiniteGrid extends InfiniteGrid {\n constructor(options) {\n options.props.GridClass = GridClass;\n super(options);\n }\n }\n}\nexport { PackingInfiniteGrid };\n"],"names":["SVELTE_INFINITEGRID_PROPS","CONTAINER_CLASS_NAME","insert","target","div","anchor","ctx","container","GridClass","$$props","vanillaGrid","dispatch","createEventDispatcher","renderer","Renderer","wrapper","attributes","visibleItems","updateAttributes","props","$$invalidate","defaultOptions","name","forEach","getItemInfos","items","itemBy","item","key","groupBy","groupKey","map","i","data","updateVisibleChildren","getRenderingItems","grid","status","usePlaceholder","useFirstRender","useLoading","horizontal","beforeUpdate","onMount","options","INFINITEGRID_EVENTS","eventName","on","e","mountRenderingItems","updated","afterUpdate","propertyTypes","onDestroy","destroy","getInstance","$$value","prototype","InfiniteGrid","INFINITEGRID_METHODS","args","self","result","MasonryInfiniteGrid","constructor","JustifiedInfiniteGrid","FrameInfiniteGrid","PackingInfiniteGrid"],"mappings":";;;;;;;;;;;;;;AAAO,MAAMA,yBAAyB,GAAG,CACvC,QADuC,EAEvC,gBAFuC,EAGvC,YAHuC,EAIvC,gBAJuC,EAKvC,OALuC,EAMvC,QANuC,EAOvC,SAPuC,CAAlC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCCsISC;;;;AAAZC,MAAAA,eAEK,CAAAC,MAAA,EAAAC,GAAA,EAAAC,MAAA,CAFL,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IADGC,GAAO,CAAA,CAAA,CAAP,CAAQC,SAAR,KAAsB,MAAI,OAAA,CAAA,CAAA;;;;;;;;EADJD,GAAU,CAAA,CAAA;;;;;;;;;;;;;;;AAAvCJ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ACD,CAFD,MAEO;AACLO,EAAAA,qBAAqB,GAAG,MAAMA,qBAAN,SAAoCP,YAApC,CAAiD;IACvEM,WAAW,CAACpB,OAAD,EAAU;AACnBA,MAAAA,OAAO,CAACzB,KAAR,CAAcX,SAAd,GAA0BA,kCAA1B,CAAA;AACA,MAAA,KAAA,CAAMoC,OAAN,CAAA,CAAA;AACD,KAAA;;GAJH,CAAA;AAMD;;ACXD,IAAIsB,iBAAJ,CAAA;;AAEA,IAAI,OAAOR,YAAP,KAAwB,QAA5B,EAAsC;AACpCQ,EAAAA,iBAAiB,GAAGR,YAApB,CAAA;AACD,CAFD,MAEO;AACLQ,EAAAA,iBAAiB,GAAG,MAAMA,iBAAN,SAAgCR,YAAhC,CAA6C;IAC/DM,WAAW,CAACpB,OAAD,EAAU;AACnBA,MAAAA,OAAO,CAACzB,KAAR,CAAcX,SAAd,GAA0BA,8BAA1B,CAAA;AACA,MAAA,KAAA,CAAMoC,OAAN,CAAA,CAAA;AACD,KAAA;;GAJH,CAAA;AAMD;;ACXD,IAAIuB,mBAAJ,CAAA;;AAEA,IAAI,OAAOT,YAAP,KAAwB,QAA5B,EAAsC;AACpCS,EAAAA,mBAAmB,GAAGT,YAAtB,CAAA;AACD,CAFD,MAEO;AACLS,EAAAA,mBAAmB,GAAG,MAAMA,mBAAN,SAAkCT,YAAlC,CAA+C;IACnEM,WAAW,CAACpB,OAAD,EAAU;AACnBA,MAAAA,OAAO,CAACzB,KAAR,CAAcX,SAAd,GAA0BA,gCAA1B,CAAA;AACA,MAAA,KAAA,CAAMoC,OAAN,CAAA,CAAA;AACD,KAAA;;GAJH,CAAA;AAMD;;;;;;;;;;;;;"}
@@ -4,7 +4,7 @@ name: @egjs/svelte-infinitegrid
4
4
  license: MIT
5
5
  author: NAVER Corp.
6
6
  repository: https://github.com/naver/egjs-infinitegrid
7
- version: 4.6.1-beta.0
7
+ version: 4.7.1
8
8
  */
9
9
  import { SvelteComponent, init, safe_not_equal, assign, element, set_attributes, insert, group_outros, transition_out, check_outros, transition_in, get_spread_update, detach, exclude_internal_props, binding_callbacks, create_slot, update_slot_base, get_all_dirty_from_scope, get_slot_changes, attr } from 'svelte/internal';
10
10
  import { createEventDispatcher, beforeUpdate, onMount, afterUpdate, onDestroy } from 'svelte';
@@ -12,7 +12,7 @@ import { Renderer, INFINITEGRID_EVENTS, mountRenderingItems, getRenderingItems,
12
12
 
13
13
  const SVELTE_INFINITEGRID_PROPS = ["status", "useFirstRender", "useLoading", "usePlaceholder", "items", "itemBy", "groupBy"];
14
14
 
15
- /* src/InfiniteGrid.svelte generated by Svelte v3.43.0 */
15
+ /* src/InfiniteGrid.svelte generated by Svelte v3.50.0 */
16
16
 
17
17
  const get_default_slot_changes_1 = dirty => ({
18
18
  visibleItems: dirty &
@@ -1 +1 @@
1
- {"version":3,"file":"infinitegrid.esm.js","sources":["../src/consts.js","../src/InfiniteGrid.svelte","../src/InfiniteGrid.js","../src/grids/MasonryInfiniteGrid.js","../src/grids/JustifiedInfiniteGrid.js","../src/grids/FrameInfiniteGrid.js","../src/grids/PackingInfiniteGrid.js"],"sourcesContent":["export const SVELTE_INFINITEGRID_PROPS = [\n \"status\",\n \"useFirstRender\",\n \"useLoading\",\n \"usePlaceholder\",\n \"items\",\n \"itemBy\",\n \"groupBy\",\n];\n","<script>\n /**\n * egjs-infinitegrid\n * Copyright (c) 2021-present NAVER Corp.\n * MIT license\n */\n import {\n onMount,\n beforeUpdate,\n createEventDispatcher,\n onDestroy,\n afterUpdate,\n } from \"svelte\";\n import {\n INFINITEGRID_EVENTS,\n Renderer,\n CONTAINER_CLASS_NAME,\n getRenderingItems,\n mountRenderingItems,\n } from \"@egjs/infinitegrid\";\n import { SVELTE_INFINITEGRID_PROPS } from \"./consts\";\n export let GridClass;\n export let vanillaGrid = null;\n\n const dispatch = createEventDispatcher();\n const renderer = new Renderer();\n let wrapper;\n let container;\n let isFirstMount = false;\n let attributes = {};\n let visibleItems = [];\n\n function updateAttributes(props) {\n attributes = { ...props };\n\n const defaultOptions = GridClass.defaultOptions;\n\n delete attributes[\"GridClass\"];\n for (const name in defaultOptions) {\n delete attributes[name];\n }\n SVELTE_INFINITEGRID_PROPS.forEach((name) => {\n delete attributes[name];\n });\n }\n function getItemInfos() {\n const items = $$props.items || [];\n const itemBy = $$props.itemBy || ((item) => item.key);\n const groupBy = $$props.groupBy || ((item) => item.groupKey);\n\n return items.map((item, i) => {\n return {\n groupKey: groupBy(item, i),\n key: itemBy(item, i),\n data: item,\n };\n });\n }\n function updateVisibleChildren(props) {\n visibleItems = getRenderingItems(getItemInfos(), {\n grid: vanillaGrid,\n status: props.status,\n usePlaceholder: props.usePlaceholder,\n useFirstRender: props.useFirstRender,\n useLoading: props.useLoading,\n horizontal: props.horizontal,\n });\n }\n\n beforeUpdate(() => {\n updateAttributes($$props);\n updateVisibleChildren($$props);\n });\n\n onMount(() => {\n const defaultOptions = GridClass.defaultOptions;\n const options = {};\n\n for (const name in defaultOptions) {\n if (name in $$props) {\n options[name] = $$props[name];\n }\n }\n if (container) {\n options.container = container;\n }\n options.renderer = renderer;\n vanillaGrid = new GridClass(wrapper, options);\n\n for (const name in INFINITEGRID_EVENTS) {\n const eventName = INFINITEGRID_EVENTS[name];\n\n vanillaGrid.on(eventName, (e) => {\n dispatch(eventName, e);\n });\n }\n renderer.on(\"requestUpdate\", () => {\n updateVisibleChildren($$props);\n });\n\n mountRenderingItems(getItemInfos(), {\n grid: vanillaGrid,\n status: $$props.status,\n usePlaceholder: $$props.usePlaceholder,\n useFirstRender: $$props.useFirstRender,\n useLoading: $$props.useLoading,\n horizontal: $$props.horizontal,\n });\n renderer.updated();\n });\n afterUpdate(() => {\n if (isFirstMount) {\n isFirstMount = false;\n return;\n }\n const propertyTypes = GridClass.propertyTypes;\n\n for (const name in propertyTypes) {\n if (name in $$props) {\n vanillaGrid[name] = $$props[name];\n }\n }\n renderer.updated();\n });\n onDestroy(() => {\n vanillaGrid && vanillaGrid.destroy();\n });\n export function getInstance() {\n return vanillaGrid;\n }\n</script>\n\n<div bind:this={wrapper} {...attributes}>\n {#if $$props.container === true}\n <div class={CONTAINER_CLASS_NAME} bind:this={container}>\n <slot {visibleItems} />\n </div>\n {:else}\n <slot {visibleItems} />\n {/if}\n</div>\n","/**\n * egjs-infinitegrid\n * Copyright (c) 2021-present NAVER Corp.\n * MIT license\n */\nimport InfiniteGrid from \"./InfiniteGrid.svelte\";\nimport { INFINITEGRID_METHODS } from \"@egjs/infinitegrid\";\n\nexport default /*#__PURE__*/ (() => {\n const prototype = InfiniteGrid.prototype;\n\n if (prototype) {\n INFINITEGRID_METHODS.forEach(name => {\n if (name in prototype) {\n return;\n }\n prototype[name] = function (...args) {\n const self = this.getInstance();\n const result = self[name](...args);\n\n if (result === self) {\n return this;\n } else {\n return result;\n }\n };\n });\n }\n return InfiniteGrid;\n})();\n","import InfiniteGrid from \"../InfiniteGrid.js\";\nimport { MasonryInfiniteGrid as GridClass } from \"@egjs/infinitegrid\";\n\n\nlet MasonryInfiniteGrid;\n\nif (typeof InfiniteGrid === \"object\") {\n MasonryInfiniteGrid = InfiniteGrid;\n} else {\n MasonryInfiniteGrid = class MasonryInfiniteGrid extends InfiniteGrid {\n constructor(options) {\n options.props.GridClass = GridClass;\n super(options);\n }\n }\n}\nexport { MasonryInfiniteGrid };\n","import InfiniteGrid from \"../InfiniteGrid.js\";\nimport { JustifiedInfiniteGrid as GridClass } from \"@egjs/infinitegrid\";\n\n\nlet JustifiedInfiniteGrid;\n\nif (typeof InfiniteGrid === \"object\") {\n JustifiedInfiniteGrid = InfiniteGrid;\n} else {\n JustifiedInfiniteGrid = class JustifiedInfiniteGrid extends InfiniteGrid {\n constructor(options) {\n options.props.GridClass = GridClass;\n super(options);\n }\n }\n}\nexport { JustifiedInfiniteGrid };\n","import InfiniteGrid from \"../InfiniteGrid.js\";\nimport { FrameInfiniteGrid as GridClass } from \"@egjs/infinitegrid\";\n\n\nlet FrameInfiniteGrid;\n\nif (typeof InfiniteGrid === \"object\") {\n FrameInfiniteGrid = InfiniteGrid;\n} else {\n FrameInfiniteGrid = class FrameInfiniteGrid extends InfiniteGrid {\n constructor(options) {\n options.props.GridClass = GridClass;\n super(options);\n }\n }\n}\nexport { FrameInfiniteGrid };\n","import InfiniteGrid from \"../InfiniteGrid.js\";\nimport { PackingInfiniteGrid as GridClass } from \"@egjs/infinitegrid\";\n\n\nlet PackingInfiniteGrid;\n\nif (typeof InfiniteGrid === \"object\") {\n PackingInfiniteGrid = InfiniteGrid;\n} else {\n PackingInfiniteGrid = class PackingInfiniteGrid extends InfiniteGrid {\n constructor(options) {\n options.props.GridClass = GridClass;\n super(options);\n }\n }\n}\nexport { PackingInfiniteGrid };\n"],"names":["SVELTE_INFINITEGRID_PROPS","CONTAINER_CLASS_NAME","insert","ctx","container","GridClass","vanillaGrid","dispatch","createEventDispatcher","renderer","Renderer","wrapper","attributes","visibleItems","updateAttributes","props","defaultOptions","name","forEach","getItemInfos","items","$$props","itemBy","item","key","groupBy","groupKey","map","i","data","updateVisibleChildren","getRenderingItems","grid","status","usePlaceholder","useFirstRender","useLoading","horizontal","beforeUpdate","onMount","options","INFINITEGRID_EVENTS","eventName","on","e","mountRenderingItems","updated","afterUpdate","propertyTypes","onDestroy","destroy","getInstance","prototype","InfiniteGrid","INFINITEGRID_METHODS","args","self","result","MasonryInfiniteGrid","constructor","JustifiedInfiniteGrid","FrameInfiniteGrid","PackingInfiniteGrid"],"mappings":";;;;;;;;;;;;AAAO,MAAMA,yBAAyB,GAAG,CACvC,QADuC,EAEvC,gBAFuC,EAGvC,YAHuC,EAIvC,gBAJuC,EAKvC,OALuC,EAMvC,QANuC,EAOvC,SAPuC,CAAlC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBCsISC;;;;AAAZC,MAAAA,MAEK,OAAA,KAAA,QAAA,CAFL;;;;;;;;;;;;;;;;;;;;;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BA,MAAAA,OAAO,CAACzB,KAAR,CAAcV,SAAd,GAA0BA,qBAA1B;AACA,YAAMmC,OAAN;AACD;;AAJkE,GAArE;AAMD;;ICXGoB;;AAEJ,IAAI,OAAOP,YAAP,KAAwB,QAA5B,EAAsC;AACpCO,EAAAA,qBAAqB,GAAGP,YAAxB;AACD,CAFD,MAEO;AACLO,EAAAA,qBAAqB,GAAG,MAAMA,qBAAN,SAAoCP,YAApC,CAAiD;AACvEM,IAAAA,WAAW,CAACnB,OAAD,EAAU;AACnBA,MAAAA,OAAO,CAACzB,KAAR,CAAcV,SAAd,GAA0BA,uBAA1B;AACA,YAAMmC,OAAN;AACD;;AAJsE,GAAzE;AAMD;;ICXGqB;;AAEJ,IAAI,OAAOR,YAAP,KAAwB,QAA5B,EAAsC;AACpCQ,EAAAA,iBAAiB,GAAGR,YAApB;AACD,CAFD,MAEO;AACLQ,EAAAA,iBAAiB,GAAG,MAAMA,iBAAN,SAAgCR,YAAhC,CAA6C;AAC/DM,IAAAA,WAAW,CAACnB,OAAD,EAAU;AACnBA,MAAAA,OAAO,CAACzB,KAAR,CAAcV,SAAd,GAA0BA,mBAA1B;AACA,YAAMmC,OAAN;AACD;;AAJ8D,GAAjE;AAMD;;ICXGsB;;AAEJ,IAAI,OAAOT,YAAP,KAAwB,QAA5B,EAAsC;AACpCS,EAAAA,mBAAmB,GAAGT,YAAtB;AACD,CAFD,MAEO;AACLS,EAAAA,mBAAmB,GAAG,MAAMA,mBAAN,SAAkCT,YAAlC,CAA+C;AACnEM,IAAAA,WAAW,CAACnB,OAAD,EAAU;AACnBA,MAAAA,OAAO,CAACzB,KAAR,CAAcV,SAAd,GAA0BA,qBAA1B;AACA,YAAMmC,OAAN;AACD;;AAJkE,GAArE;AAMD;;;;"}
1
+ {"version":3,"file":"infinitegrid.esm.js","sources":["../src/consts.js","../src/InfiniteGrid.svelte","../src/InfiniteGrid.js","../src/grids/MasonryInfiniteGrid.js","../src/grids/JustifiedInfiniteGrid.js","../src/grids/FrameInfiniteGrid.js","../src/grids/PackingInfiniteGrid.js"],"sourcesContent":["export const SVELTE_INFINITEGRID_PROPS = [\n \"status\",\n \"useFirstRender\",\n \"useLoading\",\n \"usePlaceholder\",\n \"items\",\n \"itemBy\",\n \"groupBy\",\n];\n","<script>\n /**\n * egjs-infinitegrid\n * Copyright (c) 2021-present NAVER Corp.\n * MIT license\n */\n import {\n onMount,\n beforeUpdate,\n createEventDispatcher,\n onDestroy,\n afterUpdate,\n } from \"svelte\";\n import {\n INFINITEGRID_EVENTS,\n Renderer,\n CONTAINER_CLASS_NAME,\n getRenderingItems,\n mountRenderingItems,\n } from \"@egjs/infinitegrid\";\n import { SVELTE_INFINITEGRID_PROPS } from \"./consts\";\n export let GridClass;\n export let vanillaGrid = null;\n\n const dispatch = createEventDispatcher();\n const renderer = new Renderer();\n let wrapper;\n let container;\n let isFirstMount = false;\n let attributes = {};\n let visibleItems = [];\n\n function updateAttributes(props) {\n attributes = { ...props };\n\n const defaultOptions = GridClass.defaultOptions;\n\n delete attributes[\"GridClass\"];\n for (const name in defaultOptions) {\n delete attributes[name];\n }\n SVELTE_INFINITEGRID_PROPS.forEach((name) => {\n delete attributes[name];\n });\n }\n function getItemInfos() {\n const items = $$props.items || [];\n const itemBy = $$props.itemBy || ((item) => item.key);\n const groupBy = $$props.groupBy || ((item) => item.groupKey);\n\n return items.map((item, i) => {\n return {\n groupKey: groupBy(item, i),\n key: itemBy(item, i),\n data: item,\n };\n });\n }\n function updateVisibleChildren(props) {\n visibleItems = getRenderingItems(getItemInfos(), {\n grid: vanillaGrid,\n status: props.status,\n usePlaceholder: props.usePlaceholder,\n useFirstRender: props.useFirstRender,\n useLoading: props.useLoading,\n horizontal: props.horizontal,\n });\n }\n\n beforeUpdate(() => {\n updateAttributes($$props);\n updateVisibleChildren($$props);\n });\n\n onMount(() => {\n const defaultOptions = GridClass.defaultOptions;\n const options = {};\n\n for (const name in defaultOptions) {\n if (name in $$props) {\n options[name] = $$props[name];\n }\n }\n if (container) {\n options.container = container;\n }\n options.renderer = renderer;\n vanillaGrid = new GridClass(wrapper, options);\n\n for (const name in INFINITEGRID_EVENTS) {\n const eventName = INFINITEGRID_EVENTS[name];\n\n vanillaGrid.on(eventName, (e) => {\n dispatch(eventName, e);\n });\n }\n renderer.on(\"requestUpdate\", () => {\n updateVisibleChildren($$props);\n });\n\n mountRenderingItems(getItemInfos(), {\n grid: vanillaGrid,\n status: $$props.status,\n usePlaceholder: $$props.usePlaceholder,\n useFirstRender: $$props.useFirstRender,\n useLoading: $$props.useLoading,\n horizontal: $$props.horizontal,\n });\n renderer.updated();\n });\n afterUpdate(() => {\n if (isFirstMount) {\n isFirstMount = false;\n return;\n }\n const propertyTypes = GridClass.propertyTypes;\n\n for (const name in propertyTypes) {\n if (name in $$props) {\n vanillaGrid[name] = $$props[name];\n }\n }\n renderer.updated();\n });\n onDestroy(() => {\n vanillaGrid && vanillaGrid.destroy();\n });\n export function getInstance() {\n return vanillaGrid;\n }\n</script>\n\n<div bind:this={wrapper} {...attributes}>\n {#if $$props.container === true}\n <div class={CONTAINER_CLASS_NAME} bind:this={container}>\n <slot {visibleItems} />\n </div>\n {:else}\n <slot {visibleItems} />\n {/if}\n</div>\n","/**\n * egjs-infinitegrid\n * Copyright (c) 2021-present NAVER Corp.\n * MIT license\n */\nimport InfiniteGrid from \"./InfiniteGrid.svelte\";\nimport { INFINITEGRID_METHODS } from \"@egjs/infinitegrid\";\n\nexport default /*#__PURE__*/ (() => {\n const prototype = InfiniteGrid.prototype;\n\n if (prototype) {\n INFINITEGRID_METHODS.forEach(name => {\n if (name in prototype) {\n return;\n }\n prototype[name] = function (...args) {\n const self = this.getInstance();\n const result = self[name](...args);\n\n if (result === self) {\n return this;\n } else {\n return result;\n }\n };\n });\n }\n return InfiniteGrid;\n})();\n","import InfiniteGrid from \"../InfiniteGrid.js\";\nimport { MasonryInfiniteGrid as GridClass } from \"@egjs/infinitegrid\";\n\n\nlet MasonryInfiniteGrid;\n\nif (typeof InfiniteGrid === \"object\") {\n MasonryInfiniteGrid = InfiniteGrid;\n} else {\n MasonryInfiniteGrid = class MasonryInfiniteGrid extends InfiniteGrid {\n constructor(options) {\n options.props.GridClass = GridClass;\n super(options);\n }\n }\n}\nexport { MasonryInfiniteGrid };\n","import InfiniteGrid from \"../InfiniteGrid.js\";\nimport { JustifiedInfiniteGrid as GridClass } from \"@egjs/infinitegrid\";\n\n\nlet JustifiedInfiniteGrid;\n\nif (typeof InfiniteGrid === \"object\") {\n JustifiedInfiniteGrid = InfiniteGrid;\n} else {\n JustifiedInfiniteGrid = class JustifiedInfiniteGrid extends InfiniteGrid {\n constructor(options) {\n options.props.GridClass = GridClass;\n super(options);\n }\n }\n}\nexport { JustifiedInfiniteGrid };\n","import InfiniteGrid from \"../InfiniteGrid.js\";\nimport { FrameInfiniteGrid as GridClass } from \"@egjs/infinitegrid\";\n\n\nlet FrameInfiniteGrid;\n\nif (typeof InfiniteGrid === \"object\") {\n FrameInfiniteGrid = InfiniteGrid;\n} else {\n FrameInfiniteGrid = class FrameInfiniteGrid extends InfiniteGrid {\n constructor(options) {\n options.props.GridClass = GridClass;\n super(options);\n }\n }\n}\nexport { FrameInfiniteGrid };\n","import InfiniteGrid from \"../InfiniteGrid.js\";\nimport { PackingInfiniteGrid as GridClass } from \"@egjs/infinitegrid\";\n\n\nlet PackingInfiniteGrid;\n\nif (typeof InfiniteGrid === \"object\") {\n PackingInfiniteGrid = InfiniteGrid;\n} else {\n PackingInfiniteGrid = class PackingInfiniteGrid extends InfiniteGrid {\n constructor(options) {\n options.props.GridClass = GridClass;\n super(options);\n }\n }\n}\nexport { PackingInfiniteGrid };\n"],"names":["SVELTE_INFINITEGRID_PROPS","CONTAINER_CLASS_NAME","insert","target","div","anchor","ctx","container","GridClass","$$props","vanillaGrid","dispatch","createEventDispatcher","renderer","Renderer","wrapper","attributes","visibleItems","updateAttributes","props","$$invalidate","defaultOptions","name","forEach","getItemInfos","items","itemBy","item","key","groupBy","groupKey","map","i","data","updateVisibleChildren","getRenderingItems","grid","status","usePlaceholder","useFirstRender","useLoading","horizontal","beforeUpdate","onMount","options","INFINITEGRID_EVENTS","eventName","on","e","mountRenderingItems","updated","afterUpdate","propertyTypes","onDestroy","destroy","getInstance","$$value","prototype","InfiniteGrid","INFINITEGRID_METHODS","args","self","result","MasonryInfiniteGrid","constructor","JustifiedInfiniteGrid","FrameInfiniteGrid","PackingInfiniteGrid"],"mappings":";;;;;;;;;;;;AAAO,MAAMA,yBAAyB,GAAG,CACvC,QADuC,EAEvC,gBAFuC,EAGvC,YAHuC,EAIvC,gBAJuC,EAKvC,OALuC,EAMvC,QANuC,EAOvC,SAPuC,CAAlC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBCsISC;;;;AAAZC,MAAAA,MAEK,CAAAC,MAAA,EAAAC,GAAA,EAAAC,MAAA,CAFL,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IADGC,GAAO,CAAA,CAAA,CAAP,CAAQC,SAAR,KAAsB,MAAI,OAAA,CAAA,CAAA;;;;;;;;EADJD,GAAU,CAAA,CAAA;;;;;;;;;;;;;;;AAAvCJ,MAAAA,MAQK,CAAAC,MAAA,EAAAC,GAAA,EAAAC,MAAA,CARL,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAA6BC,MAAAA,GAAU,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA/G1BE,IAAAA,SAAAA;MAASC;EACT,IAAA;AAAAC,IAAAA,WAAW,GAAI,IAAA;AAAf,GAAA,GAAmBD,OAAnB,CAAA;EAEL,MAAAE,QAAQ,GAAGC,qBAAqB,EAAhC,CAAA;AACA,EAAA,MAAAC,QAAQ,OAAOC,UAAf,CAAA;MACFC;MACAR;MAEAS,UA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AMA,iBAAN,SAAgCR,YAAhC,CAA6C;IAC/DM,WAAW,CAACpB,OAAD,EAAU;AACnBA,MAAAA,OAAO,CAACzB,KAAR,CAAcX,SAAd,GAA0BA,mBAA1B,CAAA;AACA,MAAA,KAAA,CAAMoC,OAAN,CAAA,CAAA;AACD,KAAA;;GAJH,CAAA;AAMD;;ACXD,IAAIuB,oBAAJ;;AAEA,IAAI,OAAOT,YAAP,KAAwB,QAA5B,EAAsC;AACpCS,EAAAA,mBAAmB,GAAGT,YAAtB,CAAA;AACD,CAFD,MAEO;AACLS,EAAAA,mBAAmB,GAAG,MAAMA,mBAAN,SAAkCT,YAAlC,CAA+C;IACnEM,WAAW,CAACpB,OAAD,EAAU;AACnBA,MAAAA,OAAO,CAACzB,KAAR,CAAcX,SAAd,GAA0BA,qBAA1B,CAAA;AACA,MAAA,KAAA,CAAMoC,OAAN,CAAA,CAAA;AACD,KAAA;;GAJH,CAAA;AAMD;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@egjs/svelte-infinitegrid",
3
- "version": "4.6.1-beta.0",
3
+ "version": "4.7.1",
4
4
  "description": "A Svelte component that can arrange items infinitely according to the type of grids",
5
5
  "sideEffects": false,
6
6
  "svelte": "src/index.js",
@@ -19,6 +19,11 @@
19
19
  },
20
20
  "license": "MIT",
21
21
  "homepage": "https://github.com/naver/egjs-infinitegrid",
22
+ "files": [
23
+ "./*",
24
+ "src/*",
25
+ "dist/*"
26
+ ],
22
27
  "keywords": [
23
28
  "svelte",
24
29
  "lazyloading",
@@ -69,6 +74,6 @@
69
74
  "typescript": "^4.0.0"
70
75
  },
71
76
  "dependencies": {
72
- "@egjs/infinitegrid": "~4.6.1-beta.0"
77
+ "@egjs/infinitegrid": "~4.7.1"
73
78
  }
74
79
  }
package/src/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import VanillaInfiniteGrid, {
2
2
  FrameInfiniteGridOptions, InfiniteGridMethods, InfiniteGridOptions, JustifiedInfiniteGridOptions,
3
3
  MasonryInfiniteGridOptions, PackingInfiniteGridOptions,
4
+ InfiniteGridStatus,
4
5
  } from "@egjs/Infinitegrid";
5
6
  import { SvelteComponentDev } from "svelte/internal";
6
7
 
@@ -1,32 +0,0 @@
1
- const autoPreprocess = require('svelte-preprocess');
2
- const path = require("path");
3
-
4
- module.exports = {
5
- webpackFinal: (config) => {
6
- const svelteLoader = config.module.rules.find(
7
- r => r.loader && r.loader.includes('svelte-loader'),
8
- );
9
- svelteLoader.options.preprocess = autoPreprocess({
10
- less: { includePaths: ['src', 'node_modules'] },
11
- css: { includePaths: ['src', 'node_modules'] },
12
- typescript: {
13
- tsconfigFile: './tsconfig.json',
14
- transpileOnly: true,
15
- },
16
- });
17
- config.resolve.extensions.push('.ts', '.tsx');
18
- config.resolve.alias["@egjs/infinitegrid"] = path.resolve(__dirname, '../../../dist/infinitegrid.esm.js');
19
- return config;
20
- },
21
- stories: [
22
- "../stories/**/*.stories.@(js|jsx|ts|tsx)"
23
- ],
24
- addons: [
25
- // "@storybook/addon-knobs/register",
26
- "@storybook/addon-docs/register",
27
- "@storybook/addon-controls/register",
28
- "@storybook/addon-viewport/register",
29
- "storybook-addon-preview/register",
30
- "storybook-dark-mode/register",
31
- ],
32
- };
@@ -1,5 +0,0 @@
1
- import { addons } from "@storybook/addons";
2
-
3
- addons.setConfig({
4
- panelPosition: "right",
5
- });
@@ -1,25 +0,0 @@
1
- import { themes } from "@storybook/theming";
2
- import {
3
- INITIAL_VIEWPORTS,
4
- // or MINIMAL_VIEWPORTS,
5
- } from "@storybook/addon-viewport";
6
-
7
- // or global addParameters
8
- export const parameters = {
9
- controls: {
10
- passArgsFirst: true,
11
- expanded: true,
12
- hideNoControlsWarning: true,
13
- },
14
- viewport: {
15
- viewports: {
16
- ...INITIAL_VIEWPORTS,
17
- },
18
- },
19
- darkMode: {
20
- // Override the default light theme
21
- light: { ...themes.normal },
22
- // Override the default dark theme
23
- dark: { ...themes.dark },
24
- },
25
- };
package/CHANGELOG.md DELETED
@@ -1,47 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- ## [4.6.0](https://github.com/naver/egjs-infinitegrid/compare/@egjs/svelte-infinitegrid@4.5.0...@egjs/svelte-infinitegrid@4.6.0) (2022-07-26)
7
-
8
-
9
- ### :mega: Other
10
-
11
- * update packages versions ([d4aa615](https://github.com/naver/egjs-infinitegrid/commit/d4aa615a8cd3e25b621500e2a7b243dcc9696eef))
12
-
13
-
14
-
15
- ## [4.5.0](https://github.com/naver/egjs-infinitegrid/compare/@egjs/svelte-infinitegrid@4.4.0...@egjs/svelte-infinitegrid@4.5.0) (2022-06-23)
16
-
17
-
18
- ### :mega: Other
19
-
20
- * update packages versions ([171bb74](https://github.com/naver/egjs-infinitegrid/commit/171bb74f708110a2fd986276c9b8d65472fa64ab))
21
-
22
-
23
-
24
- ## [4.4.0](https://github.com/naver/egjs-infinitegrid/compare/@egjs/svelte-infinitegrid@4.3.1...@egjs/svelte-infinitegrid@4.4.0) (2022-05-25)
25
-
26
-
27
- ### :mega: Other
28
-
29
- * update packages versions ([29bdea0](https://github.com/naver/egjs-infinitegrid/commit/29bdea08f334113e4a73180dd5f9e803c4befc99))
30
-
31
-
32
-
33
- ## [4.3.1](https://github.com/naver/egjs-infinitegrid/compare/@egjs/svelte-infinitegrid@4.3.0...@egjs/svelte-infinitegrid@4.3.1) (2022-05-17)
34
-
35
-
36
- ### :mega: Other
37
-
38
- * update packages versions ([47f9348](https://github.com/naver/egjs-infinitegrid/commit/47f9348042e19c789b986ec936ed042a3838afc8))
39
-
40
-
41
-
42
- ## [4.3.0](https://github.com/naver/egjs-infinitegrid/compare/@egjs/svelte-infinitegrid@4.2.1...@egjs/svelte-infinitegrid@4.3.0) (2022-05-13)
43
-
44
-
45
- ### :mega: Other
46
-
47
- * update packages versions ([bc07e37](https://github.com/naver/egjs-infinitegrid/commit/bc07e37a5fb40e94f87cd1b07f1f7a843ddbe7e8))
package/global.d.ts DELETED
@@ -1,8 +0,0 @@
1
- declare module "!!raw-loader!*" {
2
- const content: string;
3
- export default content;
4
- }
5
- declare module "*.svelte" {
6
- const content: any;
7
- export default content;
8
- }
Binary file
package/public/global.css DELETED
@@ -1,63 +0,0 @@
1
- html, body {
2
- position: relative;
3
- width: 100%;
4
- height: 100%;
5
- }
6
-
7
- body {
8
- color: #333;
9
- margin: 0;
10
- padding: 8px;
11
- box-sizing: border-box;
12
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
13
- }
14
-
15
- a {
16
- color: rgb(0,100,200);
17
- text-decoration: none;
18
- }
19
-
20
- a:hover {
21
- text-decoration: underline;
22
- }
23
-
24
- a:visited {
25
- color: rgb(0,80,160);
26
- }
27
-
28
- label {
29
- display: block;
30
- }
31
-
32
- input, button, select, textarea {
33
- font-family: inherit;
34
- font-size: inherit;
35
- -webkit-padding: 0.4em 0;
36
- padding: 0.4em;
37
- margin: 0 0 0.5em 0;
38
- box-sizing: border-box;
39
- border: 1px solid #ccc;
40
- border-radius: 2px;
41
- }
42
-
43
- input:disabled {
44
- color: #ccc;
45
- }
46
-
47
- button {
48
- color: #333;
49
- background-color: #f4f4f4;
50
- outline: none;
51
- }
52
-
53
- button:disabled {
54
- color: #999;
55
- }
56
-
57
- button:not(:disabled):active {
58
- background-color: #ddd;
59
- }
60
-
61
- button:focus {
62
- border-color: #666;
63
- }
package/public/index.html DELETED
@@ -1,18 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset='utf-8'>
5
- <meta name='viewport' content='width=device-width,initial-scale=1'>
6
-
7
- <title>Svelte app</title>
8
-
9
- <link rel='icon' type='image/png' href='/favicon.png'>
10
- <link rel='stylesheet' href='/global.css'>
11
- <link rel='stylesheet' href='/build/bundle.css'>
12
-
13
- <script defer src='/build/bundle.js'></script>
14
- </head>
15
-
16
- <body>
17
- </body>
18
- </html>
@@ -1,32 +0,0 @@
1
- import buildHelper from "@egjs/build-helper";
2
- import svelte from "rollup-plugin-svelte";
3
- import sveltePreprocess from "svelte-preprocess";
4
-
5
- const defaultOptions = {
6
- tsconfig: "",
7
- commonjs: true,
8
- external: {
9
- svelte: "svelte",
10
- },
11
- plugins: [
12
- svelte({
13
- preprocess: sveltePreprocess(),
14
- }),
15
- ],
16
- };
17
-
18
- export default buildHelper([
19
- {
20
- ...defaultOptions,
21
- input: "./src/index.umd.js",
22
- output: "dist/infinitegrid.cjs.js",
23
- format: "cjs",
24
- },
25
- {
26
- ...defaultOptions,
27
- input: "./src/index.js",
28
- output: "dist/infinitegrid.esm.js",
29
- format: "es",
30
- exports: "named",
31
- },
32
- ]);
package/rollup.config.js DELETED
@@ -1,83 +0,0 @@
1
- import svelte from 'rollup-plugin-svelte';
2
- import commonjs from '@rollup/plugin-commonjs';
3
- import resolve from '@rollup/plugin-node-resolve';
4
- import livereload from 'rollup-plugin-livereload';
5
- import { terser } from 'rollup-plugin-terser';
6
- import sveltePreprocess from 'svelte-preprocess';
7
- import typescript from '@rollup/plugin-typescript';
8
- import css from 'rollup-plugin-css-only';
9
-
10
- const production = !process.env.ROLLUP_WATCH;
11
-
12
- function serve() {
13
- let server;
14
-
15
- function toExit() {
16
- if (server) server.kill(0);
17
- }
18
-
19
- return {
20
- writeBundle() {
21
- if (server) return;
22
- server = require('child_process').spawn('npm', ['run', 'start', '--', '--dev'], {
23
- stdio: ['ignore', 'inherit', 'inherit'],
24
- shell: true
25
- });
26
-
27
- process.on('SIGTERM', toExit);
28
- process.on('exit', toExit);
29
- }
30
- };
31
- }
32
-
33
- export default {
34
- input: 'src/main.ts',
35
- output: {
36
- sourcemap: true,
37
- format: 'iife',
38
- name: 'app',
39
- file: 'public/build/bundle.js'
40
- },
41
- plugins: [
42
- svelte({
43
- preprocess: sveltePreprocess({ sourceMap: !production }),
44
- compilerOptions: {
45
- // enable run-time checks when not in production
46
- dev: !production
47
- }
48
- }),
49
- // we'll extract any component CSS out into
50
- // a separate file - better for performance
51
- css({ output: 'bundle.css' }),
52
-
53
- // If you have external dependencies installed from
54
- // npm, you'll most likely need these plugins. In
55
- // some cases you'll need additional configuration -
56
- // consult the documentation for details:
57
- // https://github.com/rollup/plugins/tree/master/packages/commonjs
58
- resolve({
59
- browser: true,
60
- dedupe: ['svelte']
61
- }),
62
- commonjs(),
63
- typescript({
64
- sourceMap: !production,
65
- inlineSources: !production
66
- }),
67
-
68
- // In dev mode, call `npm run start` once
69
- // the bundle has been generated
70
- !production && serve(),
71
-
72
- // Watch the `public` directory and refresh the
73
- // browser on changes when not in production
74
- !production && livereload('public'),
75
-
76
- // If we're building for production (npm run build
77
- // instead of npm run dev), minify
78
- production && terser()
79
- ],
80
- watch: {
81
- clearScreen: false
82
- }
83
- };
@@ -1,4 +0,0 @@
1
- export default {
2
- title: "Examples/MasonryInfiniteGrid",
3
- };
4
- export * from "./1-MasonryInfiniteGrid.stories";
@@ -1,27 +0,0 @@
1
- import MasonryInfiniteGridApp from "./apps/SvelteMasonryInfiniteGridApp.svelte";
2
- // import RawMasonryInfiniteGridApp from "!!raw-loader!./apps/SvelteMasonryInfiniteGridApp.svelte";
3
- // import { MASONRY_GRID_CONTROLS } from "../../../../stories/templates/controls";
4
- // import { convertPath, convertSvelteTemplate, makeArgs } from "../../../../stories/utils";
5
- import "../../../../stories/templates/default.css";
6
-
7
-
8
- export const MasonryInfiniteGridTemplate = (props) => ({
9
- Component: MasonryInfiniteGridApp,
10
- props,
11
- });
12
-
13
- MasonryInfiniteGridTemplate.storyName = "MasonryInfiniteGrid";
14
- // MasonryInfiniteGridTemplate.argTypes = MASONRY_GRID_CONTROLS;
15
- // MasonryInfiniteGridTemplate.args = {
16
- // ...makeArgs(MasonryInfiniteGridTemplate.argTypes),
17
- // };
18
-
19
- // MasonryInfiniteGridTemplate.parameters = {
20
- // preview: [
21
- // {
22
- // tab: "Svelte",
23
- // template: convertSvelteTemplate(convertPath(RawMasonryInfiniteGridApp, "src", "@egjs/svelte-grid")),
24
- // language: "html",
25
- // },
26
- // ],
27
- // };
@@ -1,42 +0,0 @@
1
- <script>
2
- import { MasonryInfiniteGrid } from "../../../src";
3
-
4
- let items = getItems(0, 10);
5
-
6
- function getItems(nextGroupKey, count) {
7
- const nextItems = [];
8
-
9
- for (let i = 0; i < count; ++i) {
10
- const nextKey = nextGroupKey * count + i;
11
-
12
- nextItems.push({ groupKey: nextGroupKey, key: nextKey });
13
- }
14
- return nextItems;
15
- }
16
- </script>
17
-
18
- <MasonryInfiniteGrid
19
- class="container"
20
- gap={5}
21
- {items}
22
- on:requestAppend={({ detail: e }) => {
23
- const nextGroupKey = (+e.groupKey || 0) + 1;
24
-
25
- items = [...items, ...getItems(nextGroupKey, 10)];
26
- }}
27
- let:visibleItems
28
- >
29
- {#each visibleItems as item (item.key)}
30
- <div class="item">
31
- <div class="thumbnail">
32
- <img
33
- src={`https://naver.github.io/egjs-infinitegrid/assets/image/${
34
- (item.key % 33) + 1
35
- }.jpg`}
36
- alt="egjs"
37
- />
38
- </div>
39
- <div class="info">{`egjs ${item.key}`}</div>
40
- </div>
41
- {/each}
42
- </MasonryInfiniteGrid>
@@ -1,5 +0,0 @@
1
- export default {
2
- title: "Examples/JustifiedInfiniteGrid",
3
- };
4
- export * from "./1-JustifiedInfiniteGrid.stories";
5
-
@@ -1,10 +0,0 @@
1
- import JustifiedInfiniteGridApp from "./apps/SvelteJustifiedInfiniteGridApp.svelte";
2
- import "../../../../stories/templates/default.css";
3
-
4
-
5
- export const JustifiedInfiniteGridTemplate = (props) => ({
6
- Component: JustifiedInfiniteGridApp,
7
- props,
8
- });
9
-
10
- JustifiedInfiniteGridTemplate.storyName = "JustifiedInfiniteGrid";
@@ -1,43 +0,0 @@
1
- <script>
2
- import { JustifiedInfiniteGrid } from "../../../src";
3
-
4
- let items = getItems(0, 10);
5
-
6
- function getItems(nextGroupKey, count) {
7
- const nextItems = [];
8
-
9
- for (let i = 0; i < count; ++i) {
10
- const nextKey = nextGroupKey * count + i;
11
-
12
- nextItems.push({ groupKey: nextGroupKey, key: nextKey });
13
- }
14
- return nextItems;
15
- }
16
- </script>
17
-
18
- <JustifiedInfiniteGrid
19
- class="container"
20
- gap={5}
21
- {items}
22
- on:requestAppend={({ detail: e }) => {
23
- const nextGroupKey = (+e.groupKey || 0) + 1;
24
-
25
- items = [...items, ...getItems(nextGroupKey, 10)];
26
- }}
27
- let:visibleItems
28
- >
29
- {#each visibleItems as item (item.key)}
30
- <div class="item">
31
- <div class="thumbnail">
32
- <img
33
- src={`https://naver.github.io/egjs-infinitegrid/assets/image/${
34
- (item.key % 33) + 1
35
- }.jpg`}
36
- alt="egjs"
37
- data-grid-maintained-target="true"
38
- />
39
- </div>
40
- <div class="info">{`egjs ${item.key}`}</div>
41
- </div>
42
- {/each}
43
- </JustifiedInfiniteGrid>
@@ -1,5 +0,0 @@
1
- export default {
2
- title: "Examples/FrameInfiniteGrid",
3
- };
4
- export * from "./1-FrameInfiniteGrid.stories";
5
-
@@ -1,10 +0,0 @@
1
- import FrameInfiniteGridApp from "./apps/SvelteFrameInfiniteGridApp.svelte";
2
- import "../../../../stories/templates/default.css";
3
-
4
-
5
- export const FrameInfiniteGridTemplate = (props) => ({
6
- Component: FrameInfiniteGridApp,
7
- props,
8
- });
9
-
10
- FrameInfiniteGridTemplate.storyName = "FrameInfiniteGrid";
@@ -1,44 +0,0 @@
1
- <script>
2
- import { FrameInfiniteGrid } from "../../../src";
3
-
4
- let items = getItems(0, 10);
5
-
6
- function getItems(nextGroupKey, count) {
7
- const nextItems = [];
8
-
9
- for (let i = 0; i < count; ++i) {
10
- const nextKey = nextGroupKey * count + i;
11
-
12
- nextItems.push({ groupKey: nextGroupKey, key: nextKey });
13
- }
14
- return nextItems;
15
- }
16
- </script>
17
-
18
- <FrameInfiniteGrid
19
- class="container"
20
- gap={5}
21
- frame={[
22
- [1, 1, 2, 2, 3],
23
- [1, 1, 4, 5, 5],
24
- ]}
25
- {items}
26
- on:requestAppend={({ detail: e }) => {
27
- const nextGroupKey = (+e.groupKey || 0) + 1;
28
-
29
- items = [...items, ...getItems(nextGroupKey, 10)];
30
- }}
31
- let:visibleItems
32
- >
33
- {#each visibleItems as item (item.key)}
34
- <div class="item">
35
- <img
36
- src={`https://naver.github.io/egjs-infinitegrid/assets/image/${
37
- (item.key % 33) + 1
38
- }.jpg`}
39
- alt="egjs"
40
- style="width: 100%; height: 100%"
41
- />
42
- </div>
43
- {/each}
44
- </FrameInfiniteGrid>
@@ -1,5 +0,0 @@
1
- export default {
2
- title: "Examples/PackingInfiniteGrid",
3
- };
4
- export * from "./1-PackingInfiniteGrid.stories";
5
-
@@ -1,10 +0,0 @@
1
- import PackingInfiniteGridApp from "./apps/SveltePackingInfiniteGridApp.svelte";
2
- import "../../../../stories/templates/default.css";
3
-
4
-
5
- export const PackingInfiniteGridTemplate = (props) => ({
6
- Component: PackingInfiniteGridApp,
7
- props,
8
- });
9
-
10
- PackingInfiniteGridTemplate.storyName = "PackingInfiniteGrid";
@@ -1,40 +0,0 @@
1
- <script>
2
- import { PackingInfiniteGrid } from "../../../src";
3
-
4
- let items = getItems(0, 10);
5
-
6
- function getItems(nextGroupKey, count) {
7
- const nextItems = [];
8
-
9
- for (let i = 0; i < count; ++i) {
10
- const nextKey = nextGroupKey * count + i;
11
-
12
- nextItems.push({ groupKey: nextGroupKey, key: nextKey });
13
- }
14
- return nextItems;
15
- }
16
- </script>
17
-
18
- <PackingInfiniteGrid
19
- class="container"
20
- gap={5}
21
- {items}
22
- on:requestAppend={({ detail: e }) => {
23
- const nextGroupKey = (+e.groupKey || 0) + 1;
24
-
25
- items = [...items, ...getItems(nextGroupKey, 10)];
26
- }}
27
- let:visibleItems
28
- >
29
- {#each visibleItems as item (item.key)}
30
- <div class="item">
31
- <img
32
- src={`https://naver.github.io/egjs-infinitegrid/assets/image/${
33
- (item.key % 33) + 1
34
- }.jpg`}
35
- alt="egjs"
36
- style="width: 100%; height: 100%"
37
- />
38
- </div>
39
- {/each}
40
- </PackingInfiniteGrid>
@@ -1,7 +0,0 @@
1
- export default {
2
- title: "Examples/Data Loading",
3
- };
4
- export * from "./1-WaitNReady.stories";
5
- export * from "./2-Placeholder.stories";
6
- export * from "./3-Loading.stories";
7
-
@@ -1,10 +0,0 @@
1
- import WaitNReadyApp from "./apps/SvelteWaitNReadyApp.svelte";
2
- import "../../../../stories/templates/default.css";
3
-
4
-
5
- export const WaitNReadyTemplate = (props) => ({
6
- Component: WaitNReadyApp,
7
- props,
8
- });
9
-
10
- WaitNReadyTemplate.storyName = "Wait & Ready";
@@ -1,10 +0,0 @@
1
- import PlaceholderApp from "./apps/SveltePlaceholderApp.svelte";
2
- import "../../../../stories/templates/default.css";
3
-
4
-
5
- export const PlaceholderTemplate = (props) => ({
6
- Component: PlaceholderApp,
7
- props,
8
- });
9
-
10
- PlaceholderTemplate.storyName = "Placeholder";
@@ -1,10 +0,0 @@
1
- import LoadingApp from "./apps/SvelteLoadingApp.svelte";
2
- import "../../../../stories/templates/default.css";
3
-
4
-
5
- export const LoadingTemplate = (props) => ({
6
- Component: LoadingApp,
7
- props,
8
- });
9
-
10
- LoadingTemplate.storyName = "Loading";
@@ -1,54 +0,0 @@
1
- <script>
2
- import { ITEM_TYPE } from "@egjs/infinitegrid";
3
- import { MasonryInfiniteGrid } from "../../../src";
4
- import { LoadingTemplate } from "../3-Loading.stories";
5
-
6
- let items = getItems(0, 10);
7
-
8
- function getItems(nextGroupKey, count) {
9
- const nextItems = [];
10
-
11
- for (let i = 0; i < count; ++i) {
12
- const nextKey = nextGroupKey * count + i;
13
-
14
- nextItems.push({ groupKey: nextGroupKey, key: nextKey });
15
- }
16
- return nextItems;
17
- }
18
- </script>
19
-
20
- <MasonryInfiniteGrid
21
- class="container"
22
- gap={5}
23
- useLoading={true}
24
- {items}
25
- on:requestAppend={({ detail: e }) => {
26
- const nextGroupKey = (+e.groupKey || 0) + 1;
27
-
28
- e.wait();
29
-
30
- setTimeout(() => {
31
- e.ready();
32
- items = [...items, ...getItems(nextGroupKey, 10)];
33
- }, 200);
34
- }}
35
- let:visibleItems
36
- >
37
- {#each visibleItems as item (item.key)}
38
- {#if item.type === ITEM_TYPE.NORMAL}
39
- <div class="item">
40
- <div class="thumbnail">
41
- <img
42
- src={`https://naver.github.io/egjs-infinitegrid/assets/image/${
43
- (item.key % 33) + 1
44
- }.jpg`}
45
- alt="egjs"
46
- />
47
- </div>
48
- <div class="info">{`egjs ${item.key}`}</div>
49
- </div>
50
- {:else if item.type === ITEM_TYPE.LOADING}
51
- <div class="loading">Loading...</div>
52
- {/if}
53
- {/each}
54
- </MasonryInfiniteGrid>
@@ -1,54 +0,0 @@
1
- <script>
2
- import { ITEM_TYPE } from "@egjs/infinitegrid";
3
- import { MasonryInfiniteGrid } from "../../../src";
4
-
5
- let items = getItems(0, 10);
6
-
7
- function getItems(nextGroupKey, count) {
8
- const nextItems = [];
9
-
10
- for (let i = 0; i < count; ++i) {
11
- const nextKey = nextGroupKey * count + i;
12
-
13
- nextItems.push({ groupKey: nextGroupKey, key: nextKey });
14
- }
15
- return nextItems;
16
- }
17
- </script>
18
-
19
- <MasonryInfiniteGrid
20
- class="container"
21
- gap={5}
22
- usePlaceholder={true}
23
- {items}
24
- on:requestAppend={({ detail: e }) => {
25
- const nextGroupKey = (+e.groupKey || 0) + 1;
26
-
27
- e.wait();
28
- e.currentTarget.appendPlaceholders(10, nextGroupKey);
29
-
30
- setTimeout(() => {
31
- e.ready();
32
- items = [...items, ...getItems(nextGroupKey, 10)];
33
- }, 200);
34
- }}
35
- let:visibleItems
36
- >
37
- {#each visibleItems as item (item.key)}
38
- {#if item.type === ITEM_TYPE.NORMAL}
39
- <div class="item">
40
- <div class="thumbnail">
41
- <img
42
- src={`https://naver.github.io/egjs-infinitegrid/assets/image/${
43
- (item.key % 33) + 1
44
- }.jpg`}
45
- alt="egjs"
46
- />
47
- </div>
48
- <div class="info">{`egjs ${item.key}`}</div>
49
- </div>
50
- {:else if item.type === ITEM_TYPE.VIRTUAL}
51
- <div class="placeholder" />
52
- {/if}
53
- {/each}
54
- </MasonryInfiniteGrid>
@@ -1,47 +0,0 @@
1
- <script>
2
- import { MasonryInfiniteGrid } from "../../../src";
3
-
4
- let items = getItems(0, 10);
5
-
6
- function getItems(nextGroupKey, count) {
7
- const nextItems = [];
8
-
9
- for (let i = 0; i < count; ++i) {
10
- const nextKey = nextGroupKey * count + i;
11
-
12
- nextItems.push({ groupKey: nextGroupKey, key: nextKey });
13
- }
14
- return nextItems;
15
- }
16
- </script>
17
-
18
- <MasonryInfiniteGrid
19
- class="container"
20
- gap={5}
21
- {items}
22
- on:requestAppend={({ detail: e }) => {
23
- const nextGroupKey = (+e.groupKey || 0) + 1;
24
-
25
- e.wait();
26
-
27
- setTimeout(() => {
28
- e.ready();
29
- items = [...items, ...getItems(nextGroupKey, 10)];;
30
- }, 1000);
31
- }}
32
- let:visibleItems
33
- >
34
- {#each visibleItems as item (item.key)}
35
- <div class="item">
36
- <div class="thumbnail">
37
- <img
38
- src={`https://naver.github.io/egjs-infinitegrid/assets/image/${
39
- (item.key % 33) + 1
40
- }.jpg`}
41
- alt="egjs"
42
- />
43
- </div>
44
- <div class="info">{`egjs ${item.key}`}</div>
45
- </div>
46
- {/each}
47
- </MasonryInfiniteGrid>
package/tsconfig.json DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "extends": "@tsconfig/svelte/tsconfig.json",
3
-
4
- "include": ["src/**/*", "./global.d.ts", "stories/**/*"],
5
- "exclude": ["node_modules/*", "__sapper__/*", "public/*"]
6
- }