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

@bigbinary/neeto-form-engine-frontend

v0.0.88

Published

Neeto Form Engine

Downloads

90

Readme

@bigbinary/neeto-form-engine-frontend

neetoFormEngine-frontend is the library that manages forms across neeto products.

Installation

yarn add @bigbinary/neeto-form-engine-frontend

neetoFormEngine-frontend has a few peer dependencies that are required for the proper functioning of the package. Install all the peer dependencies using the below command:

yarn add @bigbinary/neetoui @bigbinary/neeto-icons ramda@^0.28.0 classnames@^2.3.1 [email protected]

Import stylesheet from the following location:

@import "@bigbinary/neeto-form-engine-frontend/dist/main.css";

Add NeetoFormProvider to the root of your application:

import React from "react";

import { NeetoFormProvider } from "@bigbinary/neeto-form-engine-frontend";

const App = () => {
  return (
    <>
      <NeetoFormProvider>{/* Other children */}</NeetoFormProvider>
    </>
  );
};

Components

BuildForm component is used to render a form builder.

import { BuildForm } from "@bigbinary/neeto-form-engine-frontend";

| prop | type | description | | ------------------------ | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | isEmbedded | boolean | To apply styles for embedding | | id | string | Form id | | onUpdate | function | Callback for form update | | buildRequestArgs | object | Arguments for build request | | showAddQuestionDivider | boolean | To show add question divider | | nonRemovableFields | string[] | Field kinds that cant be deleted from a form. Accepts array of kinds: name, email, phone, rating, checkbox, dropdown | | submitButtonProps | object | Props for submit button | | cancelButtonProps | object | Props for cancel button | | requiredFields | string[] | Fields that are required. Provided fields will be treated as required by default in the External form, the checkbox for toggling required will be hidden for the fields. Accepts array of kinds: name, email, phone, rating, checkbox, dropdown |

ExternalForm component is used to render a form.

import { ExternalForm } from "@bigbinary/neeto-form-engine-frontend";

| prop | type | description | | --------------------- | ----------------- | ---------------------------------------------------------------------- | | formId | string | Form id | | customSubmitHandler | function | Custom submit handler to be called instead of internal submit handlers | | onBeforeSubmit | function | Callback for before form submit | | onCreateSuccess | function | Callback for form creation success | | showTitle | boolean | To show form title | | submitRequestArgs | object | Arguments for form submit request payload | | footer | React.Component | To render a Footer Component | | submitButtonProps | object | Props for submit button | | cancelButtonProps | object | Props for cancel button | | resetButtonProps | object | Props for reset button | | showPrefixIcons | boolean | To show prefix icons in input fields | | displayThankYou | boolean | To show thank you message after form submit | | className | string | To apply custom class to the form wrapper | | submissionId | string | To set submission id for updating the form | | preview | boolean | To show form in preview mode | | preserveValues | boolean | To preserve form values in localStorage | | formTitle | string | To set form title | | titleProps | object | To set props for form title | | clearValuesOnSubmit | boolean | To clear local storage values on submit | | clearValuesOnReset | boolean | To clear local storage values on reset | | formDomProps | object | To set props for form element |

Submission component is used to render a form result.

import { Submission } from "@bigbinary/neeto-form-engine-frontend";

| prop | type | description | | -------------------- | -------- | --------------------------------------- | | formId | string | Form id | | submissionId | string | Submission id | | className | string | To apply custom class component wrapper | | questionLabelProps | object | To override props for question label | | answerProps | object | To override props for answer text |

Hooks

useBuildFormState hook is used to get the form state.

import {
  useBuildFormState,
  BuildForm,
} from "@bigbinary/neeto-form-engine-frontend";

const FormBuilder = () => {
  const {
    values,
    dirty,
    isSubmitting,
    isValid,
    submitForm,
    resetForm,
    errors,
  } = useBuildFormState();

  return <BuildForm />;
};

useFormSubmission hook is used to fetch the form submission data.

import { useFormSubmission } from "@bigbinary/neeto-form-engine-frontend";

const Component = () => {
  const { submission, isLoading } = useFormSubmission({
    formId: "form-id",
    submissionId: "submission-id",
  });

  return <></>;
};

Development

Install all the dependencies by executing the following command

yarn install

Building

The neetoFormEngine-frontend package gets auto-published to npm for every new merge to the main branch. You can checkout the publish workflow in git actions to get a live update.

Used in