@af-utils/react-virtual-list
Advanced tools
Comparing version 0.0.15 to 0.0.16
@@ -1,4 +0,4 @@ | ||
export const raw = 2216; | ||
export const min = 1123; | ||
export const minGz = 622; | ||
export const minBrotli = 543; | ||
export const raw = 1909; | ||
export const min = 1036; | ||
export const minGz = 593; | ||
export const minBrotli = 521; |
import e from "prop-types"; | ||
import { Subscription as t, mapVisibleRange as i, EVT_FROM as l, EVT_TO as r, EVT_SCROLL_SIZE as s } from "@af-utils/react-virtual-headless"; | ||
import { Subscription as t, mapVisibleRange as i, EVT_FROM as l, EVT_TO as s, EVT_SCROLL_SIZE as r } from "@af-utils/react-virtual-headless"; | ||
@@ -11,41 +11,31 @@ export * from "@af-utils/react-virtual-headless"; | ||
const c = a("overflow: auto", "position: relative"), h = a("visibility: hidden"), p = a("position: absolute"), f = a("height: 1px"), u = a("width: 1px"), v = o(c, a("display: flex")), x = o(p, h, u, a("top: 0")), y = o(p, h, f, a("left: 0")), g = o(h, u), b = o(h, f, a("flex-shrink: 0")), N = [ "height", c, x, g ], w = [ "width", v, y, b ], I = [ l, r ], D = [ s ], H = e => { | ||
let {model: l, children: r, className: s, itemData: a, getKey: c, tabIndex: h = -1, ...p} = e; | ||
const [f, u, v, x] = l.horizontal ? w : N; | ||
const c = a("overflow: auto", "position: relative"), p = a("visibility: hidden"), h = a("position: absolute"), f = a("height: 1px"), u = a("width: 1px"), v = o(c, a("display: flex")), x = o(h, p, u, a("top: 0")), y = o(h, p, f, a("left: 0")), b = o(p, u), N = o(p, f, a("flex-shrink: 0")), g = [ "height", c, x, b ], w = [ "width", v, y, N ], I = [ l, s ], D = [ r ], K = e => { | ||
let {model: l, children: s, className: r, itemData: a, getKey: c, tabIndex: p = -1, ...h} = e; | ||
const [f, u, v, x] = l.horizontal ? w : g; | ||
/*#__PURE__*/ | ||
return d("div", { | ||
className: o(u, s), | ||
className: o(u, r), | ||
ref: l.setOuterNode, | ||
tabIndex: h, | ||
...p, | ||
tabIndex: p, | ||
...h, | ||
children: [ /*#__PURE__*/ m(t, { | ||
model: l, | ||
events: D, | ||
getHash: () => l.scrollSize, | ||
children: e => { | ||
let {scrollSize: t} = e; | ||
/*#__PURE__*/ | ||
return m("div", { | ||
className: v, | ||
style: { | ||
[f]: t | ||
} | ||
}); | ||
} | ||
children: () => /*#__PURE__*/ m("div", { | ||
className: v, | ||
style: { | ||
[f]: l.scrollSize | ||
} | ||
}) | ||
}), /*#__PURE__*/ m(t, { | ||
model: l, | ||
events: I, | ||
getHash: () => l.from + "_" + l.to, | ||
children: e => { | ||
let {from: t} = e; | ||
/*#__PURE__*/ | ||
return d(n, { | ||
children: [ /*#__PURE__*/ m("div", { | ||
className: x, | ||
style: { | ||
[f]: l.getOffset(t) | ||
} | ||
}), i(l, r, a, c) ] | ||
}); | ||
} | ||
children: () => /*#__PURE__*/ d(n, { | ||
children: [ /*#__PURE__*/ m("div", { | ||
className: x, | ||
style: { | ||
[f]: l.getOffset(l.from) | ||
} | ||
}), i(l, s, a, c) ] | ||
}) | ||
}) ] | ||
@@ -55,3 +45,3 @@ }); | ||
"production" !== process.env.NODE_ENV && (H.propTypes = { | ||
"production" !== process.env.NODE_ENV && (K.propTypes = { | ||
model: e.object.isRequired, | ||
@@ -65,3 +55,3 @@ children: e.elementType.isRequired, | ||
export { H as List }; | ||
export { K as List }; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@af-utils/react-virtual-list", | ||
"private": false, | ||
"version": "0.0.15", | ||
"version": "0.0.16", | ||
"description": "React components for rendering large scrollable data", | ||
@@ -46,15 +46,15 @@ "repository": "https://github.com/nowaalex/af-virtual-scroll.git", | ||
"devDependencies": { | ||
"@babel/core": "^7.18.5", | ||
"@babel/plugin-transform-runtime": "^7.18.5", | ||
"@babel/preset-env": "^7.18.2", | ||
"@babel/preset-react": "^7.17.12", | ||
"@babel/core": "^7.18.6", | ||
"@babel/plugin-transform-runtime": "^7.18.6", | ||
"@babel/preset-env": "^7.18.6", | ||
"@babel/preset-react": "^7.18.6", | ||
"@rollup/plugin-babel": "^5.3.1", | ||
"@rollup/plugin-commonjs": "^22.0.0", | ||
"@rollup/plugin-commonjs": "^22.0.1", | ||
"@rollup/plugin-export-bundle-size": "^0.0.1", | ||
"@rollup/plugin-replace": "^4.0.0", | ||
"@rollup/plugin-virtual": "^2.1.0", | ||
"babel-jest": "^28.1.1", | ||
"babel-jest": "^28.1.2", | ||
"babel-plugin-module-resolver": "^4.1.0", | ||
"babel-plugin-transform-react-remove-prop-types": "^0.4.24", | ||
"jest": "^28.1.1", | ||
"jest": "^28.1.2", | ||
"lodash": "^4.17.21", | ||
@@ -66,4 +66,4 @@ "rollup": "^2.75.7", | ||
"peerDependencies": { | ||
"@af-utils/react-virtual-headless": "^0.0.13", | ||
"@af-utils/styled": "^0.0.8", | ||
"@af-utils/react-virtual-headless": "^0.0.14", | ||
"@af-utils/styled": "^0.0.9", | ||
"prop-types": "^15.8.0", | ||
@@ -70,0 +70,0 @@ "react": "^17.0.0 || ^18.1.0" |
Sorry, the diff of this file is not supported yet
9192
51