open-index/open-npm huggingface dataset:
npm package: @supersoup/widgets
Description: 基于 jquery 和 underscore，兼容 ie8 的组件、插件库
Author: supersoup
Latest version: 1.0.0

# widgets

## 说明

* 遵守 AMD 规范
* 兼容 ie8+

## 示例

[http://tangchao.online](http://tangchao.online)

## css 部件

* wd-button 按钮
* wd-input 输入框
* wd-select 下拉框
* wd-textarea 文本域
* wd-link 链接
* wd-card 卡片
* wd-row 行
* wd-field 字段展示
* wd-tab 标签页
* wd-table 表格

## js 插件

* checkboxAll 全选器
* checkboxes 多选列表
* chooser 选择器
* datePicker 日期选择器
* dialog 气泡对话框
* fixedHeadTable 固定表格（不建议使用，用 Table 代替）
* input 输入框
* items 标签列表
* list 列表
* loading 加载
* message 消息
* modal 模态
* navigator 导航器
* notify 通知
* number 数字选择器
* pager 分页器
* responsive 页面响应式
* search 搜索选择框
* searchInput 搜索输入框
* searchSuper 带历史记录的搜素器
* select 下拉选择
* slider 滑块
* table 表格
* tabs 标签页
* tooltip 提示框
* transfer 穿梭框
* tree 树
* treeChoose 树选框 
* treeTable 树表

## 事例查看方式

首先用 bower 安装依赖包:

```
bower install jquery#1.12.4 underscore requirejs requirejs-text mockjs
```
npm package: @superstream/client
Description: [![License](https://img.shields.io/npm/l/@superstream/client)](https://www.npmjs.com/package/@superstream/client) [![npm](https://img.shields.io/npm/v/@superstream/client.svg)](https://www.npmjs.com/package/@superstream/client)
Author: Garvit Pahal
Latest version: 0.11.0

# Superstream typescript client SDK

[![License](https://img.shields.io/npm/l/@superstream/client)](https://www.npmjs.com/package/@superstream/client)
[![npm](https://img.shields.io/npm/v/@superstream/client.svg)](https://www.npmjs.com/package/@superstream/client)

## What is Superstream?

Superstream is a protocol and a collection of SDKs for real-time money streaming on Solana. It allows anyone to
continuously send money to anyone else at any interval upto a second.

Superstream protocol is completely open-source. View it on [GitHub](https://github.com/gpahal/superstream).

Learn more about Superstream on [superstream.finance](https://superstream.finance/).

## What is Superstream typescript client SDK?

A typescript SDK to interact with on-chain Superstream program. Developers would use this typically when they want to
create a typescript app and integrate streams into that. It's compatible with browsers and native environments (like
React Native).

## Installation

```shell
# npm
npm install @superstream/client

# pnpm
pnpm install @superstream/client

# yarn
yarn add @superstream/client
```

## Usage

- Create a `SuperstreamClient`. For complete API documentation, click
  [here](https://superstream.finance/references/client-sdks/ts/functions/createSuperstreamClient.html)

```typescript
import { createSuperstreamClient } from '@superstream/client'

const client = createSuperstreamClient('devnet', wallet)

// For mainnet-beta, use:
// const client = createSuperstreamClient("mainnet-beta", wallet)

// If you don't need to execute instructions (like creating or cancelling a stream), you can omit the wallet
// const client = createSuperstreamClient("devnet")
```

- Fetch streams and do other operations using the client. For complete API documentation, click
  [here](https://superstream.finance/references/client-sdks/ts/interfaces/SuperstreamClient.html)

```typescript
const streams = await client.getAllStreams({ isPrepaid: true, recipient: new PublicKey('public-key-base-58') })
```

- Do operations on streams. For complete API documentation, click
  [here](https://superstream.finance/references/client-sdks/ts/classes/Stream.html)

```typescript
const stream = streams[0]

// Get stream public key
stream.getStreamPublicKey()
// Check is current wallet is this stream's sender
stream.isSender()
// ... and other operations

// Get current on-chain time to do even more operations on streams
const currentTime = await client.mustGetCurrentTime()

// Check if stream has stopped
stream.hasStopped()
// Check if stream is solvent
stream.isSolvent()
// Cancel stream
await stream.cancel()
// ... and other operations
```
npm package: @superstream/inspector
Description: [![License](https://img.shields.io/npm/l/@superstream/inspector)](https://www.npmjs.com/package/@superstream/inspector) [![npm](https://img.shields.io/npm/v/@superstream/inspector.svg)](https://www.npmjs.com/package/@superstream/inspector)
Author: Garvit Pahal
Latest version: 0.2.0

# Superstream inspector

[![License](https://img.shields.io/npm/l/@superstream/inspector)](https://www.npmjs.com/package/@superstream/inspector)
[![npm](https://img.shields.io/npm/v/@superstream/inspector.svg)](https://www.npmjs.com/package/@superstream/inspector)

## What is Superstream?

Superstream is a protocol and a collection of SDKs for real-time money streaming on Solana. It allows anyone to
continuously send money to anyone else at any interval upto a second.

Superstream protocol is completely open-source. View it on [GitHub](https://github.com/gpahal/superstream).

Learn more about Superstream on [superstream.finance](https://superstream.finance/).

## What is Superstream inspector?

An off-chain software that monitors the on-chain program and cancels streams when they become
[insolvent](https://superstream.finance/docs/resources/insolvency). Anyone can run this software and earn rewards for
finding insolvent streams and penalizing bad actors in the ecosystem.

### Rewards

Senders of [unbounded streams](https://superstream.finance/docs/resources/types-of-streams#unbounded-streams) pay a
deposit amount upfront. If a stream becomes insolvent, this amount is not given back to the stream senders as punishment
and distributed as a reward to whoever found the insolvent stream.

The exact deposit amount is defined in the smart contract. It is currently equal to 8 hrs of the stream value. For
example, if someone creates a stream of $10 per hour, the deposit amount would be $80.

The exact value is defined
[here](https://docs.rs/superstream/latest/superstream/state/constant.DEPOSIT_AMOUNT_PERIOD_IN_SECS.html).

## Installation

```shell
# npm
npm install -g @superstream/inspector

# pnpm
pnpm install -g @superstream/inspector

# yarn
yarn global add @superstream/inspector
```

To check if installation succeeded, run

```shell
inspector -h
```

## Usage

```shell
# Commands supported are listed below
inspector COMMAND [...ARGUMENTS] [FLAGS]

# To get help, run
inspector -h

# To get help for a specific command, run
inspector COMMAND -h
```

## Commands

- [`inspector run`](https://github.com/gpahal/superstream/blob/main/inspector/docs/run.md) - Run inspector process.
- [`inspector stats`](https://github.com/gpahal/superstream/blob/main/inspector/docs/stats.md) - Get stream stats.
npm package: @superstructure.net/c
Description: Tiny event helper with a familiar fluent API
Latest version: 1.1.1

```

     _|_|_|
   _|
   _|
   _|
     _|_|_|

```

Tiny event helper with a familiar fluent API.

### Installation

`npm install @superstructure.net/c`

### Usage

```
import C from '@superstructure.net/c';

let c = new C();


c
    .on( 'click', '.ui-element', onClick )
    .on( 'mouseenter', '.ui-element', onMouseEnter, { capture: true } )
    .on( 'module/change', null, onChange );

c.trigger( 'module/change', data );

c.off();

```

### API

#### `on( type, selector = document, handler = () => {}, options = {} )`

Register event.

`type`: `click`, `customEvent` ...

`selector`: Selector, `document` or `window`. Default: `document`.

`handler`: `function( event )`. For delegated events find the event target in `event.actualTarget`.

`options`: Options passed to addEventListener.

#### `once( type, selector = document, handler = () => {}, options = {} )`

Same as `on()` but triggers only once.

#### `off(type, selector = null, handler = null, options = null)`

Remove events registered with this instance.

`off( type, selector, handler, options )`: Remove events that match all parameters.

`off( type, selector )`: Remove events registered to the elements matching the selector.

`off( type )`: Remove events of given type.

`off()`: Remove all events registered with this instance.

#### `trigger(type, data = {}, element = root)`

Trigger `type` event. `data` object and event target are optional.
npm package: @superstructure.net/e
Description: Tiny DOM manipulation helper with a familiar fluent API
Latest version: 1.3.2

```
_____________________________
___________/\/\/\/\/\/\______
__________/\_________________
_________/\/\/\/\/\__________
________/\/\_________________
_______/\/\/\/\/\/\__________
_____________________________

```

Tiny DOM manipulation helper with a familiar fluent API.

### Installation

`npm install @superstructure.net/e`

### Usage

```
import E from @superstructure.net/e;

// create collection
new E('.my-selector');
new E('[data-module-role="button"]');
new E(elementOrNodeList);

// create element
new E('<div></div>');

// create element and do stuff
new E('<p></p>')
  .setAttr('data-module-role', 'title')
  .setText('Groovy 🎷')
  .addClass('active')
  .appendTo('body')
```

### API

##### `filter(selector|index)`

Filter the current collection by a selector or an index.

##### `find(selector)`

Get children of the current collection matching `selector`.

##### `closest(selector)`

Gets the closest parent matching `selector`.

##### `append(selector|Element|NodeList|E)`

Append nodes to the current collection.

##### `appendTo(selector|Element|NodeList|E)`

Append the current collection to the passed nodes.

##### `prepend(selector|Element|NodeList|E)`

Prepend nodes to the current collection.

##### `prependTo(selector|Element|NodeList|E)`

Prepend the current collection to the passed nodes.

##### `clone()`

Clone the collection.

##### `remove()`

Remove the collection from DOM.

##### `addClass(class)`

Add `class` to the collection.

##### `removeClass(class)`

Remove `class` from the collection.

##### `toggleClass(class)`

Toggle `class` on the collection.

##### `setAttr(key, value [,namespace])`

Set attribute `key` to `value`. If `namespace` is passed the key used is `data-{namespace}-{key}`.

##### `getAttr(key [,namespace])`

Get attribute value of `key`. If `namespace` is passed the key used is `data-{namespace}-{key}`.

##### `toggleAttr(key, values [,namespace])`

Toggle attribute `key` between `values`. If `namespace` is passed the key used is `data-{namespace}-{key}`.
`values` must be an array containing exactly two strings.

##### `setText(text)`

Set text content of the first collection entry;

##### `getText()`

Get text content of the first collection entry;

##### `setHTML(text)`

Set inner HTML of the first collection entry;

##### `getHTML()`

Get inner HTML of the first collection entry;

##### `css(syles)`

Apply styles passed as a key-value-based object. Like `{fontSize:'2rem',color:'yellow'}`.

##### `nodes(index)` / `n(index)` / `get(index)` / `dom(index)`

Get collection entry at `index`. Returns all collection entries if no index is passed.

##### `isEmpty()`

Returns `true` if the collection is empty.

##### `repaint()`

Force repaint on colection entries.

### Q&A

##### This looks a lot like JQ\*\*\*\* ...

Don’t be silly, no one is using JQuery these days, right? 😇

##### Why not using Vanilly JS instead?

You absolutely could but isn’t it nice to have a chainable API?
npm package: @superstructure.net/m
Description: Tiny ES6 module template for progressive enhancement
Latest version: 1.5.0

```
        __
       /\  \
      |::\  \
      |:|:\  \
    __|:|\:\  \
   /::::|_\:\__\
   \:\~~\  \/__/
    \:\  \
     \:\  \
      \:\__\
       \/__/

```

Tiny ES6 module template for progressive enhancement.

### Installation

`npm install @superstructure.net/m`

> Note: This library comes as es6 module only.
> If you use a transpiler like babel or swc make sure to include `/node_modules/@superstructure.net/m` in your transpiler’s config.

### Usage

Create your module...

```javascript
import M from '@superstructure.net/m';

export default class MyModule extends M {
    constructor(mediaQuery) {
        super(mediaQuery);
    }

    onInit() {}

    onResize(viewport, isUIResize) {}

    onDestroy() {}
}
```

... and use it like

```javascript
import MyModule from './myModule.js';

new MyModule('( min-width: 800px )');
```

Classes extended from M are automatically initiated and destroyed based on the provided media query (defaults to `screen`).

### Lifecycle Functions

##### `onInit()`

##### `onResize( viewport, isUIResize )`

`viewport`: `{ width: 0, height: 0, prevWidth: 0, prevHeight: 0, height100vh: 0 }`

`isUIResize`: Boolean indicating whether the resize was triggered by a visibility change of the Browser UI on mobile devices.

##### `onDestroy()`

### Methods

##### `this.selector( role )`

Returns an attribute selector based on the module’s name and the provided role.
`this.selector( 'content' )` returns `[data-MyModule-role="content"]`

##### `destroy()`

Manually destroy the instance.

### Internal properties

`this._initiated`: Boolean representing the module’s current init state. If `true` the `<html>` element has a class of `initiated--MyModule`.

`this._name`: The module’s name e.g. `MyModule`.

`this._mediaQuery`: The module’s media query.
npm package: @superstructure.net/scroll-lock
Description: Reliably lock body scroll.
Latest version: 0.0.2

```
# ########## #
# ScrollLock #
# ########## #
```

Reliably lock body scroll.

### Installation

`npm install @superstructure.net/scroll-lock`

> Note: This library comes as es6 module only.
> If you use a transpiler like babel or swc make sure to include `/node_modules/@superstructure.net/scroll-lock` in your transpiler’s config.

### Usage

```js
import ScrollLock from '@superstructure.net/scroll-lock';

const scrollLock = new ScrollLock();

scrollLock.enable();

scrollLock.disable();

scrollLock.destroy();
```
npm package: @superstructure.net/spring
Description: Vanilla JS spring-interpolated values.
Latest version: 0.0.1

```

   /`\ /`\ /`\ /`\
 ~_` /_` /_` /_` /_~

       Spring

```

Vanilla JS spring-interpolated vaules.

Heavily based on https://github.com/asbjornh/tiny-spring.

### Installation

`npm install @superstructure.net/spring`

> Note: This library comes as es6 module only.
> If you use a transpiler like babel or swc make sure to include `/node_modules/@superstructure.net/spring` in your transpiler’s config.

### Usage

```js
import Spring from '@superstructure.net/spring';

// create spring
const x = new Spring(
    0, // initial value
    {
        stiffness: 40,
        damping: 5,
        mass: 2,
        precision: 100,
    }
);

// set value
x.transition(100);

// set value immediately without transition
x.set(100);

// get current value
x.get();

// subscribe to hooks
x.onUpdate((value) => {
    // ...
});

x.onRest((value) => {
    // ...
});

// clean up...
x.destroy();
```

By default each spring runs its own animation loop via `requestAnimationFrame`. If you have a lot of springs you might achieve better performance by manually implementing a single animation frame instead of using `onUpdate()`.

```js
// create spring
const x = new Spring(
    0,
    springConfig,
    false // IMPORTANT! Omit internal animation loop
);

function onFrame() {
    // set value
    x.transition(100);

    // update spring
    x.update();

    // do what you would otherwise do in onUpdate()
    const _x = x.get();

    requestAnimationFrame(onFrame);
}

onFrame();
```