New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@myuw-web-components/myuw-search

Package Overview
Dependencies
Maintainers
6
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@myuw-web-components/myuw-search - npm Package Compare versions

Comparing version 1.2.1 to 1.2.2

2

CHANGELOG.md
# myuw-search versions
## 1.2.1
## 1.2.2

@@ -5,0 +5,0 @@ ### Added

var MyUWSearch = (function (exports) {
'use strict';
var tpl = "<style> @import url(https://fonts.googleapis.com/icon?family=Material+Icons);\n\n :host,\n myuw-search {\n display: flex;\n flex: auto;\n border: var(--myuw-search-border, none);\n border-radius: 5px;\n }\n\n :host([hidden]) {\n display: none;\n }\n\n myuw-search {\n border: var(--myuw-search-border, none);\n }\n\n #form {\n display: flex;\n flex: auto;\n flex-direction: row;\n margin: 0;\n }\n\n #input {\n display: flex;\n flex: auto;\n height: 40px;\n padding: 0 8px;\n font-size: 1rem;\n overflow: hidden;\n border: none;\n border-top-left-radius: 5px;\n border-bottom-left-radius: 5px;\n margin: 0;\n }\n\n #submit {\n border-top-right-radius: 5px;\n border-bottom-right-radius: 5px;\n border: none;\n border-left: 1px solid;\n border-color: rgba(0,0,0,0.5);\n color: #333;\n background: #fff;\n width: 56px;\n font-size: 1.8rem;\n margin: 0;\n cursor: pointer;\n transition: background-color 0.2s ease-in-out;\n }\n\n #submit:hover {\n background-color: #ebeaea;\n }\n\n #toggle {\n display: none;\n }\n\n #icon {\n color: #333;\n }\n @media (max-width: 600px) {\n :host,\n myuw-search {\n border: none;\n }\n #form {\n justify-content: flex-end;\n padding: 0;\n align-items: center;\n }\n #submit {\n display: none;\n }\n #input {\n width: 0;\n max-width: 0;\n margin: 0;\n padding: 0;\n height: 56px;\n border-top-right-radius: 5px;\n border-bottom-right-radius: 5px;\n opacity: 0;\n transition: opacity .4s cubic-bezier(.25, .8, .25, 1);\n }\n #toggle {\n display: block;\n transition: background 0.2s cubic-bezier(.25, .8, .25, 1);\n background: transparent;\n border: none;\n margin: 0 0 0 6px;\n height: 42px;\n width: 42px;\n min-width: initial;\n padding: 4px;\n min-width: 42px;\n line-height: 24px;\n border-radius: 50%;\n cursor: pointer;\n outline: none;\n\n }\n #toggle:hover {\n background: var(--myuw-bar-button-hover, rgba(0,0,0,0.12));\n }\n \n #iconToggle {\n color: var(--myuw-app-bar-color, #fff);\n transition: background 0.2s cubic-bezier(.25, .8, .25, 1);\n background: var(--myuw-bar-button-bg, transparent);\n overflow: hidden;\n position: relative;\n height: 33px;\n width: 33px;\n line-height: 33px;\n padding: 0;\n margin: 0;\n }\n #form[expanded] {\n position: absolute;\n top: 3px;\n left: 3px;\n margin-left: 0;\n margin-right: 0;\n width: auto;\n border: var(--myuw-search-border, 1px solid rgba(0,0,0,0.5));\n border-radius: 5px;\n }\n #form[expanded] #input {\n opacity: 1;\n width: 100%;\n max-width: none;\n padding: 0 16px;\n }\n #form[expanded] #toggle {\n position: absolute;\n right: 0;\n margin: 0 6px;\n background: transparent;\n }\n #form[expanded] #toggle:hover {\n background: rgba(0,0,0,0.12);\n opacity: 1;\n }\n #form[expanded] #iconToggle {\n color: #000;\n }\n } </style> <form id=\"form\" class=\"myuw-search-container\" onsubmit=\"$event.preventDefault(); submitSearch($event)\"> <button id=\"toggle\" aria-label=\"\" type=\"button\"> <i id=\"iconToggle\" class=\"material-icons\"></i> </button> <input id=\"input\" name=\"myuw-search-input\" aria-label=\"\" type=\"text\" placeholder=\"\"> <button id=\"submit\" aria-label=\"\" type=\"submit\"> <i id=\"icon\" class=\"material-icons\"></i> </button> </form>";
var tpl = "<style> @import url(https://fonts.googleapis.com/icon?family=Material+Icons);\n\n :host,\n myuw-search {\n display: flex;\n flex: auto;\n border: var(--myuw-search-border, none);\n border-radius: 5px;\n }\n\n :host([hidden]) {\n display: none;\n }\n\n myuw-search {\n border: var(--myuw-search-border, none);\n }\n\n #form {\n display: flex;\n flex: auto;\n flex-direction: row;\n margin: 0;\n }\n\n #input {\n display: flex;\n flex: auto;\n height: 40px;\n padding: 0 8px;\n font-size: 1rem;\n overflow: hidden;\n border: none;\n border-top-left-radius: 5px;\n border-bottom-left-radius: 5px;\n margin: 0;\n }\n\n #submit {\n border-top-right-radius: 5px;\n border-bottom-right-radius: 5px;\n border: none;\n border-left: 1px solid;\n border-color: rgba(0,0,0,0.5);\n color: #333;\n background: #fff;\n width: 56px;\n font-size: 1.8rem;\n margin: 0;\n cursor: pointer;\n transition: background-color 0.2s ease-in-out;\n }\n\n #submit:hover {\n background-color: #ebeaea;\n }\n\n #toggle {\n display: none;\n }\n\n #icon {\n color: #333;\n }\n @media (max-width: 600px) {\n :host,\n myuw-search {\n border: none;\n }\n #form {\n justify-content: flex-end;\n padding: 0;\n align-items: center;\n }\n #submit {\n display: none;\n }\n #input {\n width: 0;\n max-width: 0;\n margin: 0;\n padding: 0;\n height: 56px;\n border-top-right-radius: 5px;\n border-bottom-right-radius: 5px;\n opacity: 0;\n transition: opacity .4s cubic-bezier(.25, .8, .25, 1);\n }\n #toggle {\n display: block;\n transition: background 0.2s cubic-bezier(.25, .8, .25, 1);\n background: transparent;\n border: none;\n margin: 0 0 0 6px;\n height: 42px;\n width: 42px;\n min-width: initial;\n padding: 4px;\n min-width: 42px;\n line-height: 24px;\n border-radius: 50%;\n cursor: pointer;\n outline: none;\n\n }\n #toggle:hover {\n background: var(--myuw-bar-button-hover, rgba(0,0,0,0.12));\n }\n\n #iconToggle {\n color: var(--myuw-app-bar-color, #fff);\n transition: background 0.2s cubic-bezier(.25, .8, .25, 1);\n background: var(--myuw-bar-button-bg, transparent);\n border-radius: 50%;\n overflow: hidden;\n position: relative;\n height: 33px;\n width: 33px;\n line-height: 33px;\n padding: 0;\n margin: 0;\n }\n #form[expanded] {\n position: absolute;\n top: 3px;\n left: 3px;\n margin-left: 0;\n margin-right: 0;\n width: auto;\n border: var(--myuw-search-border, 1px solid rgba(0,0,0,0.5));\n border-radius: 5px;\n }\n #form[expanded] #input {\n opacity: 1;\n width: 100%;\n max-width: none;\n padding: 0 16px;\n }\n #form[expanded] #toggle {\n position: absolute;\n right: 0;\n margin: 0 6px;\n background: transparent;\n }\n #form[expanded] #toggle:hover {\n background: rgba(0,0,0,0.12);\n opacity: 1;\n }\n #form[expanded] #iconToggle {\n color: #000;\n }\n } </style> <form id=\"form\" class=\"myuw-search-container\" onsubmit=\"$event.preventDefault(); submitSearch($event)\"> <button id=\"toggle\" aria-label=\"\" type=\"button\"> <i id=\"iconToggle\" class=\"material-icons\"></i> </button> <input id=\"input\" name=\"myuw-search-input\" aria-label=\"\" type=\"text\" placeholder=\"\"> <button id=\"submit\" aria-label=\"\" type=\"submit\"> <i id=\"icon\" class=\"material-icons\"></i> </button> </form>";

@@ -6,0 +6,0 @@ class MyUWSearch extends HTMLElement {

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

var MyUWSearch=(function(t){"use strict";class n extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(n.template.content.cloneNode(!0))}static get observedAttributes(){return["input-label","button-label","icon"]}attributeChangedCallback(t,n,e){this[t]=e,this.updateComponent(t,e)}connectedCallback(){this.icon=this.getAttribute("icon")||"search",this.inputLabel=this.getAttribute("input-label")||"Search",this.buttonLabel=this.getAttribute("button-label")||"Submit search",this.$form=this.shadowRoot.querySelector("form#form"),this.$icon=this.shadowRoot.querySelector("i#icon"),this.$input=this.shadowRoot.querySelector("input#input"),this.$button=this.shadowRoot.querySelector("button#submit"),this.$toggle=this.shadowRoot.querySelector("button#toggle"),this.$toggleIcon=this.shadowRoot.querySelector("i#iconToggle"),this.$icon.innerText=this.icon,this.$toggleIcon.innerText=this.icon,this.$input.setAttribute("aria-label",this.inputLabel),this.$input.setAttribute("placeholder",this.inputLabel),this.$button.setAttribute("aria-label",this.buttonLabel),this.$toggle.setAttribute("aria-label","show search"),this.$button.addEventListener("click",t=>{this.submitSearch(t)}),this.$toggle.addEventListener("click",t=>{this.toggleSearch(t)}),document.addEventListener("click",t=>{this.$form.hasAttribute("expanded")&&(t.target.closest("myuw-search")||this.toggleSearch(t))})}disconnectedCallback(){}updateComponent(t,n){switch(t){case"input-label":this.$input&&this.$input.setAttribute("placeholder",n);break;case"button-label":this.$button&&this.$button.setAttribute("aria-label",n);break;case"icon":this.$icon&&(this.$icon.innerText=n)}}submitSearch(t){t.preventDefault(),t.stopPropagation(),this.callback&&"function"==typeof this.callback&&this.callback(this.$input.value)}toggleSearch(t){this.$cssWidth=Math.max(document.documentElement.clientWidth,window.innerWidth||0),this.$togglePosition=this.$toggle.getBoundingClientRect();var n=Math.floor(this.$cssWidth-this.$togglePosition.left-42);this.$form.style.right=n,this.$form.hasAttribute("expanded")?(this.$form.removeAttribute("expanded"),this.$toggleIcon.innerText=this.icon,this.$toggle.setAttribute("aria-label","show search")):(this.$form.setAttribute("expanded","true"),this.$toggleIcon.innerText="arrow_forward",this.$toggle.setAttribute("aria-label","close search"))}}return n.template=(function(t){const n=document.createElement("template");return n.innerHTML=t,n})('<style> @import url(https://fonts.googleapis.com/icon?family=Material+Icons);\n\n :host,\n myuw-search {\n display: flex;\n flex: auto;\n border: var(--myuw-search-border, none);\n border-radius: 5px;\n }\n\n :host([hidden]) {\n display: none;\n }\n\n myuw-search {\n border: var(--myuw-search-border, none);\n }\n\n #form {\n display: flex;\n flex: auto;\n flex-direction: row;\n margin: 0;\n }\n\n #input {\n display: flex;\n flex: auto;\n height: 40px;\n padding: 0 8px;\n font-size: 1rem;\n overflow: hidden;\n border: none;\n border-top-left-radius: 5px;\n border-bottom-left-radius: 5px;\n margin: 0;\n }\n\n #submit {\n border-top-right-radius: 5px;\n border-bottom-right-radius: 5px;\n border: none;\n border-left: 1px solid;\n border-color: rgba(0,0,0,0.5);\n color: #333;\n background: #fff;\n width: 56px;\n font-size: 1.8rem;\n margin: 0;\n cursor: pointer;\n transition: background-color 0.2s ease-in-out;\n }\n\n #submit:hover {\n background-color: #ebeaea;\n }\n\n #toggle {\n display: none;\n }\n\n #icon {\n color: #333;\n }\n @media (max-width: 600px) {\n :host,\n myuw-search {\n border: none;\n }\n #form {\n justify-content: flex-end;\n padding: 0;\n align-items: center;\n }\n #submit {\n display: none;\n }\n #input {\n width: 0;\n max-width: 0;\n margin: 0;\n padding: 0;\n height: 56px;\n border-top-right-radius: 5px;\n border-bottom-right-radius: 5px;\n opacity: 0;\n transition: opacity .4s cubic-bezier(.25, .8, .25, 1);\n }\n #toggle {\n display: block;\n transition: background 0.2s cubic-bezier(.25, .8, .25, 1);\n background: transparent;\n border: none;\n margin: 0 0 0 6px;\n height: 42px;\n width: 42px;\n min-width: initial;\n padding: 4px;\n min-width: 42px;\n line-height: 24px;\n border-radius: 50%;\n cursor: pointer;\n outline: none;\n\n }\n #toggle:hover {\n background: var(--myuw-bar-button-hover, rgba(0,0,0,0.12));\n }\n \n #iconToggle {\n color: var(--myuw-app-bar-color, #fff);\n transition: background 0.2s cubic-bezier(.25, .8, .25, 1);\n background: var(--myuw-bar-button-bg, transparent);\n overflow: hidden;\n position: relative;\n height: 33px;\n width: 33px;\n line-height: 33px;\n padding: 0;\n margin: 0;\n }\n #form[expanded] {\n position: absolute;\n top: 3px;\n left: 3px;\n margin-left: 0;\n margin-right: 0;\n width: auto;\n border: var(--myuw-search-border, 1px solid rgba(0,0,0,0.5));\n border-radius: 5px;\n }\n #form[expanded] #input {\n opacity: 1;\n width: 100%;\n max-width: none;\n padding: 0 16px;\n }\n #form[expanded] #toggle {\n position: absolute;\n right: 0;\n margin: 0 6px;\n background: transparent;\n }\n #form[expanded] #toggle:hover {\n background: rgba(0,0,0,0.12);\n opacity: 1;\n }\n #form[expanded] #iconToggle {\n color: #000;\n }\n } </style> <form id="form" class="myuw-search-container" onsubmit="$event.preventDefault(); submitSearch($event)"> <button id="toggle" aria-label="" type="button"> <i id="iconToggle" class="material-icons"></i> </button> <input id="input" name="myuw-search-input" aria-label="" type="text" placeholder=""> <button id="submit" aria-label="" type="submit"> <i id="icon" class="material-icons"></i> </button> </form>'),window.customElements.define("myuw-search",n),t.MyUWSearch=n,t})({});
var MyUWSearch=(function(t){"use strict";class n extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(n.template.content.cloneNode(!0))}static get observedAttributes(){return["input-label","button-label","icon"]}attributeChangedCallback(t,n,e){this[t]=e,this.updateComponent(t,e)}connectedCallback(){this.icon=this.getAttribute("icon")||"search",this.inputLabel=this.getAttribute("input-label")||"Search",this.buttonLabel=this.getAttribute("button-label")||"Submit search",this.$form=this.shadowRoot.querySelector("form#form"),this.$icon=this.shadowRoot.querySelector("i#icon"),this.$input=this.shadowRoot.querySelector("input#input"),this.$button=this.shadowRoot.querySelector("button#submit"),this.$toggle=this.shadowRoot.querySelector("button#toggle"),this.$toggleIcon=this.shadowRoot.querySelector("i#iconToggle"),this.$icon.innerText=this.icon,this.$toggleIcon.innerText=this.icon,this.$input.setAttribute("aria-label",this.inputLabel),this.$input.setAttribute("placeholder",this.inputLabel),this.$button.setAttribute("aria-label",this.buttonLabel),this.$toggle.setAttribute("aria-label","show search"),this.$button.addEventListener("click",t=>{this.submitSearch(t)}),this.$toggle.addEventListener("click",t=>{this.toggleSearch(t)}),document.addEventListener("click",t=>{this.$form.hasAttribute("expanded")&&(t.target.closest("myuw-search")||this.toggleSearch(t))})}disconnectedCallback(){}updateComponent(t,n){switch(t){case"input-label":this.$input&&this.$input.setAttribute("placeholder",n);break;case"button-label":this.$button&&this.$button.setAttribute("aria-label",n);break;case"icon":this.$icon&&(this.$icon.innerText=n)}}submitSearch(t){t.preventDefault(),t.stopPropagation(),this.callback&&"function"==typeof this.callback&&this.callback(this.$input.value)}toggleSearch(t){this.$cssWidth=Math.max(document.documentElement.clientWidth,window.innerWidth||0),this.$togglePosition=this.$toggle.getBoundingClientRect();var n=Math.floor(this.$cssWidth-this.$togglePosition.left-42);this.$form.style.right=n,this.$form.hasAttribute("expanded")?(this.$form.removeAttribute("expanded"),this.$toggleIcon.innerText=this.icon,this.$toggle.setAttribute("aria-label","show search")):(this.$form.setAttribute("expanded","true"),this.$toggleIcon.innerText="arrow_forward",this.$toggle.setAttribute("aria-label","close search"))}}return n.template=(function(t){const n=document.createElement("template");return n.innerHTML=t,n})('<style> @import url(https://fonts.googleapis.com/icon?family=Material+Icons);\n\n :host,\n myuw-search {\n display: flex;\n flex: auto;\n border: var(--myuw-search-border, none);\n border-radius: 5px;\n }\n\n :host([hidden]) {\n display: none;\n }\n\n myuw-search {\n border: var(--myuw-search-border, none);\n }\n\n #form {\n display: flex;\n flex: auto;\n flex-direction: row;\n margin: 0;\n }\n\n #input {\n display: flex;\n flex: auto;\n height: 40px;\n padding: 0 8px;\n font-size: 1rem;\n overflow: hidden;\n border: none;\n border-top-left-radius: 5px;\n border-bottom-left-radius: 5px;\n margin: 0;\n }\n\n #submit {\n border-top-right-radius: 5px;\n border-bottom-right-radius: 5px;\n border: none;\n border-left: 1px solid;\n border-color: rgba(0,0,0,0.5);\n color: #333;\n background: #fff;\n width: 56px;\n font-size: 1.8rem;\n margin: 0;\n cursor: pointer;\n transition: background-color 0.2s ease-in-out;\n }\n\n #submit:hover {\n background-color: #ebeaea;\n }\n\n #toggle {\n display: none;\n }\n\n #icon {\n color: #333;\n }\n @media (max-width: 600px) {\n :host,\n myuw-search {\n border: none;\n }\n #form {\n justify-content: flex-end;\n padding: 0;\n align-items: center;\n }\n #submit {\n display: none;\n }\n #input {\n width: 0;\n max-width: 0;\n margin: 0;\n padding: 0;\n height: 56px;\n border-top-right-radius: 5px;\n border-bottom-right-radius: 5px;\n opacity: 0;\n transition: opacity .4s cubic-bezier(.25, .8, .25, 1);\n }\n #toggle {\n display: block;\n transition: background 0.2s cubic-bezier(.25, .8, .25, 1);\n background: transparent;\n border: none;\n margin: 0 0 0 6px;\n height: 42px;\n width: 42px;\n min-width: initial;\n padding: 4px;\n min-width: 42px;\n line-height: 24px;\n border-radius: 50%;\n cursor: pointer;\n outline: none;\n\n }\n #toggle:hover {\n background: var(--myuw-bar-button-hover, rgba(0,0,0,0.12));\n }\n\n #iconToggle {\n color: var(--myuw-app-bar-color, #fff);\n transition: background 0.2s cubic-bezier(.25, .8, .25, 1);\n background: var(--myuw-bar-button-bg, transparent);\n border-radius: 50%;\n overflow: hidden;\n position: relative;\n height: 33px;\n width: 33px;\n line-height: 33px;\n padding: 0;\n margin: 0;\n }\n #form[expanded] {\n position: absolute;\n top: 3px;\n left: 3px;\n margin-left: 0;\n margin-right: 0;\n width: auto;\n border: var(--myuw-search-border, 1px solid rgba(0,0,0,0.5));\n border-radius: 5px;\n }\n #form[expanded] #input {\n opacity: 1;\n width: 100%;\n max-width: none;\n padding: 0 16px;\n }\n #form[expanded] #toggle {\n position: absolute;\n right: 0;\n margin: 0 6px;\n background: transparent;\n }\n #form[expanded] #toggle:hover {\n background: rgba(0,0,0,0.12);\n opacity: 1;\n }\n #form[expanded] #iconToggle {\n color: #000;\n }\n } </style> <form id="form" class="myuw-search-container" onsubmit="$event.preventDefault(); submitSearch($event)"> <button id="toggle" aria-label="" type="button"> <i id="iconToggle" class="material-icons"></i> </button> <input id="input" name="myuw-search-input" aria-label="" type="text" placeholder=""> <button id="submit" aria-label="" type="submit"> <i id="icon" class="material-icons"></i> </button> </form>'),window.customElements.define("myuw-search",n),t.MyUWSearch=n,t})({});
{
"name": "@myuw-web-components/myuw-search",
"version": "1.2.1",
"version": "1.2.2",
"description": "A material search field made for use with MyUW web components",

@@ -5,0 +5,0 @@ "module": "dist/myuw-search.min.mjs",

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