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

@five-show/antd-prompt

v0.1.2

Published

a simple prompt for ant design

Downloads

5

Readme

antd-prompt

a simple prompt for ant design

Features

  • Prompt
  • FromModal

Requirement

  • react >= 16.8
  • antd >= 4.0

Install

npm

npm install @five-show/antd-prompt

yarn

yarn add @five-show/antd-prompt

Usage

import { Prompt } from "@five-show/antd-prompt";

component

<Prompt visible={visible} onOk={handleOk} onCancel={handleCancel} {...promptProps} />

function

const value = await Prompt.prompt({
  ...promptProps,
});
await handleOk(value);

or

await Prompt.prompt({
  ...promptProps,
  onOk: handleOk,
});

Example

git clone https://github.com/MorningK/antd-prompt.git
cd antd-prompt
npm install
cd example
npm install
npm run start

Props

| prop | description | type | default | |---------------|--------------------|---------|---------| | visible | Whether the modal dialog is visible or not | boolean | | | title | The modal dialog's title | ReactNode | | | cancelText | Text of the Cancel button | ReactNode | | | onCancel | Specify a function that will be called when a user clicks mask, close button on top right or Cancel button | () => void | Promise | | | okText | Text of the OK button | ReactNode | | | okButtonProps | The ok button props | ButtonProps | | | onOk | Specify a function that will be called when a user clicks the OK button | (value: T) => void | Promise | | | addonBefore | The ReactNode add before Form | ReactNode | | | addonAfter | The ReactNode add after Form | ReactNode | | | modalProps | The modal props | ModalProps | | | formProps | The form props | FromProps | | | name | The name of Form.Item | NamePath | input | | label | The label text of Form.Item | ReactNode | | | required | The initialValue of Form.Item | boolean | true | | initialValue | The initialValue of Form.Item | T | | | formItemProps | The props of Form.Item | FormItemProps | | | children | The children of Form.Item | ReactNode | <Input autoComplete="false" autoFocus allowClear /> |

export type FormModalProps<T = any> = {
  visible?: boolean;
  title?: React.ReactNode;
  cancelText?: React.ReactNode;
  onCancel?: () => void | Promise<any>;
  okText?: React.ReactNode;
  okButtonProps?: ButtonProps;
  onOk?: (values: T) => void | Promise<any>;
  addonBefore?: React.ReactNode;
  addonAfter?: React.ReactNode;
  children?: React.ReactNode;
  modalProps?: ModalProps;
  formProps?: FormProps;
};
export type PromptProp<T = any> = Omit<FormModalProps, 'onOk' | 'children'> & {
  onOk?: (value: T) => Promise<any>;
  name?: string;
  label?: string;
  required?: boolean;
  initialValue?: T;
  formItemProps?: FormItemProps;
  children?: React.ReactNode;
};