0.8.11 • Published 2 years ago

@pluginjs/radio v0.8.11

Weekly downloads
-
License
GPL-3.0
Repository
github
Last release
2 years ago

Radio

npm package

A flexible modern radio js plugin.

Samples

Introduction

Installation

Yarn

yarn add @pluginjs/radio

NPM

npm i @pluginjs/radio

Getting Started

CDN:

Development:

<script src="https://unpkg.com/@pluginjs/radio/dist/radio.js"></script>
<link rel="stylesheet" href="https://unpkg.com/@pluginjs/radio/dist/radio.css">

Production:

<script src="https://unpkg.com/@pluginjs/radio/dist/radio.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/@pluginjs/radio/dist/radio.min.css">

Initialize

HTML:

<div class="element"></div>

ECMAScript Module:

import Radio from "@pluginjs/radio"
import "@pluginjs/radio/dist/radio.css"

Radio.of(document.querySelector('.element'), options)

CommonJS:

require("@pluginjs/radio/dist/radio.css")
const Radio = require("@pluginjs/radio")

Radio.of(document.querySelector('.element'), options)

Browser:

<link rel="stylesheet" href="https://unpkg.com/@pluginjs/radio/dist/radio.css">
<script src="https://unpkg.com/@pluginjs/radio/dist/radio.js"></script>
<script>
  Pj.radio('.element', options)
</script>

API

Options

Options are called on radio instances through the radio options itself. You can also save the instances to variable for further use.

NameDescriptionDefault
"theme"Set plugin theme optionnull
"classes"Set the button class name{"button":"{namespace}-default"}
"disabled"Disabled pluginfalse
"getWrap"Get the parent element of each elementfunction() {...}
"getLabel"Get the adjacent element of each elementfunction() {...}
"getIcon"Get the descendants of each elementfunction() {...}
"getGroup"Set the value of the input attributefunction() {...}
"templates"Set default templates{}

Events

Events are called on radio instances through the radio events itself. You can also save the instances to variable for further use.

NameDescription
"ready"Gets fired when plugin has ready
"enable"Gets fired when plugin has enabled
"disable"Gets fired when plugin has disabled
"destroy"Gets fired when plugin has destroy
"change"Gets fired when plugin has changed
"check"Gets fired when plugin has check
"uncheck"Gets fired when plugin has uncheck

Methods

Methods are called on radio instances through the radio method itself. You can also save the instances to variable for further use.

NameDescription
"enable"Enabled plugin if plugin is disabled
"disable"Disable plugin
"destroy"Destroy plugin
"get"Get value by key
"set"Set value by key
"val"Set or get value by key
"check"Set check
"uncheck"Set uncheck

Classes

Name | Description | Default --|| "NAMESPACE" | Declare plugin namespace | pj-radio "WRAP" | Declare plugin wrap | {namespace} "THEME" | Declare plugin theme | {namespace}-{theme} "ICON" | Declare plugin icon | "CHECKED" | Declare plugin checked | {namespace}-checked "DISABLED" | Announce plugin is disabled | {namespace}-disable

Browser support

Tested on all major browsers.

IE / EdgeFirefoxChromeSafariOpera
IE11, Edgelast 2 versionslast 2 versionslast 2 versionslast 2 versions

License

@pluginjs/radio is Licensed under the GPL-v3 license.

If you want to use @pluginjs/radio project to develop commercial sites, themes, projects, and applications, the Commercial license is the appropriate license. With this option, your source code is kept proprietary.

For purchase an Commercial License, contact us purchase@thecreation.co.

Copyright

Copyright (C) 2022 Creation Studio Limited.

0.8.11

2 years ago

0.8.10

2 years ago

0.8.9

3 years ago

0.8.8

3 years ago

0.8.7

3 years ago

0.8.6

3 years ago

0.8.5

4 years ago

0.8.4

4 years ago

0.8.3

4 years ago

0.8.2

4 years ago

0.7.21

4 years ago

0.7.20

4 years ago

0.7.19

4 years ago

0.7.18

5 years ago

0.7.17

5 years ago

0.7.16

5 years ago

0.7.15

5 years ago

0.7.14

5 years ago

0.7.13

5 years ago

0.7.12

5 years ago

0.7.11

5 years ago

0.7.10

5 years ago

0.7.9

5 years ago

0.7.8

5 years ago

0.7.7

5 years ago

0.7.6

5 years ago

0.7.5

5 years ago

0.7.4

5 years ago

0.7.3

6 years ago

0.7.2

6 years ago

0.7.1

6 years ago

0.7.0

6 years ago

0.6.5

6 years ago

0.6.4

6 years ago

0.6.3

6 years ago

0.6.2

6 years ago

0.6.1

6 years ago

0.2.21

6 years ago

0.2.20

6 years ago

0.2.19

6 years ago

0.2.18

6 years ago

0.2.17

6 years ago

0.2.16

6 years ago

0.2.15

6 years ago

0.2.14

6 years ago

0.2.13

6 years ago

0.2.11

6 years ago

0.2.10

6 years ago

0.2.9

6 years ago

0.2.8

6 years ago

0.2.7

6 years ago

0.2.6

6 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago