@egjs/svelte-infinitegrid 4.7.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.
- package/dist/infinitegrid.cjs.js +2 -2
- package/dist/infinitegrid.esm.js +2 -2
- package/package.json +7 -2
- package/.storybook/main.js +0 -32
- package/.storybook/manager.js +0 -5
- package/.storybook/preview.js +0 -25
- package/CHANGELOG.md +0 -47
- package/global.d.ts +0 -8
- package/public/favicon.png +0 -0
- package/public/global.css +0 -63
- package/public/index.html +0 -18
- package/rollup.build.config.js +0 -32
- package/rollup.config.js +0 -83
- package/stories/1-MasonryInfiniteGrid/0-MasonryInfiniteGrid.stories.ts +0 -4
- package/stories/1-MasonryInfiniteGrid/1-MasonryInfiniteGrid.stories.ts +0 -27
- package/stories/1-MasonryInfiniteGrid/apps/SvelteMasonryInfiniteGridApp.svelte +0 -42
- package/stories/2-JustifiedInfiniteGrid/0-JustifiedInfiniteGrid.stories.ts +0 -5
- package/stories/2-JustifiedInfiniteGrid/1-JustifiedInfiniteGrid.stories.ts +0 -10
- package/stories/2-JustifiedInfiniteGrid/apps/SvelteJustifiedInfiniteGridApp.svelte +0 -43
- package/stories/3-FrameInfiniteGrid/0-FrameInfiniteGrid.stories.ts +0 -5
- package/stories/3-FrameInfiniteGrid/1-FrameInfiniteGrid.stories.ts +0 -10
- package/stories/3-FrameInfiniteGrid/apps/SvelteFrameInfiniteGridApp.svelte +0 -44
- package/stories/4-PackingInfiniteGrid/0-PackingInfiniteGrid.stories.ts +0 -5
- package/stories/4-PackingInfiniteGrid/1-PackingInfiniteGrid.stories.ts +0 -10
- package/stories/4-PackingInfiniteGrid/apps/SveltePackingInfiniteGridApp.svelte +0 -40
- package/stories/5-DataLoading/0-DataLoading.stories.ts +0 -7
- package/stories/5-DataLoading/1-WaitNReady.stories.ts +0 -10
- package/stories/5-DataLoading/2-Placeholder.stories.ts +0 -10
- package/stories/5-DataLoading/3-Loading.stories.ts +0 -10
- package/stories/5-DataLoading/apps/SvelteLoadingApp.svelte +0 -54
- package/stories/5-DataLoading/apps/SveltePlaceholderApp.svelte +0 -54
- package/stories/5-DataLoading/apps/SvelteWaitNReadyApp.svelte +0 -47
- package/tsconfig.json +0 -6
package/dist/infinitegrid.cjs.js
CHANGED
|
@@ -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.7.
|
|
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.
|
|
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 &
|
package/dist/infinitegrid.esm.js
CHANGED
|
@@ -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.7.
|
|
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.
|
|
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 &
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@egjs/svelte-infinitegrid",
|
|
3
|
-
"version": "4.7.
|
|
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.7.
|
|
77
|
+
"@egjs/infinitegrid": "~4.7.1"
|
|
73
78
|
}
|
|
74
79
|
}
|
package/.storybook/main.js
DELETED
|
@@ -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
|
-
};
|
package/.storybook/manager.js
DELETED
package/.storybook/preview.js
DELETED
|
@@ -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
package/public/favicon.png
DELETED
|
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>
|
package/rollup.build.config.js
DELETED
|
@@ -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,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,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,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,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,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,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>
|