fizzy-ui-utils

WebJar for fizzy-ui-utils

License

License

MIT
GroupId

GroupId

org.webjars.bower
ArtifactId

ArtifactId

fizzy-ui-utils
Last Version

Last Version

2.0.3
Release Date

Release Date

Type

Type

jar
Description

Description

fizzy-ui-utils
WebJar for fizzy-ui-utils
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/metafizzy/fizzy-ui-utils

Download fizzy-ui-utils

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.bower/fizzy-ui-utils/ -->
<dependency>
    <groupId>org.webjars.bower</groupId>
    <artifactId>fizzy-ui-utils</artifactId>
    <version>2.0.3</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bower/fizzy-ui-utils/
implementation 'org.webjars.bower:fizzy-ui-utils:2.0.3'
// https://jarcasting.com/artifacts/org.webjars.bower/fizzy-ui-utils/
implementation ("org.webjars.bower:fizzy-ui-utils:2.0.3")
'org.webjars.bower:fizzy-ui-utils:jar:2.0.3'
<dependency org="org.webjars.bower" name="fizzy-ui-utils" rev="2.0.3">
  <artifact name="fizzy-ui-utils" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bower', module='fizzy-ui-utils', version='2.0.3')
)
libraryDependencies += "org.webjars.bower" % "fizzy-ui-utils" % "2.0.3"
[org.webjars.bower/fizzy-ui-utils "2.0.3"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.bower : desandro-matches-selector jar [2.0.0,2.1)

Project Modules

There are no modules declared in this project.

Fizzy UI utils

UI utility & helper functions

Used in Flickity, Isotope, Masonry, Draggabilly

Install

npm: npm install fizzy-ui-utils

Yarn: yarn add fizzy-ui-utils

API

// browser global
const utils = window.fizzyUIUtils;

// CommonJS
const utils = require('fizzy-ui-utils');

// JavaScript module
import utils from 'fizzy-ui-utils';

// ---- ---- //

utils.makeArray( obj )
// make array from object
// makeArray('single object') => [ 'single object' ]

utils.modulo( num, div )
// num [modulo] div

utils.removeFrom( ary, obj )
// remove object from array

utils.getQueryElement( elem )
// if elem is a string, use it as a selector and return element

MyClass.prototype.handleEvent = utils.handleEvent;
// enable MyClass.onclick when element.addEventListener( 'click', this, false )

utils.filterFindElements( elems, selector )
// iterate through elems, filter and find all elements that match selector

utils.debounceMethod( MyClass, methodName, threhold )
// debounce a class method

utils.docReady( callback )
// trigger callback on document ready

utils.toDashed( str )
// 'camelCaseString' -> 'camel-case-string'

utils.htmlInit( MyClass, namespace )
// on document ready, initialize MyClass on every element
// that matches [data-my-class] attribute
// pass in JSON options from attribute value

Legacy API The following methods were available in v2, and still available in v3, but should be avoided in favor of native browser API

utils.extend( a, b )
// extend object
// use Object.assign() or { ...obj } instead

utils.getParent( elem, selector )
// get parent element of an element, given a selector string
// use elem.closest( selector ) instead

Browser support

Fizzy UI utils uses ES2018 features like spread operators and arrow functions. As such its browser support is: Chrome 46+, Firefox 34+, Safari 10+, and Edge 12+.

For older browser support, including IE10 and Android 4, try v2.


MIT license. Have at it.

By Metafizzy ๐ŸŒˆ ๐Ÿป

org.webjars.bower

Metafizzy

Delightful JS plugins

Versions

Version
2.0.3
1.0.1