# @pluginjs/list

> A flexible modern list js plugin.

Latest version **0.8.12** (published 2022-08-29) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install @pluginjs/list
pnpm add @pluginjs/list
yarn add @pluginjs/list
bun add @pluginjs/list
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.8.12 |
| Published | 2022-08-29 |
| First published | 2017-12-26 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >= 8 |
| Dependencies | 11 |
| Unpacked size | 100.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 17 |
| Author | Creation Studio Limited |
| Maintainers | thecreation, kaptinlin |

## Links

- npm: https://www.npmjs.com/package/@pluginjs/list
- Repository: https://github.com/pluginjs/pluginjs
- Homepage: https://pluginjs.com
- Issues: https://github.com/pluginjs/pluginjs/issues
- npm.io page: https://npm.io/package/@pluginjs/list

## Dependencies (11)

- [sortablejs](https://npm.io/package/sortablejs.md) *
- [@pluginjs/is](https://npm.io/package/@pluginjs/is.md) ^0.8.9
- [@pluginjs/dom](https://npm.io/package/@pluginjs/dom.md) ^0.8.10
- [@pluginjs/utils](https://npm.io/package/@pluginjs/utils.md) ^0.8.10
- [@pluginjs/events](https://npm.io/package/@pluginjs/events.md) ^0.8.11
- [@pluginjs/classes](https://npm.io/package/@pluginjs/classes.md) ^0.8.10
- [@pluginjs/factory](https://npm.io/package/@pluginjs/factory.md) ^0.8.10
- [@pluginjs/template](https://npm.io/package/@pluginjs/template.md) ^0.8.10
- [@pluginjs/component](https://npm.io/package/@pluginjs/component.md) ^0.8.9
- [@pluginjs/decorator](https://npm.io/package/@pluginjs/decorator.md) ^0.8.11
- [@pluginjs/pop-dialog](https://npm.io/package/@pluginjs/pop-dialog.md) ^0.8.12

## Recent versions

- 0.8.12 (latest) — 2022-08-29
- 0.8.11 — 2022-01-08
- 0.8.7 — 2021-03-25
- 0.8.6 — 2021-03-01
- 0.8.5 — 2020-08-27
- 0.8.4 — 2020-07-11
- 0.8.3 — 2020-02-11
- 0.8.2 — 2020-02-11
- 0.7.21 — 2019-12-17
- 0.7.20 — 2019-12-16
- 0.7.19 — 2019-09-20
- 0.7.18 — 2019-08-06
- 0.7.17 — 2019-07-22
- 0.7.16 — 2019-06-28
- 0.7.15 — 2019-05-31
- … 36 more at https://npm.io/package/@pluginjs/list/versions

## README

# List

[![npm package](https://img.shields.io/npm/v/@pluginjs/list.svg)](https://www.npmjs.com/package/@pluginjs/list)

A flexible modern list js plugin.

**[Samples](https://codesandbox.io/s/github/pluginjs/pluginjs/tree/master/modules/list/samples)**

## Introduction
### Installation

#### Yarn

```javascript
yarn add @pluginjs/list
```

#### NPM

```javascript
npm i @pluginjs/list
```

## Getting Started

**CDN:**

Development:

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

Production:

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

### Initialize

HTML:

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

ECMAScript Module:

```javascript
import List from "@pluginjs/list"
import "@pluginjs/list/dist/list.css"

List.of(document.querySelector('.element'), options)
```

CommonJS:

```javascript
require("@pluginjs/list/dist/list.css")
const List = require("@pluginjs/list")

List.of(document.querySelector('.element'), options)
```

Browser:

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

## API

### Options

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

Name | Description | Default
--|--|--
`"theme"` | Set plugin theme option | `null`
`"locale"` | Set locale environment | `en`
`"localeFallbacks"` | Set the plugin is localeFallbacks or not | `true`
`"data"` | Set data option | `null`
`"disabled"` | Disabled option | `false`
`"label"` | Set label | `function() {...}`
`"actions"` | Set actions option | `[{"tagName":"i","trigger":"pj-icon pj-icon-remove pj-list-close","event":"click"}]`
`"templates"` | Set default templates | `{}`
`"parse"` | The type of JSON change the type of object | `function() {...}`
`"process"` | The type of object change the type of JSON | `function() {...}`

### Events

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

Name | Description
--|--
`"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
`"add"` | Gets fired when plugin has add
`"clickItem"` | Gets fired when plugin has clickItem
`"clear"` | Gets fired when plugin has clear
`"edited"` | Gets fired when plugin has edited

### Methods

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

Name | Description
--|--
`"set"` | Set value by key
`"get"` | Get value by key
`"val"` | Set or get value by key
`"enable"` | Enabled plugin if plugin is disabled
`"disable"` | Disable plugin
`"destroy"` | Destroy plugin
`"init"` | Initial plugin
`"insert"` | Insert plugin
`"clear"` | Clear plugin

### Classes

Name | Description | Default
--||
`"NAMESPACE"` | Declare plugin namespace | `pj-list`
`"THEME"` | Declare plugin theme | `{namespace}--{theme}`
`"CONTAINER"` | Declare plugin range | `{namespace}-container`
`"ACTIVE"` | Announce plugin is actived | `{namespace}-active`
`"DISABLED"` | Announce plugin is disabled | `{namespace}-disabled`
`"ITEM"` | Declare plugin item | `{namespace}-item`
`"LABEL"` | Declare plugin label | `{namespace}-item-label`
`"ACTIONS"` | Declare plugin actions | `{namespace}-item-actions`
`"HANDLE"` | Declare plugin handle | `{namespace}-item-handle`
`"STORE"` | Declare plugin store | `{namespace}-store`
`"POPVER"` | Declare plugin popver | `{namespace}-popver`
`"CLONEANIMATE"` | Declare plugin cloneanimate | `{namespace}-item-clone-animate`

### Translations

Name | EN | ZH
--||-
`"cancel"` | Cancel | 取消
`"deleteTitle"` | Are you sure you want to delete? | 你确定要删除？
`"delete"` | Delete | 删除

## Browser support

Tested on all major browsers.

| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>IE / Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Safari | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/opera/opera_48x48.png" alt="Opera" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Opera |
| --------- | --------- | --------- | --------- | --------- |
| IE11, Edge| last 2 versions| last 2 versions| last 2 versions| last 2 versions|

## License

@pluginjs/list is Licensed under [the GPL-v3 license](LICENSE).

If you want to use @pluginjs/list 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](creationstudio.com).

---
_Source: https://npm.io/package/@pluginjs/list · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
