@aria-ui/collection
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -88,4 +88,3 @@ // src/index.ts | ||
const index = this._indexes.get(value); | ||
if (index == null) | ||
return null; | ||
if (index == null) return null; | ||
return (_a = this._items[index]) != null ? _a : null; | ||
@@ -92,0 +91,0 @@ } |
{ | ||
"name": "@aria-ui/collection", | ||
"type": "module", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"private": false, | ||
@@ -13,4 +13,4 @@ "sideEffects": false, | ||
"devDependencies": { | ||
"tsup": "^8.0.2", | ||
"typescript": "^5.4.5" | ||
"tsup": "^8.3.0", | ||
"typescript": "^5.6.3" | ||
}, | ||
@@ -17,0 +17,0 @@ "publishConfig": { |
132
README.md
# @aria-ui/collection | ||
## Classes | ||
## Collection <a id="collection" href="#collection">#</a> | ||
### Collection | ||
<dl> | ||
```ts | ||
new Collection(items: Iterable<HTMLElement>, loop: boolean): Collection | ||
``` | ||
<dt> | ||
| Property | Modifier | Type | | ||
| :------- | :--------- | :-------- | | ||
| `loop` | `readonly` | `boolean` | | ||
`constructor` | ||
#### Methods | ||
</dt> | ||
##### first() | ||
<dd> | ||
```ts | ||
first(): null | string | ||
``` | ||
new Collection(items: Iterable<HTMLElement, any, any>, loop?: boolean): Collection | ||
``` | ||
##### getElement() | ||
</dd> | ||
<dt> | ||
`loop` | ||
</dt> | ||
<dd> | ||
**Type**: `boolean` | ||
</dd> | ||
<dt> | ||
`first` | ||
</dt> | ||
<dd> | ||
```ts | ||
getElement(value: string): null | HTMLElement | ||
const first: () => null | string; | ||
``` | ||
##### getValues() | ||
</dd> | ||
<dt> | ||
`getElement` | ||
</dt> | ||
<dd> | ||
```ts | ||
getValues(): string[] | ||
const getElement: (value: string) => null | HTMLElement; | ||
``` | ||
##### last() | ||
</dd> | ||
<dt> | ||
`getValues` | ||
</dt> | ||
<dd> | ||
```ts | ||
last(): null | string | ||
const getValues: () => string[]; | ||
``` | ||
##### next() | ||
</dd> | ||
<dt> | ||
`last` | ||
</dt> | ||
<dd> | ||
```ts | ||
next(value: null | string): null | string | ||
const last: () => null | string; | ||
``` | ||
##### prev() | ||
</dd> | ||
<dt> | ||
`next` | ||
</dt> | ||
<dd> | ||
```ts | ||
prev(value: null | string): null | string | ||
const next: (value: null | string) => null | string; | ||
``` | ||
##### size() | ||
</dd> | ||
<dt> | ||
`prev` | ||
</dt> | ||
<dd> | ||
```ts | ||
size(): number | ||
const prev: (value: null | string) => null | string; | ||
``` | ||
## Type Aliases | ||
</dd> | ||
### ItemFilter() | ||
<dt> | ||
`size` | ||
</dt> | ||
<dd> | ||
```ts | ||
type ItemFilter: (options: Object) => boolean; | ||
const size: () => number; | ||
``` | ||
</dd> | ||
</dl> | ||
## ItemFilter <a id="item-filter" href="#item-filter">#</a> | ||
The filter function to determine if an item should be shown in the collection. | ||
## Functions | ||
**Type**: `(options: { query: string; value: string }) => boolean` | ||
### defaultItemFilter() | ||
## defaultItemFilter <a id="default-item-filter" href="#default-item-filter">#</a> | ||
A simple case-insensitive substring match filter. | ||
```ts | ||
function defaultItemFilter(options: Object): boolean; | ||
function defaultItemFilter(options: { query: string; value: string }): boolean; | ||
``` | ||
A simple case-insensitive substring match filter. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6371
146
151