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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@rn-lalala/sop-pro

v1.2.8

Published

A higher abstracted component for sop

Downloads

10

Readme

sop-pro

SOP 业务公共组件, 相比@rn-lalala/sop组件, 内部对 SOP 模板、答案、暂存、等功 能进行了封装, 并内置了 loading、error 等状态下的 UI

使用

yarn add @rn-lalala/sop-pro @rn-lalala/sop @rn-lalala/upload

请确保项目安装了上述包中peerDependencies列出的所有三方包,并仔细检查版本。

API

Form

SOP 表单组件

使用

import React from "react"
import { Form, useSopRef } from "@rn-lalala/sop-pro"

const Demo = () => {
  const sopFormRef = useSopRef()
  return (
    <Form
      ref={sopFormRef}
      title={"每个模板的title"} // 可以为render函数
      uuid={"全局唯一id"} // 推荐由路由+业务id+操作类型组成
      businessId={"业务id"}
      sopIds={"SOP ID组成的数组"}
    />
  )
}

Preview

SOP 预览组件

使用

import React from "react"
import { Preview } from "@rn-lalala/sop-pro"

const Demo = () => {
  return (
    <Preview
      title={"每个模板的title"}
      businessId={"业务id"}
      sopIds={"SOP ID组成的数组"}
    />
  )
}

useSopRef

创建Form组件的ref, 组件内部通过ref向外暴露了部分API

form

SopForm表单form属性实例

requestTempSave

请求暂存, 返回一个Promise<bool>对象, 成功结果为true, 失败结果为false

requestSave

请求保存修改后的数据, 返回一个Promise<bool>对象, 成功结果为true, 失败结果 为false

clear

清除当前表单内后台上传存储的本地资源,比如当用户已经将数据同步到后端后,应该手 动调用此方法

refresh

刷新 SOP 模板及答案的数据

usePreviewRef

refresh

刷新 SOP 模板及答案的数据