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,78 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "preact-router",
|
|
3
|
-
"amdName": "preactRouter",
|
|
4
|
-
"version": "3.2.1",
|
|
5
|
-
"description": "Connect your components up to that address bar.",
|
|
6
|
-
"main": "dist/preact-router.js",
|
|
7
|
-
"umd:main": "dist/preact-router.umd.js",
|
|
8
|
-
"unpkg": "dist/preact-router.umd.js",
|
|
9
|
-
"jsnext:main": "dist/preact-router.es.js",
|
|
10
|
-
"module": "dist/preact-router.es.js",
|
|
11
|
-
"exports": {
|
|
12
|
-
".": {
|
|
13
|
-
"import": "./dist/preact-router.es.js",
|
|
14
|
-
"require": "./dist/preact-router.js"
|
|
15
|
-
},
|
|
16
|
-
"./match": {
|
|
17
|
-
"import": "./match/index.es.js",
|
|
18
|
-
"require": "./match/index.js"
|
|
19
|
-
},
|
|
20
|
-
"./package.json": "./package.json",
|
|
21
|
-
"./": "./"
|
|
22
|
-
},
|
|
23
|
-
"scripts": {
|
|
24
|
-
"build": "microbundle -f es,modern && microbundle src/cjs.js -f cjs,umd && (cd match && npm run build)",
|
|
25
|
-
"test": "npm-run-all lint build test:unit test:ts",
|
|
26
|
-
"lint": "eslint src test",
|
|
27
|
-
"fix": "npm run lint -- --fix",
|
|
28
|
-
"test:unit": "karmatic",
|
|
29
|
-
"test:ts": "tsc -p ./test",
|
|
30
|
-
"prepublishOnly": "npm-run-all build test",
|
|
31
|
-
"release": "npm run build && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish"
|
|
32
|
-
},
|
|
33
|
-
"files": [
|
|
34
|
-
"src",
|
|
35
|
-
"dist",
|
|
36
|
-
"match",
|
|
37
|
-
"index.d.ts"
|
|
38
|
-
],
|
|
39
|
-
"typings": "./index.d.ts",
|
|
40
|
-
"keywords": [
|
|
41
|
-
"preact",
|
|
42
|
-
"router"
|
|
43
|
-
],
|
|
44
|
-
"author": "Jason Miller <jason@developit.ca>",
|
|
45
|
-
"license": "MIT",
|
|
46
|
-
"repository": "preactjs/preact-router",
|
|
47
|
-
"homepage": "https://github.com/preactjs/preact-router",
|
|
48
|
-
"eslintConfig": {
|
|
49
|
-
"rules": {
|
|
50
|
-
"jest/no-jasmine-globals": 0
|
|
51
|
-
},
|
|
52
|
-
"globals": {
|
|
53
|
-
"spyOn": "readonly"
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
"peerDependencies": {
|
|
57
|
-
"preact": ">=10"
|
|
58
|
-
},
|
|
59
|
-
"devDependencies": {
|
|
60
|
-
"@babel/plugin-transform-react-jsx": "^7.9.1",
|
|
61
|
-
"chai": "^3.5.0",
|
|
62
|
-
"copyfiles": "^1.0.0",
|
|
63
|
-
"eslint": "^6.8.0",
|
|
64
|
-
"eslint-config-preact": "^1.1.1",
|
|
65
|
-
"karmatic": "^1.4.0",
|
|
66
|
-
"microbundle": "^0.12.0-next.8",
|
|
67
|
-
"mkdirp": "^0.5.3",
|
|
68
|
-
"mocha": "^5.2.0",
|
|
69
|
-
"npm-merge-driver-install": "^1.1.1",
|
|
70
|
-
"npm-run-all": "^3.0.0",
|
|
71
|
-
"preact": "^10.3.4",
|
|
72
|
-
"rimraf": "^2.5.1",
|
|
73
|
-
"sinon": "^7.1.0",
|
|
74
|
-
"sinon-chai": "^2.8.0",
|
|
75
|
-
"typescript": "^3.4.4",
|
|
76
|
-
"webpack": "^4.42.0"
|
|
77
|
-
}
|
|
78
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { subscribers, getCurrentUrl, route, Router, Route, Link, exec } from './index';
|
|
2
|
-
|
|
3
|
-
Router.subscribers = subscribers;
|
|
4
|
-
Router.getCurrentUrl = getCurrentUrl;
|
|
5
|
-
Router.route = route;
|
|
6
|
-
Router.Router = Router;
|
|
7
|
-
Router.Route = Route;
|
|
8
|
-
Router.Link = Link;
|
|
9
|
-
Router.exec = exec;
|
|
10
|
-
|
|
11
|
-
export default Router;
|
|
@@ -1,270 +0,0 @@
|
|
|
1
|
-
import { cloneElement, createElement, Component, toChildArray } from 'preact';
|
|
2
|
-
import { exec, prepareVNodeForRanking, assign, pathRankSort } from './util';
|
|
3
|
-
|
|
4
|
-
let customHistory = null;
|
|
5
|
-
|
|
6
|
-
const ROUTERS = [];
|
|
7
|
-
|
|
8
|
-
const subscribers = [];
|
|
9
|
-
|
|
10
|
-
const EMPTY = {};
|
|
11
|
-
|
|
12
|
-
function setUrl(url, type='push') {
|
|
13
|
-
if (customHistory && customHistory[type]) {
|
|
14
|
-
customHistory[type](url);
|
|
15
|
-
}
|
|
16
|
-
else if (typeof history!=='undefined' && history[type+'State']) {
|
|
17
|
-
console.log('---------------',type);
|
|
18
|
-
history[type+'State'](null, null, url);
|
|
19
|
-
}
|
|
20
|
-
else{
|
|
21
|
-
// console.log('!!!!!!!!!!!!',type,history,history.pushState,browser_location.pushState);
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
function getCurrentUrl() {
|
|
28
|
-
let url;
|
|
29
|
-
if (customHistory && customHistory.location) {
|
|
30
|
-
url = customHistory.location;
|
|
31
|
-
}
|
|
32
|
-
else if (customHistory && customHistory.getCurrentLocation) {
|
|
33
|
-
url = customHistory.getCurrentLocation();
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
url = typeof location!=='undefined' ? location : EMPTY;
|
|
37
|
-
}
|
|
38
|
-
return `${url.pathname || ''}${url.search || ''}`;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
function route(url, replace=false) {
|
|
44
|
-
if (typeof url!=='string' && url.url) {
|
|
45
|
-
replace = url.replace;
|
|
46
|
-
url = url.url;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// only push URL into history if we can handle it
|
|
50
|
-
if (canRoute(url)) {
|
|
51
|
-
setUrl(url, replace ? 'replace' : 'push');
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
return routeTo(url);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
/** Check if the given URL can be handled by any router instances. */
|
|
59
|
-
function canRoute(url) {
|
|
60
|
-
for (let i=ROUTERS.length; i--; ) {
|
|
61
|
-
if (ROUTERS[i].canRoute(url)) return true;
|
|
62
|
-
}
|
|
63
|
-
return false;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
/** Tell all router instances to handle the given URL. */
|
|
68
|
-
function routeTo(url) {
|
|
69
|
-
let didRoute = false;
|
|
70
|
-
for (let i=0; i<ROUTERS.length; i++) {
|
|
71
|
-
if (ROUTERS[i].routeTo(url)===true) {
|
|
72
|
-
didRoute = true;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
for (let i=subscribers.length; i--; ) {
|
|
76
|
-
subscribers[i](url);
|
|
77
|
-
}
|
|
78
|
-
return didRoute;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
function routeFromLink(node) {
|
|
83
|
-
// only valid elements
|
|
84
|
-
if (!node || !node.getAttribute) return;
|
|
85
|
-
|
|
86
|
-
let href = node.getAttribute('href'),
|
|
87
|
-
target = node.getAttribute('target');
|
|
88
|
-
|
|
89
|
-
// ignore links with targets and non-path URLs
|
|
90
|
-
if (!href || !href.match(/^\//g) || (target && !target.match(/^_?self$/i))) {
|
|
91
|
-
console.log('bypass routeFromLink', href,target);
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
// attempt to route, if no match simply cede control to browser
|
|
96
|
-
return route(href);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
function handleLinkClick(e) {
|
|
101
|
-
if (e.ctrlKey || e.metaKey || e.altKey || e.shiftKey || e.button!==0) {
|
|
102
|
-
console.log('bypass handleLinkClick', e.button);
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
routeFromLink(e.currentTarget || e.target || this);
|
|
107
|
-
return prevent(e);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
function prevent(e) {
|
|
112
|
-
if (e) {
|
|
113
|
-
if (e.stopImmediatePropagation) e.stopImmediatePropagation();
|
|
114
|
-
if (e.stopPropagation) e.stopPropagation();
|
|
115
|
-
e.preventDefault();
|
|
116
|
-
}
|
|
117
|
-
return false;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
function delegateLinkHandler(e) {
|
|
122
|
-
// console.log('delegateLinkHandler',e.button,e.target.nodeName);
|
|
123
|
-
// ignore events the browser takes care of already:
|
|
124
|
-
if (e.ctrlKey || e.metaKey || e.altKey || e.shiftKey || e.button!==0) return;
|
|
125
|
-
|
|
126
|
-
let t = e.target;
|
|
127
|
-
do {
|
|
128
|
-
if (String(t.nodeName).toUpperCase()==='A' && t.getAttribute('href')) {
|
|
129
|
-
if (t.hasAttribute('native')) return;
|
|
130
|
-
// if link is handled by the router, prevent browser defaults
|
|
131
|
-
if (routeFromLink(t)) {
|
|
132
|
-
return prevent(e);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
} while ((t=t.parentNode));
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
let eventListenersInitialized = false;
|
|
140
|
-
|
|
141
|
-
function initEventListeners() {
|
|
142
|
-
if (eventListenersInitialized) return;
|
|
143
|
-
|
|
144
|
-
if (typeof addEventListener==='function') {
|
|
145
|
-
if (!customHistory) {
|
|
146
|
-
addEventListener('popstate', () => {
|
|
147
|
-
routeTo(getCurrentUrl());
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
addEventListener('click', delegateLinkHandler);
|
|
151
|
-
}
|
|
152
|
-
eventListenersInitialized = true;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
class Router extends Component {
|
|
157
|
-
constructor(props) {
|
|
158
|
-
super(props);
|
|
159
|
-
if (props.history) {
|
|
160
|
-
customHistory = props.history;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
this.state = {
|
|
164
|
-
url: props.url || getCurrentUrl()
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
initEventListeners();
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
shouldComponentUpdate(props) {
|
|
171
|
-
if (props.static!==true) return true;
|
|
172
|
-
return props.url!==this.props.url || props.onChange!==this.props.onChange;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
/** Check if the given URL can be matched against any children */
|
|
176
|
-
canRoute(url) {
|
|
177
|
-
const children = toChildArray(this.props.children);
|
|
178
|
-
return this.getMatchingChildren(children, url, false).length > 0;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
/** Re-render children with a new URL to match against. */
|
|
182
|
-
routeTo(url) {
|
|
183
|
-
this.setState({ url });
|
|
184
|
-
|
|
185
|
-
const didRoute = this.canRoute(url);
|
|
186
|
-
|
|
187
|
-
// trigger a manual re-route if we're not in the middle of an update:
|
|
188
|
-
if (!this.updating) this.forceUpdate();
|
|
189
|
-
|
|
190
|
-
return didRoute;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
componentWillMount() {
|
|
194
|
-
ROUTERS.push(this);
|
|
195
|
-
this.updating = true;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
componentDidMount() {
|
|
199
|
-
if (customHistory) {
|
|
200
|
-
this.unlisten = customHistory.listen((location) => {
|
|
201
|
-
this.routeTo(`${location.pathname || ''}${location.search || ''}`);
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
this.updating = false;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
componentWillUnmount() {
|
|
208
|
-
if (typeof this.unlisten==='function') this.unlisten();
|
|
209
|
-
ROUTERS.splice(ROUTERS.indexOf(this), 1);
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
componentWillUpdate() {
|
|
213
|
-
this.updating = true;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
componentDidUpdate() {
|
|
217
|
-
this.updating = false;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
getMatchingChildren(children, url, invoke) {
|
|
221
|
-
return children
|
|
222
|
-
.filter(prepareVNodeForRanking)
|
|
223
|
-
.sort(pathRankSort)
|
|
224
|
-
.map( vnode => {
|
|
225
|
-
let matches = exec(url, vnode.props.path, vnode.props);
|
|
226
|
-
if (matches) {
|
|
227
|
-
if (invoke !== false) {
|
|
228
|
-
let newProps = { url, matches };
|
|
229
|
-
assign(newProps, matches);
|
|
230
|
-
delete newProps.ref;
|
|
231
|
-
delete newProps.key;
|
|
232
|
-
return cloneElement(vnode, newProps);
|
|
233
|
-
}
|
|
234
|
-
return vnode;
|
|
235
|
-
}
|
|
236
|
-
}).filter(Boolean);
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
render({ children, onChange }, { url }) {
|
|
240
|
-
console.log('router state',url);
|
|
241
|
-
let active = this.getMatchingChildren(toChildArray(children), url, true);
|
|
242
|
-
|
|
243
|
-
let current = active[0] || null;
|
|
244
|
-
|
|
245
|
-
let previous = this.previousUrl;
|
|
246
|
-
if (url!==previous) {
|
|
247
|
-
this.previousUrl = url;
|
|
248
|
-
if (typeof onChange==='function') {
|
|
249
|
-
onChange({
|
|
250
|
-
router: this,
|
|
251
|
-
url,
|
|
252
|
-
previous,
|
|
253
|
-
active,
|
|
254
|
-
current
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
return current;
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
const Link = (props) => (
|
|
264
|
-
createElement('a', assign({ onClick: handleLinkClick }, props))
|
|
265
|
-
);
|
|
266
|
-
|
|
267
|
-
const Route = props => createElement(props.component, props);
|
|
268
|
-
|
|
269
|
-
export { subscribers, getCurrentUrl, route, Router, Route, Link, exec };
|
|
270
|
-
export default Router;
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
const EMPTY = {};
|
|
3
|
-
|
|
4
|
-
export function assign(obj, props) {
|
|
5
|
-
// eslint-disable-next-line guard-for-in
|
|
6
|
-
for (let i in props) {
|
|
7
|
-
obj[i] = props[i];
|
|
8
|
-
}
|
|
9
|
-
return obj;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export function exec(url, route, opts) {
|
|
13
|
-
let reg = /(?:\?([^#]*))?(#.*)?$/,
|
|
14
|
-
c = url.match(reg),
|
|
15
|
-
matches = {},
|
|
16
|
-
ret;
|
|
17
|
-
if (c && c[1]) {
|
|
18
|
-
let p = c[1].split('&');
|
|
19
|
-
for (let i=0; i<p.length; i++) {
|
|
20
|
-
let r = p[i].split('=');
|
|
21
|
-
matches[decodeURIComponent(r[0])] = decodeURIComponent(r.slice(1).join('='));
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
url = segmentize(url.replace(reg, ''));
|
|
25
|
-
route = segmentize(route || '');
|
|
26
|
-
|
|
27
|
-
let max = Math.min(url.length, route.length);
|
|
28
|
-
if(route.length>url.length)
|
|
29
|
-
max = route.length;
|
|
30
|
-
|
|
31
|
-
for (let i=0; i<max; i++) {
|
|
32
|
-
if (route[i] && route[i].charAt(0)===':') {
|
|
33
|
-
let param = route[i].replace(/(^:|[+*?]+$)/g, ''),
|
|
34
|
-
flags = (route[i].match(/[+*?]+$/) || EMPTY)[0] || '',
|
|
35
|
-
plus = ~flags.indexOf('+'),
|
|
36
|
-
star = ~flags.indexOf('*'),
|
|
37
|
-
val = url[i] || '';
|
|
38
|
-
if (!val && !star && (flags.indexOf('?')<0 || plus)) {
|
|
39
|
-
ret = false;
|
|
40
|
-
break;
|
|
41
|
-
}
|
|
42
|
-
matches[param] = decodeURIComponent(val);
|
|
43
|
-
if (plus || star) {
|
|
44
|
-
matches[param] = url.slice(i).map(decodeURIComponent).join('/');
|
|
45
|
-
break;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
else if (route[i]!==url[i]) {
|
|
49
|
-
ret = false;
|
|
50
|
-
break;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
// console.log('exec',url,route,opts,ret);
|
|
54
|
-
if (opts.default!==true && ret===false) return false;
|
|
55
|
-
return matches;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export function pathRankSort(a, b) {
|
|
59
|
-
return (
|
|
60
|
-
(a.rank < b.rank) ? 1 :
|
|
61
|
-
(a.rank > b.rank) ? -1 :
|
|
62
|
-
(a.index - b.index)
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// filter out VNodes without attributes (which are unrankeable), and add `index`/`rank` properties to be used in sorting.
|
|
67
|
-
export function prepareVNodeForRanking(vnode, index) {
|
|
68
|
-
vnode.index = index;
|
|
69
|
-
vnode.rank = rankChild(vnode);
|
|
70
|
-
return vnode.props;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export function segmentize(url) {
|
|
74
|
-
return url.replace(/(^\/+|\/+$)/g, '').split('/');
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export function rankSegment(segment) {
|
|
78
|
-
return segment.charAt(0)==':' ? (1 + '*+?'.indexOf(segment.charAt(segment.length-1))) || 4 : 5;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export function rank(path) {
|
|
82
|
-
return segmentize(path).map(rankSegment).join('');
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
function rankChild(vnode) {
|
|
86
|
-
return vnode.props.default ? 0 : rank(vnode.props.path);
|
|
87
|
-
}
|
|
@@ -1,244 +0,0 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
|
|
3
|
-
import createGridComponent from './createGridComponent';
|
|
4
|
-
|
|
5
|
-
import type { Props, ScrollToAlign } from './createGridComponent';
|
|
6
|
-
|
|
7
|
-
const FixedSizeGrid = createGridComponent({
|
|
8
|
-
getColumnOffset: ({ columnWidth }: Props<any>, index: number): number =>
|
|
9
|
-
index * ((columnWidth: any): number),
|
|
10
|
-
|
|
11
|
-
getColumnWidth: ({ columnWidth }: Props<any>, index: number): number =>
|
|
12
|
-
((columnWidth: any): number),
|
|
13
|
-
|
|
14
|
-
getRowOffset: ({ rowHeight }: Props<any>, index: number): number =>
|
|
15
|
-
index * ((rowHeight: any): number),
|
|
16
|
-
|
|
17
|
-
getRowHeight: ({ rowHeight }: Props<any>, index: number): number =>
|
|
18
|
-
((rowHeight: any): number),
|
|
19
|
-
|
|
20
|
-
getEstimatedTotalHeight: ({ rowCount, rowHeight }: Props<any>) =>
|
|
21
|
-
((rowHeight: any): number) * rowCount,
|
|
22
|
-
|
|
23
|
-
getEstimatedTotalWidth: ({ columnCount, columnWidth }: Props<any>) =>
|
|
24
|
-
((columnWidth: any): number) * columnCount,
|
|
25
|
-
|
|
26
|
-
getOffsetForColumnAndAlignment: (
|
|
27
|
-
{ columnCount, columnWidth, width }: Props<any>,
|
|
28
|
-
columnIndex: number,
|
|
29
|
-
align: ScrollToAlign,
|
|
30
|
-
scrollLeft: number,
|
|
31
|
-
instanceProps: typeof undefined,
|
|
32
|
-
scrollbarSize: number
|
|
33
|
-
): number => {
|
|
34
|
-
const lastColumnOffset = Math.max(
|
|
35
|
-
0,
|
|
36
|
-
columnCount * ((columnWidth: any): number) - width
|
|
37
|
-
);
|
|
38
|
-
const maxOffset = Math.min(
|
|
39
|
-
lastColumnOffset,
|
|
40
|
-
columnIndex * ((columnWidth: any): number)
|
|
41
|
-
);
|
|
42
|
-
const minOffset = Math.max(
|
|
43
|
-
0,
|
|
44
|
-
columnIndex * ((columnWidth: any): number) -
|
|
45
|
-
width +
|
|
46
|
-
scrollbarSize +
|
|
47
|
-
((columnWidth: any): number)
|
|
48
|
-
);
|
|
49
|
-
|
|
50
|
-
if (align === 'smart') {
|
|
51
|
-
if (scrollLeft >= minOffset - width && scrollLeft <= maxOffset + width) {
|
|
52
|
-
align = 'auto';
|
|
53
|
-
} else {
|
|
54
|
-
align = 'center';
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
switch (align) {
|
|
59
|
-
case 'start':
|
|
60
|
-
return maxOffset;
|
|
61
|
-
case 'end':
|
|
62
|
-
return minOffset;
|
|
63
|
-
case 'center':
|
|
64
|
-
// "Centered" offset is usually the average of the min and max.
|
|
65
|
-
// But near the edges of the list, this doesn't hold true.
|
|
66
|
-
const middleOffset = Math.round(
|
|
67
|
-
minOffset + (maxOffset - minOffset) / 2
|
|
68
|
-
);
|
|
69
|
-
if (middleOffset < Math.ceil(width / 2)) {
|
|
70
|
-
return 0; // near the beginning
|
|
71
|
-
} else if (middleOffset > lastColumnOffset + Math.floor(width / 2)) {
|
|
72
|
-
return lastColumnOffset; // near the end
|
|
73
|
-
} else {
|
|
74
|
-
return middleOffset;
|
|
75
|
-
}
|
|
76
|
-
case 'auto':
|
|
77
|
-
default:
|
|
78
|
-
if (scrollLeft >= minOffset && scrollLeft <= maxOffset) {
|
|
79
|
-
return scrollLeft;
|
|
80
|
-
} else if (minOffset > maxOffset) {
|
|
81
|
-
// Because we only take into account the scrollbar size when calculating minOffset
|
|
82
|
-
// this value can be larger than maxOffset when at the end of the list
|
|
83
|
-
return minOffset;
|
|
84
|
-
} else if (scrollLeft < minOffset) {
|
|
85
|
-
return minOffset;
|
|
86
|
-
} else {
|
|
87
|
-
return maxOffset;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
|
|
92
|
-
getOffsetForRowAndAlignment: (
|
|
93
|
-
{ rowHeight, height, rowCount }: Props<any>,
|
|
94
|
-
rowIndex: number,
|
|
95
|
-
align: ScrollToAlign,
|
|
96
|
-
scrollTop: number,
|
|
97
|
-
instanceProps: typeof undefined,
|
|
98
|
-
scrollbarSize: number
|
|
99
|
-
): number => {
|
|
100
|
-
const lastRowOffset = Math.max(
|
|
101
|
-
0,
|
|
102
|
-
rowCount * ((rowHeight: any): number) - height
|
|
103
|
-
);
|
|
104
|
-
const maxOffset = Math.min(
|
|
105
|
-
lastRowOffset,
|
|
106
|
-
rowIndex * ((rowHeight: any): number)
|
|
107
|
-
);
|
|
108
|
-
const minOffset = Math.max(
|
|
109
|
-
0,
|
|
110
|
-
rowIndex * ((rowHeight: any): number) -
|
|
111
|
-
height +
|
|
112
|
-
scrollbarSize +
|
|
113
|
-
((rowHeight: any): number)
|
|
114
|
-
);
|
|
115
|
-
|
|
116
|
-
if (align === 'smart') {
|
|
117
|
-
if (scrollTop >= minOffset - height && scrollTop <= maxOffset + height) {
|
|
118
|
-
align = 'auto';
|
|
119
|
-
} else {
|
|
120
|
-
align = 'center';
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
switch (align) {
|
|
125
|
-
case 'start':
|
|
126
|
-
return maxOffset;
|
|
127
|
-
case 'end':
|
|
128
|
-
return minOffset;
|
|
129
|
-
case 'center':
|
|
130
|
-
// "Centered" offset is usually the average of the min and max.
|
|
131
|
-
// But near the edges of the list, this doesn't hold true.
|
|
132
|
-
const middleOffset = Math.round(
|
|
133
|
-
minOffset + (maxOffset - minOffset) / 2
|
|
134
|
-
);
|
|
135
|
-
if (middleOffset < Math.ceil(height / 2)) {
|
|
136
|
-
return 0; // near the beginning
|
|
137
|
-
} else if (middleOffset > lastRowOffset + Math.floor(height / 2)) {
|
|
138
|
-
return lastRowOffset; // near the end
|
|
139
|
-
} else {
|
|
140
|
-
return middleOffset;
|
|
141
|
-
}
|
|
142
|
-
case 'auto':
|
|
143
|
-
default:
|
|
144
|
-
if (scrollTop >= minOffset && scrollTop <= maxOffset) {
|
|
145
|
-
return scrollTop;
|
|
146
|
-
} else if (minOffset > maxOffset) {
|
|
147
|
-
// Because we only take into account the scrollbar size when calculating minOffset
|
|
148
|
-
// this value can be larger than maxOffset when at the end of the list
|
|
149
|
-
return minOffset;
|
|
150
|
-
} else if (scrollTop < minOffset) {
|
|
151
|
-
return minOffset;
|
|
152
|
-
} else {
|
|
153
|
-
return maxOffset;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
},
|
|
157
|
-
|
|
158
|
-
getColumnStartIndexForOffset: (
|
|
159
|
-
{ columnWidth, columnCount }: Props<any>,
|
|
160
|
-
scrollLeft: number
|
|
161
|
-
): number =>
|
|
162
|
-
Math.max(
|
|
163
|
-
0,
|
|
164
|
-
Math.min(
|
|
165
|
-
columnCount - 1,
|
|
166
|
-
Math.floor(scrollLeft / ((columnWidth: any): number))
|
|
167
|
-
)
|
|
168
|
-
),
|
|
169
|
-
|
|
170
|
-
getColumnStopIndexForStartIndex: (
|
|
171
|
-
{ columnWidth, columnCount, width }: Props<any>,
|
|
172
|
-
startIndex: number,
|
|
173
|
-
scrollLeft: number
|
|
174
|
-
): number => {
|
|
175
|
-
const left = startIndex * ((columnWidth: any): number);
|
|
176
|
-
const numVisibleColumns = Math.ceil(
|
|
177
|
-
(width + scrollLeft - left) / ((columnWidth: any): number)
|
|
178
|
-
);
|
|
179
|
-
return Math.max(
|
|
180
|
-
0,
|
|
181
|
-
Math.min(
|
|
182
|
-
columnCount - 1,
|
|
183
|
-
startIndex + numVisibleColumns - 1 // -1 is because stop index is inclusive
|
|
184
|
-
)
|
|
185
|
-
);
|
|
186
|
-
},
|
|
187
|
-
|
|
188
|
-
getRowStartIndexForOffset: (
|
|
189
|
-
{ rowHeight, rowCount }: Props<any>,
|
|
190
|
-
scrollTop: number
|
|
191
|
-
): number =>
|
|
192
|
-
Math.max(
|
|
193
|
-
0,
|
|
194
|
-
Math.min(rowCount - 1, Math.floor(scrollTop / ((rowHeight: any): number)))
|
|
195
|
-
),
|
|
196
|
-
|
|
197
|
-
getRowStopIndexForStartIndex: (
|
|
198
|
-
{ rowHeight, rowCount, height }: Props<any>,
|
|
199
|
-
startIndex: number,
|
|
200
|
-
scrollTop: number
|
|
201
|
-
): number => {
|
|
202
|
-
const top = startIndex * ((rowHeight: any): number);
|
|
203
|
-
const numVisibleRows = Math.ceil(
|
|
204
|
-
(height + scrollTop - top) / ((rowHeight: any): number)
|
|
205
|
-
);
|
|
206
|
-
return Math.max(
|
|
207
|
-
0,
|
|
208
|
-
Math.min(
|
|
209
|
-
rowCount - 1,
|
|
210
|
-
startIndex + numVisibleRows - 1 // -1 is because stop index is inclusive
|
|
211
|
-
)
|
|
212
|
-
);
|
|
213
|
-
},
|
|
214
|
-
|
|
215
|
-
initInstanceProps(props: Props<any>): any {
|
|
216
|
-
// Noop
|
|
217
|
-
},
|
|
218
|
-
|
|
219
|
-
shouldResetStyleCacheOnItemSizeChange: true,
|
|
220
|
-
|
|
221
|
-
validateProps: ({ columnWidth, rowHeight }: Props<any>): void => {
|
|
222
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
223
|
-
if (typeof columnWidth !== 'number') {
|
|
224
|
-
throw Error(
|
|
225
|
-
'An invalid "columnWidth" prop has been specified. ' +
|
|
226
|
-
'Value should be a number. ' +
|
|
227
|
-
`"${
|
|
228
|
-
columnWidth === null ? 'null' : typeof columnWidth
|
|
229
|
-
}" was specified.`
|
|
230
|
-
);
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
if (typeof rowHeight !== 'number') {
|
|
234
|
-
throw Error(
|
|
235
|
-
'An invalid "rowHeight" prop has been specified. ' +
|
|
236
|
-
'Value should be a number. ' +
|
|
237
|
-
`"${rowHeight === null ? 'null' : typeof rowHeight}" was specified.`
|
|
238
|
-
);
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
},
|
|
242
|
-
});
|
|
243
|
-
|
|
244
|
-
export default FixedSizeGrid;
|