Coder Social home page Coder Social logo

mevrael / bunny Goto Github PK

View Code? Open in Web Editor NEW
485.0 20.0 42.0 790 KB

BunnyJS - Lightweight native (vanilla) JavaScript (JS) and ECMAScript 6 (ES6) browser library, package of small stand-alone components without dependencies: FormData, upload, image preview, HTML5 validation, Autocomplete, Dropdown, Calendar, Datepicker, Ajax, Datatable, Pagination, URL, Template engine, Element positioning, smooth scrolling, routing, inversion of control and more. Simple syntax and architecture. Next generation jQuery and front-end framework. Documentation and examples available.

Home Page: https://bunnyjs.com

License: MIT License

JavaScript 98.87% CSS 1.13%
vanilla-js architecture ajax vanilla vanilla-javascript javascript bunnyjs framework library dom

bunny's People

Contributors

joebordes avatar mevrael avatar ryaza avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bunny's Issues

introduce a changelog

Hi!

Currently it's hard to find out what things have changed between BunnyJS versions and if a new version introduced a breaking change. Perhaps it's a good idea to introduce a changelog file?

'BunnyElement is not defined' console message with standalone validation.min.js

Just a heads up. When using the dist/validation.min.js on its own, the console throw the following error:

validation.min.js:1 Uncaught (in promise) ReferenceError: BunnyElement is not defined at Object.focusInput (validation.min.js:1)

but validation still functions correctly. The position seems to refer to the scrollTo position. In my case this is unimportant so I removed that line from the minified js.

PS: In your docs, you mention the Validation Core itself is only 2kb. Is that this dist?

ReferenceError: babelHelpers is not defined

Hi,

I get an error in console when I run example on https://bunnyjs.com/examples/form-validation/ (just clicking submit on an empty form in enough).

Firefox 63.0:
ReferenceError: babelHelpers is not defined element.min.js:1:1368

Chrome 69.0.3497.100

element.min.js:1 Uncaught (in promise) ReferenceError: babelHelpers is not defined
    at element.min.js:1
    at new Promise (<anonymous>)
    at Object.scrollTo (element.min.js:1)
    at Object.focusInput (validation.min.js:1)
    at validation.min.js:1

Sortable and searchable

Your datatable looks promising. But both sorting and searching are crucial for most people. (I assume it's not there as I couldn't see it on the demo page)

Issue in IE 11

Hi,

I have an issue with bunnyJS and Internet Explorer 11. When i test on IE 11, I have multiple issues about functions in constant. For exemple, we have an error "SCRIPT1002" in BunnyElement.js, line 4

export const BunnyElement = {

  getCurrentDocumentPosition(top = true) {
    //return Math.abs(document.body.getBoundingClientRect().y);
    return top ? window.scrollY : window.scrollY + window.innerHeight;
  },
[...]
}

We use webpack Encore, and we add babel polyfill. But it still not working.

Thank you very much

Validating a yes/no radio group

Hey, how do I setup a yes/no radio group? I tried placing required on both fields and separately on each one, to no avail. It only accepts Yes as a possible answer.

<label for="yes1"><input type="radio" name="q1" value="0" required>Yes</label> <label for="no1"><input type="radio" name="q1" value="1">No</label>
image

Datatable go to page programatically

I am using a datatable to access a database table.

The underlying SQL gets filtered by a query generator form controlled by the user. I am having a problem with the dynamic changing of pages.

Imagine a query that returns 10 pages, the user navigates to page 5 and decides to change the query criteria. Once changed the dataset now has only 3 pages. The pagination stays on page 5.

I looked for a way to update/refresh the Pagination widget or a "goToPage(1)" method but couldn't get it working.

Is there a way to set the page to the start programatically that I couldn't find?

On error, success class is not removed

Hi,

been using the success class showvalid feature and it appears that if an input field from valid goes to invalid success class is still left on the input group container.

References issue #18

screenshot 2019-03-05 at 09 55 34

screenshot 2019-03-05 at 09 56 12

Please note how the tick is still there. It visually represents that the class has not been removed from the input group container element.

Otherwise, pretty good work. :)

Success class

