From 6d21d1f5971489c5c85f8d1ff58e9e6e8e3e6b97 Mon Sep 17 00:00:00 2001 From: Tarek Raafat Date: Sat, 30 Jan 2021 11:36:40 +0200 Subject: [PATCH] v8.3.0 => Release Notes for details --- README.md | 6 +++--- dist/js/autoComplete.js | 3 ++- dist/js/autoComplete.js.gz | Bin 5535 -> 5536 bytes dist/js/autoComplete.min.js | 2 +- dist/js/autoComplete.min.js.gz | Bin 3775 -> 3774 bytes docs/README.md | 22 +++++++++++----------- docs/_coverpage.md | 2 +- docs/demo/index.html | 4 ++-- docs/releases.md | 5 ++++- package.json | 3 ++- src/controllers/listController.js | 8 ++++---- 11 files changed, 30 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 3847eb07..d857ee13 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@

-> Simple autocomplete pure vanilla Javascript library. :rocket: Live Demo **v8.2** +> Simple autocomplete pure vanilla Javascript library. :rocket: Live Demo **v8.3** autoComplete.js is a simple pure vanilla Javascript library that's progressively designed for speed, high versatility and seamless integration with a wide range of projects & systems, made for users and developers in mind. @@ -54,13 +54,13 @@ git clone https://github.com/TarekRaafat/autoComplete.js.git `CSS` ```html - + ``` `JS` ```html - + ``` - npm install `(Node Package Manager)` diff --git a/dist/js/autoComplete.js b/dist/js/autoComplete.js index dbcfcef2..521ad1e2 100644 --- a/dist/js/autoComplete.js +++ b/dist/js/autoComplete.js @@ -195,8 +195,9 @@ var _loop = function _loop(index) { var item = data.results[index]; var resultItem = createItem(item, index, config); - resultItem.addEventListener("click", function () { + resultItem.addEventListener("click", function (event) { var dataFeedback = { + event: event, matches: matches, input: data.input, query: data.query, diff --git a/dist/js/autoComplete.js.gz b/dist/js/autoComplete.js.gz index 70fd2849c7bf8f7bdda34d0f4d13f1d0b7bf5199..e3b778da08ddbf7a3fdb9cefb1dfcf53750d5974 100644 GIT binary patch delta 5525 zcmV;G6>93AE1)Zo8h^*Ko#b*O+bXYOS6t^jZtc4-icdw67>O~5oFzH3w6^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@*z)D|B&#(mJ=`=; zZxejqt04H9HuVTxTHisEU`~4Q2#R%Cjyxm z*2?AU)%g?si$@b^?;zuMl=9Gaq$E92$#F*p+-X6S0Jj}#Nc4j=yEOmy?wW~z@#>^n z>R>jdlix);8F+kOXcnB?$**Eff9cQ0xY*h@u(CJyGahPS5RiqZr931x_}oW;S}svIq|z{svUoVCpqDs&v@M6xgCHj zV$u{NibAiwSZI0L?m!V^khzh6%YDLYPG6Jq>rZD15&k}TQqsZSuj*SFC!HKbr>=rS zOoduO zUq=C!JJ$a(s)FjjsQxeII{xo9fTpt55VETj(ENf|R1{DDS-#?j%CO0QE&iTi!Zk7Z zO^B`;8V74emA+?50{<`YKFsG#l_~BjRGcbRoGeykj)RLQ$*W@2^^4*7Z>HH5_z`T5 zo8}?&@)&=wme%iWyHmY&H~-zKz_cg7T+{_Nb8o=E)HoTsLh|kJU)bOGBe@<``j_e2 Wzhw8l+Z?}G|6h8q?QshOTmS&XL)py$ diff --git a/dist/js/autoComplete.min.js b/dist/js/autoComplete.min.js index 4b645c50..416b69a4 100644 --- a/dist/js/autoComplete.min.js +++ b/dist/js/autoComplete.min.js @@ -1 +1 @@ -var a,b;a=this,b=function(){"use strict";function e(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,i=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:t}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,r=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw r}}}}function u(e,t){for(var n=document.getElementsByClassName(e.resultsList.className),i=0;i=e.length&&(o=0),o<0&&(o=e.length-1),e[o].setAttribute("aria-selected","true"),e[o].classList.add("autoComplete_selected")},a=n.resultsList.navigation||function(e){var t=document.getElementById(n.resultsList.idName);if(!t)return n.inputField.removeEventListener("keydown",a);t=t.getElementsByTagName(n.resultItem.element),27===e.keyCode?(n.inputField.value="",u(n)):40===e.keyCode||9===e.keyCode?i(e,t,!0,n):38===e.keyCode||9===e.keyCode?i(e,t,!1,n):13===e.keyCode&&(e.preventDefault(),-1'.concat(a,""):a,o++),r.push(a)}if(o===e.length)return r.join("")}else if(i.includes(e))return e=new RegExp("".concat(e),"i").exec(t),n.highlight?t.replace(e,''.concat(e,"")):t}(s,t,o))&&e?a.push({key:e,index:n,match:t,value:i}):t&&!e&&a.push({index:n,match:t,value:i}))}var i=o.data.store[n];if(o.data.key){var t,r=l(o.data.key);try{for(r.s();!(t=r.n()).done;)e(t.value)}catch(e){r.e(e)}finally{r.f()}}else e()},t=0;t=r.threshold&&o.replace(/ /g,"").length)?a.dataStore().then(function(e){try{return u(a),a.start(n,i),s.call(a)}catch(e){return t(e)}},t):(u(a),s.call(a));function s(){return e()}})}},{key:"init",value:function(){var e,n,i,r,t=this;this.inputField="string"==typeof this.selector?document.querySelector(this.selector):this.selector(),(e=this).inputField.setAttribute("type","text"),e.inputField.setAttribute("role","combobox"),e.inputField.setAttribute("aria-haspopup",!0),e.inputField.setAttribute("aria-expanded",!1),e.inputField.setAttribute("aria-controls",e.resultsList.idName),e.inputField.setAttribute("aria-autocomplete","both"),this.placeHolder&&this.inputField.setAttribute("placeholder",this.placeHolder),this.hook=(n=function(){t.compose()},i=this.debounce,function(){var e=this,t=arguments;clearTimeout(r),r=setTimeout(function(){return n.apply(e,t)},i)}),this.trigger.event.forEach(function(e){t.inputField.removeEventListener(e,t.hook),t.inputField.addEventListener(e,t.hook)}),d(this.inputField,null,"init")}},{key:"preInit",value:function(){var o=this,s=document;new MutationObserver(function(e,t){var n,i=s.querySelector(o.selector),r=l(e);try{for(r.s();!(n=r.n()).done;){n.value;i&&(t.disconnect(),d(i,null,"connect"),o.init())}}catch(e){r.e(e)}finally{r.f()}}).observe(s,{childList:!0,subtree:!0})}},{key:"unInit",value:function(){this.inputField.removeEventListener("input",this.hook),d(this.inputField,null,"unInit")}}])&&e(n.prototype,i),h&&e(n,h),T},"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):(a="undefined"!=typeof globalThis?globalThis:a||self).autoComplete=b(); +var a,b;a=this,b=function(){"use strict";function e(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,i=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:t}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,r=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw r}}}}function u(e,t){for(var n=document.getElementsByClassName(e.resultsList.className),i=0;i=e.length&&(o=0),o<0&&(o=e.length-1),e[o].setAttribute("aria-selected","true"),e[o].classList.add("autoComplete_selected")},a=n.resultsList.navigation||function(e){var t=document.getElementById(n.resultsList.idName);if(!t)return n.inputField.removeEventListener("keydown",a);t=t.getElementsByTagName(n.resultItem.element),27===e.keyCode?(n.inputField.value="",u(n)):40===e.keyCode||9===e.keyCode?i(e,t,!0,n):38===e.keyCode||9===e.keyCode?i(e,t,!1,n):13===e.keyCode&&(e.preventDefault(),-1'.concat(a,""):a,o++),r.push(a)}if(o===e.length)return r.join("")}else if(i.includes(e))return e=new RegExp("".concat(e),"i").exec(t),n.highlight?t.replace(e,''.concat(e,"")):t}(s,t,o))&&e?a.push({key:e,index:n,match:t,value:i}):t&&!e&&a.push({index:n,match:t,value:i}))}var i=o.data.store[n];if(o.data.key){var t,r=l(o.data.key);try{for(r.s();!(t=r.n()).done;)e(t.value)}catch(e){r.e(e)}finally{r.f()}}else e()},t=0;t=r.threshold&&o.replace(/ /g,"").length)?a.dataStore().then(function(e){try{return u(a),a.start(n,i),s.call(a)}catch(e){return t(e)}},t):(u(a),s.call(a));function s(){return e()}})}},{key:"init",value:function(){var e,n,i,r,t=this;this.inputField="string"==typeof this.selector?document.querySelector(this.selector):this.selector(),(e=this).inputField.setAttribute("type","text"),e.inputField.setAttribute("role","combobox"),e.inputField.setAttribute("aria-haspopup",!0),e.inputField.setAttribute("aria-expanded",!1),e.inputField.setAttribute("aria-controls",e.resultsList.idName),e.inputField.setAttribute("aria-autocomplete","both"),this.placeHolder&&this.inputField.setAttribute("placeholder",this.placeHolder),this.hook=(n=function(){t.compose()},i=this.debounce,function(){var e=this,t=arguments;clearTimeout(r),r=setTimeout(function(){return n.apply(e,t)},i)}),this.trigger.event.forEach(function(e){t.inputField.removeEventListener(e,t.hook),t.inputField.addEventListener(e,t.hook)}),d(this.inputField,null,"init")}},{key:"preInit",value:function(){var o=this,s=document;new MutationObserver(function(e,t){var n,i=s.querySelector(o.selector),r=l(e);try{for(r.s();!(n=r.n()).done;){n.value;i&&(t.disconnect(),d(i,null,"connect"),o.init())}}catch(e){r.e(e)}finally{r.f()}}).observe(s,{childList:!0,subtree:!0})}},{key:"unInit",value:function(){this.inputField.removeEventListener("input",this.hook),d(this.inputField,null,"unInit")}}])&&e(n.prototype,i),h&&e(n,h),T},"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):(a="undefined"!=typeof globalThis?globalThis:a||self).autoComplete=b(); diff --git a/dist/js/autoComplete.min.js.gz b/dist/js/autoComplete.min.js.gz index 8842fe6ce30989752785a1049c9bc4687c6e5678..38419d248ef992a60b2b01daa0fbdfd6c5e171fd 100644 GIT binary patch literal 3774 zcmV;v4ngrBiwFP!000006Qx>hbK|xV{@!09vn@l;!8|)@)08q#<2ZK{&p78y?0$0G z3`9W|?kGSdLD{av|K4W-zDn{rna*5dzAUiV-Dh8^HP1(!O~*Vj3t6yfGA~tXq*g(= z@ybGs3X{v!c;n{zNCbkJa5L9=u*PDQoQ&0(i87%c%wnwGya_k-TqfpD-H&A?RJjy6 zpJpQI-)y%>r%XnvR&)7Ky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D9~9Q2)*Zr@gGvxGZEDBXxh(zFpA+YNn_-p+-X zO?m#EQTFULE@KK8E=FX42wgYfAT$2Had|YP?w-6n+rq`sV^Qp1Gw0svj5%jc7j1Vn zulx$<&e_V})E=GHEx?qu9-2N?%?UcM%)ZxLTL;WO*BdoHmtEB)wU=dI{e91`vaNTa z^o6w!lU}o)d!)bbb_4NQ<12`KwXM^fd8;C}wB|}*S%=s3vJn9o&7S>r50=?C|ENPI zTK(Q(35(gbh8?`2VSLjtzUwi*t$DRD$iDaoEfO;BA2i0#bZyek{+SqBdE$?3#I=$r zaZ`6I-F5R3KxOwVlG%gH{D_m>pxg6le3;n$?8D_FnYGwy>@qoc5|uuAA^oN8C0uvw zTX|78@s>4BzHFf;>pA<`zJB9o{EWuBmZho8QOX4M`hXhTdIY_XojUqXBH0#3<#fVyyaMt3Tpeirpd8m#}81#k`qAakNGs#|SBidl5~~ zSm{6Z@k6Xwj};&_a?4uEc-(9JTXO0bw|)RSVk%~bnu3-5h-S@3eDSL>CVtp8)*Y2Kx#e2Wtu zd>d&#w!F8VO0>Lblvps;*2Rv!+#iN}R@&RjkuDr*aIm=EZlU$}tpCv($V}?s6S;Bo zpb|QqkNaHI{gh&y7bv#wa5)J zA>BEU8&ZhF*@PO-Cbr5)1#o`o?0XP7lKwxYxRbb_Hlc3)a%>s4yJD#r{)93k2FY%RQK}q1QYpQI+urYK{NR2P1A82Y~nU(P1}GMXY> p^XwRdr$SG8aSyR3-DS#mI~aW)C;eWH*pC0{{{X6oOdy&j000k)Zm<9V diff --git a/docs/README.md b/docs/README.md index 481cd9fa..b3206530 100644 --- a/docs/README.md +++ b/docs/README.md @@ -16,7 +16,7 @@

