react-virtual-list
Advanced tools
Comparing version 1.0.0 to 1.2.0
@@ -1,1 +0,1 @@ | ||
{"filter":false,"title":"gulpfile.js","tooltip":"/gulpfile.js","undoManager":{"stack":[[{"start":{"row":17,"column":38},"end":{"row":17,"column":39},"action":"insert","lines":["e"],"id":171}],[{"start":{"row":17,"column":38},"end":{"row":17,"column":39},"action":"remove","lines":["e"],"id":172}],[{"start":{"row":17,"column":38},"end":{"row":17,"column":39},"action":"insert","lines":["e"],"id":173}],[{"start":{"row":17,"column":39},"end":{"row":17,"column":40},"action":"insert","lines":["r"],"id":174}],[{"start":{"row":17,"column":39},"end":{"row":17,"column":40},"action":"remove","lines":["r"],"id":175}],[{"start":{"row":17,"column":38},"end":{"row":17,"column":39},"action":"remove","lines":["e"],"id":176}],[{"start":{"row":17,"column":38},"end":{"row":17,"column":39},"action":"insert","lines":["d"],"id":177}],[{"start":{"row":17,"column":39},"end":{"row":17,"column":40},"action":"insert","lines":["e"],"id":178}],[{"start":{"row":17,"column":40},"end":{"row":17,"column":41},"action":"insert","lines":["r"],"id":179}],[{"start":{"row":17,"column":41},"end":{"row":17,"column":42},"action":"insert","lines":["e"],"id":180}],[{"start":{"row":17,"column":42},"end":{"row":17,"column":43},"action":"insert","lines":["r"],"id":181}],[{"start":{"row":17,"column":43},"end":{"row":17,"column":44},"action":"insert","lines":["."],"id":182}],[{"start":{"row":17,"column":44},"end":{"row":17,"column":45},"action":"insert","lines":["j"],"id":183}],[{"start":{"row":17,"column":45},"end":{"row":17,"column":46},"action":"insert","lines":["s"],"id":184}],[{"start":{"row":17,"column":48},"end":{"row":18,"column":0},"action":"insert","lines":["",""],"id":185},{"start":{"row":18,"column":0},"end":{"row":18,"column":4},"action":"insert","lines":[" "]}],[{"start":{"row":18,"column":4},"end":{"row":18,"column":8},"action":"insert","lines":[" "],"id":186}],[{"start":{"row":18,"column":8},"end":{"row":18,"column":9},"action":"insert","lines":[","],"id":187}],[{"start":{"row":18,"column":8},"end":{"row":18,"column":9},"action":"remove","lines":[","],"id":188}],[{"start":{"row":18,"column":8},"end":{"row":18,"column":9},"action":"insert","lines":["."],"id":189}],[{"start":{"row":18,"column":9},"end":{"row":18,"column":10},"action":"insert","lines":["o"],"id":190}],[{"start":{"row":18,"column":10},"end":{"row":18,"column":11},"action":"insert","lines":["n"],"id":191}],[{"start":{"row":18,"column":11},"end":{"row":18,"column":13},"action":"insert","lines":["()"],"id":192}],[{"start":{"row":18,"column":12},"end":{"row":18,"column":14},"action":"insert","lines":["''"],"id":193}],[{"start":{"row":18,"column":13},"end":{"row":18,"column":14},"action":"insert","lines":["e"],"id":194}],[{"start":{"row":18,"column":14},"end":{"row":18,"column":15},"action":"insert","lines":["r"],"id":195}],[{"start":{"row":18,"column":15},"end":{"row":18,"column":16},"action":"insert","lines":["r"],"id":196}],[{"start":{"row":18,"column":16},"end":{"row":18,"column":17},"action":"insert","lines":["o"],"id":197}],[{"start":{"row":18,"column":17},"end":{"row":18,"column":18},"action":"insert","lines":["r"],"id":198}],[{"start":{"row":18,"column":19},"end":{"row":18,"column":20},"action":"insert","lines":[","],"id":199}],[{"start":{"row":18,"column":20},"end":{"row":18,"column":21},"action":"insert","lines":[" "],"id":200}],[{"start":{"row":18,"column":21},"end":{"row":18,"column":22},"action":"insert","lines":["h"],"id":201}],[{"start":{"row":18,"column":22},"end":{"row":18,"column":23},"action":"insert","lines":["a"],"id":202}],[{"start":{"row":18,"column":23},"end":{"row":18,"column":24},"action":"insert","lines":["n"],"id":203}],[{"start":{"row":18,"column":24},"end":{"row":18,"column":25},"action":"insert","lines":["d"],"id":204}],[{"start":{"row":18,"column":25},"end":{"row":18,"column":26},"action":"insert","lines":["l"],"id":205}],[{"start":{"row":18,"column":26},"end":{"row":18,"column":27},"action":"insert","lines":["e"],"id":206}],[{"start":{"row":18,"column":27},"end":{"row":18,"column":28},"action":"insert","lines":["E"],"id":207}],[{"start":{"row":18,"column":28},"end":{"row":18,"column":29},"action":"insert","lines":["r"],"id":208}],[{"start":{"row":18,"column":29},"end":{"row":18,"column":30},"action":"insert","lines":["r"],"id":209}],[{"start":{"row":18,"column":30},"end":{"row":18,"column":31},"action":"insert","lines":["o"],"id":210}],[{"start":{"row":18,"column":31},"end":{"row":18,"column":32},"action":"insert","lines":["r"],"id":211}],[{"start":{"row":18,"column":33},"end":{"row":19,"column":0},"action":"insert","lines":["",""],"id":212},{"start":{"row":19,"column":0},"end":{"row":19,"column":8},"action":"insert","lines":[" "]}],[{"start":{"row":19,"column":8},"end":{"row":19,"column":9},"action":"insert","lines":["."],"id":213}],[{"start":{"row":19,"column":9},"end":{"row":19,"column":10},"action":"insert","lines":["p"],"id":214}],[{"start":{"row":19,"column":10},"end":{"row":19,"column":11},"action":"insert","lines":["i"],"id":215}],[{"start":{"row":19,"column":11},"end":{"row":19,"column":12},"action":"insert","lines":["p"],"id":216}],[{"start":{"row":19,"column":12},"end":{"row":19,"column":13},"action":"insert","lines":["e"],"id":217}],[{"start":{"row":19,"column":13},"end":{"row":19,"column":15},"action":"insert","lines":["()"],"id":218}],[{"start":{"row":19,"column":14},"end":{"row":19,"column":15},"action":"insert","lines":["g"],"id":219}],[{"start":{"row":19,"column":15},"end":{"row":19,"column":16},"action":"insert","lines":["u"],"id":220}],[{"start":{"row":19,"column":16},"end":{"row":19,"column":17},"action":"insert","lines":["l"],"id":221}],[{"start":{"row":19,"column":17},"end":{"row":19,"column":18},"action":"insert","lines":["p"],"id":222}],[{"start":{"row":19,"column":18},"end":{"row":19,"column":19},"action":"insert","lines":["."],"id":223}],[{"start":{"row":19,"column":19},"end":{"row":19,"column":20},"action":"insert","lines":["d"],"id":224}],[{"start":{"row":19,"column":20},"end":{"row":19,"column":21},"action":"insert","lines":["e"],"id":225}],[{"start":{"row":19,"column":21},"end":{"row":19,"column":22},"action":"insert","lines":["s"],"id":226}],[{"start":{"row":19,"column":22},"end":{"row":19,"column":23},"action":"insert","lines":["k"],"id":227}],[{"start":{"row":19,"column":23},"end":{"row":19,"column":25},"action":"insert","lines":["()"],"id":228}],[{"start":{"row":19,"column":24},"end":{"row":19,"column":26},"action":"insert","lines":["''"],"id":229}],[{"start":{"row":19,"column":25},"end":{"row":19,"column":26},"action":"insert","lines":["."],"id":230}],[{"start":{"row":19,"column":26},"end":{"row":19,"column":27},"action":"insert","lines":["/"],"id":231}],[{"start":{"row":19,"column":27},"end":{"row":19,"column":28},"action":"insert","lines":["d"],"id":232}],[{"start":{"row":19,"column":28},"end":{"row":19,"column":29},"action":"insert","lines":["i"],"id":233}],[{"start":{"row":19,"column":29},"end":{"row":19,"column":30},"action":"insert","lines":["s"],"id":234}],[{"start":{"row":19,"column":30},"end":{"row":19,"column":31},"action":"insert","lines":["t"],"id":235}],[{"start":{"row":19,"column":31},"end":{"row":19,"column":32},"action":"remove","lines":["'"],"id":236}],[{"start":{"row":19,"column":31},"end":{"row":19,"column":32},"action":"insert","lines":[";"],"id":237}],[{"start":{"row":19,"column":31},"end":{"row":19,"column":32},"action":"remove","lines":[";"],"id":238}],[{"start":{"row":19,"column":31},"end":{"row":19,"column":32},"action":"insert","lines":["'"],"id":239}],[{"start":{"row":19,"column":34},"end":{"row":19,"column":35},"action":"insert","lines":[";"],"id":240}],[{"start":{"row":19,"column":22},"end":{"row":19,"column":23},"action":"remove","lines":["k"],"id":241}],[{"start":{"row":19,"column":22},"end":{"row":19,"column":23},"action":"insert","lines":["t"],"id":242}],[{"start":{"row":21,"column":2},"end":{"row":21,"column":3},"action":"insert","lines":[";"],"id":243}],[{"start":{"row":17,"column":27},"end":{"row":17,"column":28},"action":"insert","lines":["h"],"id":244}],[{"start":{"row":17,"column":28},"end":{"row":17,"column":29},"action":"insert","lines":["e"],"id":245}],[{"start":{"row":17,"column":29},"end":{"row":17,"column":30},"action":"insert","lines":["l"],"id":246}],[{"start":{"row":17,"column":30},"end":{"row":17,"column":31},"action":"insert","lines":["p"],"id":247}],[{"start":{"row":17,"column":31},"end":{"row":17,"column":32},"action":"insert","lines":["e"],"id":248}],[{"start":{"row":17,"column":32},"end":{"row":17,"column":33},"action":"insert","lines":["r"],"id":249}],[{"start":{"row":17,"column":33},"end":{"row":17,"column":34},"action":"insert","lines":["s"],"id":250}],[{"start":{"row":17,"column":34},"end":{"row":17,"column":35},"action":"insert","lines":["/"],"id":251}],[{"start":{"row":17,"column":35},"end":{"row":17,"column":51},"action":"remove","lines":["virtual-renderer"],"id":252},{"start":{"row":17,"column":35},"end":{"row":17,"column":36},"action":"insert","lines":["*"]}],[{"start":{"row":19,"column":31},"end":{"row":19,"column":32},"action":"insert","lines":["/"],"id":253}],[{"start":{"row":19,"column":32},"end":{"row":19,"column":33},"action":"insert","lines":["h"],"id":254}],[{"start":{"row":19,"column":33},"end":{"row":19,"column":34},"action":"insert","lines":["e"],"id":255}],[{"start":{"row":19,"column":34},"end":{"row":19,"column":35},"action":"insert","lines":["l"],"id":256}],[{"start":{"row":19,"column":35},"end":{"row":19,"column":36},"action":"insert","lines":["p"],"id":257}],[{"start":{"row":19,"column":35},"end":{"row":19,"column":36},"action":"remove","lines":["p"],"id":258}],[{"start":{"row":19,"column":34},"end":{"row":19,"column":35},"action":"remove","lines":["l"],"id":259}],[{"start":{"row":19,"column":33},"end":{"row":19,"column":34},"action":"remove","lines":["e"],"id":260}],[{"start":{"row":19,"column":32},"end":{"row":19,"column":33},"action":"remove","lines":["h"],"id":261}],[{"start":{"row":19,"column":32},"end":{"row":19,"column":33},"action":"insert","lines":["u"],"id":262}],[{"start":{"row":19,"column":33},"end":{"row":19,"column":34},"action":"insert","lines":["t"],"id":263}],[{"start":{"row":19,"column":34},"end":{"row":19,"column":35},"action":"insert","lines":["i"],"id":264}],[{"start":{"row":19,"column":35},"end":{"row":19,"column":36},"action":"insert","lines":["l"],"id":265}],[{"start":{"row":19,"column":36},"end":{"row":19,"column":37},"action":"insert","lines":["s"],"id":266}],[{"start":{"row":17,"column":27},"end":{"row":17,"column":34},"action":"remove","lines":["helpers"],"id":267},{"start":{"row":17,"column":27},"end":{"row":17,"column":28},"action":"insert","lines":["u"]}],[{"start":{"row":17,"column":28},"end":{"row":17,"column":29},"action":"insert","lines":["t"],"id":268}],[{"start":{"row":17,"column":29},"end":{"row":17,"column":30},"action":"insert","lines":["i"],"id":269}],[{"start":{"row":17,"column":30},"end":{"row":17,"column":31},"action":"insert","lines":["l"],"id":270}],[{"start":{"row":17,"column":31},"end":{"row":17,"column":32},"action":"insert","lines":["s"],"id":271}]],"mark":100,"position":100},"ace":{"folds":[],"scrolltop":0,"scrollleft":0,"selection":{"start":{"row":8,"column":0},"end":{"row":8,"column":0},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":0},"timestamp":1432440080000,"hash":"1fe3663e61df48aef2b5b24384d14536739457f2"} | ||
{"filter":false,"title":"gulpfile.js","tooltip":"/gulpfile.js","undoManager":{"mark":52,"position":52,"stack":[[{"start":{"row":4,"column":34},"end":{"row":5,"column":0},"action":"insert","lines":["",""],"id":2}],[{"start":{"row":5,"column":0},"end":{"row":5,"column":1},"action":"insert","lines":["v"],"id":3}],[{"start":{"row":5,"column":1},"end":{"row":5,"column":2},"action":"insert","lines":["a"],"id":4}],[{"start":{"row":5,"column":2},"end":{"row":5,"column":3},"action":"insert","lines":["r"],"id":5}],[{"start":{"row":5,"column":3},"end":{"row":5,"column":4},"action":"insert","lines":[" "],"id":6}],[{"start":{"row":5,"column":4},"end":{"row":5,"column":5},"action":"insert","lines":["u"],"id":7}],[{"start":{"row":5,"column":5},"end":{"row":5,"column":6},"action":"insert","lines":["g"],"id":8}],[{"start":{"row":5,"column":6},"end":{"row":5,"column":7},"action":"insert","lines":["l"],"id":9}],[{"start":{"row":5,"column":7},"end":{"row":5,"column":8},"action":"insert","lines":["i"],"id":10}],[{"start":{"row":5,"column":8},"end":{"row":5,"column":9},"action":"insert","lines":["f"],"id":11}],[{"start":{"row":5,"column":9},"end":{"row":5,"column":10},"action":"insert","lines":["y"],"id":12}],[{"start":{"row":5,"column":10},"end":{"row":5,"column":11},"action":"insert","lines":[" "],"id":13}],[{"start":{"row":5,"column":11},"end":{"row":5,"column":12},"action":"insert","lines":["="],"id":14}],[{"start":{"row":5,"column":12},"end":{"row":5,"column":13},"action":"insert","lines":[" "],"id":15}],[{"start":{"row":5,"column":13},"end":{"row":5,"column":14},"action":"insert","lines":["r"],"id":16}],[{"start":{"row":5,"column":14},"end":{"row":5,"column":15},"action":"insert","lines":["e"],"id":17}],[{"start":{"row":5,"column":15},"end":{"row":5,"column":16},"action":"insert","lines":["q"],"id":18}],[{"start":{"row":5,"column":16},"end":{"row":5,"column":17},"action":"insert","lines":["u"],"id":19}],[{"start":{"row":5,"column":17},"end":{"row":5,"column":18},"action":"insert","lines":["i"],"id":20}],[{"start":{"row":5,"column":18},"end":{"row":5,"column":19},"action":"insert","lines":["r"],"id":21}],[{"start":{"row":5,"column":19},"end":{"row":5,"column":20},"action":"insert","lines":["e"],"id":22}],[{"start":{"row":5,"column":20},"end":{"row":5,"column":22},"action":"insert","lines":["()"],"id":23}],[{"start":{"row":5,"column":21},"end":{"row":5,"column":23},"action":"insert","lines":["''"],"id":24}],[{"start":{"row":5,"column":22},"end":{"row":5,"column":23},"action":"insert","lines":["g"],"id":25}],[{"start":{"row":5,"column":23},"end":{"row":5,"column":24},"action":"insert","lines":["u"],"id":26}],[{"start":{"row":5,"column":24},"end":{"row":5,"column":25},"action":"insert","lines":["l"],"id":27}],[{"start":{"row":5,"column":25},"end":{"row":5,"column":26},"action":"insert","lines":["p"],"id":28}],[{"start":{"row":5,"column":26},"end":{"row":5,"column":27},"action":"insert","lines":["-"],"id":29}],[{"start":{"row":5,"column":27},"end":{"row":5,"column":28},"action":"insert","lines":["u"],"id":30}],[{"start":{"row":5,"column":28},"end":{"row":5,"column":29},"action":"insert","lines":["g"],"id":31}],[{"start":{"row":5,"column":29},"end":{"row":5,"column":30},"action":"insert","lines":["l"],"id":32}],[{"start":{"row":5,"column":30},"end":{"row":5,"column":31},"action":"insert","lines":["i"],"id":33}],[{"start":{"row":5,"column":31},"end":{"row":5,"column":32},"action":"insert","lines":["f"],"id":34}],[{"start":{"row":5,"column":32},"end":{"row":5,"column":33},"action":"insert","lines":["y"],"id":35}],[{"start":{"row":5,"column":35},"end":{"row":5,"column":36},"action":"insert","lines":[";"],"id":36}],[{"start":{"row":14,"column":22},"end":{"row":15,"column":0},"action":"insert","lines":["",""],"id":37},{"start":{"row":15,"column":0},"end":{"row":15,"column":8},"action":"insert","lines":[" "]}],[{"start":{"row":15,"column":8},"end":{"row":15,"column":9},"action":"insert","lines":["."],"id":38}],[{"start":{"row":15,"column":9},"end":{"row":15,"column":10},"action":"insert","lines":["p"],"id":39}],[{"start":{"row":15,"column":10},"end":{"row":15,"column":11},"action":"insert","lines":["i"],"id":40}],[{"start":{"row":15,"column":11},"end":{"row":15,"column":12},"action":"insert","lines":["p"],"id":41}],[{"start":{"row":15,"column":12},"end":{"row":15,"column":13},"action":"insert","lines":["e"],"id":42}],[{"start":{"row":15,"column":13},"end":{"row":15,"column":15},"action":"insert","lines":["()"],"id":43}],[{"start":{"row":15,"column":14},"end":{"row":15,"column":15},"action":"insert","lines":["u"],"id":44}],[{"start":{"row":15,"column":15},"end":{"row":15,"column":16},"action":"insert","lines":["g"],"id":45}],[{"start":{"row":15,"column":16},"end":{"row":15,"column":17},"action":"insert","lines":["l"],"id":46}],[{"start":{"row":15,"column":17},"end":{"row":15,"column":18},"action":"insert","lines":["i"],"id":47}],[{"start":{"row":15,"column":18},"end":{"row":15,"column":19},"action":"insert","lines":["f"],"id":48}],[{"start":{"row":15,"column":19},"end":{"row":15,"column":20},"action":"insert","lines":["y"],"id":49}],[{"start":{"row":15,"column":20},"end":{"row":15,"column":22},"action":"insert","lines":["()"],"id":50}],[{"start":{"row":15,"column":22},"end":{"row":15,"column":23},"action":"remove","lines":[")"],"id":51}],[{"start":{"row":15,"column":22},"end":{"row":15,"column":23},"action":"insert","lines":[")"],"id":52}],[{"start":{"row":15,"column":0},"end":{"row":16,"column":0},"action":"remove","lines":[" .pipe(uglify())",""],"id":53}],[{"start":{"row":5,"column":0},"end":{"row":6,"column":0},"action":"remove","lines":["var uglify = require('gulp-uglify');",""],"id":54}]]},"ace":{"folds":[],"scrolltop":12,"scrollleft":0,"selection":{"start":{"row":5,"column":0},"end":{"row":5,"column":0},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":{"row":0,"state":"start","mode":"ace/mode/javascript"}},"timestamp":1432943275231,"hash":"2abca74e319e17902cf450cba369cd16daf5731b"} |
@@ -1,1 +0,1 @@ | ||
{"filter":false,"title":"package.json","tooltip":"/package.json","undoManager":{"stack":[[{"start":{"row":9,"column":14},"end":{"row":9,"column":22},"action":"remove","lines":["gulp && "],"id":69}],[{"start":{"row":9,"column":14},"end":{"row":9,"column":54},"action":"remove","lines":["browserify -t reactify App.jsx -o app.js"],"id":70,"ignore":true},{"start":{"row":9,"column":14},"end":{"row":9,"column":26},"action":"insert","lines":["gulp default"]},{"start":{"row":32,"column":0},"end":{"row":33,"column":0},"action":"remove","lines":[" \"browserify\": \"^10.2.1\",",""]},{"start":{"row":34,"column":29},"end":{"row":35,"column":24},"action":"remove","lines":[","," \"reactify\": \"^1.1.1\""]}]],"mark":1,"position":1},"ace":{"folds":[],"scrolltop":120,"scrollleft":0,"selection":{"start":{"row":19,"column":11},"end":{"row":19,"column":11},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":{"row":9,"state":"start","mode":"ace/mode/json"}},"timestamp":1432520499543,"hash":"74a124a415c653ca766c9b4c2f308d5cf9c1fad3"} | ||
{"filter":false,"title":"package.json","tooltip":"/package.json","undoManager":{"mark":76,"position":76,"stack":[[{"start":{"row":9,"column":45},"end":{"row":9,"column":54},"action":"remove","lines":["-o app.js"],"id":2},{"start":{"row":9,"column":45},"end":{"row":9,"column":46},"action":"insert","lines":["|"]}],[{"start":{"row":9,"column":46},"end":{"row":9,"column":47},"action":"insert","lines":[" "],"id":3}],[{"start":{"row":9,"column":47},"end":{"row":9,"column":48},"action":"insert","lines":["u"],"id":4}],[{"start":{"row":9,"column":48},"end":{"row":9,"column":49},"action":"insert","lines":["g"],"id":5}],[{"start":{"row":9,"column":49},"end":{"row":9,"column":50},"action":"insert","lines":["l"],"id":6}],[{"start":{"row":9,"column":50},"end":{"row":9,"column":51},"action":"insert","lines":["i"],"id":7}],[{"start":{"row":9,"column":51},"end":{"row":9,"column":52},"action":"insert","lines":["f"],"id":8}],[{"start":{"row":9,"column":52},"end":{"row":9,"column":53},"action":"insert","lines":["t"],"id":9}],[{"start":{"row":9,"column":53},"end":{"row":9,"column":54},"action":"insert","lines":["y"],"id":10}],[{"start":{"row":9,"column":53},"end":{"row":9,"column":54},"action":"remove","lines":["y"],"id":11}],[{"start":{"row":9,"column":52},"end":{"row":9,"column":53},"action":"remove","lines":["t"],"id":12}],[{"start":{"row":9,"column":52},"end":{"row":9,"column":53},"action":"insert","lines":["y"],"id":13}],[{"start":{"row":9,"column":53},"end":{"row":9,"column":54},"action":"insert","lines":["j"],"id":14}],[{"start":{"row":9,"column":54},"end":{"row":9,"column":55},"action":"insert","lines":["s"],"id":15}],[{"start":{"row":9,"column":55},"end":{"row":9,"column":56},"action":"insert","lines":[" "],"id":16}],[{"start":{"row":9,"column":56},"end":{"row":9,"column":57},"action":"insert","lines":["a"],"id":17}],[{"start":{"row":9,"column":57},"end":{"row":9,"column":58},"action":"insert","lines":["["],"id":18}],[{"start":{"row":9,"column":58},"end":{"row":9,"column":59},"action":"insert","lines":["["],"id":19}],[{"start":{"row":9,"column":59},"end":{"row":9,"column":60},"action":"insert","lines":[","],"id":20}],[{"start":{"row":9,"column":59},"end":{"row":9,"column":60},"action":"remove","lines":[","],"id":21}],[{"start":{"row":9,"column":58},"end":{"row":9,"column":59},"action":"remove","lines":["["],"id":22}],[{"start":{"row":9,"column":57},"end":{"row":9,"column":58},"action":"remove","lines":["["],"id":23}],[{"start":{"row":9,"column":57},"end":{"row":9,"column":58},"action":"insert","lines":["["],"id":24}],[{"start":{"row":9,"column":58},"end":{"row":9,"column":59},"action":"insert","lines":["["],"id":25}],[{"start":{"row":9,"column":58},"end":{"row":9,"column":59},"action":"remove","lines":["["],"id":26}],[{"start":{"row":9,"column":57},"end":{"row":9,"column":58},"action":"remove","lines":["["],"id":27}],[{"start":{"row":9,"column":57},"end":{"row":9,"column":58},"action":"insert","lines":["p"],"id":28}],[{"start":{"row":9,"column":58},"end":{"row":9,"column":59},"action":"insert","lines":["p"],"id":29}],[{"start":{"row":9,"column":59},"end":{"row":9,"column":60},"action":"insert","lines":["."],"id":30}],[{"start":{"row":9,"column":60},"end":{"row":9,"column":61},"action":"insert","lines":["m"],"id":31}],[{"start":{"row":9,"column":61},"end":{"row":9,"column":62},"action":"insert","lines":["i"],"id":32}],[{"start":{"row":9,"column":62},"end":{"row":9,"column":63},"action":"insert","lines":["n"],"id":33}],[{"start":{"row":9,"column":63},"end":{"row":9,"column":64},"action":"insert","lines":["."],"id":34}],[{"start":{"row":9,"column":64},"end":{"row":9,"column":65},"action":"insert","lines":["j"],"id":35}],[{"start":{"row":9,"column":65},"end":{"row":9,"column":66},"action":"insert","lines":["s"],"id":36}],[{"start":{"row":9,"column":56},"end":{"row":9,"column":57},"action":"insert","lines":["-"],"id":37}],[{"start":{"row":9,"column":57},"end":{"row":9,"column":58},"action":"insert","lines":["c"],"id":38}],[{"start":{"row":9,"column":58},"end":{"row":9,"column":59},"action":"insert","lines":[" "],"id":39}],[{"start":{"row":9,"column":59},"end":{"row":9,"column":60},"action":"insert","lines":[">"],"id":40}],[{"start":{"row":9,"column":60},"end":{"row":9,"column":61},"action":"insert","lines":[" "],"id":41}],[{"start":{"row":9,"column":65},"end":{"row":9,"column":68},"action":"remove","lines":["min"],"id":42}],[{"start":{"row":9,"column":65},"end":{"row":9,"column":66},"action":"remove","lines":["."],"id":43}],[{"start":{"row":9,"column":45},"end":{"row":9,"column":60},"action":"remove","lines":["| uglifyjs -c >"],"id":44,"ignore":true},{"start":{"row":9,"column":45},"end":{"row":9,"column":47},"action":"insert","lines":["-o"]},{"start":{"row":37,"column":28},"end":{"row":38,"column":25},"action":"remove","lines":[","," \"uglifyjs\": \"^2.4.10\""]}],[{"start":{"row":9,"column":14},"end":{"row":9,"column":54},"action":"remove","lines":["browserify -t reactify App.jsx -o app.js"],"id":45,"ignore":true},{"start":{"row":9,"column":14},"end":{"row":9,"column":26},"action":"insert","lines":["gulp default"]},{"start":{"row":32,"column":0},"end":{"row":33,"column":0},"action":"remove","lines":[" \"browserify\": \"^10.2.1\",",""]},{"start":{"row":34,"column":29},"end":{"row":36,"column":28},"action":"remove","lines":[","," \"reactify\": \"^1.1.1\","," \"run-sequence\": \"^1.1.0\""]}],[{"start":{"row":9,"column":14},"end":{"row":9,"column":26},"action":"remove","lines":["gulp default"],"id":46,"ignore":true},{"start":{"row":9,"column":14},"end":{"row":9,"column":54},"action":"insert","lines":["browserify -t reactify App.jsx -o app.js"]},{"start":{"row":32,"column":0},"end":{"row":33,"column":0},"action":"insert","lines":[" \"browserify\": \"^10.2.1\",",""]},{"start":{"row":35,"column":29},"end":{"row":37,"column":28},"action":"insert","lines":[","," \"reactify\": \"^1.1.1\","," \"run-sequence\": \"^1.1.0\""]}],[{"start":{"row":9,"column":14},"end":{"row":9,"column":54},"action":"remove","lines":["browserify -t reactify App.jsx -o app.js"],"id":47,"ignore":true},{"start":{"row":9,"column":14},"end":{"row":9,"column":26},"action":"insert","lines":["gulp default"]},{"start":{"row":32,"column":0},"end":{"row":33,"column":0},"action":"remove","lines":[" \"browserify\": \"^10.2.1\",",""]},{"start":{"row":34,"column":29},"end":{"row":36,"column":28},"action":"remove","lines":[","," \"reactify\": \"^1.1.1\","," \"run-sequence\": \"^1.1.0\""]}],[{"start":{"row":9,"column":14},"end":{"row":9,"column":26},"action":"remove","lines":["gulp default"],"id":48,"ignore":true},{"start":{"row":9,"column":14},"end":{"row":9,"column":54},"action":"insert","lines":["browserify -t reactify App.jsx -o app.js"]},{"start":{"row":32,"column":0},"end":{"row":33,"column":0},"action":"insert","lines":[" \"browserify\": \"^10.2.1\",",""]},{"start":{"row":35,"column":29},"end":{"row":37,"column":28},"action":"insert","lines":[","," \"reactify\": \"^1.1.1\","," \"run-sequence\": \"^1.1.0\""]}],[{"start":{"row":37,"column":28},"end":{"row":38,"column":25},"action":"insert","lines":[","," \"uglifyjs\": \"^2.4.10\""],"id":49,"ignore":true}],[{"start":{"row":9,"column":45},"end":{"row":9,"column":54},"action":"remove","lines":["-o app.js"],"id":50},{"start":{"row":9,"column":45},"end":{"row":9,"column":46},"action":"insert","lines":["|"]}],[{"start":{"row":9,"column":46},"end":{"row":9,"column":47},"action":"insert","lines":[" "],"id":51}],[{"start":{"row":9,"column":47},"end":{"row":9,"column":48},"action":"insert","lines":["u"],"id":52}],[{"start":{"row":9,"column":48},"end":{"row":9,"column":49},"action":"insert","lines":["g"],"id":53}],[{"start":{"row":9,"column":49},"end":{"row":9,"column":50},"action":"insert","lines":["l"],"id":54}],[{"start":{"row":9,"column":50},"end":{"row":9,"column":51},"action":"insert","lines":["i"],"id":55}],[{"start":{"row":9,"column":51},"end":{"row":9,"column":52},"action":"insert","lines":["f"],"id":56}],[{"start":{"row":9,"column":52},"end":{"row":9,"column":53},"action":"insert","lines":["y"],"id":57}],[{"start":{"row":9,"column":53},"end":{"row":9,"column":54},"action":"insert","lines":["j"],"id":58}],[{"start":{"row":9,"column":54},"end":{"row":9,"column":55},"action":"insert","lines":["s"],"id":59}],[{"start":{"row":9,"column":55},"end":{"row":9,"column":56},"action":"insert","lines":[" "],"id":60}],[{"start":{"row":9,"column":56},"end":{"row":9,"column":57},"action":"insert","lines":["-"],"id":61}],[{"start":{"row":9,"column":57},"end":{"row":9,"column":58},"action":"insert","lines":["c"],"id":62}],[{"start":{"row":9,"column":58},"end":{"row":9,"column":59},"action":"insert","lines":[" "],"id":63}],[{"start":{"row":9,"column":59},"end":{"row":9,"column":60},"action":"insert","lines":[">"],"id":64}],[{"start":{"row":9,"column":60},"end":{"row":9,"column":61},"action":"insert","lines":[" "],"id":65}],[{"start":{"row":9,"column":61},"end":{"row":9,"column":62},"action":"insert","lines":["a"],"id":66}],[{"start":{"row":9,"column":62},"end":{"row":9,"column":63},"action":"insert","lines":["p"],"id":67}],[{"start":{"row":9,"column":63},"end":{"row":9,"column":64},"action":"insert","lines":["p"],"id":68}],[{"start":{"row":9,"column":64},"end":{"row":9,"column":65},"action":"insert","lines":["."],"id":69}],[{"start":{"row":9,"column":65},"end":{"row":9,"column":66},"action":"insert","lines":["m"],"id":70}],[{"start":{"row":9,"column":66},"end":{"row":9,"column":67},"action":"insert","lines":["i"],"id":71}],[{"start":{"row":9,"column":67},"end":{"row":9,"column":68},"action":"insert","lines":["n"],"id":72}],[{"start":{"row":9,"column":68},"end":{"row":9,"column":69},"action":"insert","lines":["."],"id":73}],[{"start":{"row":9,"column":69},"end":{"row":9,"column":70},"action":"insert","lines":["j"],"id":74}],[{"start":{"row":9,"column":70},"end":{"row":9,"column":71},"action":"insert","lines":["s"],"id":75}],[{"start":{"row":9,"column":14},"end":{"row":9,"column":71},"action":"remove","lines":["browserify -t reactify App.jsx | uglifyjs -c > app.min.js"],"id":76,"ignore":true},{"start":{"row":9,"column":14},"end":{"row":9,"column":26},"action":"insert","lines":["gulp default"]},{"start":{"row":32,"column":0},"end":{"row":33,"column":0},"action":"remove","lines":[" \"browserify\": \"^10.2.1\",",""]},{"start":{"row":34,"column":29},"end":{"row":37,"column":25},"action":"remove","lines":[","," \"reactify\": \"^1.1.1\","," \"run-sequence\": \"^1.1.0\","," \"uglifyjs\": \"^2.4.10\""]}],[{"start":{"row":2,"column":16},"end":{"row":2,"column":17},"action":"remove","lines":["1"],"id":77}],[{"start":{"row":2,"column":16},"end":{"row":2,"column":17},"action":"insert","lines":["2"],"id":78}]]},"ace":{"folds":[],"scrolltop":0,"scrollleft":0,"selection":{"start":{"row":2,"column":17},"end":{"row":2,"column":17},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":0},"timestamp":1433040922048,"hash":"1975df69416198a536e86286577ad6a12a20294c"} |
@@ -1,1 +0,1 @@ | ||
{"filter":false,"title":"README.md","tooltip":"/README.md","undoManager":{"stack":[],"mark":-1,"position":-1},"ace":{"folds":[],"scrolltop":0,"scrollleft":0,"selection":{"start":{"row":0,"column":0},"end":{"row":0,"column":0},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":0},"timestamp":1432570238174,"hash":"9dcb2a22547252af6b897cb31a35f22479863296"} | ||
{"filter":false,"title":"README.md","tooltip":"/README.md","undoManager":{"stack":[[{"start":{"row":37,"column":44},"end":{"row":37,"column":45},"action":"insert","lines":["l"],"id":272}],[{"start":{"row":37,"column":45},"end":{"row":37,"column":46},"action":"insert","lines":["l"],"id":273}],[{"start":{"row":37,"column":46},"end":{"row":37,"column":47},"action":"insert","lines":[" "],"id":274}],[{"start":{"row":37,"column":47},"end":{"row":37,"column":48},"action":"insert","lines":["b"],"id":275}],[{"start":{"row":37,"column":48},"end":{"row":37,"column":49},"action":"insert","lines":["e"],"id":276}],[{"start":{"row":37,"column":49},"end":{"row":37,"column":50},"action":"insert","lines":[" "],"id":277}],[{"start":{"row":37,"column":50},"end":{"row":37,"column":51},"action":"insert","lines":["r"],"id":278}],[{"start":{"row":37,"column":51},"end":{"row":37,"column":52},"action":"insert","lines":["e"],"id":279}],[{"start":{"row":37,"column":52},"end":{"row":37,"column":53},"action":"insert","lines":["f"],"id":280}],[{"start":{"row":37,"column":53},"end":{"row":37,"column":54},"action":"insert","lines":["l"],"id":281}],[{"start":{"row":37,"column":54},"end":{"row":37,"column":55},"action":"insert","lines":["e"],"id":282}],[{"start":{"row":37,"column":55},"end":{"row":37,"column":56},"action":"insert","lines":["c"],"id":283}],[{"start":{"row":37,"column":56},"end":{"row":37,"column":57},"action":"insert","lines":["t"],"id":284}],[{"start":{"row":37,"column":57},"end":{"row":37,"column":58},"action":"insert","lines":["e"],"id":285}],[{"start":{"row":37,"column":58},"end":{"row":37,"column":59},"action":"insert","lines":["d"],"id":286}],[{"start":{"row":37,"column":59},"end":{"row":37,"column":60},"action":"insert","lines":[" "],"id":287}],[{"start":{"row":37,"column":60},"end":{"row":37,"column":61},"action":"insert","lines":["o"],"id":288}],[{"start":{"row":37,"column":61},"end":{"row":37,"column":62},"action":"insert","lines":["n"],"id":289}],[{"start":{"row":37,"column":62},"end":{"row":37,"column":63},"action":"insert","lines":[" "],"id":290}],[{"start":{"row":37,"column":63},"end":{"row":37,"column":64},"action":"insert","lines":["t"],"id":291}],[{"start":{"row":37,"column":64},"end":{"row":37,"column":65},"action":"insert","lines":["h"],"id":292}],[{"start":{"row":37,"column":65},"end":{"row":37,"column":66},"action":"insert","lines":["e"],"id":293}],[{"start":{"row":37,"column":66},"end":{"row":37,"column":67},"action":"insert","lines":[" "],"id":294}],[{"start":{"row":37,"column":67},"end":{"row":37,"column":68},"action":"insert","lines":["c"],"id":295}],[{"start":{"row":37,"column":68},"end":{"row":37,"column":69},"action":"insert","lines":["o"],"id":296}],[{"start":{"row":37,"column":69},"end":{"row":37,"column":70},"action":"insert","lines":["m"],"id":297}],[{"start":{"row":37,"column":70},"end":{"row":37,"column":71},"action":"insert","lines":["p"],"id":298}],[{"start":{"row":37,"column":71},"end":{"row":37,"column":72},"action":"insert","lines":["o"],"id":299}],[{"start":{"row":37,"column":72},"end":{"row":37,"column":73},"action":"insert","lines":["n"],"id":300}],[{"start":{"row":37,"column":73},"end":{"row":37,"column":74},"action":"insert","lines":["e"],"id":301}],[{"start":{"row":37,"column":74},"end":{"row":37,"column":75},"action":"insert","lines":["n"],"id":302}],[{"start":{"row":37,"column":75},"end":{"row":37,"column":76},"action":"insert","lines":["t"],"id":303}],[{"start":{"row":37,"column":76},"end":{"row":37,"column":77},"action":"insert","lines":["'"],"id":304}],[{"start":{"row":37,"column":77},"end":{"row":37,"column":78},"action":"insert","lines":["s"],"id":305}],[{"start":{"row":37,"column":78},"end":{"row":37,"column":79},"action":"insert","lines":[" "],"id":306}],[{"start":{"row":37,"column":79},"end":{"row":37,"column":80},"action":"insert","lines":["r"],"id":307}],[{"start":{"row":37,"column":80},"end":{"row":37,"column":81},"action":"insert","lines":["o"],"id":308}],[{"start":{"row":37,"column":81},"end":{"row":37,"column":82},"action":"insert","lines":["o"],"id":309}],[{"start":{"row":37,"column":82},"end":{"row":37,"column":83},"action":"insert","lines":["t"],"id":310}],[{"start":{"row":37,"column":83},"end":{"row":37,"column":84},"action":"insert","lines":[" "],"id":311}],[{"start":{"row":37,"column":84},"end":{"row":37,"column":85},"action":"insert","lines":["e"],"id":312}],[{"start":{"row":37,"column":85},"end":{"row":37,"column":86},"action":"insert","lines":["l"],"id":313}],[{"start":{"row":37,"column":86},"end":{"row":37,"column":87},"action":"insert","lines":["e"],"id":314}],[{"start":{"row":37,"column":87},"end":{"row":37,"column":88},"action":"insert","lines":["m"],"id":315}],[{"start":{"row":37,"column":88},"end":{"row":37,"column":89},"action":"insert","lines":["e"],"id":316}],[{"start":{"row":37,"column":89},"end":{"row":37,"column":90},"action":"insert","lines":["n"],"id":317}],[{"start":{"row":37,"column":90},"end":{"row":37,"column":91},"action":"insert","lines":["t"],"id":318}],[{"start":{"row":35,"column":32},"end":{"row":35,"column":33},"action":"insert","lines":["r"],"id":319}],[{"start":{"row":35,"column":33},"end":{"row":35,"column":34},"action":"insert","lines":["o"],"id":320}],[{"start":{"row":35,"column":34},"end":{"row":35,"column":35},"action":"insert","lines":["o"],"id":321}],[{"start":{"row":35,"column":35},"end":{"row":35,"column":36},"action":"insert","lines":["t"],"id":322}],[{"start":{"row":35,"column":36},"end":{"row":35,"column":37},"action":"insert","lines":[" "],"id":323}],[{"start":{"row":35,"column":45},"end":{"row":35,"column":46},"action":"insert","lines":["t"],"id":324}],[{"start":{"row":35,"column":46},"end":{"row":35,"column":47},"action":"insert","lines":["h"],"id":325}],[{"start":{"row":35,"column":47},"end":{"row":35,"column":48},"action":"insert","lines":["a"],"id":326}],[{"start":{"row":35,"column":48},"end":{"row":35,"column":49},"action":"insert","lines":["t"],"id":327}],[{"start":{"row":35,"column":49},"end":{"row":35,"column":50},"action":"insert","lines":[" "],"id":328}],[{"start":{"row":35,"column":58},"end":{"row":35,"column":59},"action":"insert","lines":["s"],"id":329}],[{"start":{"row":37,"column":41},"end":{"row":37,"column":42},"action":"insert","lines":[","],"id":330}],[{"start":{"row":37,"column":42},"end":{"row":37,"column":43},"action":"insert","lines":[" "],"id":331}],[{"start":{"row":37,"column":43},"end":{"row":37,"column":44},"action":"insert","lines":["s"],"id":332}],[{"start":{"row":37,"column":44},"end":{"row":37,"column":45},"action":"insert","lines":["u"],"id":333}],[{"start":{"row":37,"column":45},"end":{"row":37,"column":46},"action":"insert","lines":["c"],"id":334}],[{"start":{"row":37,"column":46},"end":{"row":37,"column":47},"action":"insert","lines":["h"],"id":335}],[{"start":{"row":37,"column":47},"end":{"row":37,"column":48},"action":"insert","lines":[" "],"id":336}],[{"start":{"row":37,"column":48},"end":{"row":37,"column":49},"action":"insert","lines":["a"],"id":337}],[{"start":{"row":37,"column":49},"end":{"row":37,"column":50},"action":"insert","lines":["s"],"id":338}],[{"start":{"row":37,"column":50},"end":{"row":37,"column":51},"action":"insert","lines":[" "],"id":339}],[{"start":{"row":37,"column":51},"end":{"row":37,"column":52},"action":"insert","lines":["`"],"id":340}],[{"start":{"row":37,"column":52},"end":{"row":37,"column":53},"action":"insert","lines":["c"],"id":341}],[{"start":{"row":37,"column":53},"end":{"row":37,"column":54},"action":"insert","lines":["l"],"id":342}],[{"start":{"row":37,"column":54},"end":{"row":37,"column":55},"action":"insert","lines":["a"],"id":343}],[{"start":{"row":37,"column":55},"end":{"row":37,"column":56},"action":"insert","lines":["s"],"id":344}],[{"start":{"row":37,"column":56},"end":{"row":37,"column":57},"action":"insert","lines":["s"],"id":345}],[{"start":{"row":37,"column":57},"end":{"row":37,"column":58},"action":"insert","lines":["N"],"id":346}],[{"start":{"row":37,"column":58},"end":{"row":37,"column":59},"action":"insert","lines":["A"],"id":347}],[{"start":{"row":37,"column":59},"end":{"row":37,"column":60},"action":"insert","lines":["m"],"id":348}],[{"start":{"row":37,"column":60},"end":{"row":37,"column":61},"action":"insert","lines":["e"],"id":349}],[{"start":{"row":37,"column":61},"end":{"row":37,"column":62},"action":"insert","lines":["`"],"id":350}],[{"start":{"row":37,"column":61},"end":{"row":37,"column":62},"action":"remove","lines":["`"],"id":351}],[{"start":{"row":37,"column":60},"end":{"row":37,"column":61},"action":"remove","lines":["e"],"id":352}],[{"start":{"row":37,"column":59},"end":{"row":37,"column":60},"action":"remove","lines":["m"],"id":353}],[{"start":{"row":37,"column":58},"end":{"row":37,"column":59},"action":"remove","lines":["A"],"id":354}],[{"start":{"row":37,"column":58},"end":{"row":37,"column":59},"action":"insert","lines":["a"],"id":355}],[{"start":{"row":37,"column":59},"end":{"row":37,"column":60},"action":"insert","lines":["m"],"id":356}],[{"start":{"row":37,"column":60},"end":{"row":37,"column":61},"action":"insert","lines":["e"],"id":357}],[{"start":{"row":37,"column":61},"end":{"row":37,"column":62},"action":"insert","lines":["`"],"id":358}],[{"start":{"row":37,"column":62},"end":{"row":37,"column":63},"action":"insert","lines":[","],"id":359}],[{"start":{"row":37,"column":63},"end":{"row":37,"column":64},"action":"insert","lines":[" "],"id":360}],[{"start":{"row":37,"column":64},"end":{"row":37,"column":65},"action":"insert","lines":["e"],"id":361}],[{"start":{"row":37,"column":65},"end":{"row":37,"column":66},"action":"insert","lines":["t"],"id":362}],[{"start":{"row":37,"column":66},"end":{"row":37,"column":67},"action":"insert","lines":["c"],"id":363}],[{"start":{"row":37,"column":67},"end":{"row":37,"column":68},"action":"insert","lines":["."],"id":364}],[{"start":{"row":37,"column":67},"end":{"row":37,"column":68},"action":"remove","lines":["."],"id":365}],[{"start":{"row":37,"column":66},"end":{"row":37,"column":67},"action":"remove","lines":["c"],"id":366}],[{"start":{"row":37,"column":65},"end":{"row":37,"column":66},"action":"remove","lines":["t"],"id":367}],[{"start":{"row":37,"column":64},"end":{"row":37,"column":65},"action":"remove","lines":["e"],"id":368}],[{"start":{"row":37,"column":63},"end":{"row":37,"column":64},"action":"remove","lines":[" "],"id":369}],[{"start":{"row":37,"column":113},"end":{"row":37,"column":114},"action":"insert","lines":["."],"id":370}],[{"start":{"row":1,"column":30},"end":{"row":1,"column":31},"action":"remove","lines":["["],"id":371,"ignore":true},{"start":{"row":1,"column":35},"end":{"row":1,"column":71},"action":"remove","lines":["](https://github.com/facebook/react)"]},{"start":{"row":34,"column":82},"end":{"row":45,"column":218},"action":"remove","lines":[". Use this if you have a list inside an element with `overflow: scroll`.","* `tagName` the tagName for the root element that surrounds the items rendered by renderItem. Defaults to `div`. Use this if you want to render a list with `ul` and `li`, or any other elements."," ","Any other properties set on `VirtualList`, such as `className`, will be reflected on the component's root element.","","#### Example Usage","","Check out [https://github.com/developerdizzle/react-virtual-list/blob/gh-pages/App.jsx](https://github.com/developerdizzle/react-virtual-list/blob/gh-pages/App.jsx) for the example used in the demo.","","## Tests","","Use `npm test` to run the tests using [jasmine-node](https://github.com/mhevery/jasmine-node). Currently only the calculations inside `./src/utils/virtual-renderer.js` are tested. Hoping to add some DOM tests as well"]},{"start":{"row":34,"column":82},"end":{"row":38,"column":197},"action":"insert","lines":["","","#### Example Usage","","Check out [https://github.com/developerdizzle/react-virtual-list/blob/gh-pages/App.jsx](https://github.com/developerdizzle/react-virtual-list/blob/gh-pages/App.jsx) for the example used in the demo"]}],[{"start":{"row":1,"column":30},"end":{"row":1,"column":31},"action":"insert","lines":["["],"id":372,"ignore":true},{"start":{"row":1,"column":36},"end":{"row":1,"column":72},"action":"insert","lines":["](https://github.com/facebook/react)"]},{"start":{"row":34,"column":82},"end":{"row":38,"column":197},"action":"remove","lines":["","","#### Example Usage","","Check out [https://github.com/developerdizzle/react-virtual-list/blob/gh-pages/App.jsx](https://github.com/developerdizzle/react-virtual-list/blob/gh-pages/App.jsx) for the example used in the demo"]},{"start":{"row":34,"column":82},"end":{"row":45,"column":218},"action":"insert","lines":[". Use this if you have a list inside an element with `overflow: scroll`.","* `tagName` the tagName for the root element that surrounds the items rendered by renderItem. Defaults to `div`. Use this if you want to render a list with `ul` and `li`, or any other elements."," ","Any other properties set on `VirtualList`, such as `className`, will be reflected on the component's root element.","","#### Example Usage","","Check out [https://github.com/developerdizzle/react-virtual-list/blob/gh-pages/App.jsx](https://github.com/developerdizzle/react-virtual-list/blob/gh-pages/App.jsx) for the example used in the demo.","","## Tests","","Use `npm test` to run the tests using [jasmine-node](https://github.com/mhevery/jasmine-node). Currently only the calculations inside `./src/utils/virtual-renderer.js` are tested. Hoping to add some DOM tests as well"]}]],"mark":100,"position":100},"ace":{"folds":[],"scrolltop":304,"scrollleft":0,"selection":{"start":{"row":34,"column":82},"end":{"row":34,"column":82},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":{"row":79,"mode":"ace/mode/markdown"}},"timestamp":1432773932676,"hash":"40d6dc2420ef210fcaa2218c095138de94bba1b3"} |
@@ -1,1 +0,1 @@ | ||
{"filter":false,"title":"virtual-renderer.js","tooltip":"/src/utils/virtual-renderer.js","undoManager":{"stack":[[{"start":{"row":10,"column":0},"end":{"row":12,"column":0},"action":"remove","lines":[" list.height = list.bottom - list.top;"," ",""],"id":936}],[{"start":{"row":0,"column":0},"end":{"row":1,"column":0},"action":"remove","lines":["// move this into VirtualList",""],"id":937}],[{"start":{"row":45,"column":85},"end":{"row":45,"column":161},"action":"remove","lines":[" //listViewBox.top > -1 ? Math.floor(listViewBox.top / this.itemHeight) : 0;"],"id":938}],[{"start":{"row":8,"column":47},"end":{"row":9,"column":0},"action":"insert","lines":["",""],"id":939},{"start":{"row":9,"column":0},"end":{"row":9,"column":4},"action":"insert","lines":[" "]}],[{"start":{"row":9,"column":4},"end":{"row":10,"column":0},"action":"insert","lines":["",""],"id":940},{"start":{"row":10,"column":0},"end":{"row":10,"column":4},"action":"insert","lines":[" "]}],[{"start":{"row":9,"column":4},"end":{"row":9,"column":5},"action":"insert","lines":["l"],"id":941}],[{"start":{"row":9,"column":5},"end":{"row":9,"column":6},"action":"insert","lines":["i"],"id":942}],[{"start":{"row":9,"column":6},"end":{"row":9,"column":7},"action":"insert","lines":["s"],"id":943}],[{"start":{"row":9,"column":7},"end":{"row":9,"column":8},"action":"insert","lines":["t"],"id":944}],[{"start":{"row":9,"column":8},"end":{"row":9,"column":9},"action":"insert","lines":["."],"id":945}],[{"start":{"row":9,"column":9},"end":{"row":9,"column":10},"action":"insert","lines":["h"],"id":946}],[{"start":{"row":9,"column":10},"end":{"row":9,"column":11},"action":"insert","lines":["e"],"id":947}],[{"start":{"row":9,"column":11},"end":{"row":9,"column":12},"action":"insert","lines":["i"],"id":948}],[{"start":{"row":9,"column":12},"end":{"row":9,"column":13},"action":"insert","lines":["g"],"id":949}],[{"start":{"row":9,"column":13},"end":{"row":9,"column":14},"action":"insert","lines":["h"],"id":950}],[{"start":{"row":9,"column":14},"end":{"row":9,"column":15},"action":"insert","lines":["t"],"id":951}],[{"start":{"row":9,"column":15},"end":{"row":9,"column":16},"action":"insert","lines":[" "],"id":952}],[{"start":{"row":9,"column":16},"end":{"row":9,"column":17},"action":"insert","lines":["="],"id":953}],[{"start":{"row":9,"column":17},"end":{"row":9,"column":18},"action":"insert","lines":[" "],"id":954}],[{"start":{"row":9,"column":18},"end":{"row":9,"column":19},"action":"insert","lines":["l"],"id":955}],[{"start":{"row":9,"column":19},"end":{"row":9,"column":20},"action":"insert","lines":["i"],"id":956}],[{"start":{"row":9,"column":20},"end":{"row":9,"column":21},"action":"insert","lines":["s"],"id":957}],[{"start":{"row":9,"column":21},"end":{"row":9,"column":22},"action":"insert","lines":["t"],"id":958}],[{"start":{"row":9,"column":22},"end":{"row":9,"column":23},"action":"insert","lines":["."],"id":959}],[{"start":{"row":9,"column":23},"end":{"row":9,"column":24},"action":"insert","lines":["h"],"id":960}],[{"start":{"row":9,"column":24},"end":{"row":9,"column":25},"action":"insert","lines":["e"],"id":961}],[{"start":{"row":9,"column":25},"end":{"row":9,"column":26},"action":"insert","lines":["i"],"id":962}],[{"start":{"row":9,"column":26},"end":{"row":9,"column":27},"action":"insert","lines":["g"],"id":963}],[{"start":{"row":9,"column":27},"end":{"row":9,"column":28},"action":"insert","lines":["h"],"id":964}],[{"start":{"row":9,"column":28},"end":{"row":9,"column":29},"action":"insert","lines":["t"],"id":965}],[{"start":{"row":9,"column":29},"end":{"row":9,"column":30},"action":"insert","lines":[" "],"id":966}],[{"start":{"row":9,"column":30},"end":{"row":9,"column":31},"action":"insert","lines":["|"],"id":967}],[{"start":{"row":9,"column":31},"end":{"row":9,"column":32},"action":"insert","lines":["|"],"id":968}],[{"start":{"row":9,"column":32},"end":{"row":9,"column":33},"action":"insert","lines":[" "],"id":969}],[{"start":{"row":9,"column":33},"end":{"row":9,"column":34},"action":"insert","lines":["l"],"id":970}],[{"start":{"row":9,"column":34},"end":{"row":9,"column":35},"action":"insert","lines":["i"],"id":971}],[{"start":{"row":9,"column":35},"end":{"row":9,"column":36},"action":"insert","lines":["s"],"id":972}],[{"start":{"row":9,"column":36},"end":{"row":9,"column":37},"action":"insert","lines":["t"],"id":973}],[{"start":{"row":9,"column":37},"end":{"row":9,"column":38},"action":"insert","lines":["."],"id":974}],[{"start":{"row":9,"column":38},"end":{"row":9,"column":39},"action":"insert","lines":["b"],"id":975}],[{"start":{"row":9,"column":39},"end":{"row":9,"column":40},"action":"insert","lines":["o"],"id":976}],[{"start":{"row":9,"column":40},"end":{"row":9,"column":41},"action":"insert","lines":["t"],"id":977}],[{"start":{"row":9,"column":41},"end":{"row":9,"column":42},"action":"insert","lines":["t"],"id":978}],[{"start":{"row":9,"column":42},"end":{"row":9,"column":43},"action":"insert","lines":["o"],"id":979}],[{"start":{"row":9,"column":43},"end":{"row":9,"column":44},"action":"insert","lines":["m"],"id":980}],[{"start":{"row":9,"column":44},"end":{"row":9,"column":45},"action":"insert","lines":[" "],"id":981}],[{"start":{"row":9,"column":45},"end":{"row":9,"column":46},"action":"insert","lines":["-"],"id":982}],[{"start":{"row":9,"column":46},"end":{"row":9,"column":47},"action":"insert","lines":[" "],"id":983}],[{"start":{"row":9,"column":47},"end":{"row":9,"column":48},"action":"insert","lines":["l"],"id":984}],[{"start":{"row":9,"column":48},"end":{"row":9,"column":49},"action":"insert","lines":["i"],"id":985}],[{"start":{"row":9,"column":49},"end":{"row":9,"column":50},"action":"insert","lines":["s"],"id":986}],[{"start":{"row":9,"column":50},"end":{"row":9,"column":51},"action":"insert","lines":["t"],"id":987}],[{"start":{"row":9,"column":51},"end":{"row":9,"column":52},"action":"insert","lines":["."],"id":988}],[{"start":{"row":9,"column":52},"end":{"row":9,"column":53},"action":"insert","lines":["t"],"id":989}],[{"start":{"row":9,"column":53},"end":{"row":9,"column":54},"action":"insert","lines":["o"],"id":990}],[{"start":{"row":9,"column":54},"end":{"row":9,"column":55},"action":"insert","lines":["p"],"id":991}],[{"start":{"row":9,"column":55},"end":{"row":9,"column":56},"action":"insert","lines":[";"],"id":992}],[{"start":{"row":9,"column":17},"end":{"row":9,"column":32},"action":"remove","lines":[" list.height ||"],"id":993,"ignore":true},{"start":{"row":32,"column":0},"end":{"row":33,"column":0},"action":"insert","lines":[" height: this.viewHeight,",""]},{"start":{"row":48,"column":25},"end":{"row":48,"column":37},"action":"remove","lines":["Math.max(0, "]},{"start":{"row":48,"column":25},"end":{"row":48,"column":47},"action":"insert","lines":["listViewBox.top > -1 ?"]},{"start":{"row":48,"column":93},"end":{"row":48,"column":94},"action":"remove","lines":[")"]},{"start":{"row":48,"column":93},"end":{"row":48,"column":97},"action":"insert","lines":[" : 0"]},{"start":{"row":53,"column":41},"end":{"row":53,"column":45},"action":"insert","lines":[" 1 -"]},{"start":{"row":53,"column":59},"end":{"row":53,"column":63},"action":"remove","lines":[" - 1"]}],[{"start":{"row":9,"column":17},"end":{"row":9,"column":32},"action":"insert","lines":[" list.height ||"],"id":994,"ignore":true},{"start":{"row":32,"column":0},"end":{"row":33,"column":0},"action":"remove","lines":[" height: this.viewHeight,",""]},{"start":{"row":47,"column":25},"end":{"row":47,"column":47},"action":"remove","lines":["listViewBox.top > -1 ?"]},{"start":{"row":47,"column":25},"end":{"row":47,"column":37},"action":"insert","lines":["Math.max(0, "]},{"start":{"row":47,"column":83},"end":{"row":47,"column":87},"action":"remove","lines":[" : 0"]},{"start":{"row":47,"column":83},"end":{"row":47,"column":84},"action":"insert","lines":[")"]},{"start":{"row":52,"column":41},"end":{"row":52,"column":45},"action":"remove","lines":[" 1 -"]},{"start":{"row":52,"column":55},"end":{"row":52,"column":59},"action":"insert","lines":[" - 1"]}]],"mark":58,"position":58},"ace":{"folds":[],"scrolltop":0,"scrollleft":0,"selection":{"start":{"row":9,"column":56},"end":{"row":9,"column":56},"isBackwards":true},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":0},"timestamp":1432572021530,"hash":"02d3b67e3217edeebb223c211a1567b50ffb7e8c"} | ||
{"filter":false,"title":"virtual-renderer.js","tooltip":"/src/utils/virtual-renderer.js","undoManager":{"mark":1,"position":1,"stack":[[{"start":{"row":57,"column":8},"end":{"row":57,"column":11},"action":"insert","lines":["// "],"id":2}],[{"start":{"row":51,"column":4},"end":{"row":51,"column":7},"action":"insert","lines":["// "],"id":3}]]},"ace":{"folds":[],"scrolltop":0,"scrollleft":0,"selection":{"start":{"row":16,"column":0},"end":{"row":16,"column":0},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":0},"timestamp":1432868271000,"hash":"21ebc8867e5f07bc0cc78049227c825056e154c7"} |
@@ -1,1 +0,1 @@ | ||
{"filter":false,"title":"VirtualList.jsx","tooltip":"/src/VirtualList.jsx","undoManager":{"stack":[[{"start":{"row":18,"column":0},"end":{"row":20,"column":0},"action":"remove","lines":[" console.log('documentOFfsetTop', element, element.offsetTop);"," ",""],"id":128}],[{"start":{"row":37,"column":0},"end":{"row":38,"column":0},"action":"remove","lines":[" // how far is the list element from the top of the document?",""],"id":129}],[{"start":{"row":43,"column":0},"end":{"row":45,"column":0},"action":"remove","lines":[" console.log('renderState', renderStats);","",""],"id":130}],[{"start":{"row":49,"column":0},"end":{"row":51,"column":0},"action":"remove","lines":[" console.log(state);","",""],"id":131}],[{"start":{"row":83,"column":0},"end":{"row":85,"column":0},"action":"remove","lines":[" console.log('VirtualList.render');"," ",""],"id":132}],[{"start":{"row":37,"column":0},"end":{"row":38,"column":0},"action":"insert","lines":[" // how far is the list element from the top of the document?",""],"id":133,"ignore":true},{"start":{"row":43,"column":0},"end":{"row":43,"column":8},"action":"remove","lines":[" "]},{"start":{"row":50,"column":0},"end":{"row":52,"column":0},"action":"insert","lines":[" console.log(state);","",""]},{"start":{"row":86,"column":0},"end":{"row":88,"column":0},"action":"insert","lines":[" console.log('VirtualList.render');"," ",""]}],[{"start":{"row":0,"column":0},"end":{"row":98,"column":29},"action":"remove","lines":["var React = require('react');","var VirtualRenderer = require('./utils/virtual-renderer');","","function areArraysEqual(a, b) {"," if (!a || !b) return false;",""," if (a.length != b.length) return false;"," "," for (var i = 0, length = a.length; i < length; i++) {"," if (a[i] != b[i]) return false; "," }"," "," return true;","}","","function documentOffsetTop(element) {"," if (!element) return 0;"," "," return element.offsetTop + documentOffsetTop(element.offsetParent);","}","","var VirtualList = React.createClass({"," // TODO add propTypes"," getVirtualState: function(props) {"," // default values"," var state = {"," items: [],"," bufferStart: 0,"," bufferEnd: 0"," };"," "," if (typeof window === 'undefined') return state;"," "," var items = props.items;",""," if (items.length === 0) return state;"," "," // how far is the list element from the top of the document?"," var offsetTop = this.isMounted() ? documentOffsetTop(this.getDOMNode()) : 0;",""," var renderer = new VirtualRenderer(window.scrollY, window.innerHeight, offsetTop, props.itemHeight, items.length);"," "," var renderStats = renderer.getItems();",""," if (renderStats.itemsInView.length === 0) return state;",""," state.items = items.slice(renderStats.firstItemIndex, renderStats.lastItemIndex + 1);"," state.bufferStart = renderStats.firstItemIndex * props.itemHeight;"," state.bufferEnd = renderStats.itemsAfterView * props.itemHeight;",""," console.log(state);",""," return state;"," },"," getInitialState: function() {"," return this.getVirtualState(this.props);"," },"," shouldComponentUpdate: function(nextProps, nextState) {"," if (this.state.bufferStart !== nextState.bufferStart) return true;"," if (this.state.bufferEnd !== nextState.bufferEnd) return true;"," "," var equal = areArraysEqual(this.state.items, nextState.items);"," "," return !equal;"," },"," componentWillReceiveProps: function(nextProps) {"," var state = this.getVirtualState(nextProps);"," "," this.setState(state);"," },"," componentDidMount: function() {"," var state = this.getVirtualState(this.props);"," "," this.setState(state);"," "," window.addEventListener('scroll', this.onScroll);"," },"," componentWillUnmount: function() {"," window.removeEventListener('scroll', this.onScroll);"," },"," onScroll: function() {"," var state = this.getVirtualState(this.props);"," "," this.setState(state);"," },"," render: function() {"," console.log('VirtualList.render');"," "," return ("," <div>"," <div style={{height: this.state.bufferStart}}></div>"," {this.state.items.map(this.props.renderItem)}"," <div style={{height: this.state.bufferEnd}}></div>"," </div>"," );"," }","});","","module.exports = VirtualList;"],"id":134},{"start":{"row":0,"column":0},"end":{"row":93,"column":29},"action":"insert","lines":["var React = require('react');","var VirtualRenderer = require('./utils/virtual-renderer');","","function areArraysEqual(a, b) {"," if (!a || !b) return false;",""," if (a.length != b.length) return false;"," "," for (var i = 0, length = a.length; i < length; i++) {"," if (a[i] != b[i]) return false; "," }"," "," return true;","}","","function documentOffsetTop(element) {"," if (!element) return 0;"," "," return element.offsetTop + documentOffsetTop(element.offsetParent);","}","","var VirtualList = React.createClass({"," // TODO add propTypes"," getVirtualState: function(props) {"," // default values"," var state = {"," items: [],"," bufferStart: 0,"," bufferEnd: 0"," };"," "," if (typeof window === 'undefined') return state;"," "," var items = props.items;",""," if (items.length === 0) return state;"," "," var offsetTop = this.isMounted() ? documentOffsetTop(this.getDOMNode()) : 0;",""," var renderer = new VirtualRenderer(window.scrollY, window.innerHeight, offsetTop, props.itemHeight, items.length);"," "," var renderStats = renderer.getItems();"," "," if (renderStats.itemsInView.length === 0) return state;",""," state.items = items.slice(renderStats.firstItemIndex, renderStats.lastItemIndex + 1);"," state.bufferStart = renderStats.firstItemIndex * props.itemHeight;"," state.bufferEnd = renderStats.itemsAfterView * props.itemHeight;",""," return state;"," },"," getInitialState: function() {"," return this.getVirtualState(this.props);"," },"," shouldComponentUpdate: function(nextProps, nextState) {"," if (this.state.bufferStart !== nextState.bufferStart) return true;"," if (this.state.bufferEnd !== nextState.bufferEnd) return true;"," "," var equal = areArraysEqual(this.state.items, nextState.items);"," "," return !equal;"," },"," componentWillReceiveProps: function(nextProps) {"," var state = this.getVirtualState(nextProps);"," "," this.setState(state);"," },"," componentDidMount: function() {"," var state = this.getVirtualState(this.props);"," "," this.setState(state);"," "," window.addEventListener('scroll', this.onScroll);"," },"," componentWillUnmount: function() {"," window.removeEventListener('scroll', this.onScroll);"," },"," onScroll: function() {"," var state = this.getVirtualState(this.props);"," "," this.setState(state);"," },"," render: function() {"," return ("," <div>"," <div style={{height: this.state.bufferStart}}></div>"," {this.state.items.map(this.props.renderItem)}"," <div style={{height: this.state.bufferEnd}}></div>"," </div>"," );"," }","});","","module.exports = VirtualList;"]}],[{"start":{"row":37,"column":0},"end":{"row":38,"column":0},"action":"insert","lines":[" // how far is the list element from the top of the document?",""],"id":135,"ignore":true},{"start":{"row":43,"column":0},"end":{"row":43,"column":8},"action":"remove","lines":[" "]},{"start":{"row":50,"column":0},"end":{"row":52,"column":0},"action":"insert","lines":[" console.log(state);","",""]},{"start":{"row":86,"column":0},"end":{"row":88,"column":0},"action":"insert","lines":[" console.log('VirtualList.render');"," ",""]}],[{"start":{"row":37,"column":0},"end":{"row":38,"column":0},"action":"remove","lines":[" // how far is the list element from the top of the document?",""],"id":136,"ignore":true},{"start":{"row":42,"column":0},"end":{"row":42,"column":8},"action":"insert","lines":[" "]},{"start":{"row":49,"column":0},"end":{"row":51,"column":0},"action":"remove","lines":[" console.log(state);","",""]},{"start":{"row":83,"column":0},"end":{"row":85,"column":0},"action":"remove","lines":[" console.log('VirtualList.render');"," ",""]}]],"mark":8,"position":8},"ace":{"folds":[],"scrolltop":300,"scrollleft":0,"selection":{"start":{"row":30,"column":8},"end":{"row":30,"column":8},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":0},"timestamp":1432524768000,"hash":"25afe659251e20de30641c387ef8b588135b3779"} | ||
{"filter":false,"title":"VirtualList.jsx","tooltip":"/src/VirtualList.jsx","undoManager":{"mark":100,"position":100,"stack":[[{"start":{"row":172,"column":67},"end":{"row":172,"column":68},"action":"remove","lines":["."],"id":3674}],[{"start":{"row":173,"column":55},"end":{"row":173,"column":59},"action":"remove","lines":["this"],"id":3675}],[{"start":{"row":173,"column":55},"end":{"row":173,"column":56},"action":"remove","lines":["."],"id":3676}],[{"start":{"row":176,"column":0},"end":{"row":177,"column":0},"action":"remove","lines":[" // var itemsAfterView = this.itemCount - lastItemIndex - 1;",""],"id":3677}],[{"start":{"row":181,"column":0},"end":{"row":182,"column":0},"action":"remove","lines":[" // itemsAfterView: itemsAfterView",""],"id":3679}],[{"start":{"row":3,"column":0},"end":{"row":23,"column":1},"action":"remove","lines":["function areArraysEqual(a, b) {"," if (!a || !b) return false;",""," if (a.length != b.length) return false;"," "," for (var i = 0, length = a.length; i < length; i++) {"," if (a[i] != b[i]) return false; "," }"," "," return true;","}","","function topDifference(element, container) {"," return topFromWindow(element) - topFromWindow(container);","}","","function topFromWindow(element) {"," if (!element || element === window) return 0;"," "," return element.offsetTop + topFromWindow(element.offsetParent);","}"],"id":3680}],[{"start":{"row":1,"column":4},"end":{"row":1,"column":19},"action":"remove","lines":["VirtualRenderer"],"id":3681},{"start":{"row":1,"column":4},"end":{"row":1,"column":5},"action":"insert","lines":["u"]}],[{"start":{"row":1,"column":5},"end":{"row":1,"column":6},"action":"insert","lines":["t"],"id":3682}],[{"start":{"row":1,"column":6},"end":{"row":1,"column":7},"action":"insert","lines":["i"],"id":3683}],[{"start":{"row":1,"column":7},"end":{"row":1,"column":8},"action":"insert","lines":["l"],"id":3684}],[{"start":{"row":1,"column":8},"end":{"row":1,"column":9},"action":"insert","lines":["s"],"id":3685}],[{"start":{"row":1,"column":28},"end":{"row":1,"column":45},"action":"remove","lines":["/virtual-renderer"],"id":3686}],[{"start":{"row":44,"column":24},"end":{"row":44,"column":29},"action":"insert","lines":["utils"],"id":3687}],[{"start":{"row":44,"column":29},"end":{"row":44,"column":30},"action":"insert","lines":["."],"id":3688}],[{"start":{"row":69,"column":20},"end":{"row":69,"column":25},"action":"insert","lines":["utils"],"id":3689}],[{"start":{"row":69,"column":25},"end":{"row":69,"column":26},"action":"insert","lines":["."],"id":3690}],[{"start":{"row":166,"column":0},"end":{"row":168,"column":0},"action":"remove","lines":["module.exports = VirtualRenderer;","",""],"id":3691}],[{"start":{"row":150,"column":22},"end":{"row":150,"column":37},"action":"remove","lines":["VirtualRenderer"],"id":3692},{"start":{"row":150,"column":22},"end":{"row":150,"column":23},"action":"insert","lines":["V"]}],[{"start":{"row":150,"column":23},"end":{"row":150,"column":24},"action":"insert","lines":["i"],"id":3693}],[{"start":{"row":150,"column":24},"end":{"row":150,"column":25},"action":"insert","lines":["r"],"id":3694}],[{"start":{"row":150,"column":25},"end":{"row":150,"column":26},"action":"insert","lines":["t"],"id":3695}],[{"start":{"row":150,"column":26},"end":{"row":150,"column":27},"action":"insert","lines":["u"],"id":3696}],[{"start":{"row":150,"column":27},"end":{"row":150,"column":28},"action":"insert","lines":["a"],"id":3697}],[{"start":{"row":150,"column":28},"end":{"row":150,"column":29},"action":"insert","lines":["l"],"id":3698}],[{"start":{"row":150,"column":29},"end":{"row":150,"column":30},"action":"insert","lines":["L"],"id":3699}],[{"start":{"row":150,"column":30},"end":{"row":150,"column":31},"action":"insert","lines":["i"],"id":3700}],[{"start":{"row":150,"column":31},"end":{"row":150,"column":32},"action":"insert","lines":["s"],"id":3701}],[{"start":{"row":150,"column":32},"end":{"row":150,"column":33},"action":"insert","lines":["t"],"id":3702}],[{"start":{"row":2,"column":0},"end":{"row":3,"column":0},"action":"remove","lines":["",""],"id":3703}],[{"start":{"row":2,"column":0},"end":{"row":3,"column":0},"action":"remove","lines":["",""],"id":3704}],[{"start":{"row":103,"column":0},"end":{"row":111,"column":0},"action":"remove","lines":["function VirtualRenderer(viewTop, viewHeight, listTop, itemHeight, itemCount) {"," this.viewTop = viewTop;"," this.viewHeight = viewHeight;"," this.listTop = listTop;"," this.itemHeight = itemHeight;"," this.itemCount = itemCount;","}","",""],"id":3705}],[{"start":{"row":13,"column":23},"end":{"row":13,"column":24},"action":"insert","lines":["t"],"id":3706}],[{"start":{"row":13,"column":24},"end":{"row":13,"column":25},"action":"insert","lines":["y"],"id":3707}],[{"start":{"row":13,"column":25},"end":{"row":13,"column":26},"action":"insert","lines":["p"],"id":3708}],[{"start":{"row":13,"column":26},"end":{"row":13,"column":27},"action":"insert","lines":["e"],"id":3709}],[{"start":{"row":13,"column":27},"end":{"row":13,"column":28},"action":"insert","lines":["o"],"id":3710}],[{"start":{"row":13,"column":28},"end":{"row":13,"column":29},"action":"insert","lines":["f"],"id":3711}],[{"start":{"row":13,"column":29},"end":{"row":13,"column":30},"action":"insert","lines":[" "],"id":3712}],[{"start":{"row":13,"column":36},"end":{"row":13,"column":37},"action":"insert","lines":[" "],"id":3713}],[{"start":{"row":13,"column":37},"end":{"row":13,"column":38},"action":"insert","lines":["!"],"id":3714}],[{"start":{"row":13,"column":38},"end":{"row":13,"column":39},"action":"insert","lines":["="],"id":3715}],[{"start":{"row":13,"column":39},"end":{"row":13,"column":40},"action":"insert","lines":["="],"id":3716}],[{"start":{"row":13,"column":40},"end":{"row":13,"column":41},"action":"insert","lines":[" "],"id":3717}],[{"start":{"row":13,"column":41},"end":{"row":13,"column":43},"action":"insert","lines":["''"],"id":3718}],[{"start":{"row":13,"column":42},"end":{"row":13,"column":43},"action":"insert","lines":["u"],"id":3719}],[{"start":{"row":13,"column":43},"end":{"row":13,"column":44},"action":"insert","lines":["n"],"id":3720}],[{"start":{"row":13,"column":44},"end":{"row":13,"column":45},"action":"insert","lines":["d"],"id":3721}],[{"start":{"row":13,"column":45},"end":{"row":13,"column":46},"action":"insert","lines":["e"],"id":3722}],[{"start":{"row":13,"column":46},"end":{"row":13,"column":47},"action":"insert","lines":["f"],"id":3723}],[{"start":{"row":13,"column":47},"end":{"row":13,"column":48},"action":"insert","lines":["i"],"id":3724}],[{"start":{"row":13,"column":48},"end":{"row":13,"column":49},"action":"insert","lines":["n"],"id":3725}],[{"start":{"row":13,"column":49},"end":{"row":13,"column":50},"action":"insert","lines":["e"],"id":3726}],[{"start":{"row":13,"column":50},"end":{"row":13,"column":51},"action":"insert","lines":["d"],"id":3727}],[{"start":{"row":13,"column":52},"end":{"row":13,"column":53},"action":"insert","lines":[" "],"id":3728}],[{"start":{"row":13,"column":53},"end":{"row":13,"column":54},"action":"insert","lines":["?"],"id":3729}],[{"start":{"row":13,"column":54},"end":{"row":13,"column":55},"action":"insert","lines":[" "],"id":3730}],[{"start":{"row":13,"column":55},"end":{"row":13,"column":56},"action":"insert","lines":["w"],"id":3731}],[{"start":{"row":13,"column":56},"end":{"row":13,"column":57},"action":"insert","lines":["i"],"id":3732}],[{"start":{"row":13,"column":57},"end":{"row":13,"column":58},"action":"insert","lines":["n"],"id":3733}],[{"start":{"row":13,"column":58},"end":{"row":13,"column":59},"action":"insert","lines":["d"],"id":3734}],[{"start":{"row":13,"column":59},"end":{"row":13,"column":60},"action":"insert","lines":["o"],"id":3735}],[{"start":{"row":13,"column":60},"end":{"row":13,"column":61},"action":"insert","lines":["w"],"id":3736}],[{"start":{"row":13,"column":61},"end":{"row":13,"column":62},"action":"insert","lines":[" "],"id":3737}],[{"start":{"row":13,"column":62},"end":{"row":13,"column":63},"action":"insert","lines":[":"],"id":3738}],[{"start":{"row":13,"column":63},"end":{"row":13,"column":64},"action":"insert","lines":[" "],"id":3739}],[{"start":{"row":13,"column":64},"end":{"row":13,"column":65},"action":"insert","lines":["u"],"id":3740}],[{"start":{"row":13,"column":65},"end":{"row":13,"column":66},"action":"insert","lines":["n"],"id":3741}],[{"start":{"row":13,"column":66},"end":{"row":13,"column":67},"action":"insert","lines":["d"],"id":3742}],[{"start":{"row":13,"column":67},"end":{"row":13,"column":68},"action":"insert","lines":["e"],"id":3743}],[{"start":{"row":13,"column":68},"end":{"row":13,"column":69},"action":"insert","lines":["f"],"id":3744}],[{"start":{"row":13,"column":69},"end":{"row":13,"column":70},"action":"insert","lines":["i"],"id":3745}],[{"start":{"row":13,"column":70},"end":{"row":13,"column":71},"action":"insert","lines":["n"],"id":3746}],[{"start":{"row":13,"column":71},"end":{"row":13,"column":72},"action":"insert","lines":["e"],"id":3747}],[{"start":{"row":13,"column":72},"end":{"row":13,"column":73},"action":"insert","lines":["d"],"id":3748}],[{"start":{"row":46,"column":27},"end":{"row":46,"column":42},"action":"remove","lines":["VirtualRenderer"],"id":3749},{"start":{"row":46,"column":27},"end":{"row":46,"column":28},"action":"insert","lines":["V"]}],[{"start":{"row":46,"column":28},"end":{"row":46,"column":29},"action":"insert","lines":["i"],"id":3750}],[{"start":{"row":46,"column":29},"end":{"row":46,"column":30},"action":"insert","lines":["r"],"id":3751}],[{"start":{"row":46,"column":30},"end":{"row":46,"column":31},"action":"insert","lines":["t"],"id":3752}],[{"start":{"row":46,"column":31},"end":{"row":46,"column":32},"action":"insert","lines":["u"],"id":3753}],[{"start":{"row":46,"column":32},"end":{"row":46,"column":33},"action":"insert","lines":["a"],"id":3754}],[{"start":{"row":46,"column":33},"end":{"row":46,"column":34},"action":"insert","lines":["l"],"id":3755}],[{"start":{"row":46,"column":34},"end":{"row":46,"column":35},"action":"insert","lines":["L"],"id":3756}],[{"start":{"row":46,"column":35},"end":{"row":46,"column":36},"action":"insert","lines":["i"],"id":3757}],[{"start":{"row":46,"column":36},"end":{"row":46,"column":37},"action":"insert","lines":["s"],"id":3758}],[{"start":{"row":46,"column":37},"end":{"row":46,"column":38},"action":"insert","lines":["t"],"id":3759}],[{"start":{"row":48,"column":26},"end":{"row":48,"column":34},"action":"remove","lines":["renderer"],"id":3760},{"start":{"row":48,"column":26},"end":{"row":48,"column":27},"action":"insert","lines":["V"]}],[{"start":{"row":48,"column":27},"end":{"row":48,"column":28},"action":"insert","lines":["i"],"id":3761}],[{"start":{"row":48,"column":28},"end":{"row":48,"column":29},"action":"insert","lines":["r"],"id":3762}],[{"start":{"row":48,"column":29},"end":{"row":48,"column":30},"action":"insert","lines":["t"],"id":3763}],[{"start":{"row":48,"column":30},"end":{"row":48,"column":31},"action":"insert","lines":["u"],"id":3764}],[{"start":{"row":48,"column":31},"end":{"row":48,"column":32},"action":"insert","lines":["a"],"id":3765}],[{"start":{"row":48,"column":32},"end":{"row":48,"column":33},"action":"insert","lines":["l"],"id":3766}],[{"start":{"row":48,"column":33},"end":{"row":48,"column":34},"action":"insert","lines":["L"],"id":3767}],[{"start":{"row":48,"column":34},"end":{"row":48,"column":35},"action":"insert","lines":["i"],"id":3768}],[{"start":{"row":48,"column":35},"end":{"row":48,"column":36},"action":"insert","lines":["s"],"id":3769}],[{"start":{"row":48,"column":36},"end":{"row":48,"column":37},"action":"insert","lines":["t"],"id":3770}],[{"start":{"row":46,"column":39},"end":{"row":46,"column":101},"action":"remove","lines":["viewTop, viewHeight, offsetTop, props.itemHeight, items.length"],"id":3771}],[{"start":{"row":48,"column":47},"end":{"row":48,"column":109},"action":"insert","lines":["viewTop, viewHeight, offsetTop, props.itemHeight, items.length"],"id":3772}],[{"start":{"row":46,"column":0},"end":{"row":48,"column":0},"action":"remove","lines":[" var renderer = new VirtualList();","",""],"id":3773}],[{"start":{"row":53,"column":0},"end":{"row":54,"column":0},"action":"remove","lines":[" // state.bufferEnd = renderStats.itemsAfterView * props.itemHeight;",""],"id":3774}],[{"start":{"row":22,"column":0},"end":{"row":23,"column":0},"action":"remove","lines":[" // bufferEnd: 0,",""],"id":3775}]]},"ace":{"folds":[],"scrolltop":1440,"scrollleft":0,"selection":{"start":{"row":137,"column":4},"end":{"row":137,"column":4},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":{"row":119,"state":"start","mode":"ace/mode/jsx"}},"timestamp":1432950989000,"hash":"f238caa33cbedb7a1bf0c6e6000796cdfa3444af"} |
@@ -1,1 +0,1 @@ | ||
{"filter":false,"title":"virtual-renderer.js","tooltip":"/test/virtual-renderer.js","undoManager":{"stack":[],"mark":-1,"position":-1},"ace":{"folds":[],"scrolltop":0,"scrollleft":0,"selection":{"start":{"row":19,"column":8},"end":{"row":19,"column":8},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":0},"timestamp":1432522423224,"hash":"7dd3c0aab34804d68505e094b280db863471eec6"} | ||
{"filter":false,"title":"virtual-renderer.js","tooltip":"/test/virtual-renderer.js","undoManager":{"mark":2,"position":2,"stack":[[{"start":{"row":200,"column":0},"end":{"row":201,"column":0},"action":"remove","lines":[" expect(result.itemsAfterView).toBe(15);",""],"id":5}],[{"start":{"row":213,"column":0},"end":{"row":214,"column":0},"action":"remove","lines":[" expect(result.itemsAfterView).toBe(0);",""],"id":6}],[{"start":{"row":263,"column":0},"end":{"row":264,"column":0},"action":"remove","lines":[" expect(result.itemsAfterView).toBe(0);",""],"id":7}]]},"ace":{"folds":[],"scrolltop":2431.5,"scrollleft":0,"selection":{"start":{"row":224,"column":3},"end":{"row":283,"column":3},"isBackwards":true},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":{"row":29,"state":"start","mode":"ace/mode/javascript"}},"timestamp":1432939238639,"hash":"206df8a2baf83c102c6badb41e4eaed374cf35ee"} |
var React = require('react'); | ||
var VirtualRenderer = require('./utils/virtual-renderer'); | ||
var utils = require('./utils'); | ||
function areArraysEqual(a, b) { | ||
if (!a || !b) return false; | ||
if (a.length != b.length) return false; | ||
for (var i = 0, length = a.length; i < length; i++) { | ||
if (a[i] != b[i]) return false; | ||
} | ||
return true; | ||
} | ||
function documentOffsetTop(element) { | ||
if (!element) return 0; | ||
return element.offsetTop + documentOffsetTop(element.offsetParent); | ||
} | ||
var VirtualList = React.createClass({displayName: "VirtualList", | ||
// TODO add propTypes | ||
propTypes: { | ||
items: React.PropTypes.array.isRequired, | ||
itemHeight: React.PropTypes.number.isRequired, | ||
renderItem: React.PropTypes.func.isRequired, | ||
container: React.PropTypes.object.isRequired, | ||
tagName: React.PropTypes.string.isRequired | ||
}, | ||
getDefaultProps: function() { | ||
return { | ||
container: typeof window !== 'undefined' ? window : undefined, | ||
tagName: 'div' | ||
}; | ||
}, | ||
getVirtualState: function(props) { | ||
@@ -29,17 +23,28 @@ // default values | ||
bufferStart: 0, | ||
bufferEnd: 0 | ||
height: 0 | ||
}; | ||
if (typeof window === 'undefined') return state; | ||
// early return if nothing to render | ||
if (typeof props.container === 'undefined' || props.items.length === 0 || props.itemHeight <= 0 || !this.isMounted()) return state; | ||
var items = props.items; | ||
state.height = props.items.length * props.itemHeight; | ||
if (items.length === 0) return state; | ||
var container = props.container; | ||
var viewHeight = typeof container.innerHeight !== 'undefined' ? container.innerHeight : container.clientHeight; | ||
var offsetTop = this.isMounted() ? documentOffsetTop(this.getDOMNode()) : 0; | ||
// no space to render | ||
if (viewHeight <= 0) return state; | ||
var list = this.getDOMNode(); | ||
var renderer = new VirtualRenderer(window.scrollY, window.innerHeight, offsetTop, props.itemHeight, items.length); | ||
var offsetTop = utils.topDifference(list, container); | ||
var viewTop = typeof container.scrollY !== 'undefined' ? container.scrollY : container.scrollTop; | ||
var renderStats = VirtualList.getItems(viewTop, viewHeight, offsetTop, props.itemHeight, items.length); | ||
var renderStats = renderer.getItems(); | ||
// no items to render | ||
if (renderStats.itemsInView.length === 0) return state; | ||
@@ -49,4 +54,3 @@ | ||
state.bufferStart = renderStats.firstItemIndex * props.itemHeight; | ||
state.bufferEnd = renderStats.itemsAfterView * props.itemHeight; | ||
return state; | ||
@@ -59,5 +63,6 @@ }, | ||
if (this.state.bufferStart !== nextState.bufferStart) return true; | ||
if (this.state.bufferEnd !== nextState.bufferEnd) return true; | ||
// if (this.state.bufferEnd !== nextState.bufferEnd) return true; | ||
if (this.state.height !== nextState.height) return true; | ||
var equal = areArraysEqual(this.state.items, nextState.items); | ||
var equal = utils.areArraysEqual(this.state.items, nextState.items); | ||
@@ -68,2 +73,5 @@ return !equal; | ||
var state = this.getVirtualState(nextProps); | ||
this.props.container.removeEventListener('scroll', this.onScroll); | ||
nextProps.container.addEventListener('scroll', this.onScroll); | ||
@@ -77,6 +85,6 @@ this.setState(state); | ||
window.addEventListener('scroll', this.onScroll); | ||
this.props.container.addEventListener('scroll', this.onScroll); | ||
}, | ||
componentWillUnmount: function() { | ||
window.removeEventListener('scroll', this.onScroll); | ||
this.props.container.removeEventListener('scroll', this.onScroll); | ||
}, | ||
@@ -90,6 +98,4 @@ onScroll: function() { | ||
return ( | ||
React.createElement("div", null, | ||
React.createElement("div", {style: {height: this.state.bufferStart}}), | ||
this.state.items.map(this.props.renderItem), | ||
React.createElement("div", {style: {height: this.state.bufferEnd}}) | ||
React.createElement(this.props.tagName, React.__spread({}, this.props, {style: {height: this.state.height, paddingTop: this.state.bufferStart}}), | ||
this.state.items.map(this.props.renderItem) | ||
) | ||
@@ -100,2 +106,55 @@ ); | ||
VirtualList.getBox = function(view, list) { | ||
list.height = list.height || list.bottom - list.top; | ||
return { | ||
top: Math.max(0, Math.min(view.top - list.top)), | ||
bottom: Math.max(0, Math.min(list.height, view.bottom - list.top)) | ||
}; | ||
}; | ||
VirtualList.getItems = function(viewTop, viewHeight, listTop, itemHeight, itemCount) { | ||
if (itemCount === 0 || itemHeight === 0) return { | ||
itemsInView: 0 | ||
}; | ||
var listHeight = itemHeight * itemCount; | ||
var listBox = { | ||
top: listTop, | ||
height: listHeight, | ||
bottom: listTop + listHeight | ||
}; | ||
var viewBox = { | ||
top: viewTop, | ||
bottom: viewTop + viewHeight | ||
}; | ||
// list is below viewport | ||
if (viewBox.bottom < listBox.top) return { | ||
itemsInView: 0 | ||
}; | ||
// list is above viewport | ||
if (viewBox.top > listBox.bottom) return { | ||
itemsInView: 0 | ||
}; | ||
var listViewBox = VirtualList.getBox(viewBox, listBox); | ||
var firstItemIndex = Math.max(0, Math.floor(listViewBox.top / itemHeight)); | ||
var lastItemIndex = Math.ceil(listViewBox.bottom / itemHeight) - 1; | ||
var itemsInView = lastItemIndex - firstItemIndex + 1; | ||
var result = { | ||
firstItemIndex: firstItemIndex, | ||
lastItemIndex: lastItemIndex, | ||
itemsInView: itemsInView, | ||
}; | ||
return result; | ||
}; | ||
module.exports = VirtualList; |
{ | ||
"name": "react-virtual-list", | ||
"version": "1.0.0", | ||
"version": "1.2.0", | ||
"description": "Super simple virtualized list React component", | ||
@@ -5,0 +5,0 @@ "main": "dist/virtual-list.js", |
# react-virtual-list | ||
Super simple virtualized list React component | ||
Super simple virtualized list [React](https://github.com/facebook/react) component | ||
@@ -33,4 +33,8 @@ [Check out the demo here](http://developerdizzle.github.io/react-virtual-list) | ||
* `items` the full array of list items. Only the visible subset of these will be rendered. | ||
* `renderItem` a function to render a single item, passed as argument `item` | ||
* `renderItem` a function to render a single item, passed as argument `item`. Must return a single React element (`React.createElement(...)`) | ||
* `itemHeight` the height in pixels of a single item. **You must have a CSS rule that sets the height of each list item to this value.** | ||
* `container` the scrollable element that contains the list. Defaults to `window`. Use this if you have a list inside an element with `overflow: scroll`. | ||
* `tagName` the tagName for the root element that surrounds the items rendered by renderItem. Defaults to `div`. Use this if you want to render a list with `ul` and `li`, or any other elements. | ||
Any other properties set on `VirtualList`, such as `className`, will be reflected on the component's root element. | ||
@@ -40,1 +44,5 @@ #### Example Usage | ||
Check out [https://github.com/developerdizzle/react-virtual-list/blob/gh-pages/App.jsx](https://github.com/developerdizzle/react-virtual-list/blob/gh-pages/App.jsx) for the example used in the demo. | ||
## Tests | ||
Use `npm test` to run the tests using [jasmine-node](https://github.com/mhevery/jasmine-node). Currently only the calculations inside `./src/utils/virtual-renderer.js` are tested. Hoping to add some DOM tests as well. |
var React = require('react'); | ||
var VirtualRenderer = require('./utils/virtual-renderer'); | ||
var utils = require('./utils'); | ||
function areArraysEqual(a, b) { | ||
if (!a || !b) return false; | ||
if (a.length != b.length) return false; | ||
for (var i = 0, length = a.length; i < length; i++) { | ||
if (a[i] != b[i]) return false; | ||
} | ||
return true; | ||
} | ||
function documentOffsetTop(element) { | ||
if (!element) return 0; | ||
return element.offsetTop + documentOffsetTop(element.offsetParent); | ||
} | ||
var VirtualList = React.createClass({ | ||
// TODO add propTypes | ||
propTypes: { | ||
items: React.PropTypes.array.isRequired, | ||
itemHeight: React.PropTypes.number.isRequired, | ||
renderItem: React.PropTypes.func.isRequired, | ||
container: React.PropTypes.object.isRequired, | ||
tagName: React.PropTypes.string.isRequired | ||
}, | ||
getDefaultProps: function() { | ||
return { | ||
container: typeof window !== 'undefined' ? window : undefined, | ||
tagName: 'div' | ||
}; | ||
}, | ||
getVirtualState: function(props) { | ||
@@ -29,17 +23,28 @@ // default values | ||
bufferStart: 0, | ||
bufferEnd: 0 | ||
height: 0 | ||
}; | ||
if (typeof window === 'undefined') return state; | ||
// early return if nothing to render | ||
if (typeof props.container === 'undefined' || props.items.length === 0 || props.itemHeight <= 0 || !this.isMounted()) return state; | ||
var items = props.items; | ||
state.height = props.items.length * props.itemHeight; | ||
if (items.length === 0) return state; | ||
var container = props.container; | ||
var viewHeight = typeof container.innerHeight !== 'undefined' ? container.innerHeight : container.clientHeight; | ||
var offsetTop = this.isMounted() ? documentOffsetTop(this.getDOMNode()) : 0; | ||
// no space to render | ||
if (viewHeight <= 0) return state; | ||
var list = this.getDOMNode(); | ||
var renderer = new VirtualRenderer(window.scrollY, window.innerHeight, offsetTop, props.itemHeight, items.length); | ||
var offsetTop = utils.topDifference(list, container); | ||
var viewTop = typeof container.scrollY !== 'undefined' ? container.scrollY : container.scrollTop; | ||
var renderStats = VirtualList.getItems(viewTop, viewHeight, offsetTop, props.itemHeight, items.length); | ||
var renderStats = renderer.getItems(); | ||
// no items to render | ||
if (renderStats.itemsInView.length === 0) return state; | ||
@@ -49,4 +54,3 @@ | ||
state.bufferStart = renderStats.firstItemIndex * props.itemHeight; | ||
state.bufferEnd = renderStats.itemsAfterView * props.itemHeight; | ||
return state; | ||
@@ -59,5 +63,6 @@ }, | ||
if (this.state.bufferStart !== nextState.bufferStart) return true; | ||
if (this.state.bufferEnd !== nextState.bufferEnd) return true; | ||
// if (this.state.bufferEnd !== nextState.bufferEnd) return true; | ||
if (this.state.height !== nextState.height) return true; | ||
var equal = areArraysEqual(this.state.items, nextState.items); | ||
var equal = utils.areArraysEqual(this.state.items, nextState.items); | ||
@@ -68,2 +73,5 @@ return !equal; | ||
var state = this.getVirtualState(nextProps); | ||
this.props.container.removeEventListener('scroll', this.onScroll); | ||
nextProps.container.addEventListener('scroll', this.onScroll); | ||
@@ -77,6 +85,6 @@ this.setState(state); | ||
window.addEventListener('scroll', this.onScroll); | ||
this.props.container.addEventListener('scroll', this.onScroll); | ||
}, | ||
componentWillUnmount: function() { | ||
window.removeEventListener('scroll', this.onScroll); | ||
this.props.container.removeEventListener('scroll', this.onScroll); | ||
}, | ||
@@ -90,7 +98,5 @@ onScroll: function() { | ||
return ( | ||
<div> | ||
<div style={{height: this.state.bufferStart}}></div> | ||
<this.props.tagName {...this.props} style={{height: this.state.height, paddingTop: this.state.bufferStart }} > | ||
{this.state.items.map(this.props.renderItem)} | ||
<div style={{height: this.state.bufferEnd}}></div> | ||
</div> | ||
</this.props.tagName> | ||
); | ||
@@ -100,2 +106,55 @@ } | ||
VirtualList.getBox = function(view, list) { | ||
list.height = list.height || list.bottom - list.top; | ||
return { | ||
top: Math.max(0, Math.min(view.top - list.top)), | ||
bottom: Math.max(0, Math.min(list.height, view.bottom - list.top)) | ||
}; | ||
}; | ||
VirtualList.getItems = function(viewTop, viewHeight, listTop, itemHeight, itemCount) { | ||
if (itemCount === 0 || itemHeight === 0) return { | ||
itemsInView: 0 | ||
}; | ||
var listHeight = itemHeight * itemCount; | ||
var listBox = { | ||
top: listTop, | ||
height: listHeight, | ||
bottom: listTop + listHeight | ||
}; | ||
var viewBox = { | ||
top: viewTop, | ||
bottom: viewTop + viewHeight | ||
}; | ||
// list is below viewport | ||
if (viewBox.bottom < listBox.top) return { | ||
itemsInView: 0 | ||
}; | ||
// list is above viewport | ||
if (viewBox.top > listBox.bottom) return { | ||
itemsInView: 0 | ||
}; | ||
var listViewBox = VirtualList.getBox(viewBox, listBox); | ||
var firstItemIndex = Math.max(0, Math.floor(listViewBox.top / itemHeight)); | ||
var lastItemIndex = Math.ceil(listViewBox.bottom / itemHeight) - 1; | ||
var itemsInView = lastItemIndex - firstItemIndex + 1; | ||
var result = { | ||
firstItemIndex: firstItemIndex, | ||
lastItemIndex: lastItemIndex, | ||
itemsInView: itemsInView, | ||
}; | ||
return result; | ||
}; | ||
module.exports = VirtualList; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
193550
34
532
47
1