Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@openscd/oscd-filtered-list

Package Overview
Dependencies
Maintainers
5
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@openscd/oscd-filtered-list

Webcomponent oscd-filtered-list following open-wc recommendations

latest
npmnpm
Version
1.1.1
Version published
Maintainers
5
Created
Source

<oscd-filtered-list>

This webcomponent follows the open-wc recommendation.

Installation

npm i @openscd/oscd-filtered-list

Usage

<script type="module">
  import 'oscd-filtered-list';
</script>

<oscd-filtered-list></oscd-filtered-list>

Linting and formatting

To scan the project for linting and formatting errors, run

npm run lint

To automatically fix linting and formatting errors, run

npm run format

Testing with Web Test Runner

To execute a single test run:

npm run test

To run the tests in interactive watch mode run:

npm run test:watch

Demoing with Storybook

To run a local instance of Storybook for your component, run

npm run storybook

To build a production version of Storybook, run

npm run storybook:build

Tooling configs

For most of the tools, the configuration is in the package.json to reduce the amount of files in your project.

If you customize the configuration a lot, you can consider moving them to individual files.

Icon font

Material Icons are being used for the icons. This font needs to be added in the html first. You can add it like so:

<link
  href="https://fonts.googleapis.com/css?family=Material+Icons&display=block"
  rel="stylesheet"
/>

Local Demo with web-dev-server

npm start

To run a local development server that serves the basic demo located in demo/index.html

src/OscdFilteredList.ts:

Exports

KindNameDeclarationModulePackage
custom-element-definitionoscd-filtered-listOscdFilteredList/src/oscd-filtered-list.js
jsOscdFilteredListOscdFilteredListsrc/OscdFilteredList.ts

src/oscd-filtered-list.ts:

class: OscdFilteredList, oscd-filtered-list

Superclass

NameModulePackage
LitElementlit-element

Fields

NamePrivacyTypeDefaultDescriptionInherited From
searchFieldLabelstring | undefinedsearch mwc-textfield label property
disableCheckAllbooleanfalseWhether the check all option (checkbox next to search text field) is activated
filterstring | undefinedThe current input value of the filter textbox
wrapFocusbooleanfalseWhen `true`, pressing `up` on the keyboard when focused on the first item will focus the last item and `down` when focused on the last item will focus the first item.
multibooleanfalseWhen `true`, enables selection of multiple items. This will result in `index` being of type `Set<number>` and selected returning `ListItemBase[]`.
activatablebooleanfalseSets activated attribute on selected items which provides a focus-persistent highlight.
listList
selectedCurrently-selected list item(s). When `multi` is `true`, `selected` is of type `ListItemBase[]` and when `false`, `selected` is of type `ListItemBase`. `selected` is `null` when no item is selected.
indexIndex / indices of selected item(s). When `multi` is `true`, `index` is of type `number` and when `false`, `index` is of type `Set<number>`. Unset indicies are `-1` and empty `Set<number>` for single and multi selection respectively.
itemsArray<ListItem>[]All list items that are available for selection. Eligible items have the `[mwc-list-item]` attribute which `ListItemBase` applies automatically.
searchFieldTextField

Methods

NamePrivacyDescriptionParametersReturnInherited From
onFilterInputvoid

Events

NameTypeDescriptionInherited From
actionActionEventFired when a selection has been made via click or keyboard action.
selectedSelectedEventFired when a selection has been made. `index` is the selected index (will be of type `Set<number>` if multi and `number` if single), and `diff` (of type `IndexDiff`\*\*) represents the diff of added and removed indices from previous selection.

Functions

NameDescriptionParametersReturn
redispatchEventelement: LitElement, event: Event

Exports

KindNameDeclarationModulePackage
jsredispatchEventredispatchEventsrc/oscd-filtered-list.ts
jsOscdFilteredListOscdFilteredListsrc/oscd-filtered-list.ts

© 2023 Alliander N.V.

FAQs

Package last updated on 31 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts