1.2.0 • Published 3 years ago

@riot-material/focus-manager v1.2.0

Weekly downloads
3
License
MIT
Repository
-
Last release
3 years ago

focus manager for riot-material

Installation

You can install it via nodejs

npm install @riot-material/focus-manager

or download one of the bundled file

/**
 * `dist/index.amd.js`
 * `dist/index.umd.js`
 */
requirejs.config({
  paths: {
    "@riot-material/focus-manager": "path/to/@riot-material/focus-manager",
  },
});

require(['@riot-material/focus-manager'], function (focusManager) {
    // ...
});

/**
 * `dist/index.js`
 */
import * as focusManager from "@riot-material/focus-manager";

// or

import { ... } from "@riot-material/focus-manager";

otherwise you can include the script in your project html

<script src="@riot-material/focus-manager/index.umd.js" />

and access it via

window.riotMaterial.focusManager;

Methods

hold(options?:IOptions): void

release(): void

on<T extends keyofIManageableEvent`>(type: T, listener: (event: HTMLElementEventMapT) => void): void

Interfaces

IOptions

element?: HTMLElement onFocusInside?: (element: Element) => boolean if returns true the focus is kept to the element and hold back when it blurs away onFocusOutside?: (element: Element) => boolean if returns true the focus-manager is released onPrevious?: () => void onNext?: () => void

IManageableEvent

"keydown": KeyboardEvent "keyup": KeyboardEvent

1.2.0

3 years ago

1.1.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago