Coder Social home page Coder Social logo

nickmaev / nval-tippy Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 0.0 1.29 MB

JavaScript validator with awesome tooltips

Home Page: https://codesandbox.io/s/nvaltippy-5p6ol

License: MIT License

TypeScript 25.76% JavaScript 27.87% HTML 46.36%
nval tippyjs tippy tooltip validation javascript validator forms vanilla-js

nval-tippy's Introduction

npm version npm downloads

Description

NVal-Tippy is a wrapper for NVal and Tippy.js plugins that allows you to display validation errors in tooltips.

Installation

NPM

npm install nval-tippy

CDN

<script src="https://unpkg.com/[email protected]/dist/browser/nval.min.js"></script>
<script src="https://unpkg.com/popper.js@1"></script>
<script src="https://unpkg.com/tippy.js@4"></script>
<script src="https://unpkg.com/[email protected]/dist/browser/nval-tippy.min.js"></script>

Usage

Declare

NPM version

Import:
import { NValTippy } from "nval-tippy";
Then:
// Pass the form element as an argument.
var validator = new NValTippy(document.getElementById("myForm"));

CDN version

// Pass the form element as an argument.
var validator = new NValTippy.NValTippy(document.getElementById("myForm"));

Run

validator.isValid(); // Returns boolean.

Configuration

Validation

NValTippy object extends NVal. To configure validation use the official documentation for it.

Tooltips

Tooltip options are available by the public property tippyOptions. To configure tooltips use the official documentation for Tippy.js.

nval-tippy's People

Contributors

nickmaev avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

nval-tippy's Issues

Linux support

I am trying to use NVal-Tippy in a Linux environment however the following issue is currently preventing that.

in index.ts you have
export { NValTippy } from "./src/nvalTippy";

however the src/nvalTippy file is actually

./src/nvaltippy.ts

linux is case sensitive, this should work on windows, but fails on linux with the following:

ERROR in ./node_modules/nval-tippy/dist/cjs/index.js Module not found: Error: Can't resolve './src/nvalTippy' in '/src/node_modules/nval-tippy/dist/cjs' @ ./node_modules/nval-tippy/dist/cjs/index.js 3:18-44

Could you please fix these lower-case / upper-case inconsistencies?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.