typedata-suggestions

1.0.2 • Public • Published

JavaScript - плагин Typedata

npm version NPM license

JavaScript-плагин для сервиса подсказок TypeData.net.

Установка

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/typedata-suggestions@latest/dist/typedata-suggestions.css">
    ...
</head>

<body>
...
<div class="typedataSuggestions_wrapper">
    <input id="typedataSuggestions" type="search" spellcheck=false autocorrect="off" autocomplete="off" autocapitalize="off">
</div>
...
<script src="https://cdn.jsdelivr.net/npm/typedata-suggestions@latest/dist/typedata-suggestions.min.js"></script>
<script>
    const typedataSuggestionsJS = new typedataSuggestions({
        token: 'TOKEN',
        events: {
            input: {
                selection: (event) => {
                    const selection = event.detail.selection.value;
                    typedataSuggestionsJS.input.value = selection.value;
                    alert(JSON.stringify(selection));
                }
            }
        }
    });
</script>
...
</body>
</html>

npm package

LICENSE

Copyright (c) 2023 Rave Technology. Licensed under the MIT license.

Package Sidebar

Install

npm i typedata-suggestions

Weekly Downloads

3

Version

1.0.2

License

MIT

Unpacked Size

64.5 kB

Total Files

18

Last publish

Collaborators

  • rave.technology