npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

ght-react-search

v0.0.4

Published

前端组件

Readme

说明

安装依赖 yarn add ght-react --save

Upload组件

上传组件

| 参数 | 说明 | 默认值 | |--|--|--|--- | url | 上传地址 | 不能为空 | beforUpload| 返回true,继续上传,返回false中止上传,同时传递文件列表| 不能为空 | progressHandle| 上传进度回调| | speedHandle| 上传速率回调 | | completeHandle| 上传成功回调 | | beforUpload| 上传前的文件回调列表(可用与判断是否继续上传)|

可编辑组件Table组件

功能:提供表格合并单元格、拆分单元格,内容更改

具体使用如下:

  import {Table} from 'abc-algorithms'
  <Table
    rawData={TableData.raw_data}
    rowCount={TableData.data.length}
    columnCount={TableData.data[0].length}
    enableSelect={true}
    isedit={this.state.isedit}
    ref={(c)=>this.tb=c}
  </Table>
参数说明:
rawData:算法解析出来的表格数据,是个数组,数据组像中包含,row,column,text字段
rowCount:表格共多少行
columnCount:表格共多少列
enableSelect:单元格是否充许选中,拆分时用到
isedit:表格是否支持编辑
tb.splitCells:拆分方法,供外部调用
tb.mergeCells:合并方法,供外部调用
tb.getData: 获取最新操作后的表格数据
tb.replaceTableContent(findContent,replaceContent):findContent替换前的内容,replaceContent:替换后的内容

ParsingView组件:

import pdfjs from 'pdfjs-dist';

import {ParsingView} from 'abc-algorithms'
componentDidMount() {
  var self=this;

      let url ='https://abc-crawler.oss-cn-hangzhou.aliyuncs.com/downloads/4b4e093efac74b20b058313c97aa1477.pdf'
    let loadingTask;
    try{
    loadingTask = pdfjs.getDocument({
        url: url,
    });
  }catch(err)
  {
      console.log(url)
    //  window.location.reload();
  }
    loadingTask.promise.then((pdf) => {
        console.log(`Document ${ url} loaded ${pdf.numPages} page(s)`);
        self.setState({pdf});
    }, (reason) => {
      //  this.props.abortmission('解析pdf失败,是否中止当前任务?');

        console.error(`Error during ${this.props.url} loading: ${reason}`);
    });
}

render() {
    return (
    <div style={{height:500}}>
      {this.state.pdf?(<ParsingView
        parsePageParams={{fileId:7,userId:'amen111'}}
        hostUrl="http://dcgate-dev.researchreport.cn"
        socketUrl="ws://dc-messagecenter.researchreport.cn:8889/date/call/amen111/token11"
        editable={true}
        parseAreaCallBack={this.parseAreaCallBack}
        selectRectCallBack={this.selectRectCallBack}
        pageChangeCallBack={this.pageChangeCallBack}
        pdf={this.state.pdf}
        />):(null)}
    </div>
    )
}

参数说明:

| 参数 | 意义 |默认值 | | ------------ | ------------ | ------------ | | editable |是否可框选 | true| | pdf | pdfjs-dist解析PDF生成PDF对象 | 不能为null | | parseAreaCallBack | 选定一个框并点击解析后的数据回调 | | | parsePageParams | 区域解析及查询接口入参 | | | hostUrl | 接口地址的hostName | | | socketUrl | websokcet地址 | | | selectRectCallBack | 选中区域后的回调 | | | pageChangeCallBack | 翻页回调,返回每页的数据 | |

##ParsingThumbnail组件(parsing缩略视图组件)

import pdfjs from 'pdfjs-dist';

import {ParsingView} from 'abc-algorithms'
componentDidMount() {
  var self=this;

      let url ='https://abc-crawler.oss-cn-hangzhou.aliyuncs.com/downloads/4b4e093efac74b20b058313c97aa1477.pdf'
    let loadingTask;
    try{
    loadingTask = pdfjs.getDocument({
        url: url,
    });
  }catch(err)
  {
      console.log(url)
    //  window.location.reload();
  }
    loadingTask.promise.then((pdf) => {
        console.log(`Document ${ url} loaded ${pdf.numPages} page(s)`);
        self.setState({pdf});
    }, (reason) => {
      //  this.props.abortmission('解析pdf失败,是否中止当前任务?');

        console.error(`Error during ${this.props.url} loading: ${reason}`);
    });
}

render() {
    return (
    <ParsingThumbnail
      parsePageParams={{fileId:50,userId:'940ee7f4-8b6c-4a91-9f17-32c293257a65111'}}
      hostUrl="http://dcgate-dev.researchreport.cn"
      socketUrl="ws://dc-messagecenter.researchreport.cn:8889/date/call/940ee7f4-8b6c-4a91-9f17-32c293257a65111/token11"
      pdf={this.state.pdf} />
    )
}

| 参数 | 意义 |默认值 | | ------------ | ------------ | ------------ | | editable |是否可框选 | true| | pdf | pdfjs-dist解析PDF生成PDF对象 | 不能为null | | parsePageParams | 区域解析及查询接口入参 | | | hostUrl | 接口地址的hostName | | | socketUrl | websokcet地址 | |

组件

ChangeLog

1、新增parsingView组件