Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nrk/core-input

Package Overview
Dependencies
Maintainers
88
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nrk/core-input - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

2

core-input.js

@@ -35,3 +35,3 @@ import {name, version} from './package.json'

addEvent(UUID, 'click', onClickOrFocus)
addEvent(UUID, 'focus', onClickOrFocus)
addEvent(UUID, 'focus', onClickOrFocus, true) // Use focus with capturing instead of focusin for old Firefox
function onClickOrFocus (event) {

@@ -38,0 +38,0 @@ if (event.ctrlKey || event.altKey || event.metaKey || event.defaultPrevented) return

@@ -180,3 +180,3 @@ ---

window.getCountries(value, (data) => { // getCountries defined in JS
this.setState({items: data.length ? data : {name: 'No results'}})
this.setState({items: data.length ? data : [{name: 'No results'}]})
})

@@ -183,0 +183,0 @@ }

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.coreInput=t()}(this,function(){"use strict";var e="undefined"!=typeof window,t=(e&&/(android)/i.test(navigator.userAgent),e&&/iPad|iPhone|iPod/.test(String(navigator.platform)));function n(e,t,n){var r="blur"===t||"focus"===t,i=e+"-"+t;"undefined"==typeof window||window[i]||document.addEventListener(window[i]=t,n,r)}var r={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","/":"&#x2F;","'":"&#x27;"};function i(e){return String(e||"").replace(/[&<>"'/]/g,function(e){return r[e]})}var o="prevent_recursive_dispatch_maximum_callstack";function a(e,t,n){void 0===n&&(n={});var r,i=""+o+t;return!!e[i]||(e[i]=!0,"function"==typeof window.CustomEvent?r=new window.CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n}):(r=document.createEvent("CustomEvent")).initCustomEvent(t,!0,!0,n),e.dispatchEvent(r),e[i]=null,!r.defaultPrevented)}function u(e,t){if(void 0===t&&(t=document),e){if(e.nodeType)return[e];if("string"==typeof e)return[].slice.call(t.querySelectorAll(e));if(e.length)return[].slice.call(e)}return[]}var c="data-@nrk/core-input-1.0.1".replace(/\W+/g,"-"),l={ENTER:13,ESC:27,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,UP:38,DOWN:40},d='[tabindex="-1"]';function f(e,n){var r="object"==typeof n?n:{content:n},i="string"==typeof r.content;return u(e).map(function(e){var n=e.nextElementSibling;return e.setAttribute(c,""),e.setAttribute(t?"data-role":"role","combobox"),e.setAttribute("aria-autocomplete","list"),e.setAttribute("autocomplete","off"),i&&(n.innerHTML=r.content),u("a,button",n).forEach(m),v(e,r.open),e})}function s(e){e.ctrlKey||e.altKey||e.metaKey||e.defaultPrevented||u("["+c+"]").forEach(function(t){var n=t.nextElementSibling,r=t===e.target||n.contains(e.target),i="click"===e.type&&r&&u(d,n).filter(function(t){return t.contains(e.target)})[0];i?function(e,t){a(e,"input.select",t)&&(e.value=t.value,e.focus(),v(e,!1))}(t,{relatedTarget:n,currentTarget:i,value:i.value||i.textContent.trim()}):v(t,r)})}function p(e,t){var n=e.nextElementSibling,r=u(d+":not([hidden])",n),i=r.indexOf(document.activeElement),o=!1;t.keyCode===l.DOWN?o=r[i+1]||r[0]:t.keyCode===l.UP?o=r[i-1]||r.pop():n.contains(t.target)&&(t.keyCode===l.END||t.keyCode===l.PAGEDOWN?o=r.pop():t.keyCode===l.HOME||t.keyCode===l.PAGEUP?o=r[0]:t.keyCode!==l.ENTER&&e.focus()),n.hasAttribute("hidden")||t.keyCode!==l.ESC||t.preventDefault(),v(e,t.keyCode!==l.ESC),!1!==o&&t.preventDefault(),o&&o.focus()}function v(e,t){void 0===t&&(t="true"===e.getAttribute("aria-expanded")),e.nextElementSibling[t?"removeAttribute":"setAttribute"]("hidden",""),e.setAttribute("aria-expanded",t)}function m(e,t,n){e.setAttribute("aria-label",e.textContent.trim()+", "+(t+1)+" av "+n.length),e.setAttribute("tabindex","-1")}return f.escapeHTML=i,f.highlight=function(e,t){var n=t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&");return i(e).replace(new RegExp(n||".^","gi"),"<mark>$&</mark>")},n(c,"click",s),n(c,"focus",s),n(c,"input",function(e){var t=e.target;t.hasAttribute(c)&&function(e,t){a(e,"input.filter",t)&&u(d,e.nextElementSibling).reduce(function(t,n){var r=-1!==n.textContent.toLowerCase().indexOf(e.value.toLowerCase());return n[r?"removeAttribute":"setAttribute"]("hidden",""),r?t.concat(n):t},[]).forEach(m)}(t,{relatedTarget:t.nextElementSibling})}),n(c,"keydown",function(e){if(!(e.ctrlKey||e.altKey||e.metaKey)){if(e.target.hasAttribute(c))return p(e.target,e);for(var t=e.target,n=void 0;t;t=t.parentElement)if((n=t.previousElementSibling)&&n.hasAttribute(c))return p(n,e)}}),f});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.coreInput=t()}(this,function(){"use strict";var e="undefined"!=typeof window,t=(e&&/(android)/i.test(navigator.userAgent),e&&/iPad|iPhone|iPod/.test(String(navigator.platform))),n=function(e){void 0===e&&(e=!1);try{window.addEventListener("test",null,{get passive(){e=!0}})}catch(e){}return e}();function i(e,t,i,r){(void 0===r&&(r=!1),"undefined"==typeof window||window[e=e+"-"+t])||(n||"object"!=typeof r||(r=Boolean(r.capture)),("resize"===t||"load"===t?window:document).addEventListener(window[e]=t,i,r))}var r={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","/":"&#x2F;","'":"&#x27;"};function o(e){return String(e||"").replace(/[&<>"'/]/g,function(e){return r[e]})}var a="prevent_recursive_dispatch_maximum_callstack";function u(e,t,n){void 0===n&&(n={});var i,r=""+a+t;if(e[r])return!0;e[r]=!0,"function"==typeof window.CustomEvent?i=new window.CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n}):(i=document.createEvent("CustomEvent")).initCustomEvent(t,!0,!0,n);var o=e.dispatchEvent(i);return e[r]=null,o}function c(e,t){if(void 0===t&&(t=document),e){if(e.nodeType)return[e];if("string"==typeof e)return[].slice.call(t.querySelectorAll(e));if(e.length)return[].slice.call(e)}return[]}var d="data-@nrk/core-input-1.0.2".replace(/\W+/g,"-"),l={ENTER:13,ESC:27,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,UP:38,DOWN:40},f='[tabindex="-1"]';function s(e,n){var i="object"==typeof n?n:{content:n},r="string"==typeof i.content;return c(e).map(function(e){var n=e.nextElementSibling;return e.setAttribute(d,""),e.setAttribute(t?"data-role":"role","combobox"),e.setAttribute("aria-autocomplete","list"),e.setAttribute("autocomplete","off"),r&&(n.innerHTML=i.content),c("a,button",n).forEach(m),g(e,i.open),e})}function p(e){e.ctrlKey||e.altKey||e.metaKey||e.defaultPrevented||c("["+d+"]").forEach(function(t){var n=t.nextElementSibling,i=t===e.target||n.contains(e.target),r="click"===e.type&&i&&c(f,n).filter(function(t){return t.contains(e.target)})[0];r?function(e,t){u(e,"input.select",t)&&(e.value=t.value,e.focus(),g(e,!1))}(t,{relatedTarget:n,currentTarget:r,value:r.value||r.textContent.trim()}):g(t,i)})}function v(e,t){var n=e.nextElementSibling,i=c(f+":not([hidden])",n),r=i.indexOf(document.activeElement),o=!1;t.keyCode===l.DOWN?o=i[r+1]||i[0]:t.keyCode===l.UP?o=i[r-1]||i.pop():n.contains(t.target)&&(t.keyCode===l.END||t.keyCode===l.PAGEDOWN?o=i.pop():t.keyCode===l.HOME||t.keyCode===l.PAGEUP?o=i[0]:t.keyCode!==l.ENTER&&e.focus()),n.hasAttribute("hidden")||t.keyCode!==l.ESC||t.preventDefault(),g(e,t.keyCode!==l.ESC),!1!==o&&t.preventDefault(),o&&o.focus()}function g(e,t){void 0===t&&(t="true"===e.getAttribute("aria-expanded")),e.nextElementSibling[t?"removeAttribute":"setAttribute"]("hidden",""),e.setAttribute("aria-expanded",t)}function m(e,t,n){e.setAttribute("aria-label",e.textContent.trim()+", "+(t+1)+" av "+n.length),e.setAttribute("tabindex","-1")}return s.escapeHTML=o,s.highlight=function(e,t){var n=t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&");return o(e).replace(new RegExp(n||".^","gi"),"<mark>$&</mark>")},i(d,"click",p),i(d,"focus",p,!0),i(d,"input",function(e){var t=e.target;t.hasAttribute(d)&&function(e,t){u(e,"input.filter",t)&&c(f,e.nextElementSibling).reduce(function(t,n){var i=-1!==n.textContent.toLowerCase().indexOf(e.value.toLowerCase());return n[i?"removeAttribute":"setAttribute"]("hidden",""),i?t.concat(n):t},[]).forEach(m)}(t,{relatedTarget:t.nextElementSibling})}),i(d,"keydown",function(e){if(!(e.ctrlKey||e.altKey||e.metaKey)){if(e.target.hasAttribute(d))return v(e.target,e);for(var t=e.target,n=void 0;t;t=t.parentElement)if((n=t.previousElementSibling)&&n.hasAttribute(d))return v(n,e)}}),s});
//# sourceMappingURL=core-input.min.js.map

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):e.CoreInput=t(e.React)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var t="undefined"!=typeof window,n=(t&&/(android)/i.test(navigator.userAgent),t&&/iPad|iPhone|iPod/.test(String(navigator.platform)));function r(e,t,n){var r="blur"===t||"focus"===t,i=e+"-"+t;"undefined"==typeof window||window[i]||document.addEventListener(window[i]=t,n,r)}var i={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","/":"&#x2F;","'":"&#x27;"};function o(e){return String(e||"").replace(/[&<>"'/]/g,function(e){return i[e]})}var u="prevent_recursive_dispatch_maximum_callstack";function a(e,t,n){void 0===n&&(n={});var r,i=""+u+t;return!!e[i]||(e[i]=!0,"function"==typeof window.CustomEvent?r=new window.CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n}):(r=document.createEvent("CustomEvent")).initCustomEvent(t,!0,!0,n),e.dispatchEvent(r),e[i]=null,!r.defaultPrevented)}function l(e,t){if(void 0===t&&(t=document),e){if(e.nodeType)return[e];if("string"==typeof e)return[].slice.call(t.querySelectorAll(e));if(e.length)return[].slice.call(e)}return[]}var c="data-@nrk/core-input-1.0.1".replace(/\W+/g,"-"),d={ENTER:13,ESC:27,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,UP:38,DOWN:40},p='[tabindex="-1"]';function s(e,t){var r="object"==typeof t?t:{content:t},i="string"==typeof r.content;return l(e).map(function(e){var t=e.nextElementSibling;return e.setAttribute(c,""),e.setAttribute(n?"data-role":"role","combobox"),e.setAttribute("aria-autocomplete","list"),e.setAttribute("autocomplete","off"),i&&(t.innerHTML=r.content),l("a,button",t).forEach(h),m(e,r.open),e})}function f(e){e.ctrlKey||e.altKey||e.metaKey||e.defaultPrevented||l("["+c+"]").forEach(function(t){var n=t.nextElementSibling,r=t===e.target||n.contains(e.target),i="click"===e.type&&r&&l(p,n).filter(function(t){return t.contains(e.target)})[0];i?function(e,t){a(e,"input.select",t)&&(e.value=t.value,e.focus(),m(e,!1))}(t,{relatedTarget:n,currentTarget:i,value:i.value||i.textContent.trim()}):m(t,r)})}function v(e,t){var n=e.nextElementSibling,r=l(p+":not([hidden])",n),i=r.indexOf(document.activeElement),o=!1;t.keyCode===d.DOWN?o=r[i+1]||r[0]:t.keyCode===d.UP?o=r[i-1]||r.pop():n.contains(t.target)&&(t.keyCode===d.END||t.keyCode===d.PAGEDOWN?o=r.pop():t.keyCode===d.HOME||t.keyCode===d.PAGEUP?o=r[0]:t.keyCode!==d.ENTER&&e.focus()),n.hasAttribute("hidden")||t.keyCode!==d.ESC||t.preventDefault(),m(e,t.keyCode!==d.ESC),!1!==o&&t.preventDefault(),o&&o.focus()}function m(e,t){void 0===t&&(t="true"===e.getAttribute("aria-expanded")),e.nextElementSibling[t?"removeAttribute":"setAttribute"]("hidden",""),e.setAttribute("aria-expanded",t)}function h(e,t,n){e.setAttribute("aria-label",e.textContent.trim()+", "+(t+1)+" av "+n.length),e.setAttribute("tabindex","-1")}s.escapeHTML=o,s.highlight=function(e,t){var n=t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&");return o(e).replace(new RegExp(n||".^","gi"),"<mark>$&</mark>")},r(c,"click",f),r(c,"focus",f),r(c,"input",function(e){var t=e.target;t.hasAttribute(c)&&function(e,t){a(e,"input.filter",t)&&l(p,e.nextElementSibling).reduce(function(t,n){var r=-1!==n.textContent.toLowerCase().indexOf(e.value.toLowerCase());return n[r?"removeAttribute":"setAttribute"]("hidden",""),r?t.concat(n):t},[]).forEach(h)}(t,{relatedTarget:t.nextElementSibling})}),r(c,"keydown",function(e){if(!(e.ctrlKey||e.altKey||e.metaKey)){if(e.target.hasAttribute(c))return v(e.target,e);for(var t=e.target,n=void 0;t;t=t.parentElement)if((n=t.previousElementSibling)&&n.hasAttribute(c))return v(n,e)}});var E={open:null,onFilter:null,onSelect:null},g=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.componentDidMount=function(){this.el.addEventListener("input.filter",this.props.onFilter),this.el.addEventListener("input.select",this.props.onSelect),s(this.el.firstElementChild)},n.prototype.componentDidUpdate=function(){s(this.el.firstElementChild)},n.prototype.componentWillUnmount=function(){this.el.removeEventListener("input.filter",this.props.onFilter),this.el.removeEventListener("input.select",this.props.onSelect)},n.prototype.render=function(){var t=this;return e.createElement("div",function(e,t,n){return void 0===n&&(n={}),Object.keys(e).reduce(function(n,r){return t.hasOwnProperty(r)||(n[r]=e[r]),n},n)}(this.props,E,{ref:function(e){return t.el=e}}),e.Children.map(this.props.children,function(n,r){return 0===r?e.cloneElement(n,{"aria-expanded":String(Boolean(t.props.open))}):1===r?e.cloneElement(n,{hidden:!t.props.open}):n}))},n}(e.Component);return g.Highlight=function(t){var n=t.text,r=t.query;return void 0===r&&(r=""),e.createElement("span",{dangerouslySetInnerHTML:{__html:s.highlight(n,r)}})},g});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):e.CoreInput=t(e.React)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var t="undefined"!=typeof window,n=(t&&/(android)/i.test(navigator.userAgent),t&&/iPad|iPhone|iPod/.test(String(navigator.platform))),r=function(e){void 0===e&&(e=!1);try{window.addEventListener("test",null,{get passive(){e=!0}})}catch(e){}return e}();function i(e,t,n,i){(void 0===i&&(i=!1),"undefined"==typeof window||window[e=e+"-"+t])||(r||"object"!=typeof i||(i=Boolean(i.capture)),("resize"===t||"load"===t?window:document).addEventListener(window[e]=t,n,i))}var o={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","/":"&#x2F;","'":"&#x27;"};function u(e){return String(e||"").replace(/[&<>"'/]/g,function(e){return o[e]})}var a="prevent_recursive_dispatch_maximum_callstack";function l(e,t,n){void 0===n&&(n={});var r,i=""+a+t;if(e[i])return!0;e[i]=!0,"function"==typeof window.CustomEvent?r=new window.CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n}):(r=document.createEvent("CustomEvent")).initCustomEvent(t,!0,!0,n);var o=e.dispatchEvent(r);return e[i]=null,o}function c(e,t){if(void 0===t&&(t=document),e){if(e.nodeType)return[e];if("string"==typeof e)return[].slice.call(t.querySelectorAll(e));if(e.length)return[].slice.call(e)}return[]}var d="data-@nrk/core-input-1.0.2".replace(/\W+/g,"-"),p={ENTER:13,ESC:27,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,UP:38,DOWN:40},s='[tabindex="-1"]';function f(e,t){var r="object"==typeof t?t:{content:t},i="string"==typeof r.content;return c(e).map(function(e){var t=e.nextElementSibling;return e.setAttribute(d,""),e.setAttribute(n?"data-role":"role","combobox"),e.setAttribute("aria-autocomplete","list"),e.setAttribute("autocomplete","off"),i&&(t.innerHTML=r.content),c("a,button",t).forEach(E),h(e,r.open),e})}function v(e){e.ctrlKey||e.altKey||e.metaKey||e.defaultPrevented||c("["+d+"]").forEach(function(t){var n=t.nextElementSibling,r=t===e.target||n.contains(e.target),i="click"===e.type&&r&&c(s,n).filter(function(t){return t.contains(e.target)})[0];i?function(e,t){l(e,"input.select",t)&&(e.value=t.value,e.focus(),h(e,!1))}(t,{relatedTarget:n,currentTarget:i,value:i.value||i.textContent.trim()}):h(t,r)})}function m(e,t){var n=e.nextElementSibling,r=c(s+":not([hidden])",n),i=r.indexOf(document.activeElement),o=!1;t.keyCode===p.DOWN?o=r[i+1]||r[0]:t.keyCode===p.UP?o=r[i-1]||r.pop():n.contains(t.target)&&(t.keyCode===p.END||t.keyCode===p.PAGEDOWN?o=r.pop():t.keyCode===p.HOME||t.keyCode===p.PAGEUP?o=r[0]:t.keyCode!==p.ENTER&&e.focus()),n.hasAttribute("hidden")||t.keyCode!==p.ESC||t.preventDefault(),h(e,t.keyCode!==p.ESC),!1!==o&&t.preventDefault(),o&&o.focus()}function h(e,t){void 0===t&&(t="true"===e.getAttribute("aria-expanded")),e.nextElementSibling[t?"removeAttribute":"setAttribute"]("hidden",""),e.setAttribute("aria-expanded",t)}function E(e,t,n){e.setAttribute("aria-label",e.textContent.trim()+", "+(t+1)+" av "+n.length),e.setAttribute("tabindex","-1")}f.escapeHTML=u,f.highlight=function(e,t){var n=t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&");return u(e).replace(new RegExp(n||".^","gi"),"<mark>$&</mark>")},i(d,"click",v),i(d,"focus",v,!0),i(d,"input",function(e){var t=e.target;t.hasAttribute(d)&&function(e,t){l(e,"input.filter",t)&&c(s,e.nextElementSibling).reduce(function(t,n){var r=-1!==n.textContent.toLowerCase().indexOf(e.value.toLowerCase());return n[r?"removeAttribute":"setAttribute"]("hidden",""),r?t.concat(n):t},[]).forEach(E)}(t,{relatedTarget:t.nextElementSibling})}),i(d,"keydown",function(e){if(!(e.ctrlKey||e.altKey||e.metaKey)){if(e.target.hasAttribute(d))return m(e.target,e);for(var t=e.target,n=void 0;t;t=t.parentElement)if((n=t.previousElementSibling)&&n.hasAttribute(d))return m(n,e)}});var g={open:null,onFilter:null,onSelect:null},y=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.componentDidMount=function(){this.el.addEventListener("input.filter",this.props.onFilter),this.el.addEventListener("input.select",this.props.onSelect),f(this.el.firstElementChild)},n.prototype.componentDidUpdate=function(){f(this.el.firstElementChild)},n.prototype.componentWillUnmount=function(){this.el.removeEventListener("input.filter",this.props.onFilter),this.el.removeEventListener("input.select",this.props.onSelect)},n.prototype.render=function(){var t=this;return e.createElement("div",function(e,t,n){return void 0===n&&(n={}),Object.keys(e).reduce(function(n,r){return t.hasOwnProperty(r)||(n[r]=e[r]),n},n)}(this.props,g,{ref:function(e){return t.el=e}}),e.Children.map(this.props.children,function(n,r){return 0===r?e.cloneElement(n,{"aria-expanded":String(Boolean(t.props.open))}):1===r?e.cloneElement(n,{hidden:!t.props.open}):n}))},n}(e.Component);return y.Highlight=function(t){var n=t.text,r=t.query;return void 0===r&&(r=""),e.createElement("span",{dangerouslySetInnerHTML:{__html:f.highlight(n,r)}})},y});
//# sourceMappingURL=index.js.map

@@ -5,3 +5,3 @@ {

"author": "NRK <opensource@nrk.no> (https://www.nrk.no/)",
"version": "1.0.2",
"version": "1.0.3",
"license": "MIT",

@@ -8,0 +8,0 @@ "main": "core-input.min.js",

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc