open-index/open-npm huggingface dataset:
npm package: @legoo/treasure-chest
Description: treasure-chest
Author: JinYuShao
Latest version: 0.0.1

# @legoo/treasure-chest

treasure-chest

## Installation

```sh
npm install @legoo/treasure-chest
```

## Usage

```js
import { multiply } from '@legoo/treasure-chest';

// ...

const result = await multiply(3, 7);
```

## Contributing

See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

## License

MIT

---

Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
npm package: @legosafe/theme-chalk
Description: Lego component chalk theme.
Author: yi.shyang@ele.me
Latest version: 0.0.1

# @legosafe/theme-chalk

> element component chalk theme.

## Installation

```shell
npm i  @legosafe/theme-chalk -S
```

## Usage

Use Sass import

```css
@import " @legosafe/theme-chalk";
```

Or Use webpack

```javascript
import " @legosafe/theme-chalk";
```

Or

```html
<link
  rel="stylesheet"
  href="path/to/node_modules/ @legosafe/theme-chalk/lib/index.css"
/>
```

## Import on demand

```javascript
import " @legosafe/theme-chalk/lib/input.css";
import " @legosafe/theme-chalk/lib/select.css";

// ...
```
npm package: @legt/token-service
Description: Middleware for calling blockchain interactions in a web2 environment
Author: Tony Nacumoto
Latest version: 0.0.0

# easy-web3

> Middleware for calling blockchain functions via javascript

## Install

```sh
npm install easy-web3
```

## Usage

```js
import { mint } from 'easy-web3';

mint({name:'My New Token', symbol:'MNT', supply: 1,000,000});
//=> '0x1234...' deployed token address
```

## API

### mint(tokenObject, options?)

#### input

Type: `object`

Fields in the tokenObject vary according to the type of token you are minting.  Current supported tokens are:
```
standard: 'erc20',
name:'My New Token',
symbol:'MNT',
supply: 1,000,000
```
```
standard: 'erc721',
name:'My NFT Factory',
symbol:'MNF'
```

#### options

Type: `object`

```
provider: the wallet provider of account that will be minting tokens
onSuccess: function to call on success
onError: function to call on error
```
npm package: @legtech/azureauthentication
Description: Function to extend Azure AD token lifetime through javascript polling
Latest version: 2.0.0

﻿Function to initiate polling that will keep your Azure AD token alive. Needed with POSTs and ajax calls.

To use, put the following in your layout (or in a single view if applicable):

```javascript
<script>
    var renewUrl = WSL.Url.resolve([Your renewal url]);
    WSLApp.AzureAuthentication.renewAzureSessionBeforeExpiration([token expiration string],renewUrl, [tokenLifetimeInMinutes], [expirationBufferInMinutes]);
</script>
```

Notes:
1. Your renewal url should be a link to a controller method that forces a reauthentication
1. Your token expiration string should be the expriation of your access token which is found in the claim.  
1. Your tokenLifetimeInMinutes is how long your token is configured to last in Azure AD. Typically this is 1 hour (ask TSG to confirm for your app if needed).  This js file defaults to 60 mins if you don't pass a value.
1. Your expirationBufferInMinutes is the buffer allowed before token expiration when a re-auth is tried.  This js file defaults to 5 minutes if you don't pass a value.
npm package: @legtech/clientsidehistory
Description: Adds client-side history to elements
Latest version: 1.0.0

﻿Adds client-side history to elements. This allows them to retain state when using the back button.

Monitors changes to controls with

1. The attribute data-client-side-history on them directly
1. INPUT elements (textboxes, radio buttons, checkboxes) that are inside an html element with this attribute
1. SELECT elements that are inside an html element with this attribute
npm package: @legtech/dialog
Description: Provides functionality for displaying page content in dialogs using ajax and bootstrap
Latest version: 1.0.4

﻿Provides functionality for displaying page content in dialogs using ajax and bootstrap

Start with some html element that you want to open a pop up
Put a data-dialog-url attribute in this, and set the value to the url which holds your pop up content

```html
<a data-dialog-url="www.google.com">Google it!</a>
```

If you want to submit the contents of your pop up, just put a form in there.

Want to validate the contents of the form? Then just add validators - either client or server side. If the validation fails on the server, just return the view how you want it to display (with validation errors).

Want to update the page after your dialog saves? Just return the page element from your save method
Set the id of the element and add a data-dialog-parent-id attribute (set to the id of the parent element)
npm package: @legtech/export
Description: Functions to format an html table and data into json for export to Excel
Latest version: 2.0.0

﻿Functions to format an html table and data into json for export to Excel

Steps to use:

1. Put the following in your html page or javascript:
```javascript
WSLApp.Export.init();	
```
2. Include an export button in the following format:
```html
<input type="button" class="btn btn-primary exportTableButton" value="Export" disabled data-export-table="[id of the table you want to export]" data-export-url="@Url.Action("[ACTION NAME]","[CONTROLLER NAME]")"/>
```
3. Include a controllor action to post the data too - for example:
```cs
[HttpPost]
public ActionResult ExportSearchResults(string exportSearchResultsData)
{
    if (exportSearchResultsData == null)
        return new EmptyResult();

    var searchResults = JsonConvert.DeserializeObject<IEnumerable<IEnumerable<string>>>(exportSearchResultsData);

    var csv = new StringBuilder();

    foreach (var rowResult in searchResults)
    {
        var quotedRow = rowResult.Select(p => "\"" + p.Replace("\"", "\"\"") + "\"");
        var row = string.Join(",", quotedRow);
        csv.AppendLine(row);
    }

    // This is a lot faster than using the File action.  See http://stackoverflow.com/questions/1928494/mvc-action-taking-a-long-time-to-return.

    Response.ContentType = "text/csv";
    Response.Headers.Add("Content-Disposition", "attachment;filename=SearchResults.csv");
    var csvBytes = Encoding.UTF8.GetBytes(csv.ToString());
    Response.Body.WriteAsync(csvBytes,0, csvBytes.Length );

    return new EmptyResult();
}
```

Additional Options:

1. You can add a Title for a table, which will appear above the table in the first column.  To set a title add the following attribute to a table: data-export-title="Your Title Here"
1. You can specify mulitple tables for export by using a class instead of a table id.  The tables will show up sequentially with a single line between them.  To target multiple tables use the following on the export button data-export-table="[css class on the tables you want to export]"
1. You can have the exporter ignore child elements within a table cell.  To have it ignore child elements add data-trim-children="true" to the necessary table cell.  For example, if your cell looks like <td>Text<i>Some Icon</i></td> and you would like to just export 'Text'.
1. You can override the text being exported from a cell. If set, the value of data-export-text will be used instead of the content of the cell.  To use this, add attribute data-export-text="Text to export" to any td or th.
npm package: @legtech/formatprint
Description: Functions to help format inputs to print as labels
Latest version: 2.0.0

﻿Functions to help format inputs to print as labels. Works with Bootstrap.

When the form is printed, the input elements are hidden and the labels are shown.

To use, include the "printAsLabel" class on the inputs you want to be shown as a label. For example:

```csharp
@Html.TextBoxFor(b => b.Property, new { @class = "form-control mr-2 d-print-none printAsLabel" })
@Html.RadioButtonFor(model => model.IsBill, true, new { Checked = "checked", @class = "d-print-none printAsLabel" }) Bill
```

Buttons can be tagged as print buttons using the "printWindow" class

```html
<button type="button" class="btn btn-primary printWindow">
    Print
</button>
```
npm package: @legtech/initiativeparser
Description: Provides a way to parse and convert initiatives to digit only or it's display format
Latest version: 1.0.2

﻿getLegislationNumber: Parses initiative inputs to their digit format. For example, if you supply "IL24-999", "24-999", or "IL24-999", it will return "24999".
getLegislationDisplayNumber: Converts the 5 digit initiative inputs to their proper display format. For example, if you supply "24999", it will return "IL24-999".

Steps to use: 
Make sure that you have the script referenced in your HTML file (Ex: _Layout.cshtml). 
For example: "<script src="~/lib/initiativeNumberParser.js" asp-append-version="true"></script>"
To use it in your javascript code, you would use it like so: 
"var initiativeNumber = WslInitiativeParser.getLegislationNumber(input);"
"var initiativeDisplayNumber = WslInitiativeParser.getLegislationDisplayNumber(input);"
npm package: @legtech/jsmediaqueries
Description: Javascript module to responsively modify elements when css cannot be used.  Also ties css media query breakpoints into js breakpoint so they are the same.
Author: Kate Beck
Latest version: 1.0.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

﻿Javascript module to responsively modify elements when css cannot be used.  Also ties css media query breakpoints into js breakpoint so they are the same.

To use, put the following in your site.js:

$(document).ready(function (event, data) {  
    //initialize javascript media queries
    WSLApp.JSMediaQueries.init();
    WSLApp.JSMediaQueries.apply();  
});

The processMediaQuery function will be run on every resize after the specified throttle.

Any transormations that need to occure can be put inthe ResponsiveElements file as a new function and called from jsMediaQueries (to decouple the action from the breakpoint logic).
npm package: @legtech/legtech-select
Description: HTML select UI enhancer jQuery plugin
Latest version: 2.0.2

﻿Jquery plugin to make html select inputs easier to use (UI enhancements).

# Installation

Package is dependent on jQuery and Bootstrap, so the corresponding JS and CSS must be referenced in the HTML along with the legtech-select JS and CSS.

# Basic Usage

Create a select.

```html
<select id="mySelect" class="allMySelects"><option>Option 1</option><option>Option 2</option></select>
```

Call legTechSelect() on the jquery selector of your select(s).

```javascript
$("#mySelect").legTechSelect();  or  $(".allMySelects").legTechSelect();`
```

It will automatically format the UI if the select is a single or multiple. It will ignore non-select elements. Options that are set to "selected" will be pre-selected, of course.

```html
<select id="singleSelect"><option>Option 1</option><option>Option 2</option></select>` or `<select id="multipleSelect" multiple><option>Option 1</option><option>Option 2</option></select>
```

# External data for options list

You can specify a remote source when initializing the select. Legtech-select will make an AJAX get request to pull in the list of options.

```javascript
$("#mySelect").legTechSelect("url to data");
```

The format must be an array of JSON objects with the following properties/values:

```javascript
{ value: "value of option", text: "Text to display", selected: true/false }
```

The selected property can be omitted and defaults to false.

Example

```javascript
[{ value: "US", text: "United States", selected: true },{ value: "CA", text: "Canada" }]
```

# Refreshing the List

If you update the dropdown value list you must call refresh to update the UI. Note that this will clear any selected values.

```javascript
$("#mySelect").legTechSelect("refresh");
```

Don't forget to reference the CSS file.
npm package: @legtech/namespace
Description: Provides WSLApp namespace for javascript modules
Latest version: 2.0.0

﻿Provides WSLApp namespace for javascript modules

This is the basic pattern

```js
WSLApp.ModuleName = (function () {
    // Code goes here
})();
```

To create your own namespace within your application (though most apps just use WSLApp):

```js
// Define this globally
var MyNameSpace = WSL.EnsureNamespace('My.Namespace');

// Other modules can then use your namespace variable
MyNamespace.ModuleName = (function () {

    return {
        publicFunction: functionName,
       
    };

} ());
```
npm package: @legtech/url
Description: Functions to help resolve urls in javascript when working in MVC
Latest version: 2.0.0

﻿Functions to help resolve urls in javascript when working in MVC

To use, put the following in your layout:

```html
    <script type="text/javascript">
    $(document).ready(function(event, data) {
        WSL.Url.setRelativeRoot('@Url.Content("~/")');
    });
    </script>
```

Then, in js you can resolve urls as follows:

```javascript
WSL.Url.resolve("~/Controller/Action");
```