Hi all,
I saw there was a errorClass option, but am not seeing anything that would allow a "success" class to be added to input groups - is that possible?

How to use different text for label in error message (with classLabel)?

I have a checkbox with a very long label containing some consent messaging. I'd like the error to just say "Consent is required" rather than the whole label text.

It looks like using this class on a span within the label should do just that, but I don't see any change in the error message.

// label to pick textContent from to insert field name into error message
    classLabel: 'form-control-label',

Am I understanding the use of classLabel correctly?

Pagination buttons change location URL

I am testing the beta release.
I have a datatable with pagination. On the previous release the page links would launch an ajax call and update the table , now those buttons, show the spinner, scroll to the top and update the URL in the browser location address. The first two new behaviors are fantastic but the URL update is a problem as it breaks the browser history and also gives a raw JSON output if you click on the "reload" browser button.

Can we revert that behavior back so the address URL is not changed? Or is there a way of deactivating that on a per-project setting?

change class of submit button in Validation ?

Hi, first of all, thank's for your works, this lib save time !
I wanted to know if it's possible to add/change the submit button class when it's not validated yet (with instantly validated) in order to apply some css/js (can't submit if it's not validated for example) ?
Thank's for your answer

setSelectionRange uncaught exception

I have
<input type="email" name="whatever" required maxlength="50" />

when validating, and input contains invalid value Chrome 54 macOS gives:
Validation.js:658 Uncaught (in promise) DOMException: Failed to execute 'setSelectionRange' on 'HTMLInputElement': The input element's type ('email') does not support selection.

Validation.js line #658
input.setSelectionRange(input.value.length, input.value.length);

Example of datepicker

Hey thanks for resolving the js-yaml so quickly. I was able to try creating a simple button using bunny. I've been looking at the source code in examples for datepicker but notice that it doesn't have an index.html page demonstrating how it might work like a few of the other examples. I did the following

  • added the datepicker index.js code and link it to my index.html
  • added input element with id="datepicker" to my index.html
  • added the styles for datepicker in a styles.css and had link it in my index.html file

but I didn't see any indication that the input field was in fact a date picker is there something I'm missing?

problem to remove a required field

Reproduce problem: https://jsfiddle.net/oc0veLLp/9/

Hi,
I have the following problem, if I want a field to don't required (Once the form has been initialized, and this changed dynamically), I delete the "required" by javascript but if the field has other attributes such as "minLength" or "maxLength" it is still mandatory.

How can I solve this in the best way?

thanks

Sorting and paging

I am testing the sorting option on the datatable. The datatable I am using has pagination.
When I click on the column header to sort I get the correct call, but once the table is sorted and I click the pagination to move to another page I lose the search parameters.

Do I have to do something with the Pagination configuration to get it to respect the sorting conditions established?

License change?

Hi,

First of all I think you have done a wonderful job. I have spent the weekend playing with the datatables and other libraries and they work very well.

I would like to know if it would be possible for you to establish a more business friendly license. Something like MIT, BSD, Apache or MPL. GPL is just to restrictive and incompatible with my open-source project. Even an LGPL would do as this is a library...

Thanks for your hard work and for sharing.

Transpile Validation

We are only using Validation from bunnyjs but the src/Validation file isn't precompiled into the dist file.

To get around this we exclude bunnyjs in our babel loader.

exclude: /node_modules(?!\/bunnyjs)/,

But it would be precompiled into the dist folder or exported from the main bunnyjs object.

Validation preSubmit and isValid method

What's up guys?

I couldn't found neither in docs or source code a way to verify if the form is valid.

In fact, I need to do extra things before properly submit the form (like sanitize inputs, made some animations, etc.)

Today, is it possible? Am I missing some method here?

If not, I suggest to implement these methods. It would be very interesting to have these.

Thank you very much.

#Documentation Information for BunnyJS

1 Getting started (Installation, configuration, building project, architecture)
2. DOM utils
3. URL utils
4. Files and Images
5. SVG
6. Components

  • Form Validation
  • DataTable
  • Dropdown
  • Autocomplete
  • CustomSelect
  1. Experimental Components
  • DOMObserver
  • Core Component
  • Custom components

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.