datalist-polyfill
Advanced tools
Comparing version 1.24.3 to 1.24.4
{ | ||
"name": "datalist-polyfill", | ||
"description": "Minimal and dependency-free vanilla JS datalist polyfill. Supports all standard's functionality as well as mimics other browsers behavior.", | ||
"version": "1.24.3", | ||
"version": "1.24.4", | ||
"homepage": "https://github.com/mfranzke/datalist-polyfill", | ||
@@ -6,0 +6,0 @@ "authors": [ |
@@ -14,2 +14,16 @@ # Changelog | ||
## [1.24.4] - 2020-05-23 | ||
### Changed | ||
- Updated webdriverio, prettier, husky and xo dependencies | ||
- Replaced Greenkeeper by Snyk for vulnerabilities scanning | ||
- Formatted code by prettier | ||
- husky: moved the hook to the dedicated config file | ||
- README: added Gitter badge | ||
### Fixed | ||
- npmignore: added necessary folder | ||
## [1.24.3] - 2020-03-22 | ||
@@ -16,0 +30,0 @@ |
@@ -13,3 +13,3 @@ /* | ||
(function() { | ||
(function () { | ||
'use strict'; | ||
@@ -73,7 +73,7 @@ | ||
if (typeof MutationObserver !== 'undefined') { | ||
obs = new MutationObserver(function(mutations) { | ||
obs = new MutationObserver(function (mutations) { | ||
var datalistNeedsAnUpdate = false; | ||
// Look through all mutations that just occured | ||
mutations.forEach(function(mutation) { | ||
mutations.forEach(function (mutation) { | ||
// Check if any of the mutated nodes was a datalist | ||
@@ -108,3 +108,3 @@ if ( | ||
// Function regarding the inputs interactions on keyup event | ||
var inputInputList = function(event) { | ||
var inputInputList = function (event) { | ||
var input = event.target, | ||
@@ -177,7 +177,7 @@ datalist = input.list, | ||
// On keypress check all options for that as a substring, save the original value as a data-attribute and preset that inputs value (for sorting) for all option values (probably as well enhanced by a token) | ||
var updateIEOptions = function(input, datalist) { | ||
var updateIEOptions = function (input, datalist) { | ||
var inputValue = getInputValue(input); | ||
// Loop through the options | ||
Array.prototype.slice.call(datalist.options, 0).forEach(function(option) { | ||
Array.prototype.slice.call(datalist.options, 0).forEach(function (option) { | ||
// We're using .getAttribute instead of .dataset here for IE10- | ||
@@ -212,3 +212,3 @@ var dataOriginalvalue = option.getAttribute('data-originalvalue'), | ||
// Check for the input and probably replace by correct options elements value | ||
var inputInputListIE = function(event) { | ||
var inputInputListIE = function (event) { | ||
var input = event.target, | ||
@@ -239,3 +239,3 @@ datalist = input.list; | ||
// Check for whether this is a valid suggestion | ||
var isValidSuggestion = function(option, inputValue) { | ||
var isValidSuggestion = function (option, inputValue) { | ||
var optValue = option.value.toLowerCase(), | ||
@@ -259,3 +259,3 @@ inptValue = inputValue.toLowerCase(), | ||
// Focusin and -out events | ||
var changesInputList = function(event) { | ||
var changesInputList = function (event) { | ||
// Check for correct element on this event delegation | ||
@@ -308,3 +308,3 @@ if (!event.target.matches('input[list]')) { | ||
// Prepare the input | ||
var prepareInput = function(input, eventType) { | ||
var prepareInput = function (input, eventType) { | ||
// We'd like to prevent autocomplete on the input datalist field | ||
@@ -345,3 +345,3 @@ input.setAttribute('autocomplete', 'off'); | ||
// Get the input value for dividing regular and mail types | ||
var getInputValue = function(input) { | ||
var getInputValue = function (input) { | ||
// In case of type=email and multiple attribute, we would need to grab the last piece | ||
@@ -356,3 +356,3 @@ // Using .getAttribute here for IE9 purpose - elsewhere it wouldn't return the newer HTML5 values correctly | ||
// Set the input value for dividing regular and mail types | ||
var setInputValue = function(input, datalistSelectValue) { | ||
var setInputValue = function (input, datalistSelectValue) { | ||
var lastSeperator; | ||
@@ -379,3 +379,3 @@ | ||
// Function for preparing and sorting the options/suggestions | ||
var prepOptions = function(datalist, input) { | ||
var prepOptions = function (datalist, input) { | ||
if (typeof obs !== 'undefined') { | ||
@@ -397,3 +397,3 @@ obs.disconnect(); | ||
// ... sort all entries and | ||
.sort(function(a, b) { | ||
.sort(function (a, b) { | ||
var aValue = a.value, | ||
@@ -410,3 +410,3 @@ bValue = b.value; | ||
}) | ||
.forEach(function(opt) { | ||
.forEach(function (opt) { | ||
var optionValue = opt.value, | ||
@@ -469,3 +469,3 @@ label = opt.getAttribute('label'), | ||
// Define function for setting up the polyfilling select | ||
var setUpPolyfillingSelect = function(input, datalist) { | ||
var setUpPolyfillingSelect = function (input, datalist) { | ||
// Check for whether it's of one of the supported input types defined at the beginning | ||
@@ -563,3 +563,3 @@ // Using .getAttribute here for IE9 purpose - elsewhere it wouldn't return the newer HTML5 values correctly | ||
// Functions regarding changes to the datalist polyfilling created selects keypress | ||
var datalistSelectKeyPress = function(event) { | ||
var datalistSelectKeyPress = function (event) { | ||
var datalistSelect = event.target, | ||
@@ -592,3 +592,3 @@ datalist = datalistSelect.parentNode, | ||
// Change, Click, Blur, Keydown | ||
var changeDataListSelect = function(event) { | ||
var changeDataListSelect = function (event) { | ||
var datalistSelect = event.currentTarget, | ||
@@ -646,3 +646,3 @@ datalist = datalistSelect.parentNode, | ||
// Create and dispatch the input event; divided for IE9 usage | ||
var dispatchInputEvent = function(input) { | ||
var dispatchInputEvent = function (input) { | ||
var evt; | ||
@@ -663,3 +663,3 @@ | ||
// Toggle the visibility of the datalist select | ||
var toggleVisibility = function(visible, datalistSelect) { | ||
var toggleVisibility = function (visible, datalistSelect) { | ||
if (visible) { | ||
@@ -676,3 +676,3 @@ datalistSelect.removeAttribute('hidden'); | ||
// list property / https://developer.mozilla.org/en/docs/Web/API/HTMLInputElement | ||
(function(constructor) { | ||
(function (constructor) { | ||
if ( | ||
@@ -684,3 +684,3 @@ constructor && | ||
Object.defineProperty(constructor.prototype, 'list', { | ||
get: function() { | ||
get: function () { | ||
/* | ||
@@ -705,3 +705,3 @@ According to the specs ... | ||
// Options property / https://developer.mozilla.org/en/docs/Web/API/HTMLDataListElement | ||
(function(constructor) { | ||
(function (constructor) { | ||
if ( | ||
@@ -713,3 +713,3 @@ constructor && | ||
Object.defineProperty(constructor.prototype, 'options', { | ||
get: function() { | ||
get: function () { | ||
return typeof this === 'object' && this instanceof constructor | ||
@@ -716,0 +716,0 @@ ? this.getElementsByTagName('option') |
{ | ||
"name": "datalist-polyfill", | ||
"version": "1.24.3", | ||
"version": "1.24.4", | ||
"description": "A minimal and dependency-free vanilla JavaScript datalist polyfill. Supports all standard's functionality as well as mimics other browsers behavior.", | ||
@@ -35,12 +35,12 @@ "main": "datalist-polyfill.js", | ||
"@commitlint/config-conventional": "^8.3.4", | ||
"@wdio/cli": "^5.22.3", | ||
"@wdio/dot-reporter": "^5.18.6", | ||
"@wdio/local-runner": "^5.22.3", | ||
"@wdio/mocha-framework": "^5.18.7", | ||
"@wdio/sync": "^5.20.1", | ||
"husky": "^4.2.3", | ||
"prettier": "^2.0.1", | ||
"@wdio/cli": "^6.1.12", | ||
"@wdio/dot-reporter": "^6.1.9", | ||
"@wdio/local-runner": "^6.1.12", | ||
"@wdio/mocha-framework": "^6.1.8", | ||
"@wdio/sync": "^6.1.8", | ||
"husky": "^4.2.5", | ||
"prettier": "^2.0.5", | ||
"pretty-quick": "^2.0.1", | ||
"webdriverio": "^5.22.3", | ||
"xo": "^0.28.0" | ||
"webdriverio": "^6.1.12", | ||
"xo": "^0.30.0" | ||
}, | ||
@@ -59,8 +59,3 @@ "xo": { | ||
} | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "pretty-quick --staged" | ||
} | ||
} | ||
} |
@@ -8,8 +8,9 @@ # datalist-polyfill | ||
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/d1f98a2d1fd44c41b7ad5c7670d8cdcd)](https://app.codacy.com/app/mfranzke/datalist-polyfill?utm_source=github.com&utm_medium=referral&utm_content=mfranzke/datalist-polyfill&utm_campaign=badger) | ||
[![Known Vulnerabilities](https://snyk.io/test/github/mfranzke/datalist-polyfill/badge.svg?targetFile=package.json)](https://snyk.io/test/github/mfranzke/datalist-polyfill?targetFile=package.json) | ||
[![dependencies Status](https://david-dm.org/mfranzke/datalist-polyfill/status.svg "Count of dependencies")](https://david-dm.org/mfranzke/datalist-polyfill "datalist polyfill – on david-dm") | ||
[![datalist-polyfill on Npmjs](https://img.shields.io/npm/v/datalist-polyfill.svg?color=rgb%28237%2C%2028%2C%2036%29 "npm version")](https://npmjs.com/package/datalist-polyfill "datalist polyfill – on NPM") | ||
[![Greenkeeper badge](https://badges.greenkeeper.io/mfranzke/datalist-polyfill.svg)](https://greenkeeper.io/) | ||
[![dependencies Status](https://david-dm.org/mfranzke/datalist-polyfill/status.svg "Count of dependencies")](https://david-dm.org/mfranzke/datalist-polyfill "datalist polyfill – on david-dm") | ||
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier) | ||
[![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo) | ||
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org) | ||
[![Join the chat at https://gitter.im/datalist-polyfill/community](https://badges.gitter.im/datalist-polyfill/community.svg)](https://gitter.im/datalist-polyfill/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
@@ -16,0 +17,0 @@ **Update:** Safari now supports the `datalist` element at least basically, as [announced earlier this year with the latest release of Safari both for iOS and MacOS X](https://developer.apple.com/documentation/safari_release_notes/safari_12_1_release_notes#3130314). Yeah !!! Exciting news! |
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
69119
227