Socket
Socket
Sign inDemoInstall

@github/auto-complete-element

Package Overview
Dependencies
1
Maintainers
14
Versions
35
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.8.1 to 1.0.0

28

dist/index.esm.js

@@ -0,1 +1,9 @@

class AutocompleteEvent extends CustomEvent {
constructor(type, init) {
super(type, init);
this.relatedTarget = init.relatedTarget;
}
}
function debounce(callback, wait) {

@@ -290,3 +298,3 @@ let timeout;

for (const el of this.results.querySelectorAll('[role="option"]:not([id])')) {
el.id = `${this.results.id}-option-${id++}`;
el.id = "".concat(this.results.id, "-option-").concat(id++);
}

@@ -327,8 +335,2 @@ }

this.container.setAttribute('aria-expanded', 'true');
this.container.dispatchEvent(new CustomEvent('toggle', {
detail: {
input: this.input,
results: this.results
}
}));
}

@@ -341,8 +343,2 @@

this.container.setAttribute('aria-expanded', 'false');
this.container.dispatchEvent(new CustomEvent('toggle', {
detail: {
input: this.input,
results: this.results
}
}));
}

@@ -430,4 +426,5 @@

this.dispatchEvent(new CustomEvent('change', {
bubbles: true
this.dispatchEvent(new AutocompleteEvent('auto-complete-change', {
bubbles: true,
relatedTarget: autocomplete.input
}));

@@ -446,1 +443,2 @@ break;

export default AutocompleteElement;
export { AutocompleteEvent };
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global = global || self, global.AutocompleteElement = factory());
}(this, function () { 'use strict';
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(global = global || self, factory(global.AutocompleteElement = {}));
}(this, function (exports) { 'use strict';
class AutocompleteEvent extends CustomEvent {
constructor(type, init) {
super(type, init);
this.relatedTarget = init.relatedTarget;
}
}
function debounce(callback, wait) {

@@ -296,3 +304,3 @@ let timeout;

for (const el of this.results.querySelectorAll('[role="option"]:not([id])')) {
el.id = `${this.results.id}-option-${id++}`;
el.id = "".concat(this.results.id, "-option-").concat(id++);
}

@@ -333,8 +341,2 @@ }

this.container.setAttribute('aria-expanded', 'true');
this.container.dispatchEvent(new CustomEvent('toggle', {
detail: {
input: this.input,
results: this.results
}
}));
}

@@ -347,8 +349,2 @@

this.container.setAttribute('aria-expanded', 'false');
this.container.dispatchEvent(new CustomEvent('toggle', {
detail: {
input: this.input,
results: this.results
}
}));
}

@@ -436,4 +432,5 @@

this.dispatchEvent(new CustomEvent('change', {
bubbles: true
this.dispatchEvent(new AutocompleteEvent('auto-complete-change', {
bubbles: true,
relatedTarget: autocomplete.input
}));

@@ -451,4 +448,7 @@ break;

return AutocompleteElement;
exports.AutocompleteEvent = AutocompleteEvent;
exports.default = AutocompleteElement;
Object.defineProperty(exports, '__esModule', { value: true });
}));
{
"name": "@github/auto-complete-element",
"version": "0.8.1",
"version": "1.0.0",
"description": "Auto-complete input values from server results",

@@ -28,9 +28,9 @@ "repository": "github/auto-complete-element",

"devDependencies": {
"@babel/core": "^7.3.3",
"babel-preset-github": "^2.1.2",
"@babel/core": "^7.4.3",
"babel-preset-github": "^3.2.0",
"chai": "^4.2.0",
"eslint": "^5.14.1",
"eslint-plugin-github": "^1.9.0",
"flow-bin": "^0.93.0",
"karma": "^4.0.0",
"eslint": "^5.16.0",
"eslint-plugin-github": "^2.0.0",
"flow-bin": "^0.97.0",
"karma": "^4.1.0",
"karma-chai": "^0.1.0",

@@ -40,6 +40,6 @@ "karma-chrome-launcher": "^2.2.0",

"karma-mocha-reporter": "^2.2.5",
"mocha": "^6.0.0",
"rollup": "^1.2.2",
"mocha": "^6.1.3",
"rollup": "^1.10.0",
"rollup-plugin-babel": "^4.3.2",
"rollup-plugin-node-resolve": "^4.0.0"
"rollup-plugin-node-resolve": "^4.2.3"
},

@@ -46,0 +46,0 @@ "eslintIgnore": [

@@ -65,8 +65,6 @@ # <auto-complete> element

// Auto-complete result events.
completer.addEventListener('change', function(event) {
completer.addEventListener('auto-complete-change', function(event) {
console.log('Auto-completed value chosen or cleared', completer.value)
console.log('Related input element', event.relatedTarget)
})
completer.addEventListener('toggle', function(event) {
console.log('Auto-completion list is now open or closed', completer.open)
})
```

@@ -73,0 +71,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc