pixuireactcomponents 1.2.0 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -6
- package/package.json +9 -66
- package/tsconfig.json +27 -13
- package/{src/pixUIReactComponents/ui → ui}/components/slapface/Slapface.tsx +17 -17
- package/ui/sample/Slapface/SlapfaceDemo.tsx +30 -0
- package/.eslintignore +0 -7
- package/.eslintrc.js +0 -48
- package/.pixiderc/apps.json +0 -12
- package/.pixiderc/devel-config.meta.json +0 -23
- package/.pixiderc/postinstall.js +0 -17
- package/.pixiderc/util.js +0 -136
- package/.pixiderc/webpack.js +0 -180
- package/faas/helloworld.js +0 -8
- package/gen/pbo/pandora_pb.d.ts +0 -1179
- package/gen/pbo/pandora_pb.js +0 -10475
- package/gen/pbo/pandora_pb_service.d.ts +0 -1317
- package/gen/pbo/pandora_pb_service.js +0 -2307
- package/gen/pbo/test_pb.d.ts +0 -99
- package/gen/pbo/test_pb.js +0 -889
- package/gen/pbo/test_pb_service.d.ts +0 -82
- package/gen/pbo/test_pb_service.js +0 -117
- package/lib/assets/border.png +0 -0
- package/lib/assets/check.html +0 -54
- package/lib/assets/pixui.png +0 -0
- package/lib/assets/preact.png +0 -0
- package/lib/check/main.less +0 -63
- package/lib/check/main.tsx +0 -42
- package/lib/check/tool.js +0 -3
- package/lib/check/util.tsx +0 -107
- package/lib/dom.ts +0 -16
- package/lib/ext.d.ts +0 -95
- package/lib/grpc-web/dist/ChunkParser.js +0 -115
- package/lib/grpc-web/dist/ChunkParser.js.map +0 -1
- package/lib/grpc-web/dist/Code.js +0 -58
- package/lib/grpc-web/dist/Code.js.map +0 -1
- package/lib/grpc-web/dist/client.js +0 -299
- package/lib/grpc-web/dist/client.js.map +0 -1
- package/lib/grpc-web/dist/debug.js +0 -16
- package/lib/grpc-web/dist/debug.js.map +0 -1
- package/lib/grpc-web/dist/detach.js +0 -7
- package/lib/grpc-web/dist/detach.js.map +0 -1
- package/lib/grpc-web/dist/index.js +0 -29
- package/lib/grpc-web/dist/index.js.map +0 -1
- package/lib/grpc-web/dist/invoke.js +0 -32
- package/lib/grpc-web/dist/invoke.js.map +0 -1
- package/lib/grpc-web/dist/message.js +0 -3
- package/lib/grpc-web/dist/message.js.map +0 -1
- package/lib/grpc-web/dist/metadata.js +0 -5
- package/lib/grpc-web/dist/metadata.js.map +0 -1
- package/lib/grpc-web/dist/service.js +0 -3
- package/lib/grpc-web/dist/service.js.map +0 -1
- package/lib/grpc-web/dist/transports/Transport.js +0 -13
- package/lib/grpc-web/dist/transports/Transport.js.map +0 -1
- package/lib/grpc-web/dist/transports/http/fetch.js +0 -112
- package/lib/grpc-web/dist/transports/http/fetch.js.map +0 -1
- package/lib/grpc-web/dist/transports/http/http.js +0 -15
- package/lib/grpc-web/dist/transports/http/http.js.map +0 -1
- package/lib/grpc-web/dist/transports/http/xhr.js +0 -127
- package/lib/grpc-web/dist/transports/http/xhr.js.map +0 -1
- package/lib/grpc-web/dist/transports/http/xhrUtil.js +0 -37
- package/lib/grpc-web/dist/transports/http/xhrUtil.js.map +0 -1
- package/lib/grpc-web/dist/transports/websocket/websocket.js +0 -95
- package/lib/grpc-web/dist/transports/websocket/websocket.js.map +0 -1
- package/lib/grpc-web/dist/typings/ChunkParser.d.ts +0 -17
- package/lib/grpc-web/dist/typings/Code.d.ts +0 -20
- package/lib/grpc-web/dist/typings/client.d.ts +0 -22
- package/lib/grpc-web/dist/typings/debug.d.ts +0 -1
- package/lib/grpc-web/dist/typings/detach.d.ts +0 -1
- package/lib/grpc-web/dist/typings/index.d.ts +0 -60
- package/lib/grpc-web/dist/typings/invoke.d.ts +0 -17
- package/lib/grpc-web/dist/typings/message.d.ts +0 -8
- package/lib/grpc-web/dist/typings/metadata.d.ts +0 -2
- package/lib/grpc-web/dist/typings/service.d.ts +0 -16
- package/lib/grpc-web/dist/typings/transports/Transport.d.ts +0 -22
- package/lib/grpc-web/dist/typings/transports/http/fetch.d.ts +0 -6
- package/lib/grpc-web/dist/typings/transports/http/http.d.ts +0 -5
- package/lib/grpc-web/dist/typings/transports/http/xhr.d.ts +0 -27
- package/lib/grpc-web/dist/typings/transports/http/xhrUtil.d.ts +0 -3
- package/lib/grpc-web/dist/typings/transports/websocket/websocket.d.ts +0 -2
- package/lib/grpc-web/dist/typings/unary.d.ts +0 -20
- package/lib/grpc-web/dist/typings/util.d.ts +0 -2
- package/lib/grpc-web/dist/unary.js +0 -44
- package/lib/grpc-web/dist/unary.js.map +0 -1
- package/lib/grpc-web/dist/util.js +0 -11
- package/lib/grpc-web/dist/util.js.map +0 -1
- package/lib/grpcTransport/PixHttp2Transport.ts +0 -104
- package/lib/grpcTransport/PixLuaTransport.ts +0 -80
- package/lib/pi_component/tinyList/tinyList.js +0 -573
- package/lib/pi_component/tinyList/tinyList.tsx +0 -586
- package/lib/preact/compat/src/Children.js +0 -26
- package/lib/preact/compat/src/PureComponent.js +0 -19
- package/lib/preact/compat/src/events.js +0 -36
- package/lib/preact/compat/src/forwardRef.js +0 -29
- package/lib/preact/compat/src/index.d.ts +0 -121
- package/lib/preact/compat/src/index.js +0 -159
- package/lib/preact/compat/src/internal.d.ts +0 -45
- package/lib/preact/compat/src/memo.js +0 -34
- package/lib/preact/compat/src/portals.js +0 -85
- package/lib/preact/compat/src/render.js +0 -166
- package/lib/preact/compat/src/suspense-list.d.ts +0 -14
- package/lib/preact/compat/src/suspense-list.js +0 -127
- package/lib/preact/compat/src/suspense.d.ts +0 -15
- package/lib/preact/compat/src/suspense.js +0 -165
- package/lib/preact/compat/src/util.js +0 -23
- package/lib/preact/hooks/src/index.d.ts +0 -133
- package/lib/preact/hooks/src/index.js +0 -339
- package/lib/preact/hooks/src/internal.d.ts +0 -55
- package/lib/preact/src/clone-element.js +0 -27
- package/lib/preact/src/compat.ts +0 -0
- package/lib/preact/src/component.js +0 -219
- package/lib/preact/src/constants.js +0 -3
- package/lib/preact/src/create-context.js +0 -55
- package/lib/preact/src/create-element.js +0 -102
- package/lib/preact/src/css.d.ts +0 -30341
- package/lib/preact/src/diff/catch-error.js +0 -41
- package/lib/preact/src/diff/children.js +0 -259
- package/lib/preact/src/diff/index.js +0 -445
- package/lib/preact/src/diff/props.js +0 -163
- package/lib/preact/src/index.d.ts +0 -275
- package/lib/preact/src/index.js +0 -14
- package/lib/preact/src/internal.d.ts +0 -94
- package/lib/preact/src/jsx.d.ts +0 -884
- package/lib/preact/src/options.js +0 -16
- package/lib/preact/src/render.js +0 -98
- package/lib/preact/src/util.js +0 -25
- package/lib/preact-router/.travis.yml +0 -3
- package/lib/preact-router/LICENSE +0 -21
- package/lib/preact-router/README.md +0 -254
- package/lib/preact-router/index.d.ts +0 -71
- package/lib/preact-router/match/index.d.ts +0 -16
- package/lib/preact-router/match/package.json +0 -13
- package/lib/preact-router/match/src/cjs.js +0 -4
- package/lib/preact-router/match/src/index.js +0 -36
- package/lib/preact-router/package-lock.json +0 -12330
- package/lib/preact-router/package.json +0 -78
- package/lib/preact-router/src/cjs.js +0 -11
- package/lib/preact-router/src/index.js +0 -270
- package/lib/preact-router/src/util.js +0 -87
- package/lib/react-window/src/FixedSizeGrid.js +0 -244
- package/lib/react-window/src/FixedSizeList.js +0 -130
- package/lib/react-window/src/VariableSizeGrid.js +0 -507
- package/lib/react-window/src/VariableSizeList.js +0 -316
- package/lib/react-window/src/__tests__/FixedSizeGrid.js +0 -1336
- package/lib/react-window/src/__tests__/FixedSizeList.js +0 -966
- package/lib/react-window/src/__tests__/VariableSizeGrid.js +0 -779
- package/lib/react-window/src/__tests__/VariableSizeList.js +0 -442
- package/lib/react-window/src/__tests__/__snapshots__/FixedSizeGrid.js.snap +0 -912
- package/lib/react-window/src/__tests__/__snapshots__/FixedSizeList.js.snap +0 -568
- package/lib/react-window/src/__tests__/__snapshots__/VariableSizeGrid.js.snap +0 -542
- package/lib/react-window/src/__tests__/__snapshots__/VariableSizeList.js.snap +0 -331
- package/lib/react-window/src/__tests__/areEqual.js +0 -32
- package/lib/react-window/src/__tests__/shouldComponentUpdate.js +0 -36
- package/lib/react-window/src/areEqual.js +0 -18
- package/lib/react-window/src/createGridComponent.js +0 -919
- package/lib/react-window/src/createListComponent.js +0 -729
- package/lib/react-window/src/domHelpers.js +0 -72
- package/lib/react-window/src/index.js +0 -9
- package/lib/react-window/src/shallowDiffers.js +0 -17
- package/lib/react-window/src/shouldComponentUpdate.js +0 -16
- package/lib/react-window/src/test.js.flow +0 -382
- package/lib/react-window/src/timer.js +0 -36
- package/src/app/demopage.tsx +0 -77
- package/src/app/index.html +0 -48
- package/src/app/main.tsx +0 -30
- package/src/asset/Textures/Alert/bg_tips.png +0 -0
- package/src/asset/Textures/Alert/btn_zhedie_a.png +0 -0
- package/src/asset/Textures/Alert/com_home_bg_left.png +0 -0
- package/src/asset/Textures/Alert/com_home_bg_rightbar.png +0 -0
- package/src/asset/Textures/Commons/com_home_bg_a.png +0 -0
- package/src/asset/Textures/Commons/com_home_bg_back_top.png +0 -0
- package/src/asset/Textures/Commons/com_home_bg_bottombar_sheet.png +0 -0
- package/src/asset/Textures/Commons/com_home_bg_list_xiala.png +0 -0
- package/src/asset/Textures/Commons/com_home_bg_rightbar_line.png +0 -0
- package/src/asset/Textures/Commons/com_home_bg_rightbar_selected.png +0 -0
- package/src/asset/Textures/Commons/com_home_bg_touxiang_140.png +0 -0
- package/src/asset/Textures/Commons/com_home_bg_touxiang_60.png +0 -0
- package/src/asset/Textures/Commons/com_home_bg_touxiang_80.png +0 -0
- package/src/asset/Textures/Commons/com_home_btn_back.png +0 -0
- package/src/asset/Textures/Commons/com_home_btn_bottombar.png +0 -0
- package/src/asset/Textures/Commons/com_home_btn_bottombar_fadongtai.png +0 -0
- package/src/asset/Textures/Commons/com_home_btn_close.png +0 -0
- package/src/asset/Textures/Commons/com_home_btn_guanzhu_126.png +0 -0
- package/src/asset/Textures/Commons/com_home_btn_guanzhu_86.png +0 -0
- package/src/asset/Textures/Commons/com_home_btn_left_bianji.png +0 -0
- package/src/asset/Textures/Commons/com_home_btn_left_dongtai.png +0 -0
- package/src/asset/Textures/Commons/com_home_btn_left_touxiang.png +0 -0
- package/src/asset/Textures/Commons/com_home_btn_selet.png +0 -0
- package/src/asset/Textures/Commons/com_home_btn_yiguanzhu_126.png +0 -0
- package/src/asset/Textures/Commons/com_home_btn_yiguanzhu_86.png +0 -0
- package/src/asset/Textures/Commons/com_home_icon_bottombar_fadongtai.png +0 -0
- package/src/asset/Textures/Commons/com_home_icon_bottombar_red.png +0 -0
- package/src/asset/Textures/Commons/com_home_icon_loading.png +0 -0
- package/src/asset/Textures/Commons/com_home_pic_touxiang_moren.png +0 -0
- package/src/asset/Textures/Commons/com_home_tab_left_a.png +0 -0
- package/src/asset/Textures/Commons/com_home_tab_left_b.png +0 -0
- package/src/asset/Textures/Commons/com_home_tab_left_c.png +0 -0
- package/src/asset/Textures/Commons/feedItems/gc1_huati_icon_middle_v.png +0 -0
- package/src/asset/Textures/Commons/feedItems/gc1_huati_icon_middle_yonghurenzheng.png +0 -0
- package/src/asset/Textures/Commons/feedItems/pinglun_bg.png +0 -0
- package/src/asset/Textures/Commons/feedItems/pinglun_bg_line.png +0 -0
- package/src/asset/Textures/Commons/feedItems/pinglun_bg_middle_chakan.png +0 -0
- package/src/asset/Textures/Commons/feedItems/pinglun_bg_middle_input.png +0 -0
- package/src/asset/Textures/Commons/feedItems/pinglun_bg_zan.png +0 -0
- package/src/asset/Textures/Commons/feedItems/pinglun_btn_middle_input.png +0 -0
- package/src/asset/Textures/Commons/feedItems/pinglun_btn_more.png +0 -0
- package/src/asset/Textures/Commons/feedItems/pinglun_btn_normal.png +0 -0
- package/src/asset/Textures/Commons/feedItems/pinglun_btn_photo_more.png +0 -0
- package/src/asset/Textures/Commons/feedItems/pinglun_btn_zhedie_a.png +0 -0
- package/src/asset/Textures/Commons/feedItems/pinglun_btn_zhedie_a_shadow.png +0 -0
- package/src/asset/Textures/Commons/feedItems/pinglun_btn_zhedie_b_normal.png +0 -0
- package/src/asset/Textures/Commons/feedItems/pinglun_btn_zhedie_b_pressed.png +0 -0
- package/src/asset/Textures/Commons/feedItems/pinglun_icon_a_normal.png +0 -0
- package/src/asset/Textures/Commons/feedItems/pinglun_icon_a_pressed.png +0 -0
- package/src/asset/Textures/Commons/feedItems/pinglun_icon_b_normal.png +0 -0
- package/src/asset/Textures/Commons/feedItems/pinglun_icon_c_normal.png +0 -0
- package/src/asset/Textures/Commons/feedItems/pinglun_icon_d.png +0 -0
- package/src/asset/Textures/Commons/feedItems/pinglun_icon_e.png +0 -0
- package/src/asset/Textures/Commons/feedItems/pinglun_icon_f_share.png +0 -0
- package/src/asset/Textures/Commons/feedItems/pinglun_icon_middle_input_back.png +0 -0
- package/src/asset/Textures/Commons/gc1_huati_bg_middle_topbtn.png +0 -0
- package/src/asset/Textures/Commons/gc1_huati_bg_middle_topbtn_pressd.png +0 -0
- package/src/asset/Textures/Commons/karaoke/rukou_bg_music.png +0 -0
- package/src/asset/Textures/Commons/karaoke/rukou_btn_a.png +0 -0
- package/src/asset/Textures/Commons/karaoke/rukou_btn_b.png +0 -0
- package/src/asset/Textures/Commons/karaoke/rukou_icon_b.png +0 -0
- package/src/asset/Textures/Commons/karaoke/rukou_icon_d.png +0 -0
- package/src/asset/Textures/Commons/karaoke/rukou_icon_e.png +0 -0
- package/src/asset/Textures/Commons/rukou_bg_bottombar_line.png +0 -0
- package/src/asset/Textures/Commons/rukou_icon_a.png +0 -0
- package/src/asset/Textures/Commons/tc_bianji_tab_a.png +0 -0
- package/src/asset/Textures/Commons/tc_zanshang_bg_line.png +0 -0
- package/src/asset/Textures/Commons/touxiang_bg_tishikuang.png +0 -0
- package/src/asset/Textures/Commons/video/rukou_icon_shipin.png +0 -0
- package/src/asset/Textures/Commons/video/xiangce_btn_bofang.png +0 -0
- package/src/asset/Textures/Commons/voice/rukou_icon_yuyin.png +0 -0
- package/src/asset/Textures/Commons/voice/tc_yuyin_bg.png +0 -0
- package/src/asset/Textures/Commons/voice/tc_yuyin_bg_load.png +0 -0
- package/src/asset/Textures/Commons/voice/tc_yuyin_bg_xinhao_a.png +0 -0
- package/src/asset/Textures/Commons/voice/tc_yuyin_bg_xinhao_b.png +0 -0
- package/src/asset/Textures/Commons/xiangce_icon_bottombar_gulita.png +0 -0
- package/src/asset/Textures/SocialSecond/com_tc_bg.png +0 -0
- package/src/asset/Textures/SocialSecond/com_tc_bg_bottom.png +0 -0
- package/src/asset/Textures/SocialSecond/com_tc_bg_input.png +0 -0
- package/src/asset/Textures/SocialSecond/com_tc_bg_tips.png +0 -0
- package/src/asset/Textures/SocialSecond/com_tc_bg_topbar_a.png +0 -0
- package/src/asset/Textures/SocialSecond/com_tc_bg_topbar_line.png +0 -0
- package/src/asset/Textures/SocialSecond/com_tc_bg_upload_photo.png +0 -0
- package/src/asset/Textures/SocialSecond/com_tc_bg_upload_photo_line.png +0 -0
- package/src/asset/Textures/SocialSecond/com_tc_bg_zhaopian_line.png +0 -0
- package/src/asset/Textures/SocialSecond/com_tc_btn.png +0 -0
- package/src/asset/Textures/SocialSecond/com_tc_btn_close.png +0 -0
- package/src/asset/Textures/SocialSecond/com_tc_btn_upload_photo.png +0 -0
- package/src/asset/Textures/SocialSecond/com_tc_radio_normal.png +0 -0
- package/src/asset/Textures/SocialSecond/com_tc_radio_normal_@slice_0.png +0 -0
- package/src/asset/Textures/SocialSecond/com_tc_radio_selected.png +0 -0
- package/src/asset/Textures/SocialSecond/com_tc_tab_a.png +0 -0
- package/src/asset/Textures/SocialSecond/gc1_huati_bg_middle_topbar.png +0 -0
- package/src/asset/Textures/SocialSecond/gc1_huati_bg_middle_topbar_pre.png +0 -0
- package/src/asset/Textures/SocialSecond/newmessage_bg_left_line.png +0 -0
- package/src/asset/Textures/SocialSecond/newmessage_bg_left_normal.png +0 -0
- package/src/asset/Textures/SocialSecond/newmessage_bg_left_selected.png +0 -0
- package/src/asset/Textures/SocialSecond/newmessage_bg_middle_new.png +0 -0
- package/src/asset/Textures/SocialSecond/paihang_bg_list.png +0 -0
- package/src/asset/Textures/SocialSecond/paihang_bg_list_line.png +0 -0
- package/src/asset/Textures/SocialSecond/paihang_bg_list_my.png +0 -0
- package/src/asset/Textures/SocialSecond/paihang_bg_list_top.png +0 -0
- package/src/asset/Textures/SocialSecond/paihang_bg_topbar_a.png +0 -0
- package/src/asset/Textures/SocialSecond/paihang_icon_topbar_selected.png +0 -0
- package/src/asset/Textures/SocialSecond/paihang_pic_1.png +0 -0
- package/src/asset/Textures/SocialSecond/paihang_pic_2.png +0 -0
- package/src/asset/Textures/SocialSecond/tc_fadongtai_btn_close.png +0 -0
- package/src/asset/Textures/SocialSecond/tc_guanzhu_bg_topbar.png +0 -0
- package/src/asset/Textures/SocialSecond/tc_guanzhu_bg_topbar_selected.png +0 -0
- package/src/asset/Textures/SocialSecond/tc_liwu_bg.png +0 -0
- package/src/asset/Textures/SocialSecond/tc_liwu_bg_daoju.png +0 -0
- package/src/asset/Textures/SocialSecond/tc_liwu_btn_a.png +0 -0
- package/src/asset/Textures/SocialSecond/tc_liwu_btn_b.png +0 -0
- package/src/asset/Textures/SocialSecond/tc_liwu_btn_c.png +0 -0
- package/src/asset/Textures/SocialSecond/tc_liwu_pic_daoju1.png +0 -0
- package/src/asset/Textures/SocialSecond/tc_liwu_pic_daoju2.png +0 -0
- package/src/asset/Textures/SocialSecond/tc_liwu_pic_daoju3.png +0 -0
- package/src/asset/Textures/SocialSecond/tc_pinglun_bg.png +0 -0
- package/src/asset/Textures/SocialSecond/tc_shipin_tianjiashipin.png +0 -0
- package/src/asset/Textures/SocialSecond/tc_yuyin_bg.png +0 -0
- package/src/asset/Textures/SocialSecond/tc_yuyin_bg_delete.png +0 -0
- package/src/asset/Textures/SocialSecond/tc_yuyin_bg_xinhao_a.png +0 -0
- package/src/asset/Textures/SocialSecond/tc_yuyin_bg_xinhao_b.png +0 -0
- package/src/asset/Textures/SocialSecond/tc_yuyin_star.png +0 -0
- package/src/asset/Textures/SocialSecond/tc_yuyin_stop.png +0 -0
- package/src/asset/Textures/SocialSecond/tc_zanshang_bg_line.png +0 -0
- package/src/asset/Textures/SocialSecond/touxiang_bg_tishikuang.png +0 -0
- package/src/asset/Textures/SocialSecond/xiangce_huadong.png +0 -0
- package/src/asset/Textures/SocialSecond/xiangce_huadong_xuanzhong.png +0 -0
- package/src/asset/Textures/SocialSecond/xiangce_icon_xiazai.png +0 -0
- package/src/asset/Textures/SocialVideo/com_home_btn_close.png +0 -0
- package/src/asset/Textures/SocialVideo/tc_shipin_bg_guodu.png +0 -0
- package/src/asset/Textures/SocialVideo/tc_shipin_jinduanjian.png +0 -0
- package/src/asset/Textures/SocialVideo/tc_shipin_jindutiao.png +0 -0
- package/src/asset/Textures/SocialVideo/tc_shipin_jindutiao_hui.png +0 -0
- package/src/asset/Textures/SocialVideo/tc_shipin_play.png +0 -0
- package/src/asset/Textures/SocialVideo/tc_shipin_play_big.png +0 -0
- package/src/asset/Textures/SocialVideo/tc_shipin_stop.png +0 -0
- package/src/asset/laugh.gif +0 -0
- package/src/asset/npms.png +0 -0
- package/src/asset/pixui.png +0 -0
- package/src/asset/preact.png +0 -0
- package/src/asset/template.html +0 -47
- package/src/common/frame/appsettings.js +0 -111
- package/src/common/frame/common.js +0 -17
- package/src/common/frame/platform-api-callback.js +0 -341
- package/src/common/frame/platform-api.d.ts +0 -156
- package/src/common/frame/platform-api.js +0 -479
- package/src/common/main.less +0 -119
- package/src/pixUIReactComponents/README.md +0 -8
- package/src/pixUIReactComponents/package.json +0 -11
- package/src/pixUIReactComponents/tsconfig.json +0 -45
- package/src/pixUIReactComponents/ui/sample/Slapface/SlapfaceDemo.tsx +0 -30
- package/src/pixUIReactUtils/GenerateConstructorAndGeterSeter.js +0 -227
- package/src/pixUIReactUtils/MakeImage.js +0 -207
- package/src/pixUIReactUtils/README.md +0 -124
- package/src/pixUIReactUtils/Version.js +0 -3
- package/src/pixUIReactUtils/img/makeImage.png +0 -0
- package/src/pixUIReactUtils/index.js +0 -1
- package/src/pixUIReactUtils/package.json +0 -16
- package/src/preprocess/index.html +0 -48
- package/src/preprocess/main.tsx +0 -17
- package/src/preprocess/preprocesspage.tsx +0 -41
- /package/{src/pixUIReactComponents/cmdAfterTsBuild.js → cmdAfterTsBuild.js} +0 -0
- /package/{src/pixUIReactComponents/index.js → index.js} +0 -0
- /package/{src/pixUIReactComponents/tools → tools}/EventDispatcherJs.tsx +0 -0
- /package/{src/pixUIReactComponents/tools → tools}/Logger.tsx +0 -0
- /package/{src/pixUIReactComponents/tools → tools}/img/logger.png +0 -0
- /package/{src/pixUIReactComponents/tools → tools}/tools.md +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/components/bulletscreen/BulletItemAnimation.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/components/bulletscreen/BulletScreenAnimation.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/components/bulletscreen/bullet.less +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/components/button/Button.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/components/carousel/Carousel.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/components/checkBox/CheckBox.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/components/dropdown/Dropdown.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/components/dropdown/DropdownOptionUI.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/components/dropdown/DropdownSpreadMainUI.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/components/dropdown/DropdownUnspreadMainUI.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/components/gradient/GradientText.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/components/outlinetext/OutlineText.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/components/progress/Progress.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/components/slapface/less/Slapface.less +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/components/slider/Slider.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/components/tab/Tab.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/components/tab/Tabs.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/components/togglegroup/ToggleGroup.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/components/videoplayer/VideoPlayer.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/components/waterfallcomponent/WaterfallComponent.jsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/components/waterfallcomponent/less/WaterfallComponent.less +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/Images.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/OutlineText/OutlineDemo.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/btn_close.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/changtai_button.jpg +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/checkbox0.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/checkbox1.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/data_arrow_down.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/data_arrow_up.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/dot.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/inner.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/item_reddot.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/loading.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/money_dropdown.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/money_dropdownall.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/outer.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/slapface_samplepic1.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/slapface_samplepic2.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/slapface_samplepic3.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/slapface_samplepic4.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/slapface_samplepic5.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/slapface_samplepic6.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/tab_choosed.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/tabs_bg.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/video_pause.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/video_play.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/video_reload.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/xuanfu_button.jpg +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/yaxia_button.jpg +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/bulletscreen/BulletDemo.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/button/ButtonDemo.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/carousel/carouselDemo.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/checkBox/checkBoxDemo.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/dropdown/DropdownDemo.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/dropdown/MoneyDropdownOption.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/dropdown/MoneyDropdownSpreadMain.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/dropdown/MoneyDropdownUnspreadMain.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/gradient/GradientDemo.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/less/video.less +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/progress/ProgressDemo.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/slider/SliderDemo.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/tab/TabDemo.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/tab/TopTab.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/togglegroup/ToggleGroupDemo.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/videoplayer/VideoPlayerDemo.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/waterfallcomponent/WaterfallComponentDemo.jsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/ui.md +0 -0
|
@@ -1,919 +0,0 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
|
|
3
|
-
import memoizeOne from 'memoize-one';
|
|
4
|
-
import { createElement, PureComponent } from 'react';
|
|
5
|
-
import { cancelTimeout, requestTimeout } from './timer';
|
|
6
|
-
import { getScrollbarSize, getRTLOffsetType } from './domHelpers';
|
|
7
|
-
|
|
8
|
-
import type { TimeoutID } from './timer';
|
|
9
|
-
|
|
10
|
-
type Direction = 'ltr' | 'rtl';
|
|
11
|
-
export type ScrollToAlign = 'auto' | 'smart' | 'center' | 'start' | 'end';
|
|
12
|
-
|
|
13
|
-
type itemSize = number | ((index: number) => number);
|
|
14
|
-
|
|
15
|
-
type RenderComponentProps<T> = {|
|
|
16
|
-
columnIndex: number,
|
|
17
|
-
data: T,
|
|
18
|
-
isScrolling?: boolean,
|
|
19
|
-
rowIndex: number,
|
|
20
|
-
style: Object,
|
|
21
|
-
|};
|
|
22
|
-
export type RenderComponent<T> = React$ComponentType<
|
|
23
|
-
$Shape<RenderComponentProps<T>>
|
|
24
|
-
>;
|
|
25
|
-
|
|
26
|
-
type ScrollDirection = 'forward' | 'backward';
|
|
27
|
-
|
|
28
|
-
type OnItemsRenderedCallback = ({
|
|
29
|
-
overscanColumnStartIndex: number,
|
|
30
|
-
overscanColumnStopIndex: number,
|
|
31
|
-
overscanRowStartIndex: number,
|
|
32
|
-
overscanRowStopIndex: number,
|
|
33
|
-
visibleColumnStartIndex: number,
|
|
34
|
-
visibleColumnStopIndex: number,
|
|
35
|
-
visibleRowStartIndex: number,
|
|
36
|
-
visibleRowStopIndex: number,
|
|
37
|
-
}) => void;
|
|
38
|
-
type OnScrollCallback = ({
|
|
39
|
-
horizontalScrollDirection: ScrollDirection,
|
|
40
|
-
scrollLeft: number,
|
|
41
|
-
scrollTop: number,
|
|
42
|
-
scrollUpdateWasRequested: boolean,
|
|
43
|
-
verticalScrollDirection: ScrollDirection,
|
|
44
|
-
}) => void;
|
|
45
|
-
|
|
46
|
-
type ScrollEvent = SyntheticEvent<HTMLDivElement>;
|
|
47
|
-
type ItemStyleCache = { [key: string]: Object };
|
|
48
|
-
|
|
49
|
-
type OuterProps = {|
|
|
50
|
-
children: React$Node,
|
|
51
|
-
className: string | void,
|
|
52
|
-
onScroll: ScrollEvent => void,
|
|
53
|
-
style: {
|
|
54
|
-
[string]: mixed,
|
|
55
|
-
},
|
|
56
|
-
|};
|
|
57
|
-
|
|
58
|
-
type InnerProps = {|
|
|
59
|
-
children: React$Node,
|
|
60
|
-
style: {
|
|
61
|
-
[string]: mixed,
|
|
62
|
-
},
|
|
63
|
-
|};
|
|
64
|
-
|
|
65
|
-
export type Props<T> = {|
|
|
66
|
-
children: RenderComponent<T>,
|
|
67
|
-
className?: string,
|
|
68
|
-
columnCount: number,
|
|
69
|
-
columnWidth: itemSize,
|
|
70
|
-
direction: Direction,
|
|
71
|
-
height: number,
|
|
72
|
-
initialScrollLeft?: number,
|
|
73
|
-
initialScrollTop?: number,
|
|
74
|
-
innerRef?: any,
|
|
75
|
-
innerElementType?: string | React$AbstractComponent<InnerProps, any>,
|
|
76
|
-
innerTagName?: string, // deprecated
|
|
77
|
-
itemData: T,
|
|
78
|
-
itemKey?: (params: {|
|
|
79
|
-
columnIndex: number,
|
|
80
|
-
data: T,
|
|
81
|
-
rowIndex: number,
|
|
82
|
-
|}) => any,
|
|
83
|
-
onItemsRendered?: OnItemsRenderedCallback,
|
|
84
|
-
onScroll?: OnScrollCallback,
|
|
85
|
-
outerRef?: any,
|
|
86
|
-
outerElementType?: string | React$AbstractComponent<OuterProps, any>,
|
|
87
|
-
outerTagName?: string, // deprecated
|
|
88
|
-
overscanColumnCount?: number,
|
|
89
|
-
overscanColumnsCount?: number, // deprecated
|
|
90
|
-
overscanCount?: number, // deprecated
|
|
91
|
-
overscanRowCount?: number,
|
|
92
|
-
overscanRowsCount?: number, // deprecated
|
|
93
|
-
rowCount: number,
|
|
94
|
-
rowHeight: itemSize,
|
|
95
|
-
style?: Object,
|
|
96
|
-
useIsScrolling: boolean,
|
|
97
|
-
width: number,
|
|
98
|
-
|};
|
|
99
|
-
|
|
100
|
-
type State = {|
|
|
101
|
-
instance: any,
|
|
102
|
-
isScrolling: boolean,
|
|
103
|
-
horizontalScrollDirection: ScrollDirection,
|
|
104
|
-
scrollLeft: number,
|
|
105
|
-
scrollTop: number,
|
|
106
|
-
scrollUpdateWasRequested: boolean,
|
|
107
|
-
verticalScrollDirection: ScrollDirection,
|
|
108
|
-
|};
|
|
109
|
-
|
|
110
|
-
type getItemOffset = (
|
|
111
|
-
props: Props<any>,
|
|
112
|
-
index: number,
|
|
113
|
-
instanceProps: any
|
|
114
|
-
) => number;
|
|
115
|
-
type getItemSize = (
|
|
116
|
-
props: Props<any>,
|
|
117
|
-
index: number,
|
|
118
|
-
instanceProps: any
|
|
119
|
-
) => number;
|
|
120
|
-
type getEstimatedTotalSize = (props: Props<any>, instanceProps: any) => number;
|
|
121
|
-
type GetOffsetForItemAndAlignment = (
|
|
122
|
-
props: Props<any>,
|
|
123
|
-
index: number,
|
|
124
|
-
align: ScrollToAlign,
|
|
125
|
-
scrollOffset: number,
|
|
126
|
-
instanceProps: any,
|
|
127
|
-
scrollbarSize: number
|
|
128
|
-
) => number;
|
|
129
|
-
type GetStartIndexForOffset = (
|
|
130
|
-
props: Props<any>,
|
|
131
|
-
offset: number,
|
|
132
|
-
instanceProps: any
|
|
133
|
-
) => number;
|
|
134
|
-
type GetStopIndexForStartIndex = (
|
|
135
|
-
props: Props<any>,
|
|
136
|
-
startIndex: number,
|
|
137
|
-
scrollOffset: number,
|
|
138
|
-
instanceProps: any
|
|
139
|
-
) => number;
|
|
140
|
-
type InitInstanceProps = (props: Props<any>, instance: any) => any;
|
|
141
|
-
type ValidateProps = (props: Props<any>) => void;
|
|
142
|
-
|
|
143
|
-
const IS_SCROLLING_DEBOUNCE_INTERVAL = 150;
|
|
144
|
-
|
|
145
|
-
const defaultItemKey = ({ columnIndex, data, rowIndex }) =>
|
|
146
|
-
`${rowIndex}:${columnIndex}`;
|
|
147
|
-
|
|
148
|
-
// In DEV mode, this Set helps us only log a warning once per component instance.
|
|
149
|
-
// This avoids spamming the console every time a render happens.
|
|
150
|
-
let devWarningsOverscanCount = null;
|
|
151
|
-
let devWarningsOverscanRowsColumnsCount = null;
|
|
152
|
-
let devWarningsTagName = null;
|
|
153
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
154
|
-
if (typeof window !== 'undefined' && typeof window.WeakSet !== 'undefined') {
|
|
155
|
-
devWarningsOverscanCount = new WeakSet();
|
|
156
|
-
devWarningsOverscanRowsColumnsCount = new WeakSet();
|
|
157
|
-
devWarningsTagName = new WeakSet();
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
export default function createGridComponent({
|
|
162
|
-
getColumnOffset,
|
|
163
|
-
getColumnStartIndexForOffset,
|
|
164
|
-
getColumnStopIndexForStartIndex,
|
|
165
|
-
getColumnWidth,
|
|
166
|
-
getEstimatedTotalHeight,
|
|
167
|
-
getEstimatedTotalWidth,
|
|
168
|
-
getOffsetForColumnAndAlignment,
|
|
169
|
-
getOffsetForRowAndAlignment,
|
|
170
|
-
getRowHeight,
|
|
171
|
-
getRowOffset,
|
|
172
|
-
getRowStartIndexForOffset,
|
|
173
|
-
getRowStopIndexForStartIndex,
|
|
174
|
-
initInstanceProps,
|
|
175
|
-
shouldResetStyleCacheOnItemSizeChange,
|
|
176
|
-
validateProps,
|
|
177
|
-
}: {|
|
|
178
|
-
getColumnOffset: getItemOffset,
|
|
179
|
-
getColumnStartIndexForOffset: GetStartIndexForOffset,
|
|
180
|
-
getColumnStopIndexForStartIndex: GetStopIndexForStartIndex,
|
|
181
|
-
getColumnWidth: getItemSize,
|
|
182
|
-
getEstimatedTotalHeight: getEstimatedTotalSize,
|
|
183
|
-
getEstimatedTotalWidth: getEstimatedTotalSize,
|
|
184
|
-
getOffsetForColumnAndAlignment: GetOffsetForItemAndAlignment,
|
|
185
|
-
getOffsetForRowAndAlignment: GetOffsetForItemAndAlignment,
|
|
186
|
-
getRowOffset: getItemOffset,
|
|
187
|
-
getRowHeight: getItemSize,
|
|
188
|
-
getRowStartIndexForOffset: GetStartIndexForOffset,
|
|
189
|
-
getRowStopIndexForStartIndex: GetStopIndexForStartIndex,
|
|
190
|
-
initInstanceProps: InitInstanceProps,
|
|
191
|
-
shouldResetStyleCacheOnItemSizeChange: boolean,
|
|
192
|
-
validateProps: ValidateProps,
|
|
193
|
-
|}) {
|
|
194
|
-
return class Grid<T> extends PureComponent<Props<T>, State> {
|
|
195
|
-
_instanceProps: any = initInstanceProps(this.props, this);
|
|
196
|
-
_resetIsScrollingTimeoutId: TimeoutID | null = null;
|
|
197
|
-
_outerRef: ?HTMLDivElement;
|
|
198
|
-
|
|
199
|
-
static defaultProps = {
|
|
200
|
-
direction: 'ltr',
|
|
201
|
-
itemData: undefined,
|
|
202
|
-
useIsScrolling: false,
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
state: State = {
|
|
206
|
-
instance: this,
|
|
207
|
-
isScrolling: false,
|
|
208
|
-
horizontalScrollDirection: 'forward',
|
|
209
|
-
scrollLeft:
|
|
210
|
-
typeof this.props.initialScrollLeft === 'number'
|
|
211
|
-
? this.props.initialScrollLeft
|
|
212
|
-
: 0,
|
|
213
|
-
scrollTop:
|
|
214
|
-
typeof this.props.initialScrollTop === 'number'
|
|
215
|
-
? this.props.initialScrollTop
|
|
216
|
-
: 0,
|
|
217
|
-
scrollUpdateWasRequested: false,
|
|
218
|
-
verticalScrollDirection: 'forward',
|
|
219
|
-
};
|
|
220
|
-
|
|
221
|
-
// Always use explicit constructor for React components.
|
|
222
|
-
// It produces less code after transpilation. (#26)
|
|
223
|
-
// eslint-disable-next-line no-useless-constructor
|
|
224
|
-
constructor(props: Props<T>) {
|
|
225
|
-
super(props);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
static getDerivedStateFromProps(
|
|
229
|
-
nextProps: Props<T>,
|
|
230
|
-
prevState: State
|
|
231
|
-
): $Shape<State> | null {
|
|
232
|
-
validateSharedProps(nextProps, prevState);
|
|
233
|
-
validateProps(nextProps);
|
|
234
|
-
return null;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
scrollTo({
|
|
238
|
-
scrollLeft,
|
|
239
|
-
scrollTop,
|
|
240
|
-
}: {
|
|
241
|
-
scrollLeft: number,
|
|
242
|
-
scrollTop: number,
|
|
243
|
-
}): void {
|
|
244
|
-
if (scrollLeft !== undefined) {
|
|
245
|
-
scrollLeft = Math.max(0, scrollLeft);
|
|
246
|
-
}
|
|
247
|
-
if (scrollTop !== undefined) {
|
|
248
|
-
scrollTop = Math.max(0, scrollTop);
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
this.setState(prevState => {
|
|
252
|
-
if (scrollLeft === undefined) {
|
|
253
|
-
scrollLeft = prevState.scrollLeft;
|
|
254
|
-
}
|
|
255
|
-
if (scrollTop === undefined) {
|
|
256
|
-
scrollTop = prevState.scrollTop;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
if (
|
|
260
|
-
prevState.scrollLeft === scrollLeft &&
|
|
261
|
-
prevState.scrollTop === scrollTop
|
|
262
|
-
) {
|
|
263
|
-
return null;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
return {
|
|
267
|
-
horizontalScrollDirection:
|
|
268
|
-
prevState.scrollLeft < scrollLeft ? 'forward' : 'backward',
|
|
269
|
-
scrollLeft: scrollLeft,
|
|
270
|
-
scrollTop: scrollTop,
|
|
271
|
-
scrollUpdateWasRequested: true,
|
|
272
|
-
verticalScrollDirection:
|
|
273
|
-
prevState.scrollTop < scrollTop ? 'forward' : 'backward',
|
|
274
|
-
};
|
|
275
|
-
}, this._resetIsScrollingDebounced);
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
scrollToItem({
|
|
279
|
-
align = 'auto',
|
|
280
|
-
columnIndex,
|
|
281
|
-
rowIndex,
|
|
282
|
-
}: {
|
|
283
|
-
align: ScrollToAlign,
|
|
284
|
-
columnIndex?: number,
|
|
285
|
-
rowIndex?: number,
|
|
286
|
-
}): void {
|
|
287
|
-
const { columnCount, height, rowCount, width } = this.props;
|
|
288
|
-
const { scrollLeft, scrollTop } = this.state;
|
|
289
|
-
const scrollbarSize = getScrollbarSize();
|
|
290
|
-
|
|
291
|
-
if (columnIndex !== undefined) {
|
|
292
|
-
columnIndex = Math.max(0, Math.min(columnIndex, columnCount - 1));
|
|
293
|
-
}
|
|
294
|
-
if (rowIndex !== undefined) {
|
|
295
|
-
rowIndex = Math.max(0, Math.min(rowIndex, rowCount - 1));
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
const estimatedTotalHeight = getEstimatedTotalHeight(
|
|
299
|
-
this.props,
|
|
300
|
-
this._instanceProps
|
|
301
|
-
);
|
|
302
|
-
const estimatedTotalWidth = getEstimatedTotalWidth(
|
|
303
|
-
this.props,
|
|
304
|
-
this._instanceProps
|
|
305
|
-
);
|
|
306
|
-
|
|
307
|
-
// The scrollbar size should be considered when scrolling an item into view,
|
|
308
|
-
// to ensure it's fully visible.
|
|
309
|
-
// But we only need to account for its size when it's actually visible.
|
|
310
|
-
const horizontalScrollbarSize =
|
|
311
|
-
estimatedTotalWidth > width ? scrollbarSize : 0;
|
|
312
|
-
const verticalScrollbarSize =
|
|
313
|
-
estimatedTotalHeight > height ? scrollbarSize : 0;
|
|
314
|
-
|
|
315
|
-
this.scrollTo({
|
|
316
|
-
scrollLeft:
|
|
317
|
-
columnIndex !== undefined
|
|
318
|
-
? getOffsetForColumnAndAlignment(
|
|
319
|
-
this.props,
|
|
320
|
-
columnIndex,
|
|
321
|
-
align,
|
|
322
|
-
scrollLeft,
|
|
323
|
-
this._instanceProps,
|
|
324
|
-
verticalScrollbarSize
|
|
325
|
-
)
|
|
326
|
-
: scrollLeft,
|
|
327
|
-
scrollTop:
|
|
328
|
-
rowIndex !== undefined
|
|
329
|
-
? getOffsetForRowAndAlignment(
|
|
330
|
-
this.props,
|
|
331
|
-
rowIndex,
|
|
332
|
-
align,
|
|
333
|
-
scrollTop,
|
|
334
|
-
this._instanceProps,
|
|
335
|
-
horizontalScrollbarSize
|
|
336
|
-
)
|
|
337
|
-
: scrollTop,
|
|
338
|
-
});
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
componentDidMount() {
|
|
342
|
-
const { initialScrollLeft, initialScrollTop } = this.props;
|
|
343
|
-
|
|
344
|
-
if (this._outerRef != null) {
|
|
345
|
-
const outerRef = ((this._outerRef: any): HTMLElement);
|
|
346
|
-
if (typeof initialScrollLeft === 'number') {
|
|
347
|
-
outerRef.scrollLeft = initialScrollLeft;
|
|
348
|
-
}
|
|
349
|
-
if (typeof initialScrollTop === 'number') {
|
|
350
|
-
outerRef.scrollTop = initialScrollTop;
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
this._callPropsCallbacks();
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
componentDidUpdate() {
|
|
358
|
-
const { direction } = this.props;
|
|
359
|
-
const { scrollLeft, scrollTop, scrollUpdateWasRequested } = this.state;
|
|
360
|
-
|
|
361
|
-
if (scrollUpdateWasRequested && this._outerRef != null) {
|
|
362
|
-
// TRICKY According to the spec, scrollLeft should be negative for RTL aligned elements.
|
|
363
|
-
// This is not the case for all browsers though (e.g. Chrome reports values as positive, measured relative to the left).
|
|
364
|
-
// So we need to determine which browser behavior we're dealing with, and mimic it.
|
|
365
|
-
const outerRef = ((this._outerRef: any): HTMLElement);
|
|
366
|
-
if (direction === 'rtl') {
|
|
367
|
-
switch (getRTLOffsetType()) {
|
|
368
|
-
case 'negative':
|
|
369
|
-
outerRef.scrollLeft = -scrollLeft;
|
|
370
|
-
break;
|
|
371
|
-
case 'positive-ascending':
|
|
372
|
-
outerRef.scrollLeft = scrollLeft;
|
|
373
|
-
break;
|
|
374
|
-
default:
|
|
375
|
-
const { clientWidth, scrollWidth } = outerRef;
|
|
376
|
-
outerRef.scrollLeft = scrollWidth - clientWidth - scrollLeft;
|
|
377
|
-
break;
|
|
378
|
-
}
|
|
379
|
-
} else {
|
|
380
|
-
outerRef.scrollLeft = Math.max(0, scrollLeft);
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
outerRef.scrollTop = Math.max(0, scrollTop);
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
this._callPropsCallbacks();
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
componentWillUnmount() {
|
|
390
|
-
if (this._resetIsScrollingTimeoutId !== null) {
|
|
391
|
-
cancelTimeout(this._resetIsScrollingTimeoutId);
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
render() {
|
|
396
|
-
const {
|
|
397
|
-
children,
|
|
398
|
-
className,
|
|
399
|
-
columnCount,
|
|
400
|
-
direction,
|
|
401
|
-
height,
|
|
402
|
-
innerRef,
|
|
403
|
-
innerElementType,
|
|
404
|
-
innerTagName,
|
|
405
|
-
itemData,
|
|
406
|
-
itemKey = defaultItemKey,
|
|
407
|
-
outerElementType,
|
|
408
|
-
outerTagName,
|
|
409
|
-
rowCount,
|
|
410
|
-
style,
|
|
411
|
-
useIsScrolling,
|
|
412
|
-
width,
|
|
413
|
-
} = this.props;
|
|
414
|
-
const { isScrolling } = this.state;
|
|
415
|
-
|
|
416
|
-
const [
|
|
417
|
-
columnStartIndex,
|
|
418
|
-
columnStopIndex,
|
|
419
|
-
] = this._getHorizontalRangeToRender();
|
|
420
|
-
const [rowStartIndex, rowStopIndex] = this._getVerticalRangeToRender();
|
|
421
|
-
|
|
422
|
-
const items = [];
|
|
423
|
-
if (columnCount > 0 && rowCount) {
|
|
424
|
-
for (
|
|
425
|
-
let rowIndex = rowStartIndex;
|
|
426
|
-
rowIndex <= rowStopIndex;
|
|
427
|
-
rowIndex++
|
|
428
|
-
) {
|
|
429
|
-
for (
|
|
430
|
-
let columnIndex = columnStartIndex;
|
|
431
|
-
columnIndex <= columnStopIndex;
|
|
432
|
-
columnIndex++
|
|
433
|
-
) {
|
|
434
|
-
items.push(
|
|
435
|
-
createElement(children, {
|
|
436
|
-
columnIndex,
|
|
437
|
-
data: itemData,
|
|
438
|
-
isScrolling: useIsScrolling ? isScrolling : undefined,
|
|
439
|
-
key: itemKey({ columnIndex, data: itemData, rowIndex }),
|
|
440
|
-
rowIndex,
|
|
441
|
-
style: this._getItemStyle(rowIndex, columnIndex),
|
|
442
|
-
})
|
|
443
|
-
);
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
// Read this value AFTER items have been created,
|
|
449
|
-
// So their actual sizes (if variable) are taken into consideration.
|
|
450
|
-
const estimatedTotalHeight = getEstimatedTotalHeight(
|
|
451
|
-
this.props,
|
|
452
|
-
this._instanceProps
|
|
453
|
-
);
|
|
454
|
-
const estimatedTotalWidth = getEstimatedTotalWidth(
|
|
455
|
-
this.props,
|
|
456
|
-
this._instanceProps
|
|
457
|
-
);
|
|
458
|
-
|
|
459
|
-
return createElement(
|
|
460
|
-
outerElementType || outerTagName || 'div',
|
|
461
|
-
{
|
|
462
|
-
className,
|
|
463
|
-
onScroll: this._onScroll,
|
|
464
|
-
ref: this._outerRefSetter,
|
|
465
|
-
style: {
|
|
466
|
-
position: 'relative',
|
|
467
|
-
height,
|
|
468
|
-
width,
|
|
469
|
-
overflow: 'scroll',//'auto',
|
|
470
|
-
WebkitOverflowScrolling: 'touch',
|
|
471
|
-
willChange: 'transform',
|
|
472
|
-
direction,
|
|
473
|
-
...style,
|
|
474
|
-
},
|
|
475
|
-
},
|
|
476
|
-
createElement(innerElementType || innerTagName || 'div', {
|
|
477
|
-
children: items,
|
|
478
|
-
ref: innerRef,
|
|
479
|
-
style: {
|
|
480
|
-
height: estimatedTotalHeight,
|
|
481
|
-
pointerEvents: isScrolling ? 'none' : undefined,
|
|
482
|
-
width: estimatedTotalWidth,
|
|
483
|
-
},
|
|
484
|
-
})
|
|
485
|
-
);
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
_callOnItemsRendered: (
|
|
489
|
-
overscanColumnStartIndex: number,
|
|
490
|
-
overscanColumnStopIndex: number,
|
|
491
|
-
overscanRowStartIndex: number,
|
|
492
|
-
overscanRowStopIndex: number,
|
|
493
|
-
visibleColumnStartIndex: number,
|
|
494
|
-
visibleColumnStopIndex: number,
|
|
495
|
-
visibleRowStartIndex: number,
|
|
496
|
-
visibleRowStopIndex: number
|
|
497
|
-
) => void;
|
|
498
|
-
_callOnItemsRendered = memoizeOne(
|
|
499
|
-
(
|
|
500
|
-
overscanColumnStartIndex: number,
|
|
501
|
-
overscanColumnStopIndex: number,
|
|
502
|
-
overscanRowStartIndex: number,
|
|
503
|
-
overscanRowStopIndex: number,
|
|
504
|
-
visibleColumnStartIndex: number,
|
|
505
|
-
visibleColumnStopIndex: number,
|
|
506
|
-
visibleRowStartIndex: number,
|
|
507
|
-
visibleRowStopIndex: number
|
|
508
|
-
) =>
|
|
509
|
-
((this.props.onItemsRendered: any): OnItemsRenderedCallback)({
|
|
510
|
-
overscanColumnStartIndex,
|
|
511
|
-
overscanColumnStopIndex,
|
|
512
|
-
overscanRowStartIndex,
|
|
513
|
-
overscanRowStopIndex,
|
|
514
|
-
visibleColumnStartIndex,
|
|
515
|
-
visibleColumnStopIndex,
|
|
516
|
-
visibleRowStartIndex,
|
|
517
|
-
visibleRowStopIndex,
|
|
518
|
-
})
|
|
519
|
-
);
|
|
520
|
-
|
|
521
|
-
_callOnScroll: (
|
|
522
|
-
scrollLeft: number,
|
|
523
|
-
scrollTop: number,
|
|
524
|
-
horizontalScrollDirection: ScrollDirection,
|
|
525
|
-
verticalScrollDirection: ScrollDirection,
|
|
526
|
-
scrollUpdateWasRequested: boolean
|
|
527
|
-
) => void;
|
|
528
|
-
_callOnScroll = memoizeOne(
|
|
529
|
-
(
|
|
530
|
-
scrollLeft: number,
|
|
531
|
-
scrollTop: number,
|
|
532
|
-
horizontalScrollDirection: ScrollDirection,
|
|
533
|
-
verticalScrollDirection: ScrollDirection,
|
|
534
|
-
scrollUpdateWasRequested: boolean
|
|
535
|
-
) =>
|
|
536
|
-
((this.props.onScroll: any): OnScrollCallback)({
|
|
537
|
-
horizontalScrollDirection,
|
|
538
|
-
scrollLeft,
|
|
539
|
-
scrollTop,
|
|
540
|
-
verticalScrollDirection,
|
|
541
|
-
scrollUpdateWasRequested,
|
|
542
|
-
})
|
|
543
|
-
);
|
|
544
|
-
|
|
545
|
-
_callPropsCallbacks() {
|
|
546
|
-
const { columnCount, onItemsRendered, onScroll, rowCount } = this.props;
|
|
547
|
-
|
|
548
|
-
if (typeof onItemsRendered === 'function') {
|
|
549
|
-
if (columnCount > 0 && rowCount > 0) {
|
|
550
|
-
const [
|
|
551
|
-
overscanColumnStartIndex,
|
|
552
|
-
overscanColumnStopIndex,
|
|
553
|
-
visibleColumnStartIndex,
|
|
554
|
-
visibleColumnStopIndex,
|
|
555
|
-
] = this._getHorizontalRangeToRender();
|
|
556
|
-
const [
|
|
557
|
-
overscanRowStartIndex,
|
|
558
|
-
overscanRowStopIndex,
|
|
559
|
-
visibleRowStartIndex,
|
|
560
|
-
visibleRowStopIndex,
|
|
561
|
-
] = this._getVerticalRangeToRender();
|
|
562
|
-
this._callOnItemsRendered(
|
|
563
|
-
overscanColumnStartIndex,
|
|
564
|
-
overscanColumnStopIndex,
|
|
565
|
-
overscanRowStartIndex,
|
|
566
|
-
overscanRowStopIndex,
|
|
567
|
-
visibleColumnStartIndex,
|
|
568
|
-
visibleColumnStopIndex,
|
|
569
|
-
visibleRowStartIndex,
|
|
570
|
-
visibleRowStopIndex
|
|
571
|
-
);
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
if (typeof onScroll === 'function') {
|
|
576
|
-
const {
|
|
577
|
-
horizontalScrollDirection,
|
|
578
|
-
scrollLeft,
|
|
579
|
-
scrollTop,
|
|
580
|
-
scrollUpdateWasRequested,
|
|
581
|
-
verticalScrollDirection,
|
|
582
|
-
} = this.state;
|
|
583
|
-
this._callOnScroll(
|
|
584
|
-
scrollLeft,
|
|
585
|
-
scrollTop,
|
|
586
|
-
horizontalScrollDirection,
|
|
587
|
-
verticalScrollDirection,
|
|
588
|
-
scrollUpdateWasRequested
|
|
589
|
-
);
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
// Lazily create and cache item styles while scrolling,
|
|
594
|
-
// So that pure component sCU will prevent re-renders.
|
|
595
|
-
// We maintain this cache, and pass a style prop rather than index,
|
|
596
|
-
// So that List can clear cached styles and force item re-render if necessary.
|
|
597
|
-
_getItemStyle: (rowIndex: number, columnIndex: number) => Object;
|
|
598
|
-
_getItemStyle = (rowIndex: number, columnIndex: number): Object => {
|
|
599
|
-
const { columnWidth, direction, rowHeight } = this.props;
|
|
600
|
-
|
|
601
|
-
const itemStyleCache = this._getItemStyleCache(
|
|
602
|
-
shouldResetStyleCacheOnItemSizeChange && columnWidth,
|
|
603
|
-
shouldResetStyleCacheOnItemSizeChange && direction,
|
|
604
|
-
shouldResetStyleCacheOnItemSizeChange && rowHeight
|
|
605
|
-
);
|
|
606
|
-
|
|
607
|
-
const key = `${rowIndex}:${columnIndex}`;
|
|
608
|
-
|
|
609
|
-
let style;
|
|
610
|
-
if (itemStyleCache.hasOwnProperty(key)) {
|
|
611
|
-
style = itemStyleCache[key];
|
|
612
|
-
} else {
|
|
613
|
-
const offset = getColumnOffset(
|
|
614
|
-
this.props,
|
|
615
|
-
columnIndex,
|
|
616
|
-
this._instanceProps
|
|
617
|
-
);
|
|
618
|
-
const isRtl = direction === 'rtl';
|
|
619
|
-
itemStyleCache[key] = style = {
|
|
620
|
-
position: 'absolute',
|
|
621
|
-
left: isRtl ? undefined : offset,
|
|
622
|
-
right: isRtl ? offset : undefined,
|
|
623
|
-
top: getRowOffset(this.props, rowIndex, this._instanceProps),
|
|
624
|
-
height: getRowHeight(this.props, rowIndex, this._instanceProps),
|
|
625
|
-
width: getColumnWidth(this.props, columnIndex, this._instanceProps),
|
|
626
|
-
};
|
|
627
|
-
}
|
|
628
|
-
|
|
629
|
-
return style;
|
|
630
|
-
};
|
|
631
|
-
|
|
632
|
-
_getItemStyleCache: (_: any, __: any, ___: any) => ItemStyleCache;
|
|
633
|
-
_getItemStyleCache = memoizeOne((_: any, __: any, ___: any) => ({}));
|
|
634
|
-
|
|
635
|
-
_getHorizontalRangeToRender(): [number, number, number, number] {
|
|
636
|
-
const {
|
|
637
|
-
columnCount,
|
|
638
|
-
overscanColumnCount,
|
|
639
|
-
overscanColumnsCount,
|
|
640
|
-
overscanCount,
|
|
641
|
-
rowCount,
|
|
642
|
-
} = this.props;
|
|
643
|
-
const { horizontalScrollDirection, isScrolling, scrollLeft } = this.state;
|
|
644
|
-
|
|
645
|
-
const overscanCountResolved: number =
|
|
646
|
-
overscanColumnCount || overscanColumnsCount || overscanCount || 1;
|
|
647
|
-
|
|
648
|
-
if (columnCount === 0 || rowCount === 0) {
|
|
649
|
-
return [0, 0, 0, 0];
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
const startIndex = getColumnStartIndexForOffset(
|
|
653
|
-
this.props,
|
|
654
|
-
scrollLeft,
|
|
655
|
-
this._instanceProps
|
|
656
|
-
);
|
|
657
|
-
const stopIndex = getColumnStopIndexForStartIndex(
|
|
658
|
-
this.props,
|
|
659
|
-
startIndex,
|
|
660
|
-
scrollLeft,
|
|
661
|
-
this._instanceProps
|
|
662
|
-
);
|
|
663
|
-
|
|
664
|
-
// Overscan by one item in each direction so that tab/focus works.
|
|
665
|
-
// If there isn't at least one extra item, tab loops back around.
|
|
666
|
-
const overscanBackward =
|
|
667
|
-
!isScrolling || horizontalScrollDirection === 'backward'
|
|
668
|
-
? Math.max(1, overscanCountResolved)
|
|
669
|
-
: 1;
|
|
670
|
-
const overscanForward =
|
|
671
|
-
!isScrolling || horizontalScrollDirection === 'forward'
|
|
672
|
-
? Math.max(1, overscanCountResolved)
|
|
673
|
-
: 1;
|
|
674
|
-
|
|
675
|
-
return [
|
|
676
|
-
Math.max(0, startIndex - overscanBackward),
|
|
677
|
-
Math.max(0, Math.min(columnCount - 1, stopIndex + overscanForward)),
|
|
678
|
-
startIndex,
|
|
679
|
-
stopIndex,
|
|
680
|
-
];
|
|
681
|
-
}
|
|
682
|
-
|
|
683
|
-
_getVerticalRangeToRender(): [number, number, number, number] {
|
|
684
|
-
const {
|
|
685
|
-
columnCount,
|
|
686
|
-
overscanCount,
|
|
687
|
-
overscanRowCount,
|
|
688
|
-
overscanRowsCount,
|
|
689
|
-
rowCount,
|
|
690
|
-
} = this.props;
|
|
691
|
-
const { isScrolling, verticalScrollDirection, scrollTop } = this.state;
|
|
692
|
-
|
|
693
|
-
const overscanCountResolved: number =
|
|
694
|
-
overscanRowCount || overscanRowsCount || overscanCount || 1;
|
|
695
|
-
|
|
696
|
-
if (columnCount === 0 || rowCount === 0) {
|
|
697
|
-
return [0, 0, 0, 0];
|
|
698
|
-
}
|
|
699
|
-
|
|
700
|
-
const startIndex = getRowStartIndexForOffset(
|
|
701
|
-
this.props,
|
|
702
|
-
scrollTop,
|
|
703
|
-
this._instanceProps
|
|
704
|
-
);
|
|
705
|
-
const stopIndex = getRowStopIndexForStartIndex(
|
|
706
|
-
this.props,
|
|
707
|
-
startIndex,
|
|
708
|
-
scrollTop,
|
|
709
|
-
this._instanceProps
|
|
710
|
-
);
|
|
711
|
-
|
|
712
|
-
// Overscan by one item in each direction so that tab/focus works.
|
|
713
|
-
// If there isn't at least one extra item, tab loops back around.
|
|
714
|
-
const overscanBackward =
|
|
715
|
-
!isScrolling || verticalScrollDirection === 'backward'
|
|
716
|
-
? Math.max(1, overscanCountResolved)
|
|
717
|
-
: 1;
|
|
718
|
-
const overscanForward =
|
|
719
|
-
!isScrolling || verticalScrollDirection === 'forward'
|
|
720
|
-
? Math.max(1, overscanCountResolved)
|
|
721
|
-
: 1;
|
|
722
|
-
|
|
723
|
-
return [
|
|
724
|
-
Math.max(0, startIndex - overscanBackward),
|
|
725
|
-
Math.max(0, Math.min(rowCount - 1, stopIndex + overscanForward)),
|
|
726
|
-
startIndex,
|
|
727
|
-
stopIndex,
|
|
728
|
-
];
|
|
729
|
-
}
|
|
730
|
-
|
|
731
|
-
_onScroll = (event: ScrollEvent): void => {
|
|
732
|
-
const {
|
|
733
|
-
clientHeight,
|
|
734
|
-
clientWidth,
|
|
735
|
-
scrollLeft,
|
|
736
|
-
scrollTop,
|
|
737
|
-
scrollHeight,
|
|
738
|
-
scrollWidth,
|
|
739
|
-
} = event.currentTarget;
|
|
740
|
-
this.setState(prevState => {
|
|
741
|
-
if (
|
|
742
|
-
prevState.scrollLeft === scrollLeft &&
|
|
743
|
-
prevState.scrollTop === scrollTop
|
|
744
|
-
) {
|
|
745
|
-
// Scroll position may have been updated by cDM/cDU,
|
|
746
|
-
// In which case we don't need to trigger another render,
|
|
747
|
-
// And we don't want to update state.isScrolling.
|
|
748
|
-
return null;
|
|
749
|
-
}
|
|
750
|
-
|
|
751
|
-
const { direction } = this.props;
|
|
752
|
-
|
|
753
|
-
// TRICKY According to the spec, scrollLeft should be negative for RTL aligned elements.
|
|
754
|
-
// This is not the case for all browsers though (e.g. Chrome reports values as positive, measured relative to the left).
|
|
755
|
-
// It's also easier for this component if we convert offsets to the same format as they would be in for ltr.
|
|
756
|
-
// So the simplest solution is to determine which browser behavior we're dealing with, and convert based on it.
|
|
757
|
-
let calculatedScrollLeft = scrollLeft;
|
|
758
|
-
if (direction === 'rtl') {
|
|
759
|
-
switch (getRTLOffsetType()) {
|
|
760
|
-
case 'negative':
|
|
761
|
-
calculatedScrollLeft = -scrollLeft;
|
|
762
|
-
break;
|
|
763
|
-
case 'positive-descending':
|
|
764
|
-
calculatedScrollLeft = scrollWidth - clientWidth - scrollLeft;
|
|
765
|
-
break;
|
|
766
|
-
}
|
|
767
|
-
}
|
|
768
|
-
|
|
769
|
-
// Prevent Safari's elastic scrolling from causing visual shaking when scrolling past bounds.
|
|
770
|
-
calculatedScrollLeft = Math.max(
|
|
771
|
-
0,
|
|
772
|
-
Math.min(calculatedScrollLeft, scrollWidth - clientWidth)
|
|
773
|
-
);
|
|
774
|
-
const calculatedScrollTop = Math.max(
|
|
775
|
-
0,
|
|
776
|
-
Math.min(scrollTop, scrollHeight - clientHeight)
|
|
777
|
-
);
|
|
778
|
-
|
|
779
|
-
return {
|
|
780
|
-
isScrolling: true,
|
|
781
|
-
horizontalScrollDirection:
|
|
782
|
-
prevState.scrollLeft < scrollLeft ? 'forward' : 'backward',
|
|
783
|
-
scrollLeft: calculatedScrollLeft,
|
|
784
|
-
scrollTop: calculatedScrollTop,
|
|
785
|
-
verticalScrollDirection:
|
|
786
|
-
prevState.scrollTop < scrollTop ? 'forward' : 'backward',
|
|
787
|
-
scrollUpdateWasRequested: false,
|
|
788
|
-
};
|
|
789
|
-
}, this._resetIsScrollingDebounced);
|
|
790
|
-
};
|
|
791
|
-
|
|
792
|
-
_outerRefSetter = (ref: any): void => {
|
|
793
|
-
const { outerRef } = this.props;
|
|
794
|
-
|
|
795
|
-
this._outerRef = ((ref: any): HTMLDivElement);
|
|
796
|
-
|
|
797
|
-
if (typeof outerRef === 'function') {
|
|
798
|
-
outerRef(ref);
|
|
799
|
-
} else if (
|
|
800
|
-
outerRef != null &&
|
|
801
|
-
typeof outerRef === 'object' &&
|
|
802
|
-
outerRef.hasOwnProperty('current')
|
|
803
|
-
) {
|
|
804
|
-
outerRef.current = ref;
|
|
805
|
-
}
|
|
806
|
-
};
|
|
807
|
-
|
|
808
|
-
_resetIsScrollingDebounced = () => {
|
|
809
|
-
if (this._resetIsScrollingTimeoutId !== null) {
|
|
810
|
-
cancelTimeout(this._resetIsScrollingTimeoutId);
|
|
811
|
-
}
|
|
812
|
-
|
|
813
|
-
this._resetIsScrollingTimeoutId = requestTimeout(
|
|
814
|
-
this._resetIsScrolling,
|
|
815
|
-
IS_SCROLLING_DEBOUNCE_INTERVAL
|
|
816
|
-
);
|
|
817
|
-
};
|
|
818
|
-
|
|
819
|
-
_resetIsScrolling = () => {
|
|
820
|
-
this._resetIsScrollingTimeoutId = null;
|
|
821
|
-
|
|
822
|
-
this.setState({ isScrolling: false }, () => {
|
|
823
|
-
// Clear style cache after state update has been committed.
|
|
824
|
-
// This way we don't break pure sCU for items that don't use isScrolling param.
|
|
825
|
-
this._getItemStyleCache(-1);
|
|
826
|
-
});
|
|
827
|
-
};
|
|
828
|
-
};
|
|
829
|
-
}
|
|
830
|
-
|
|
831
|
-
const validateSharedProps = (
|
|
832
|
-
{
|
|
833
|
-
children,
|
|
834
|
-
direction,
|
|
835
|
-
height,
|
|
836
|
-
innerTagName,
|
|
837
|
-
outerTagName,
|
|
838
|
-
overscanColumnsCount,
|
|
839
|
-
overscanCount,
|
|
840
|
-
overscanRowsCount,
|
|
841
|
-
width,
|
|
842
|
-
}: Props<any>,
|
|
843
|
-
{ instance }: State
|
|
844
|
-
): void => {
|
|
845
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
846
|
-
if (typeof overscanCount === 'number') {
|
|
847
|
-
if (devWarningsOverscanCount && !devWarningsOverscanCount.has(instance)) {
|
|
848
|
-
devWarningsOverscanCount.add(instance);
|
|
849
|
-
console.warn(
|
|
850
|
-
'The overscanCount prop has been deprecated. ' +
|
|
851
|
-
'Please use the overscanColumnCount and overscanRowCount props instead.'
|
|
852
|
-
);
|
|
853
|
-
}
|
|
854
|
-
}
|
|
855
|
-
|
|
856
|
-
if (
|
|
857
|
-
typeof overscanColumnsCount === 'number' ||
|
|
858
|
-
typeof overscanRowsCount === 'number'
|
|
859
|
-
) {
|
|
860
|
-
if (
|
|
861
|
-
devWarningsOverscanRowsColumnsCount &&
|
|
862
|
-
!devWarningsOverscanRowsColumnsCount.has(instance)
|
|
863
|
-
) {
|
|
864
|
-
devWarningsOverscanRowsColumnsCount.add(instance);
|
|
865
|
-
console.warn(
|
|
866
|
-
'The overscanColumnsCount and overscanRowsCount props have been deprecated. ' +
|
|
867
|
-
'Please use the overscanColumnCount and overscanRowCount props instead.'
|
|
868
|
-
);
|
|
869
|
-
}
|
|
870
|
-
}
|
|
871
|
-
|
|
872
|
-
if (innerTagName != null || outerTagName != null) {
|
|
873
|
-
if (devWarningsTagName && !devWarningsTagName.has(instance)) {
|
|
874
|
-
devWarningsTagName.add(instance);
|
|
875
|
-
console.warn(
|
|
876
|
-
'The innerTagName and outerTagName props have been deprecated. ' +
|
|
877
|
-
'Please use the innerElementType and outerElementType props instead.'
|
|
878
|
-
);
|
|
879
|
-
}
|
|
880
|
-
}
|
|
881
|
-
|
|
882
|
-
if (children == null) {
|
|
883
|
-
throw Error(
|
|
884
|
-
'An invalid "children" prop has been specified. ' +
|
|
885
|
-
'Value should be a React component. ' +
|
|
886
|
-
`"${children === null ? 'null' : typeof children}" was specified.`
|
|
887
|
-
);
|
|
888
|
-
}
|
|
889
|
-
|
|
890
|
-
switch (direction) {
|
|
891
|
-
case 'ltr':
|
|
892
|
-
case 'rtl':
|
|
893
|
-
// Valid values
|
|
894
|
-
break;
|
|
895
|
-
default:
|
|
896
|
-
throw Error(
|
|
897
|
-
'An invalid "direction" prop has been specified. ' +
|
|
898
|
-
'Value should be either "ltr" or "rtl". ' +
|
|
899
|
-
`"${direction}" was specified.`
|
|
900
|
-
);
|
|
901
|
-
}
|
|
902
|
-
|
|
903
|
-
if (typeof width !== 'number') {
|
|
904
|
-
throw Error(
|
|
905
|
-
'An invalid "width" prop has been specified. ' +
|
|
906
|
-
'Grids must specify a number for width. ' +
|
|
907
|
-
`"${width === null ? 'null' : typeof width}" was specified.`
|
|
908
|
-
);
|
|
909
|
-
}
|
|
910
|
-
|
|
911
|
-
if (typeof height !== 'number') {
|
|
912
|
-
throw Error(
|
|
913
|
-
'An invalid "height" prop has been specified. ' +
|
|
914
|
-
'Grids must specify a number for height. ' +
|
|
915
|
-
`"${height === null ? 'null' : typeof height}" was specified.`
|
|
916
|
-
);
|
|
917
|
-
}
|
|
918
|
-
}
|
|
919
|
-
};
|