autoComplete.js

-> Simple autocomplete pure vanilla Javascript library. :rocket: Live Demo **v8.2** +> Simple autocomplete pure vanilla Javascript library. :rocket: Live Demo **v8.3** autoComplete.js is a simple pure vanilla Javascript library that's progressively designed for speed, high versatility and seamless integration with a wide range of projects & systems, made for users and developers in mind. @@ -69,13 +69,13 @@ npm run build `CSS` ```html - + ``` `JS` ```html - + ``` - cdnjs Logo CDN @@ -83,27 +83,27 @@ npm run build `CSS` ```html - + ``` `JS` ```html - + ``` -- unpkg Logo CDN +- unpkg Logo CDN `CSS` ```html - + ``` `JS` ```html - + ``` - HTML Logo HTML Local load @@ -151,7 +151,7 @@ const autoComplete = require("@tarekraafat/autocomplete.js/dist/js/autoComplete" ```html OR - + ``` 2. Assign the default `id` value `"autoComplete"` to the desired input field or use any custom `id/class` and configure the API selector accordingly in `Step 4` @@ -166,7 +166,7 @@ OR OR - + ``` @@ -326,7 +326,7 @@ it with [autoComplete.js][so tag]. * * * -## 6. What's New in v8.2? +## 6. What's New in v8.3? Check out Releases Information :sparkles: diff --git a/docs/_coverpage.md b/docs/_coverpage.md index cace437c..ae3709e9 100644 --- a/docs/_coverpage.md +++ b/docs/_coverpage.md @@ -2,7 +2,7 @@ autoComplete.js Logo -> Simple autocomplete pure vanilla Javascript library. Live Demo **v8.2** +> Simple autocomplete pure vanilla Javascript library. Live Demo **v8.3** autoComplete.js is a simple pure vanilla Javascript library that's progressively designed for speed,
high versatility and seamless integration with a wide range of projects & systems. diff --git a/docs/demo/index.html b/docs/demo/index.html index dcd58170..fabc5d5a 100644 --- a/docs/demo/index.html +++ b/docs/demo/index.html @@ -72,7 +72,7 @@ + href="https://cdn.jsdelivr.net/npm/@tarekraafat/autocomplete.js@8.3.0/dist/css/autoComplete.min.css"> @@ -151,7 +151,7 @@

mode

- + diff --git a/docs/releases.md b/docs/releases.md index 4069d4ad..41be0675 100644 --- a/docs/releases.md +++ b/docs/releases.md @@ -26,7 +26,10 @@ Release flags: ## Release Notes -- v8.2.3 ✨ +- v8.3.0 ✨ + - ➕ Added: `event` object to the `onSelection` data `feedback` (Thanks 👍 @Liano) #176 + +- v8.2.3 - 🔧 Fix: `resultItem` ID `setAttribute` to be `idName` instead of `className` (Thanks 👍 @marsimeau) #173 - v8.2.2 diff --git a/package.json b/package.json index 34b32b58..f8829f6d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tarekraafat/autocomplete.js", - "version": "8.2.3", + "version": "8.3.0", "description": "Simple autocomplete pure vanilla Javascript library.", "keywords": [ "simple", @@ -43,6 +43,7 @@ "dist/css/autoComplete.css", "dist/css/autoComplete.01.css", "dist/css/autoComplete.02.css", + "dist/css/images/magnifier.svg", "dist/css/images/search.svg" ], "main": "dist/js/autoComplete.js", diff --git a/src/controllers/listController.js b/src/controllers/listController.js index 46777955..6fbdd8ce 100644 --- a/src/controllers/listController.js +++ b/src/controllers/listController.js @@ -6,7 +6,7 @@ import createItem from "../components/Item"; * * @param {Object} config - autoComplete configurations * @param {Element} element - Current selected element - * + * */ const closeAllLists = (config, element) => { // Get all autoComplete lists @@ -29,7 +29,7 @@ const closeAllLists = (config, element) => { * @param {Object} config - autoComplete configurations * @param {Object|Array} data - The available data object * @param {Array} matches - autoComplete configurations - * + * * @return {Component} - The matching results list component */ const generateList = (config, data, matches) => { @@ -43,12 +43,12 @@ const generateList = (config, data, matches) => { // create result item const resultItem = createItem(item, index, config); // Listen to clicks on this item - resultItem.addEventListener("click", (e) => { + resultItem.addEventListener("click", (event) => { // Prepare onSelection feedback data object const dataFeedback = { + event, matches, input: data.input, - event: e, query: data.query, results: data.results, selection: {