@smart-webcomponents-angular/phoneinput 10.3.4 → 13.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +10 -2
  2. package/esm2020/phoneinput/index.mjs +2 -0
  3. package/{esm2015/phoneinput/public_api.js → esm2020/phoneinput/public_api.mjs} +0 -0
  4. package/{esm2015/phoneinput/smart-webcomponents-angular-phoneinput.js → esm2020/phoneinput/smart-webcomponents-angular-phoneinput.mjs} +2 -3
  5. package/esm2020/phoneinput/smart.element.mjs +99 -0
  6. package/esm2020/phoneinput/smart.phoneinput.mjs +443 -0
  7. package/esm2020/phoneinput/smart.phoneinput.module.mjs +18 -0
  8. package/fesm2015/{smart-webcomponents-angular-phoneinput.js → smart-webcomponents-angular-phoneinput.mjs} +88 -51
  9. package/fesm2015/smart-webcomponents-angular-phoneinput.mjs.map +1 -0
  10. package/fesm2020/smart-webcomponents-angular-phoneinput.mjs +568 -0
  11. package/fesm2020/smart-webcomponents-angular-phoneinput.mjs.map +1 -0
  12. package/index.d.ts +369 -44
  13. package/package.json +26 -24
  14. package/phoneinput/index.d.ts +1 -0
  15. package/phoneinput/smart-webcomponents-angular-phoneinput.d.ts +2 -2
  16. package/phoneinput/smart.element.d.ts +4 -1
  17. package/phoneinput/smart.phoneinput.d.ts +4 -1
  18. package/phoneinput/smart.phoneinput.module.d.ts +5 -0
  19. package/source/modules/smart.input.js +1 -1
  20. package/source/modules/smart.phoneinput.js +1 -1
  21. package/source/smart.button.js +2 -2
  22. package/source/smart.countryinput.js +1 -1
  23. package/source/smart.element.js +2 -2
  24. package/source/smart.input.js +2 -2
  25. package/source/smart.phoneinput.js +2 -2
  26. package/source/smart.scrollbar.js +1 -1
  27. package/styles/font/smart-icons.eot +0 -0
  28. package/styles/font/smart-icons.svg +11 -3
  29. package/styles/font/smart-icons.ttf +0 -0
  30. package/styles/font/smart-icons.woff +0 -0
  31. package/styles/font/smart-icons.woff2 +0 -0
  32. package/styles/smart.base.css +2 -2
  33. package/styles/smart.phoneinput.css +2 -2
  34. package/bundles/smart-webcomponents-angular-phoneinput.umd.js +0 -1001
  35. package/bundles/smart-webcomponents-angular-phoneinput.umd.min.js +0 -25
  36. package/esm2015/phoneinput/smart.element.js +0 -83
  37. package/esm2015/phoneinput/smart.phoneinput.js +0 -434
  38. package/esm2015/phoneinput/smart.phoneinput.module.js +0 -13
  39. package/fesm2015/smart-webcomponents-angular-phoneinput.js.map +0 -1
  40. package/phoneinput/smart-webcomponents-angular-phoneinput.metadata.json +0 -1
@@ -1,6 +1,6 @@
1
1
 
2
- /* Smart UI v10.2.37 (2021-11-21)
2
+ /* Smart UI v13.0.8 (2022-02-21)
3
3
  Copyright (c) 2011-2021 jQWidgets.
4
4
  License: https://htmlelements.com/license/ */ //
5
5
 
6
- Smart("smart-input",class extends Smart.BaseElement{static get properties(){return{autoCompleteDelay:{value:100,type:"number"},dataSource:{type:"any",value:[],reflectToAttribute:!1},dropDownClassList:{value:[],type:"array",reflectToAttribute:!1},dropDownDataSource:{type:"any",value:[]},dropDownHeight:{type:"any",value:200},dropDownOpenMode:{allowedValues:["default","manual"],value:"default",type:"string"},dropDownWidth:{type:"any",value:null},dropDownButtonPosition:{allowedValues:["none","left","right"],value:"none",type:"string"},hint:{type:"string",value:""},inputPurpose:{type:"string",value:"off"},items:{type:"number",value:8},minLength:{type:"number",value:1},name:{value:"",type:"string"},opened:{value:!1,type:"boolean"},query:{type:"string",value:""},queryMode:{allowedValues:["contains","containsIgnoreCase","doesNotContain","doesNotContainIgnoreCase","equals","equalsIgnoreCase","startsWith","startsWithIgnoreCase","endsWith","endsWithIgnoreCase"],type:"string",value:"containsIgnoreCase"},placeholder:{value:"",type:"string"},readonly:{type:"boolean",value:!1},sorted:{value:!1,type:"boolean"},sortDirection:{value:"asc",type:"string"},selectedIndex:{type:"number",value:-1},selectedValues:{value:[],type:"array"},type:{type:"string"},value:{type:"string",value:""}}}static get styleUrls(){return["smart.textbox.css"]}template(){return'<div id="inputContainer" role="presentation"><input class="smart-input" id=\'input\' readonly=\'[[readonly]]\' placeholder=\'[[placeholder]]\' type=\'[[type]]\' name=\'[[name]]\' value=\'{{value::keyup}}\' disabled=\'[[disabled]]\' aria-label="[[placeholder]]" /><span class="smart-hidden smart-hint" id="span">[[hint]]</span><div id="dropDownButton" tabindex=-1 class="smart-drop-down-button" role="button" aria-label="Toggle popup"><div id="arrow" class="arrow" aria-hidden="true"></div></div></div>'}static get listeners(){return{"input.focus":"_focusHandler","input.blur":"_blurHandler","input.keydown":"_keyDownHandler","input.keyup":"_keyUpHandler","input.keypress":"_keyPressHandler","input.paste":"_pasteHandler","dropDownButton.down":"_dropDownButtonDownHandler","inputContainer.down":"_downHandler","document.up":"_documentUpHandler"}}get selectedIndexes(){return this.isCompleted?[this.selectedIndex]:[]}set selectedIndexes(e){this.isCompleted&&(e&&e[0]?this.selectedIndex=e[0]:this.selectedIndex=-1)}focus(){this.$.input.focus()}select(){const e=this;e.readonly?e.$.input.focus():e.$.input.select()}_documentUpHandler(e){const t=this,r=t.shadowRoot||t.isInShadowDOM?e.originalEvent.composedPath()[0]:e.originalEvent.target;r!==t&&r!==t.$.dropDownButton&&r!==t.$.input&&r!==t.$.arrow?t.$.scrollView.contains(r.shadowParent||r)?t._isPointerDown&&(t._isPointerDown=!1,t.opened&&(t._preventLookup=!0),t.$.input.focus()):(t.opened&&(t._preventLookup=!0),"manual"===t.dropDownOpenMode||t._isPointerDown||t.close(),t._isPointerDown=!1):t._isPointerDown=!1}_focusHandler(){const e=this;e.setAttribute("focus",""),e.readonly||0!==e.minLength||0!==e.$.input.value.length||e._preventLookup?(e.$.fireEvent("focus"),delete e._preventLookup):e._lookup()}_blurHandler(){const e=this;e.opened||e.removeAttribute("focus"),e.opened||e.$.fireEvent("blur"),e._refreshSelectedIndex(),delete e._preventLookup}_pasteHandler(e){const t=this,r=t.$.input,o=r.value,n=r.selectionStart,a=r.selectionEnd;if(!e.clipboardData&&!window.clipboardData)return;const s=(e.clipboardData||window.clipboardData).getData("text");let i=o.slice(0,n)+s,l=i.length;i+=o.slice(a),e.preventDefault(),t.set("value",i),t.setAttribute("data-value",i),r.setSelectionRange(l,l),t._refreshSelectedIndex()}_refreshSelectedIndex(){const e=this;let t=e.dataSource;if(t){let r=-1;if(e.dataSource instanceof Promise)return;if("function"==typeof e.dataSource)return;"string"==typeof t&&(t=e.$.deserialize(t,"array"));for(let o=0;o<t.length;o++){let n=t[o];if("number"!=typeof n&&"boolean"!=typeof n||(n=""+n),"string"==typeof n){if(n===e.value){r=o;break}}else if(n&&n.label===e.value){r=o;break}}e.set("selectedIndex",r,!1),-1===e.selectedIndex&&(e.$.input.dataValue=null)}}selectItem(e){const t=this;let r=t.dataSource;if("string"==typeof r&&(r=t.$.deserialize(r,"array")),r)for(let o=0;o<r.length;o++){const n=r[o];if(t.set("selectedIndex",-1),t.set("value",""),t.$.input.dataValue=null,"string"==typeof n){if(n===e)return t.set("selectedIndex",o,!1),t.set("value",t.$.input.dataValue=e),void t.setAttribute("data-value",t.$.input.dataValue)}else if(n.value===e)return t.set("selectedIndex",o,!1),t.set("value",n.label),t.$.input.dataValue=e,void t.setAttribute("data-value",t.$.input.dataValue)}else t.set("value",t.$.input.dataValue=e),t.setAttribute("data-value",t.$.input.dataValue),t.set("selectedIndex",-1,!1)}getItem(e){const t=this;if(t.dataSource)for(let r=0;r<t.dataSource.length;r++){const o=t.dataSource[r];if(o.value===e)return o}return null}getSelectedItem(){const e=this;return{label:e.value,value:e.$.input.dataValue||e.value}}_refreshMenu(){const e=this;e.$.menu.classList.remove("scroll"),e.$.scrollView.computedVerticalScrollBarVisibility&&e.$.menu.classList.add("scroll")}_performSelect(){const e=this,t=e.$.menu.querySelector(".active"),r=t.getAttribute("data-label"),o=t.dataValue,n=e.value,a=e.$.input.dataValue;e.set("value",r),e.$.input.dataValue=o,e.setAttribute("data-value",o),e.set("selectedIndex",t.index),e.set("selectedValues",[e.$.input.dataValue]),e.close(),r===n&&o===a||e.$.fireEvent("change",{value:o,label:r,oldValue:a,oldLabel:n})}_open(){const e=this;if(e.opened)return;const t=window.scrollX,r=window.scrollY;let o=e.getBoundingClientRect(),n=0,a=0;if(e.timer&&clearTimeout(e.timer),e.getRootNode()&&e.getRootNode().host?e.getRootNode().host.shadowRoot.appendChild(e.$.scrollView):document.body.appendChild(e.$.scrollView),e.setAttribute("aria-owns",e.$.scrollView.id),e.readonly||e.$.input.setAttribute("aria-controls",e.$.scrollView.id),e.$.scrollView.enableShadowDOM&&!e._importedStyle&&(e.$.scrollView.importStyle(e._getStyleUrl("smart.textbox.css")),e._importedStyle=!0),"static"!==getComputedStyle(document.body).position){const e=document.body.getBoundingClientRect();n=e.left,a=e.top}e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",""),e.$.scrollView.style.left=-3+o.left+t-n+"px",e.$.scrollView.style.top=o.bottom+r-a+1+"px",e.$.scrollView.classList.remove("open"),e.opening=!0,e._positionTimer=setInterval((()=>{const t=e.getBoundingClientRect();if(e.opening)e.opening=!1,o=t;else if(t.top!==o.top||t.left!==o.left)return void e.close()}),50),e.$.scrollView.onpointerdown=function(){e._isPointerDown=!0},requestAnimationFrame((function(){const t=e.dropDownWidth;if(e.$.scrollView.refresh&&e.$.scrollView.refresh(),e._refreshMenu(),e.$.scrollView.setAttribute("open",""),e.setAttribute("open",""),e.$.dropDownButton.setAttribute("open",""),e.$.input.setAttribute("open",""),t&&"string"==typeof t&&-1!==t.indexOf("%")){const r=parseFloat(t)/100;e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",e.offsetWidth*r+"px")}else if("auto"!==t&&t)e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",parseFloat(t)+"px");else if("auto"===t){if(e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",""),e.$.scrollView.$.scrollViewerContainer.classList.contains("vscroll")){const t=e.$.scrollView.offsetWidth+parseFloat(getComputedStyle(e.$.scrollView).getPropertyValue("--smart-scroll-bar-size"));e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",t+"px")}}else{e.$.menu.style.width="auto";let t=e.$.menu.offsetWidth;const r=e.$.menu.querySelectorAll("li");for(let t=0;t<r.length;t++)e._maxDropDownWidth=Math.max((r[t].firstElementChild||r[t]).offsetWidth,e._maxDropDownWidth);e.$.scrollView.computedVerticalScrollBarVisibility&&(t+=e.$.scrollView.$&&e.$.scrollView.$.verticalScrollBar?e.$.scrollView.$.verticalScrollBar.offsetWidth:30),e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",Math.max(t,e.offsetWidth-8)+"px"),e.$.menu.style.width=""}(e.shadowRoot||e.isInShadowDOM)&&e.$.scrollView._scrollView&&Smart.ScrollBar&&requestAnimationFrame((()=>{e.$.scrollView._scrollView&&e.$.scrollView._scrollView.vScrollBar.refresh()}))})),e.$.scrollView.refresh&&e.$.scrollView.refresh(),e._refreshMenu(),e.set("opened",!0),e.setAttribute("aria-expanded",!0),e.$.fireEvent("open")}close(){const e=this;return!!e.opened&&(e.timer&&clearTimeout(e.timer),e.timer=setTimeout((function(){e.$.scrollView.parentNode&&!e.opened&&(e.$.scrollView.remove(),e.removeAttribute("aria-owns"),e.readonly||e.$.input.removeAttribute("aria-controls"))}),1e3),e._positionTimer&&clearInterval(e._positionTimer),e.$.scrollView.removeAttribute("open"),e.$.dropDownButton.removeAttribute("open"),e.$.input.removeAttribute("open"),e.removeAttribute("open"),e.set("opened",!1),e.setAttribute("aria-expanded",!1),e.$.input.focus(),e.$.fireEvent("close"),!0)}refresh(){const e=this;e.$.scrollView.refresh&&e.$.scrollView.refresh(),e.close()}_lookup(e){const t=this;if(t.query=t.$.input.value,t.$.input.readonly&&(t._incrementalSearchQuery||(t._incrementalSearchQuery=""),t._incrementalSearchQuery+=e.key,t._incrementalSearchTimer&&clearTimeout(t._incrementalSearchTimer),t.query=t._incrementalSearchQuery,t._incrementalSearchTimer=setTimeout((function(){t._incrementalSearchQuery=""}),700)),t.query.length<t.minLength)return void t.close();const r=function(e){clearTimeout(t._autoCompleteTimeout),t._autoCompleteTimeout=setTimeout((()=>{const r=t.context;t.context=t,t._process(e),t.context=r}),t.autoCompleteDelay)};"function"==typeof t.dataSource?t.dataSource(t.query,r):r(t.dataSource)}_downHandler(e){const t=this;t.readonly&&t._dropDownButtonDownHandler(e)}_dropDownButtonDownHandler(e){const t=this;return"manual"!==t.dropDownOpenMode&&t._toggle(),e.preventDefault(),e.stopPropagation(),e.originalEvent.preventDefault(),e.originalEvent.stopPropagation(),t._isPointerDown=!0,!1}_toggle(){const e=this;e.opened?e.close():e.open()}open(){const e=this;function t(t){e._process(t);const r=e.$.menu.querySelector(".active");if(r){const t=e.$.input.dataValue;for(let o=0;o<e.$.menu.children.length;o++){const n=e.$.menu.children[o],a=n.getAttribute("data-label"),s=n.dataValue;if(void 0!==t&&s===t||void 0===t&&a===e.$.input.value){r.classList.remove("active"),n.classList.add("active"),e._setActiveDescendant(n),e.$.input.dataValue=s,e.setAttribute("data-value",s);break}}}e.ensureVisible(),e.$.input.focus(),setTimeout((function(){e.$.input.focus()}),25)}e.dropDownDataSource&&(Array.isArray(e.dropDownDataSource)&&e.dropDownDataSource.length>0||"function"==typeof e.dropDownDataSource)?(e.query="","function"==typeof e.dropDownDataSource?e.dropDownDataSource(e.query,t):t(e.dropDownDataSource)):(e.query="","function"==typeof e.dataSource?e.dataSource(e.query,t):t(e.dataSource))}_process(e){const t=this;"string"==typeof e&&(e=t.$.deserialize(e,"array")),e=e.filter((function(e){return""===e||(t.matcher?t.matcher(e):t._matcher(e))})),e=t._sorter(e),t.sorted&&(e.sort(((e,t)=>void 0!==e.label?e.label.localeCompare(t.label):e.localeCompare(t))),"desc"===t.sortDirection&&e.reverse()),!e.length&&t.opened&&t.close(),0!==e.length&&(t.query.length>0?t._render(e.slice(0,t.items)):t._render(e),t._open(),t.$.scrollView.refresh&&t.$.scrollView.refresh(),t._refreshMenu(),t.ensureVisible())}_matcher(e){const t=this.query;switch(null===e&&(e="null"),e=""+(e=e.label||e),this.queryMode){case"startsWith":return e.startsWith(t);case"startsWithIgnoreCase":return e.toLowerCase().startsWith(t.toLowerCase());case"doesNotContain":return e.indexOf(t)<0;case"doesNotContainIgnoreCase":return e.toLowerCase().indexOf(t.toLowerCase())<0;case"contains":return e.indexOf(t)>-1;default:case"containsIgnoreCase":return~e.toLowerCase().indexOf(t.toLowerCase());case"equals":return 0===e.localeCompare(t);case"equalsIgnoreCase":return 0===e.toLowerCase().localeCompare(t.toLowerCase());case"endsWith":return e.endsWith(t);case"endsWithIgnoreCase":return e.toLowerCase().endsWith(t.toLowerCase())}}_sorter(e){const t=this;let r,o=[],n=[],a=[];if(e&&""===e[0])return e;for(;r=e.shift();){let e=r.label||r;e=""+e,e.toLowerCase().indexOf(t.query.toLowerCase())?~e.indexOf(t.query)?n.push(r):a.push(r):o.push(r)}return o.concat(n,a)}_highlighter(e){const t=this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");return e.replace(new RegExp("("+t+")","ig"),(function(e,t){return"<strong>"+t+"</strong>"}))}_render(e){const t=this;let r=0;const o=e.map((function(e){let o=e,n=e;"object"==typeof e&&(o=e.label,n=void 0!==e.value?e.value:o),o=""+o;const a=document.createElement("li"),s=document.createElement("a");if(s.href="#",a.id=t.id+"Item"+Math.floor(65536*(1+Math.random())).toString(16).substring(1),a.setAttribute("data-label",o),a.index=r++,a.dataValue=n,"string"==typeof n?a.setAttribute("value",n):a.setAttribute("value",JSON.stringify(n)),a.setAttribute("role","option"),a.setAttribute("aria-label",o),s.innerHTML=t.highlighter?t.highlighter(o):t._highlighter(o),s.setAttribute("aria-hidden",!0),e.icon&&(s.classList.add("icon"),s.classList.add(e.icon)),e.prefix){const t=document.createElement("span");t.innerHTML=e.prefix,s.classList.add("has-prefix"),s.innerHTML=t.innerHTML+s.innerHTML}if(e.suffix){const t=document.createElement("span");t.innerHTML=e.suffix,s.classList.add("has-suffix"),s.innerHTML=s.innerHTML+t.innerHTML}return a.appendChild(s),a}));function n(){const e=t.$.menu.getElementsByClassName("active");e[0]&&e[0].classList.remove("active"),this.classList.add("active"),t._setActiveDescendant(this)}o.length>0&&(o[0].classList.add("active"),t._setActiveDescendant(o[0])),t.$.menu.innerHTML="";for(let e=0;e<o.length;e++){const r=o[e];t.$.menu.appendChild(r),r.onmouseenter=n,r.onmouseleave=function(){this.classList.remove("active"),t._setActiveDescendant(null)},r.onclick=n}}ensureVisible(){const e=this,t=e.$.menu.querySelector(".active");t&&(t.offsetTop+t.offsetHeight>=e.$.scrollView.scrollTop+e.$.scrollView.offsetHeight&&(e.$.scrollView.scrollTop=t.offsetTop+t.offsetHeight),(t.offsetTop<=e.$.scrollView.scrollTop||t.offsetTop>=e.$.scrollView.scrollTop+e.$.scrollView.offsetHeight)&&(e.$.scrollView.scrollTop=t.offsetTop),0===[...e.$.menu.children].indexOf(t)?e.$.scrollView.scrollTop=0:[...e.$.menu.children].indexOf(t)===e.$.menu.children.length-1&&(e.$.scrollView.scrollTop=e.$.scrollView.scrollHeight))}_next(){const e=this,t=e.$.menu.querySelector(".active");if(!t){const t=e.$.menu.firstElementChild;return t.classList.add("active"),void e._setActiveDescendant(t)}t.classList.remove("active");let r=t.nextElementSibling;r||(r=e.$.menu.firstElementChild),r.classList.add("active"),e._setActiveDescendant(r),e.ensureVisible()}_prev(){const e=this,t=e.$.menu.querySelector(".active");if(!t){const t=e.$.menu.firstElementChild;return t.classList.add("active"),void e._setActiveDescendant(t)}t.classList.remove("active");let r=t.previousElementSibling;r||(r=e.$.menu.lastElementChild),r.classList.add("active"),e._setActiveDescendant(r),e.ensureVisible()}_move(e){const t=this;if(t.opened){switch(e.keyCode){case 9:case 13:case 27:e.preventDefault();break;case 38:e.preventDefault(),t._prev();break;case 40:e.preventDefault(),t._next()}e.stopPropagation()}}_keyDownHandler(e){const t=this;t._suppressKeyPressRepeat=![40,38,9,13,27,16,17,18].includes(e.keyCode),t._oldValue=t.$.input.value,e.shiftKey||e.altKey||e.ctrlKey||t._move(e)}_keyPressHandler(e){this._suppressKeyPressRepeat||e.shiftKey||e.altKey||e.ctrlKey||this._move(e)}_keyUpHandler(e){const t=this;if(!e.shiftKey)switch(e.keyCode){case 40:case 38:case 16:case 17:case 18:40===e.keyCode&&e.altKey&&t.open(),38===e.keyCode&&e.altKey&&t.close();break;case 9:case 13:if(!t.opened)return;t._performSelect(),e.stopPropagation(),e.preventDefault();break;case 27:if(!t.opened)return;t.close(),e.stopPropagation(),e.preventDefault();break;default:t._lookup(e),!t.opened||e.ctrlKey||e.shiftKey||(e.stopPropagation(),e.preventDefault()),t.$.fireEvent("changing",{value:t.$.input.value,oldValue:t._oldValue}),t.$.input.dataValue=t.$.input.value,t.setAttribute("data-value",t.$.input.dataValue)}}propertyChangedHandler(e,t,r){super.propertyChangedHandler(e,t,r);const o=this;if("selectedIndex"===e)o._setSelection();else if("dropDownClassList"===e){const e=o.$.scrollView;for(let r=0,o=t.length;r<o;r+=1)e.classList.remove(t[r]);for(let t=0,o=r.length;t<o;t+=1)e.classList.add(r[t])}else if("dropDownHeight"===e)"auto"!==o.dropDownHeight?o.$.scrollView.style.setProperty("--smart-input-drop-down-menu-height",o.dropDownHeight+"px"):o.$.scrollView.style.setProperty("--smart-input-drop-down-menu-height","auto");else if("opened"===e)o.opened=t,r?o.open():o.close();else if("placeholder"===e){if(o.readonly){const e=o.getAttribute("aria-label");if(e&&e!==t)return;r?o.setAttribute("aria-label",r):o.removeAttribute("aria-label")}}else if("selectedValues"===e)if(null===r)o.$.input.value="",o.$.input.dataValue=r,o.setAttribute("data-value",r),o._refreshSelectedIndex();else{const e=r.join(","),t=o.value;o.value=e,o.propertyChangedHandler("value",t,o.value)}else"value"===e?(o.displayMember!==o.valueMember&&"string"!=typeof r?(o.set("value",r[o.displayMember]),o.$.input.dataValue=r[o.valueMember],o.setAttribute("data-value",o.$.input.dataValue)):(o.$.input.value=o.$.input.dataValue=r,o.setAttribute("data-value",r)),o._refreshSelectedIndex()):"readonly"===e?(o._setAriaRelations(),o._setInputPurpose()):"theme"===e||"rightToLeft"===e?o.$.scrollView[e]=r:"inputPurpose"===e?o._setInputPurpose():"inverted"===e?r?o.$.scrollView.setAttribute("inverted",""):o.$.scrollView.removeAttribute("inverted"):"disabled"!==e&&"unfocusable"!==e||o._setFocusable()}detached(){super.detached(),this.close(),this.removeAttribute("focus")}render(){const e=this,t=e.dropDownClassList;e._createElement&&e._createElement();const r=e.$.scrollView;for(let e=0,o=t.length;e<o;e+=1)r.classList.add(t[e]);e.opened&&(e.opened=!1,e.open());const o=e.$.menu;o&&(o.setAttribute("role","presentation"),r.appendChild(o)),"auto"!==e.dropDownHeight?r.style.setProperty("--smart-input-drop-down-menu-height",e.dropDownHeight+"px"):r.style.setProperty("--smart-input-drop-down-menu-height","auto"),r.classList.add("smart-input-drop-down-menu");for(let t=0;t<e.classList.length;t++){const o=e.classList[t];"smart-element"!==o&&"smart-input"!==o&&r.classList.add(o+"-drop-down-menu")}r.id=e.id+"_"+e.tagName.toLowerCase()+"_menu_"+Math.floor(65536*(1+Math.random())).toString(16).substring(1),r.ownerElement=e,e._setAriaRelations(),e._setInputPurpose(),e._setSelection(),e.isInitialized=!0,super.render()}_setSelection(){const e=this;let t=e.dataSource;if("string"==typeof t&&(t=e.$.deserialize(t,"array")),e.selectedIndex>=0&&t&&t.length>0){let r=t[e.selectedIndex];if("number"!=typeof r&&"boolean"!=typeof r||(r=""+r),"string"==typeof r){let t=e.$.input.dataValue,o=e.value;e.set("value",r),e.$.input.dataValue=r,e.$.input.setAttribute("data-value",r),e.selectedValues=[e.$.input.dataValue],e.isInitialized&&e.$.fireEvent("change",{value:e.value,label:e.label,oldValue:t,oldLabel:o})}else{let t=e.$.input.dataValue,o=e.value;r.value?(e.set("value",void 0!==r.value?r.value+"":""),e.$.input.dataValue=r.value,e.$.input.setAttribute("data-value",r.value),e.selectedValues=[e.$.input.dataValue]):r.label&&(e.selectedValues=[r.value]),r.label&&e.set("value",r.label),e.isInitialized&&e.$.fireEvent("change",{value:e.$.input.dataValue,label:r.value,oldValue:t,oldLabel:o})}}}_createElement(){const e=this,t=document.createElement("ul"),r=document.createElement("smart-scroll-viewer");r.rightToLeft=e.rightToLeft,r.theme=e.theme,r.horizontalScrollBarVisibility="hidden",e.inverted?r.setAttribute("inverted",""):r.removeAttribute("inverted"),e.$.scrollView=r,e.$.menu=t,e._setFocusable(),e.$.menu.onclick=function(t){const r=t.target.closest("li");t.stopPropagation(),t.preventDefault(),e._performSelect(),r&&e.$.fireEvent("itemClick",{item:r,label:r.getAttribute("aria-label"),value:r.dataValue}),e.$.input.focus()}}_setAriaRelations(){const e=this,t=e.getAttribute("aria-label");e.readonly?(e.setAttribute("role","button"),!t&&e.placeholder&&e.setAttribute("aria-label",e.placeholder),e.removeAttribute("aria-readonly"),e.$.input.setAttribute("aria-hidden",!0),e.$.input.removeAttribute("aria-activedescendant"),e.$.input.removeAttribute("aria-controls"),e.$.dropDownButton.setAttribute("aria-hidden",!0)):(e.setAttribute("role","combobox"),t&&t===e.placeholder&&e.removeAttribute("aria-label"),e.$.input.setAttribute("role","searchbox"),e.$.input.removeAttribute("aria-hidden",!0),e.$.dropDownButton.removeAttribute("aria-hidden")),e.setAttribute("aria-expanded",e.opened),e.setAttribute("aria-haspopup","listbox"),e.setAttribute("aria-owns",e.$.scrollView.id),e.$.scrollView.setAttribute("role","listbox")}_setActiveDescendant(e){const t=this;t.readonly||(e?t.setAttribute("aria-activedescendant",e.id):t.removeAttribute("aria-activedescendant"))}_setInputPurpose(){const e=this;e.readonly?e.$.input.removeAttribute("autocomplete"):e.$.input.setAttribute("autocomplete",e.inputPurpose)}_setFocusable(){const e=this;e.disabled||e.unfocusable?e.$.input.setAttribute("tabindex",-1):e.$.input.removeAttribute("tabindex")}});
6
+ Smart("smart-input",class extends Smart.BaseElement{static get properties(){return{autoCompleteDelay:{value:100,type:"number"},dataSource:{type:"any",value:[],reflectToAttribute:!1},dropDownClassList:{value:[],type:"array",reflectToAttribute:!1},dropDownDataSource:{type:"any",value:[]},dropDownHeight:{type:"any",value:200},dropDownOpenMode:{allowedValues:["default","manual"],value:"default",type:"string"},dropDownWidth:{type:"any",value:null},dropDownButtonPosition:{allowedValues:["none","left","right"],value:"none",type:"string"},dropDownOpenPosition:{allowedValues:["bottom","top"],value:"bottom",type:"string"},hint:{type:"string",value:""},inputPurpose:{type:"string",value:"off"},items:{type:"number",value:8},minLength:{type:"number",value:1},name:{value:"",type:"string"},opened:{value:!1,type:"boolean"},query:{type:"string",value:""},queryMode:{allowedValues:["contains","containsIgnoreCase","doesNotContain","doesNotContainIgnoreCase","equals","equalsIgnoreCase","startsWith","startsWithIgnoreCase","endsWith","endsWithIgnoreCase"],type:"string",value:"containsIgnoreCase"},placeholder:{value:"",type:"string"},readonly:{type:"boolean",value:!1},sorted:{value:!1,type:"boolean"},sortDirection:{value:"asc",type:"string"},selectedIndex:{type:"number",value:-1},selectedValues:{value:[],type:"array"},type:{type:"string"},value:{type:"string",value:""}}}static get styleUrls(){return["smart.textbox.css"]}template(){return'<div id="inputContainer" role="presentation"><input class="smart-input" id=\'input\' readonly=\'[[readonly]]\' placeholder=\'[[placeholder]]\' type=\'[[type]]\' name=\'[[name]]\' value=\'{{value::keyup}}\' disabled=\'[[disabled]]\' aria-label="[[placeholder]]" /><span class="smart-hidden smart-hint" id="span">[[hint]]</span><div id="dropDownButton" tabindex=-1 class="smart-drop-down-button" role="button" aria-label="Toggle popup"><div id="arrow" class="arrow" aria-hidden="true"></div></div></div>'}static get listeners(){return{"input.focus":"_focusHandler","input.blur":"_blurHandler","input.keydown":"_keyDownHandler","input.keyup":"_keyUpHandler","input.keypress":"_keyPressHandler","input.paste":"_pasteHandler","dropDownButton.down":"_dropDownButtonDownHandler","inputContainer.down":"_downHandler","document.up":"_documentUpHandler"}}get selectedIndexes(){return this.isCompleted?[this.selectedIndex]:[]}set selectedIndexes(e){this.isCompleted&&(e&&void 0!==e[0]?this.selectedIndex=e[0]:this.selectedIndex=-1)}focus(){this.$.input.focus()}select(){const e=this;e.readonly?e.$.input.focus():e.$.input.select()}_documentUpHandler(e){const t=this,o=t.shadowRoot||t.isInShadowDOM?e.originalEvent.composedPath()[0]:e.originalEvent.target;o!==t&&o!==t.$.dropDownButton&&o!==t.$.input&&o!==t.$.arrow?t.$.scrollView.contains(o.shadowParent||o)?t._isPointerDown&&(t._isPointerDown=!1,t.opened&&(t._preventLookup=!0),t.$.input.focus()):(t.opened&&(t._preventLookup=!0),"manual"===t.dropDownOpenMode||t._isPointerDown||t.close(),t._isPointerDown=!1):t._isPointerDown=!1}_focusHandler(){const e=this;e.setAttribute("focus",""),e.readonly||0!==e.minLength||0!==e.$.input.value.length||e._preventLookup?(e.$.fireEvent("focus"),delete e._preventLookup):e._lookup()}_blurHandler(){const e=this;e.opened||e.removeAttribute("focus"),e.opened||e.$.fireEvent("blur"),e._refreshSelectedIndex(),delete e._preventLookup}_pasteHandler(e){const t=this,o=t.$.input,r=o.value,n=o.selectionStart,a=o.selectionEnd;if(!e.clipboardData&&!window.clipboardData)return;const l=(e.clipboardData||window.clipboardData).getData("text");let s=r.slice(0,n)+l,i=s.length;s+=r.slice(a),e.preventDefault(),t.set("value",s),t.setAttribute("data-value",s),o.setSelectionRange(i,i),t._refreshSelectedIndex()}_refreshSelectedIndex(){const e=this;let t=e.dataSource;if(t){let o=-1;if(e.dataSource instanceof Promise)return;if("function"==typeof e.dataSource)return;"string"==typeof t&&(t=e.$.deserialize(t,"array"));for(let r=0;r<t.length;r++){let n=t[r];if("number"!=typeof n&&"boolean"!=typeof n||(n=""+n),"string"==typeof n){if(n===e.value){o=r;break}}else if(n&&n.label===e.value){o=r;break}}e.set("selectedIndex",o,!1),-1===e.selectedIndex&&(e.$.input.dataValue=null)}}selectItem(e){const t=this;let o=t.dataSource;if("string"==typeof o&&(o=t.$.deserialize(o,"array")),o)for(let r=0;r<o.length;r++){const n=o[r];if(t.set("selectedIndex",-1),t.set("value",""),t.$.input.dataValue=null,"string"==typeof n){if(n===e)return t.set("selectedIndex",r,!1),t.set("value",t.$.input.dataValue=e),void t.setAttribute("data-value",t.$.input.dataValue)}else if(n.value===e)return t.set("selectedIndex",r,!1),t.set("value",n.label),t.$.input.dataValue=e,void t.setAttribute("data-value",t.$.input.dataValue)}else t.set("value",t.$.input.dataValue=e),t.setAttribute("data-value",t.$.input.dataValue),t.set("selectedIndex",-1,!1)}getItem(e){const t=this;if(t.dataSource)for(let o=0;o<t.dataSource.length;o++){const r=t.dataSource[o];if(r.value===e)return r}return null}getPrevItem(){const e=this,t=e.getSelectedItem();if(e.dataSource&&t)for(let o=0;o<e.dataSource.length;o++)if(e.dataSource[o].value===t.value)return e.dataSource[o-1];return null}getNextItem(){const e=this,t=e.getSelectedItem();if(e.dataSource&&t)for(let o=0;o<e.dataSource.length;o++)if(e.dataSource[o].value===t.value)return e.dataSource[o+1];return null}getSelectedItem(){const e=this;return{label:e.value,value:void 0!==e.$.input.dataValue?e.$.input.dataValue:e.value}}_refreshMenu(){const e=this;e.$.menu.classList.remove("scroll"),e.$.scrollView.computedVerticalScrollBarVisibility&&e.$.menu.classList.add("scroll")}_performSelect(){const e=this,t=e.$.menu.querySelector(".active"),o=t.getAttribute("data-label"),r=t.dataValue,n=e.value,a=e.$.input.dataValue;e.set("value",o),e.$.input.dataValue=r,e.setAttribute("data-value",r),e.set("selectedIndex",t.index),e.set("selectedValues",[e.$.input.dataValue]),e.close(),o===n&&r===a||e.$.fireEvent("change",{value:r,label:o,oldValue:a,oldLabel:n})}_open(){const e=this;if(e.opened)return;const t=window.scrollX,o=window.scrollY;let r=e.getBoundingClientRect(),n=0,a=0;if(e.timer&&clearTimeout(e.timer),e.getRootNode()&&e.getRootNode().host?e.getRootNode().host.shadowRoot.appendChild(e.$.scrollView):document.body.appendChild(e.$.scrollView),e.setAttribute("aria-owns",e.$.scrollView.id),e.readonly||e.$.input.setAttribute("aria-controls",e.$.scrollView.id),e.$.scrollView.enableShadowDOM&&!e._importedStyle&&(e.$.scrollView.importStyle(e._getStyleUrl("smart.textbox.css")),e._importedStyle=!0),"static"!==getComputedStyle(document.body).position){const e=document.body.getBoundingClientRect();n=e.left,a=e.top}e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",""),e.$.scrollView.style.left=-3+r.left+t-n+"px",e.$.scrollView.classList.remove("open"),"bottom"===e.dropDownOpenPosition?e.$.scrollView.style.top=r.bottom+o-a+1+"px":e.$.scrollView.style.top=r.top-e.$.scrollView.offsetHeight+o-a+1+"px",e.opening=!0,e._positionTimer&&clearInterval(e._positionTimer),e._positionTimer=setInterval((()=>{const t=e.getBoundingClientRect();if(e.opening)e.opening=!1,r=t;else if(Math.abs(parseInt(t.top)-parseInt(r.top))>=10||Math.abs(parseInt(t.left)-parseInt(r.left))>=10){const o=window.scrollX,r=window.scrollY;return e.$.scrollView.style.left=-3+t.left+o-n+"px",void("bottom"===e.dropDownOpenPosition?e.$.scrollView.style.top=t.bottom+r-a+1+"px":e.$.scrollView.style.top=t.top-e.$.scrollView.offsetHeight+r-a+1+"px")}}),50),e.$.scrollView.onpointerdown=function(){e._isPointerDown=!0},requestAnimationFrame((function(){const t=e.dropDownWidth;if(e.$.scrollView.refresh&&e.$.scrollView.refresh(),e._refreshMenu(),e.$.scrollView.setAttribute("open",""),e.setAttribute("open",""),e.$.dropDownButton.setAttribute("open",""),e.$.input.setAttribute("open",""),t&&"string"==typeof t&&-1!==t.indexOf("%")){const o=parseFloat(t)/100;e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",e.offsetWidth*o+"px")}else if("auto"!==t&&t)e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",parseFloat(t)+"px");else if("auto"===t){if(e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",""),e.$.scrollView.$.scrollViewerContainer.classList.contains("vscroll")){const t=e.$.scrollView.offsetWidth+parseFloat(getComputedStyle(e.$.scrollView).getPropertyValue("--smart-scroll-bar-size"));e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",t+"px")}}else{e.$.menu.style.width="auto";let t=e.$.menu.offsetWidth;const o=e.$.menu.querySelectorAll("li");for(let t=0;t<o.length;t++)e._maxDropDownWidth=Math.max((o[t].firstElementChild||o[t]).offsetWidth,e._maxDropDownWidth);e.$.scrollView.computedVerticalScrollBarVisibility&&(t+=e.$.scrollView.$&&e.$.scrollView.$.verticalScrollBar?e.$.scrollView.$.verticalScrollBar.offsetWidth:30),e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",Math.max(t,e.offsetWidth-8)+"px"),e.$.menu.style.width=""}(e.shadowRoot||e.isInShadowDOM)&&e.$.scrollView._scrollView&&Smart.ScrollBar&&requestAnimationFrame((()=>{e.$.scrollView._scrollView&&e.$.scrollView._scrollView.vScrollBar.refresh()}))})),e.$.scrollView.refresh&&e.$.scrollView.refresh(),e._refreshMenu(),e.set("opened",!0),e.setAttribute("aria-expanded",!0),e.$.fireEvent("open")}close(){const e=this;return!!e.opened&&(e.timer&&clearTimeout(e.timer),e.timer=setTimeout((function(){e.$.scrollView.parentNode&&!e.opened&&(e.$.scrollView.remove(),e.removeAttribute("aria-owns"),e.readonly||e.$.input.removeAttribute("aria-controls"))}),1e3),e._positionTimer&&clearInterval(e._positionTimer),e.$.scrollView.removeAttribute("open"),e.$.dropDownButton.removeAttribute("open"),e.$.input.removeAttribute("open"),e.removeAttribute("open"),e.set("opened",!1),e.setAttribute("aria-expanded",!1),e.$.input.focus(),e.$.fireEvent("close"),!0)}refresh(){const e=this;e.$.scrollView.refresh&&e.$.scrollView.refresh(),e.close()}_lookup(e){const t=this;if(t.query=t.$.input.value,t.$.input.readonly&&(t._incrementalSearchQuery||(t._incrementalSearchQuery=""),t._incrementalSearchQuery+=e.key,t._incrementalSearchTimer&&clearTimeout(t._incrementalSearchTimer),t.query=t._incrementalSearchQuery,t._incrementalSearchTimer=setTimeout((function(){t._incrementalSearchQuery=""}),700)),t.query.length<t.minLength)return void t.close();const o=function(e){clearTimeout(t._autoCompleteTimeout),t._autoCompleteTimeout=setTimeout((()=>{const o=t.context;t.context=t,t._process(e),t.context=o}),t.autoCompleteDelay)};"function"==typeof t.dataSource?t.dataSource(t.query,o):o(t.dataSource)}_downHandler(e){const t=this;t.readonly&&t._dropDownButtonDownHandler(e)}_dropDownButtonDownHandler(e){const t=this;return"manual"!==t.dropDownOpenMode&&t._toggle(),e.preventDefault(),e.stopPropagation(),e.originalEvent.preventDefault(),e.originalEvent.stopPropagation(),t._isPointerDown=!0,!1}_toggle(){const e=this;e.opened?e.close():e.open()}open(){const e=this;function t(t){e._process(t);const o=e.$.menu.querySelector(".active");if(o){const t=e.$.input.dataValue;for(let r=0;r<e.$.menu.children.length;r++){const n=e.$.menu.children[r],a=n.getAttribute("data-label"),l=n.dataValue;if(void 0!==t&&l===t||void 0===t&&a===e.$.input.value){o.classList.remove("active"),n.classList.add("active"),e._setActiveDescendant(n),e.$.input.dataValue=l,e.setAttribute("data-value",l);break}}}e.ensureVisible(),e.$.input.focus(),setTimeout((function(){e.$.input.focus()}),25)}e.dropDownDataSource&&(Array.isArray(e.dropDownDataSource)&&e.dropDownDataSource.length>0||"function"==typeof e.dropDownDataSource)?(e.query="","function"==typeof e.dropDownDataSource?e.dropDownDataSource(e.query,t):t(e.dropDownDataSource)):(e.query="","function"==typeof e.dataSource?e.dataSource(e.query,t):t(e.dataSource))}_process(e){const t=this;"string"==typeof e&&(e=t.$.deserialize(e,"array")),e=t.readonly?e.filter((function(){return!0})):e.filter((function(e){return""===e||(t.matcher?t.matcher(e):t._matcher(e))})),e=t._sorter(e),t.sorted&&(e.sort(((e,t)=>void 0!==e.label?e.label.localeCompare(t.label):e.localeCompare(t))),"desc"===t.sortDirection&&e.reverse()),!e.length&&t.opened&&t.close(),0===e.length&&!0!==t.allowItemsAdd||(t.query.length>0?t._render(e.slice(0,t.items)):t._render(e),t._open(),t.$.scrollView.refresh&&t.$.scrollView.refresh(),t._refreshMenu(),t.ensureVisible())}_matcher(e){const t=this.query;switch(null===e&&(e="null"),e=""+(e=e.label||e),this.queryMode){case"startsWith":return e.startsWith(t);case"startsWithIgnoreCase":return e.toLowerCase().startsWith(t.toLowerCase());case"doesNotContain":return e.indexOf(t)<0;case"doesNotContainIgnoreCase":return e.toLowerCase().indexOf(t.toLowerCase())<0;case"contains":return e.indexOf(t)>-1;default:case"containsIgnoreCase":return~e.toLowerCase().indexOf(t.toLowerCase());case"equals":return 0===e.localeCompare(t);case"equalsIgnoreCase":return 0===e.toLowerCase().localeCompare(t.toLowerCase());case"endsWith":return e.endsWith(t);case"endsWithIgnoreCase":return e.toLowerCase().endsWith(t.toLowerCase())}}_sorter(e){const t=this;let o,r=[],n=[],a=[];if(e&&""===e[0])return e;for(;o=e.shift();){let e=o.label||o;e=""+e,e.toLowerCase().indexOf(t.query.toLowerCase())?~e.indexOf(t.query)?n.push(o):a.push(o):r.push(o)}return r.concat(n,a)}_highlighter(e){const t=this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");return e.replace(new RegExp("("+t+")","ig"),(function(e,t){return"<strong>"+t+"</strong>"}))}_render(e){const t=this;let o=0;const r=e.map((function(e){let r=e,n=e;"object"==typeof e&&(r=e.label,n=void 0!==e.value?e.value:r),r=""+r;const a=document.createElement("li"),l=document.createElement("a");if(l.href="#",a.id=t.id+"Item"+Math.floor(65536*(1+Math.random())).toString(16).substring(1),a.setAttribute("data-label",r),a.index=o++,a.dataValue=n,"string"==typeof n?a.setAttribute("value",n):a.setAttribute("value",JSON.stringify(n)),a.setAttribute("role","option"),a.setAttribute("aria-label",r),l.innerHTML=t.highlighter?t.highlighter(r):t._highlighter(r),l.setAttribute("aria-hidden",!0),e.icon&&(l.classList.add("icon"),l.classList.add(e.icon)),e.prefix){const t=document.createElement("span");t.innerHTML=e.prefix,l.classList.add("has-prefix"),l.innerHTML=t.innerHTML+l.innerHTML}if(e.suffix){const t=document.createElement("span");t.innerHTML=e.suffix,l.classList.add("has-suffix"),l.innerHTML=l.innerHTML+t.innerHTML}return a.appendChild(l),a}));function n(){const e=t.$.menu.getElementsByClassName("active");e[0]&&e[0].classList.remove("active"),this.classList.add("active"),t._setActiveDescendant(this)}r.length>0&&(r[0].classList.add("active"),t._setActiveDescendant(r[0])),t.$.menu.innerHTML="";for(let e=0;e<r.length;e++){const o=r[e];t.$.menu.appendChild(o),o.onmouseenter=n,o.onmouseleave=function(){this.classList.remove("active"),t._setActiveDescendant(null)},o.onclick=n}}ensureVisible(){const e=this,t=e.$.menu.querySelector(".active");t&&(t.offsetTop+t.offsetHeight>=e.$.scrollView.scrollTop+e.$.scrollView.offsetHeight&&(e.$.scrollView.scrollTop=t.offsetTop+t.offsetHeight),(t.offsetTop<=e.$.scrollView.scrollTop||t.offsetTop>=e.$.scrollView.scrollTop+e.$.scrollView.offsetHeight)&&(e.$.scrollView.scrollTop=t.offsetTop),0===[...e.$.menu.children].indexOf(t)?e.$.scrollView.scrollTop=0:[...e.$.menu.children].indexOf(t)===e.$.menu.children.length-1&&(e.$.scrollView.scrollTop=e.$.scrollView.scrollHeight))}_next(){const e=this,t=e.$.menu.querySelector(".active");if(!t){const t=e.$.menu.firstElementChild;return t.classList.add("active"),void e._setActiveDescendant(t)}t.classList.remove("active");let o=t.nextElementSibling;o||(o=e.$.menu.firstElementChild),o.classList.add("active"),e._setActiveDescendant(o),e.ensureVisible()}_prev(){const e=this,t=e.$.menu.querySelector(".active");if(!t){const t=e.$.menu.firstElementChild;return t.classList.add("active"),void e._setActiveDescendant(t)}t.classList.remove("active");let o=t.previousElementSibling;o||(o=e.$.menu.lastElementChild),o.classList.add("active"),e._setActiveDescendant(o),e.ensureVisible()}_move(e){const t=this;if(t.readonly&&!t.opened){if("ArrowUp"===e.key){const o=t.getPrevItem();o&&t.selectItem(o.value),e.preventDefault()}if("ArrowDown"===e.key){const o=t.getNextItem();o&&t.selectItem(o.value),e.preventDefault()}}if(t.opened){switch(e.keyCode){case 9:case 13:case 27:e.preventDefault();break;case 38:e.preventDefault(),t._prev();break;case 40:e.preventDefault(),t._next()}e.stopPropagation()}}_keyDownHandler(e){const t=this;t._suppressKeyPressRepeat=![40,38,9,13,27,16,17,18].includes(e.keyCode),t._oldValue=t.$.input.value,e.shiftKey||e.altKey||e.ctrlKey||t._move(e)}_keyPressHandler(e){this._suppressKeyPressRepeat||e.shiftKey||e.altKey||e.ctrlKey||this._move(e)}_keyUpHandler(e){const t=this;if(!e.shiftKey&&"F2"!==e.key)switch(e.keyCode){case 40:case 38:case 16:case 17:case 18:40===e.keyCode&&e.altKey&&t.open(),38===e.keyCode&&e.altKey&&t.close();break;case 9:case 13:if(!t.opened)return;t._performSelect(),e.stopPropagation(),e.preventDefault();break;case 27:if(!t.opened)return;t.close(),e.stopPropagation(),e.preventDefault();break;default:t._lookup(e),!t.opened||e.ctrlKey||e.shiftKey||(e.stopPropagation(),e.preventDefault()),t.$.fireEvent("changing",{value:t.$.input.value,oldValue:t._oldValue}),t.$.input.dataValue=t.$.input.value,t.setAttribute("data-value",t.$.input.dataValue)}}propertyChangedHandler(e,t,o){super.propertyChangedHandler(e,t,o);const r=this;if("selectedIndex"===e)r._setSelection();else if("dataSource"===e)r._setSelection(!1);else if("dropDownClassList"===e){const e=r.$.scrollView;for(let o=0,r=t.length;o<r;o+=1)e.classList.remove(t[o]);for(let t=0,r=o.length;t<r;t+=1)e.classList.add(o[t])}else if("dropDownHeight"===e)"auto"!==r.dropDownHeight?r.$.scrollView.style.setProperty("--smart-input-drop-down-menu-height",r.dropDownHeight+"px"):r.$.scrollView.style.setProperty("--smart-input-drop-down-menu-height","auto");else if("opened"===e)r.opened=t,o?r.open():r.close();else if("placeholder"===e){if(r.readonly){const e=r.getAttribute("aria-label");if(e&&e!==t)return;o?r.setAttribute("aria-label",o):r.removeAttribute("aria-label")}}else if("selectedValues"===e)if(null===o)r.$.input.value="",r.$.input.dataValue=o,r.setAttribute("data-value",o),r._refreshSelectedIndex();else{const e=o.join(","),t=r.value;r.value=e,r.propertyChangedHandler("value",t,r.value)}else"value"===e?(r.displayMember!==r.valueMember&&"string"!=typeof o?(r.set("value",o[r.displayMember]),r.$.input.dataValue=o[r.valueMember],r.setAttribute("data-value",r.$.input.dataValue)):(r.$.input.value=r.$.input.dataValue=o,r.setAttribute("data-value",o)),r._refreshSelectedIndex()):"readonly"===e?(r._setAriaRelations(),r._setInputPurpose()):"theme"===e||"rightToLeft"===e?r.$.scrollView[e]=o:"inputPurpose"===e?r._setInputPurpose():"inverted"===e?o?r.$.scrollView.setAttribute("inverted",""):r.$.scrollView.removeAttribute("inverted"):"disabled"!==e&&"unfocusable"!==e||r._setFocusable()}detached(){super.detached(),this.close(),this.removeAttribute("focus")}render(){const e=this,t=e.dropDownClassList;if(e.selectedValues&&e.selectedValues.length){const t=e.selectedValues.join(",");e.value=t}e._createElement&&e._createElement();const o=e.$.scrollView;for(let e=0,r=t.length;e<r;e+=1)o.classList.add(t[e]);e.opened&&(e.opened=!1,e.open());const r=e.$.menu;r&&(r.setAttribute("role","presentation"),o.appendChild(r)),"auto"!==e.dropDownHeight?o.style.setProperty("--smart-input-drop-down-menu-height",e.dropDownHeight+"px"):o.style.setProperty("--smart-input-drop-down-menu-height","auto"),o.classList.add("smart-input-drop-down-menu");for(let t=0;t<e.classList.length;t++){const r=e.classList[t];"smart-element"!==r&&"smart-input"!==r&&o.classList.add(r+"-drop-down-menu")}o.id=e.id+"_"+e.tagName.toLowerCase()+"_menu_"+Math.floor(65536*(1+Math.random())).toString(16).substring(1),o.ownerElement=e,e._setAriaRelations(),e._setInputPurpose(),e._setSelection(),e.isInitialized=!0,super.render()}_setSelection(e){const t=this;let o=t.dataSource;if("string"==typeof o&&(o=t.$.deserialize(o,"array")),t.selectedIndex>=0&&o&&o.length>0){let r=o[t.selectedIndex];if("number"!=typeof r&&"boolean"!=typeof r||(r=""+r),"string"==typeof r){let e=t.$.input.dataValue,o=t.value;t.set("value",r),t.$.input.dataValue=r,t.$.input.setAttribute("data-value",r),t.selectedValues=[t.$.input.dataValue],t.isInitialized&&t.$.fireEvent("change",{value:t.value,label:t.label,oldValue:e,oldLabel:o})}else{let o=t.$.input.dataValue,n=t.value;r&&(void 0!==r.value?(t.set("value",void 0!==r.value?r.value+"":""),t.$.input.dataValue=r.value,t.$.input.setAttribute("data-value",r.value),t.selectedValues=[t.$.input.dataValue]):r.label&&(t.selectedValues=[r.value]),r.label&&t.set("value",r.label)),t.isInitialized&&!1!==e&&t.$.fireEvent("change",{value:t.$.input.dataValue,label:r.value,oldValue:o,oldLabel:n})}}}_createElement(){const e=this,t=document.createElement("ul"),o=document.createElement("smart-scroll-viewer");o.rightToLeft=e.rightToLeft,o.theme=e.theme,o.horizontalScrollBarVisibility="hidden",e.inverted?o.setAttribute("inverted",""):o.removeAttribute("inverted"),e.$.scrollView=o,e.$.menu=t,e._setFocusable(),e.$.menu.onclick=function(t){const o=t.target.closest("li");t.stopPropagation(),t.preventDefault(),e._performSelect(),o&&e.$.fireEvent("itemClick",{item:o,label:o.getAttribute("aria-label"),value:o.dataValue}),e.$.input.focus()}}_setAriaRelations(){const e=this,t=e.getAttribute("aria-label");e.readonly?(e.setAttribute("role","button"),!t&&e.placeholder&&e.setAttribute("aria-label",e.placeholder),e.removeAttribute("aria-readonly"),e.$.input.setAttribute("aria-hidden",!0),e.$.input.removeAttribute("aria-activedescendant"),e.$.input.removeAttribute("aria-controls"),e.$.dropDownButton.setAttribute("aria-hidden",!0)):(e.setAttribute("role","combobox"),t&&t===e.placeholder&&e.removeAttribute("aria-label"),e.$.input.setAttribute("role","searchbox"),e.$.input.removeAttribute("aria-hidden",!0),e.$.dropDownButton.removeAttribute("aria-hidden")),e.setAttribute("aria-expanded",e.opened),e.setAttribute("aria-haspopup","listbox"),e.setAttribute("aria-owns",e.$.scrollView.id),e.$.scrollView.setAttribute("role","listbox")}_setActiveDescendant(e){const t=this;t.readonly||(e?t.setAttribute("aria-activedescendant",e.id):t.removeAttribute("aria-activedescendant"))}_setInputPurpose(){const e=this;e.readonly?e.$.input.removeAttribute("autocomplete"):e.$.input.setAttribute("autocomplete",e.inputPurpose)}_setFocusable(){const e=this;e.disabled||e.unfocusable?e.$.input.setAttribute("tabindex",-1):e.$.input.removeAttribute("tabindex")}});
@@ -1,6 +1,6 @@
1
1
 
2
- /* Smart UI v10.2.37 (2021-11-21)
2
+ /* Smart UI v13.0.8 (2022-02-21)
3
3
  Copyright (c) 2011-2021 jQWidgets.
4
4
  License: https://htmlelements.com/license/ */ //
5
5
 
6
- Smart("smart-phone-input",class extends Smart.CountryInput{static get properties(){return{nationalMode:{value:!1,type:"boolean"},messages:{value:{en:{Example:"Example: ",IS_POSSIBLE:"Is possible",INVALID_COUNTRY_CODE:"Invalid country code",TOO_SHORT:"Too short",TOO_LONG:"Too long",IS_POSSIBLE_LOCAL_ONLY:"Is possible local only",INVALID_LENGTH:"Invalid length"}}}}}_autoSelectCountry(){const e=this;if((e.$.input.value.indexOf("+")>=0||e.$.input.value.startsWith("00")>=0)&&!e.nationalMode){const t=e.$.input.value.split(" ")[0],a=e.getItemByDialCode(t);a&&e.selectedCountry!==a.countryCode&&(e.selectedCountry=a.countryCode,e.refresh())}}propertyChangedHandler(e,t,a){super.propertyChangedHandler(e,t,a);const n=this;switch(e){case"nationalMode":case"value":n.isValidNumber()?(n.value=n.getNumber(),n.$.input.value=n.value):n.$.input.value="",n._autoSelectCountry(),n.validate();break;case"selectedCountry":n.selectItem(n.selectedCountry)}}template(){return'<div id="inputContainer" role="presentation"><input class="smart-input" id=\'input\' readonly=\'[[readonly]]\' placeholder=\'[[placeholder]]\' type=\'tel\' name=\'[[name]]\' disabled=\'[[disabled]]\' aria-label="[[placeholder]]" /><span class="smart-hidden smart-hint" id="span">[[hint]]</span><div id="dropDownButton" tabindex=-1 class="smart-drop-down-button smart-flag-box" role="button" aria-label="Toggle popup"></div></div>'}render(){const e=this;super.render(),e.readonly=!1,e.dropDownButtonPosition="left",e.selectItem(e.selectedCountry)}_updatePlaceHolder(){const e=this,t=e.getSelectedItem(),a=window.phoneNumberUtils.getExampleNumber(t.value,e.nationalMode,1);e.placeholder=e.hint=a}getSelectedItem(){const e=this,t=e.getAttribute("data-label"),a=e.getAttribute("data-dial-code"),n=e.getAttribute("data-country-code");return{label:t,value:n,iso2:n,dialCode:a}}refresh(){const e=this,t=e.getItem(e.selectedCountry);e.setAttribute("data-label",t.label),e.setAttribute("data-value",t.value),e.setAttribute("data-dial-code",t.dialCode),e.setAttribute("data-country-code",t.countryCode),e.selectedCountry=t.countryCode,e._updatePlaceHolder();const a='<div class="flag '+t.iso2+'"></div>';e.$.dropDownButton.innerHTML=a,e.$.dropDownButton.title=t.label+" +"+t.dialCode,e.validate()}selectItem(e){const t=this;super.selectItem(e),t.value=t.getNumber(),t.selectedCountry=e,t.refresh(),t.$.input.value=t.value}validate(){const e=this;if(e.isValidNumber()){e.classList.remove("smart-validation-error");const t=e.getSelectedItem(),a=e.nationalMode,n=window.phoneNumberUtils.getExampleNumber(t.value,a,1);e.setAttribute("title",e.localize("Example")+" "+n)}else{e.classList.add("smart-validation-error");const t={0:"IS_POSSIBLE",1:"INVALID_COUNTRY_CODE",2:"TOO_SHORT",3:"TOO_LONG",4:"IS_POSSIBLE_LOCAL_ONLY",5:"INVALID_LENGTH"};let a=window.phoneNumberUtils.getValidationError(e.$.input.value,e.selectedCountry);if(-99===a&&(a=5),t[a]){const n=e.localize(t[a]),l=e.getSelectedItem(),o=e.nationalMode,i=window.phoneNumberUtils.getExampleNumber(l.value,o,1);e.setAttribute("title",n+", "+e.localize("Example")+" "+i)}}}_blurHandler(){const e=this;super._blurHandler(),e.isValidNumber()&&(e.value=e.$.input.value=e.getNumber()),e.validate()}getItemByDialCode(e){const t=this;if(t.dataSource){let a=(e=""+e).indexOf("+")>=0?e.substring(1):e;if(e.startsWith("00")&&-1===e.indexOf("+")&&(a=e.substring(2)),"1"===a)return t.getItem("us");for(let e=0;e<t.dataSource.length;e++){const n=t.dataSource[e];if(n.dialCode===a)return n}}return null}getNumber(e){const t=this;if(window.phoneNumberUtils){const a=void 0===e?t.nationalMode:e,{NATIONAL:n,INTERNATIONAL:l}=window.phoneNumberUtils.numberFormat,o=a?n:l;let i=t.$.input.value;if(!a&&i.startsWith("00")){const e=t.getItem(t.selectedCountry).dialCode;i=i.substring(2+e.length).trim()}return window.phoneNumberUtils.formatNumber(i,this.selectedCountry,o)}return""}_performSelect(){const e=this,t=e.$.menu.querySelector(".active"),a=t.getAttribute("data-label"),n=t.dataValue,l=e.$.input.value,o=e.$.input.dataValue;e.$.input.dataValue=n,e.setAttribute("data-value",n),e.set("selectedIndex",t.index),e.set("selectedValues",[e.$.input.dataValue]),e.close();const i=t.querySelector(".smart-flag-box").innerHTML;e.$.dropDownButton.innerHTML=i;const r=t.getAttribute("data-dial-code");e.$.dropDownButton.title=a+" +"+r,a===l&&n===o||e.$.fireEvent("change",{value:n,label:a,oldValue:o,oldLabel:l});const s=t.getAttribute("data-country-code");e.setAttribute("data-label",a),e.setAttribute("data-value",n),e.setAttribute("data-dial-code",r),e.setAttribute("data-country-code",s),e.selectedCountry=s,e.set("value",e.$.input.value),e.nationalMode?e.$.input.value="":e.$.input.value="+"+r,e._updatePlaceHolder(),e.validate()}isValidNumber(){const e=this;let t=e.$.input.value.trim();const a=e.selectedCountry;if(t.startsWith("00")){const n=e.getItem(a).dialCode;t=t.substring(2+n.length)}return window.phoneNumberUtils?window.phoneNumberUtils.isValidNumber(t,a):null}_keyDownHandler(e){const t=this;t._suppressKeyPressRepeat=![40,38,9,13,27,16,17,18].includes(e.keyCode),t.opened&&(e.key.toUpperCase()!==e.key.toLowerCase()||e.key.codePointAt(0)>127)&&(e.preventDefault(),e.stopPropagation()),e.shiftKey||e.altKey||e.ctrlKey||t._move(e)}_keyUpHandler(e){const t=this;if(!e.shiftKey)switch(e.keyCode){case 40:case 38:case 16:case 17:case 18:40===e.keyCode&&e.altKey&&t.open(),38===e.keyCode&&e.altKey&&t.close();break;case 9:case 13:if(!t.opened)return;t._performSelect(),e.stopPropagation(),e.preventDefault();break;case 27:if(!t.opened)return;t.close(),e.stopPropagation(),e.preventDefault();break;default:if(!e.ctrlKey&&!e.altKey&&" "!==e.key){t.validate();const e=t.isValidNumber();t.value=e?t.getNumber():""}" "===e.key&&t._autoSelectCountry(),!t.opened||e.ctrlKey||e.shiftKey||(t._lookup(e),e.stopPropagation(),e.preventDefault())}}_lookup(e){const t=this;if(t.query=t.$.input.value,t._incrementalSearchQuery||(t._incrementalSearchQuery=""),t._incrementalSearchQuery+=e.key,t._incrementalSearchTimer&&clearTimeout(t._incrementalSearchTimer),t.query=t._incrementalSearchQuery,t._incrementalSearchTimer=setTimeout((function(){t._incrementalSearchQuery=""}),700),t.query.length<t.minLength)return void t.close();const a=function(e){clearTimeout(t._autoCompleteTimeout),t._autoCompleteTimeout=setTimeout((()=>{const a=t.context;t.context=t,t._process(e),t.context=a}),t.autoCompleteDelay)};"function"==typeof t.dataSource?t.dataSource(t.query,a):a(t.dataSource)}_render(e){const t=this;let a=0;const n=t.query?null:t.getSelectedItem(),l=e.map((function(e){let l=e,o=e;"object"==typeof e&&(l=e.label,o=void 0!==e.value?e.value:l),l=""+l;const i=document.createElement("li"),r=document.createElement("a");return r.href="#",i.id=t.id+"Item"+Math.floor(65536*(1+Math.random())).toString(16).substring(1),i.setAttribute("data-label",l),i.index=a++,i.dataValue=o,"string"==typeof o?i.setAttribute("value",o):i.setAttribute("value",JSON.stringify(o)),i.setAttribute("role","option"),i.setAttribute("aria-label",l),l='<div class="smart-flag-box"><div class="flag '+e.iso2+'"></div></div><span class="country-name">'+e.label+'</span><span class="dial-code">+'+e.dialCode+"</span>",r.innerHTML=l,r.setAttribute("aria-hidden",!0),i.classList.add("country"),i.setAttribute("data-dial-code",e.dialCode),i.setAttribute("data-country-code",e.iso2),i.appendChild(r),n&&n.value===e.iso2&&(i.classList.add("active"),t._setActiveDescendant(i)),i}));function o(){const e=t.$.menu.getElementsByClassName("active");e[0]&&e[0].classList.remove("active"),this.classList.add("active"),t._setActiveDescendant(this)}l.length>0&&!n&&(l[0].classList.add("active"),t._setActiveDescendant(l[0])),t.$.menu.innerHTML="";for(let e=0;e<l.length;e++){const a=l[e];t.$.menu.appendChild(a),a.onmouseenter=o,a.onmouseleave=function(){this.classList.remove("active"),t._setActiveDescendant(null)},a.onclick=o}}});
6
+ Smart("smart-phone-input",class extends Smart.CountryInput{static get properties(){return{nationalMode:{value:!1,type:"boolean"},messages:{value:{en:{Example:"Example: ",IS_POSSIBLE:"Is possible",INVALID_COUNTRY_CODE:"Invalid country code",TOO_SHORT:"Too short",TOO_LONG:"Too long",IS_POSSIBLE_LOCAL_ONLY:"Is possible local only",INVALID_LENGTH:"Invalid length"}}}}}_autoSelectCountry(){const e=this;if((e.$.input.value.indexOf("+")>=0||e.$.input.value.startsWith("00")>=0)&&!e.nationalMode){const t=e.$.input.value.split(" ")[0],a=e.getItemByDialCode(t);a&&e.selectedCountry!==a.countryCode&&(e.selectedCountry=a.countryCode,e.refresh())}}propertyChangedHandler(e,t,a){super.propertyChangedHandler(e,t,a);const n=this;switch(e){case"nationalMode":case"value":n.isValidNumber()?(n.value=n.getNumber(),n.$.input.value=n.value):n.$.input.value="",n._autoSelectCountry(),n.validate();break;case"selectedCountry":n.selectItem(n.selectedCountry)}}template(){return'<div id="inputContainer" role="presentation"><input class="smart-input" id=\'input\' readonly=\'[[readonly]]\' placeholder=\'[[placeholder]]\' type=\'tel\' name=\'[[name]]\' disabled=\'[[disabled]]\' aria-label="[[placeholder]]" /><span class="smart-hidden smart-hint" id="span">[[hint]]</span><div id="dropDownButton" tabindex=-1 class="smart-drop-down-button smart-flag-box" role="button" aria-label="Toggle popup"></div></div>'}render(){const e=this;super.render(),e.readonly=!1,e.dropDownButtonPosition="left",e.selectItem(e.selectedCountry)}_updatePlaceHolder(){const e=this,t=e.getSelectedItem(),a=window.phoneNumberUtils.getExampleNumber(t.value,e.nationalMode,1);e.placeholder=e.hint=a}getSelectedItem(){const e=this,t=e.getAttribute("data-label"),a=e.getAttribute("data-dial-code"),n=e.getAttribute("data-country-code");return{label:t,value:n,iso2:n,dialCode:a}}refresh(){const e=this,t=e.getItem(e.selectedCountry);e.setAttribute("data-label",t.label),e.setAttribute("data-value",t.value),e.setAttribute("data-dial-code",t.dialCode),e.setAttribute("data-country-code",t.countryCode),e.selectedCountry=t.countryCode,e._updatePlaceHolder();const a='<div class="flag '+t.iso2+'"></div>';e.$.dropDownButton.innerHTML=a,e.$.dropDownButton.title=t.label+" +"+t.dialCode,e.validate()}selectItem(e){const t=this;super.selectItem(e),t.value=t.getNumber(),t.selectedCountry=e,t.refresh(),t.$.input.value=t.value}validate(){const e=this;if(e.isValidNumber()){e.classList.remove("invalid-number");const t=e.getSelectedItem(),a=e.nationalMode,n=window.phoneNumberUtils.getExampleNumber(t.value,a,1);e.setAttribute("title",e.localize("Example")+" "+n)}else{e.classList.add("invalid-number");const t={0:"IS_POSSIBLE",1:"INVALID_COUNTRY_CODE",2:"TOO_SHORT",3:"TOO_LONG",4:"IS_POSSIBLE_LOCAL_ONLY",5:"INVALID_LENGTH"};let a=window.phoneNumberUtils.getValidationError(e.$.input.value,e.selectedCountry);if(-99===a&&(a=5),t[a]){const n=e.localize(t[a]),l=e.getSelectedItem(),o=e.nationalMode,i=window.phoneNumberUtils.getExampleNumber(l.value,o,1);e.setAttribute("title",n+", "+e.localize("Example")+" "+i)}}}_blurHandler(){const e=this;super._blurHandler(),e.isValidNumber()&&(e.value=e.$.input.value=e.getNumber()),e.validate()}getItemByDialCode(e){const t=this;if(t.dataSource){let a=(e=""+e).indexOf("+")>=0?e.substring(1):e;if(e.startsWith("00")&&-1===e.indexOf("+")&&(a=e.substring(2)),"1"===a)return t.getItem("us");for(let e=0;e<t.dataSource.length;e++){const n=t.dataSource[e];if(n.dialCode===a)return n}}return null}getNumber(e){const t=this;if(window.phoneNumberUtils){const a=void 0===e?t.nationalMode:e,{NATIONAL:n,INTERNATIONAL:l}=window.phoneNumberUtils.numberFormat,o=a?n:l;let i=t.$.input.value;if(!a&&i.startsWith("00")){const e=t.getItem(t.selectedCountry).dialCode;i=i.substring(2+e.length).trim()}return window.phoneNumberUtils.formatNumber(i,this.selectedCountry,o)}return""}_performSelect(){const e=this,t=e.$.menu.querySelector(".active"),a=t.getAttribute("data-label"),n=t.dataValue,l=e.$.input.value,o=e.$.input.dataValue;e.$.input.dataValue=n,e.setAttribute("data-value",n),e.set("selectedIndex",t.index),e.set("selectedValues",[e.$.input.dataValue]),e.close();const i=t.querySelector(".smart-flag-box").innerHTML;e.$.dropDownButton.innerHTML=i;const r=t.getAttribute("data-dial-code");e.$.dropDownButton.title=a+" +"+r,a===l&&n===o||e.$.fireEvent("change",{value:n,label:a,oldValue:o,oldLabel:l});const s=t.getAttribute("data-country-code");e.setAttribute("data-label",a),e.setAttribute("data-value",n),e.setAttribute("data-dial-code",r),e.setAttribute("data-country-code",s),e.selectedCountry=s,e.set("value",e.$.input.value),e.nationalMode?e.$.input.value="":e.$.input.value="+"+r,e._updatePlaceHolder(),e.validate()}isValidNumber(){const e=this;let t=e.$.input.value.trim();const a=e.selectedCountry;if(t.startsWith("00")){const n=e.getItem(a).dialCode;t=t.substring(2+n.length)}return window.phoneNumberUtils?window.phoneNumberUtils.isValidNumber(t,a):null}_keyDownHandler(e){const t=this;t._suppressKeyPressRepeat=![40,38,9,13,27,16,17,18].includes(e.keyCode),t.opened&&(e.key.toUpperCase()!==e.key.toLowerCase()||e.key.codePointAt(0)>127)&&(e.preventDefault(),e.stopPropagation()),e.shiftKey||e.altKey||e.ctrlKey||t._move(e)}_keyUpHandler(e){const t=this;if(!e.shiftKey)switch(e.keyCode){case 40:case 38:case 16:case 17:case 18:40===e.keyCode&&e.altKey&&t.open(),38===e.keyCode&&e.altKey&&t.close();break;case 9:case 13:if(!t.opened)return;t._performSelect(),e.stopPropagation(),e.preventDefault();break;case 27:if(!t.opened)return;t.close(),e.stopPropagation(),e.preventDefault();break;default:if(!e.ctrlKey&&!e.altKey&&" "!==e.key){t.validate();const e=t.isValidNumber();t.value=e?t.getNumber():""}" "===e.key&&t._autoSelectCountry(),!t.opened||e.ctrlKey||e.shiftKey||(t._lookup(e),e.stopPropagation(),e.preventDefault())}}_lookup(e){const t=this;if(t.query=t.$.input.value,t._incrementalSearchQuery||(t._incrementalSearchQuery=""),t._incrementalSearchQuery+=e.key,t._incrementalSearchTimer&&clearTimeout(t._incrementalSearchTimer),t.query=t._incrementalSearchQuery,t._incrementalSearchTimer=setTimeout((function(){t._incrementalSearchQuery=""}),700),t.query.length<t.minLength)return void t.close();const a=function(e){clearTimeout(t._autoCompleteTimeout),t._autoCompleteTimeout=setTimeout((()=>{const a=t.context;t.context=t,t._process(e),t.context=a}),t.autoCompleteDelay)};"function"==typeof t.dataSource?t.dataSource(t.query,a):a(t.dataSource)}_render(e){const t=this;let a=0;const n=t.query?null:t.getSelectedItem(),l=e.map((function(e){let l=e,o=e;"object"==typeof e&&(l=e.label,o=void 0!==e.value?e.value:l),l=""+l;const i=document.createElement("li"),r=document.createElement("a");return r.href="#",i.id=t.id+"Item"+Math.floor(65536*(1+Math.random())).toString(16).substring(1),i.setAttribute("data-label",l),i.index=a++,i.dataValue=o,"string"==typeof o?i.setAttribute("value",o):i.setAttribute("value",JSON.stringify(o)),i.setAttribute("role","option"),i.setAttribute("aria-label",l),l='<div class="smart-flag-box"><div class="flag '+e.iso2+'"></div></div><span class="country-name">'+e.label+'</span><span class="dial-code">+'+e.dialCode+"</span>",r.innerHTML=l,r.setAttribute("aria-hidden",!0),i.classList.add("country"),i.setAttribute("data-dial-code",e.dialCode),i.setAttribute("data-country-code",e.iso2),i.appendChild(r),n&&n.value===e.iso2&&(i.classList.add("active"),t._setActiveDescendant(i)),i}));function o(){const e=t.$.menu.getElementsByClassName("active");e[0]&&e[0].classList.remove("active"),this.classList.add("active"),t._setActiveDescendant(this)}l.length>0&&!n&&(l[0].classList.add("active"),t._setActiveDescendant(l[0])),t.$.menu.innerHTML="";for(let e=0;e<l.length;e++){const a=l[e];t.$.menu.appendChild(a),a.onmouseenter=o,a.onmouseleave=function(){this.classList.remove("active"),t._setActiveDescendant(null)},a.onclick=o}}});
@@ -1,5 +1,5 @@
1
1
 
2
- /* Smart UI v10.2.37 (2021-11-21)
2
+ /* Smart UI v13.0.8 (2022-02-21)
3
3
  Copyright (c) 2011-2021 jQWidgets.
4
4
  License: https://htmlelements.com/license/ */ //
5
5
 
Binary file
@@ -1,10 +1,10 @@
1
1
  <?xml version="1.0" standalone="no"?>
2
2
  <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
3
  <svg xmlns="http://www.w3.org/2000/svg">
4
- <metadata>Copyright (C) 2021 by original authors @ fontello.com</metadata>
4
+ <metadata>Copyright (C) 2022 by original authors @ fontello.com</metadata>
5
5
  <defs>
6
- <font id="fontello" horiz-adv-x="1000" >
7
- <font-face font-family="fontello" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
6
+ <font id="jqx-icons" horiz-adv-x="1000" >
7
+ <font-face font-family="jqx-icons" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
8
8
  <missing-glyph horiz-adv-x="1000" />
9
9
  <glyph glyph-name="table" unicode="&#xe800;" d="M286 148v-108q0-22-16-37t-38-16h-178q-23 0-38 16t-16 37v108q0 22 16 38t38 15h178q23 0 38-15t16-38z m0 285v-107q0-22-16-38t-38-15h-178q-23 0-38 15t-16 38v107q0 23 16 38t38 16h178q23 0 38-16t16-38z m357-285v-108q0-22-16-37t-38-16h-178q-23 0-38 16t-16 37v108q0 22 16 38t38 15h178q23 0 38-15t16-38z m-357 571v-107q0-22-16-38t-38-16h-178q-23 0-38 16t-16 38v107q0 22 16 38t38 16h178q23 0 38-16t16-38z m357-286v-107q0-22-16-38t-38-15h-178q-23 0-38 15t-16 38v107q0 23 16 38t38 16h178q23 0 38-16t16-38z m357-285v-108q0-22-16-37t-38-16h-178q-22 0-38 16t-16 37v108q0 22 16 38t38 15h178q23 0 38-15t16-38z m-357 571v-107q0-22-16-38t-38-16h-178q-23 0-38 16t-16 38v107q0 22 16 38t38 16h178q23 0 38-16t16-38z m357-286v-107q0-22-16-38t-38-15h-178q-22 0-38 15t-16 38v107q0 23 16 38t38 16h178q23 0 38-16t16-38z m0 286v-107q0-22-16-38t-38-16h-178q-22 0-38 16t-16 38v107q0 22 16 38t38 16h178q23 0 38-16t16-38z" horiz-adv-x="1000" />
10
10
 
@@ -134,6 +134,8 @@
134
134
 
135
135
  <glyph glyph-name="up" unicode="&#xe83f;" d="M366 784l334-334q31-31 31-73t-31-74-74-31-73 31l-83 82v-377q0-44-31-74t-73-30q-43 0-74 31t-31 73v377l-82-82q-31-31-74-31t-74 31-31 74 31 73z" horiz-adv-x="731.4" />
136
136
 
137
+ <glyph glyph-name="videocam" unicode="&#xe840;" d="M1000 654v-608q0-23-22-32-7-3-14-3-15 0-25 10l-225 225v-92q0-67-47-114t-113-47h-393q-67 0-114 47t-47 114v392q0 67 47 114t114 47h393q66 0 113-47t47-114v-92l225 225q10 10 25 10 7 0 14-2 22-10 22-33z" horiz-adv-x="1000" />
138
+
137
139
  <glyph glyph-name="first_page" unicode="&#xe900;" d="M250 600h84v-500h-84v500z m518-441l-59-59-250 250 250 250 59-59-192-191z" horiz-adv-x="1000" />
138
140
 
139
141
  <glyph glyph-name="keyboard_arrow_down" unicode="&#xe901;" d="M309 524l191-192 191 192 59-59-250-250-250 250z" horiz-adv-x="1000" />
@@ -198,6 +200,8 @@
198
200
 
199
201
  <glyph glyph-name="underline" unicode="&#xf0cd;" d="M27 726q-21 1-25 2l-2 49q7 1 22 1 34 0 63-3 74-4 93-4 47 0 93 2 65 2 82 3 31 0 48 1l-1-8 1-36v-5q-33-5-69-5-33 0-44-14-7-7-7-73 0-7 0-18t0-15l1-127 8-157q3-69 28-112 20-33 54-52 49-26 98-26 59 0 107 16 31 10 55 28 27 20 37 36 20 31 29 63 12 41 12 128 0 44-2 72t-6 68-8 89l-2 33q-3 37-13 49-19 20-43 19l-56-1-8 2 1 48h47l114-6q43-2 110 6l10-1q3-22 3-29 0-4-2-17-25-7-47-8-41-6-44-9-8-8-8-23 0-4 0-15t1-17q5-11 13-221 3-109-9-170-8-42-23-68-21-36-62-69-42-31-102-49-61-19-142-19-93 0-159 26-66 26-99 68-34 42-47 109-9 45-9 132v186q0 105-9 119-14 20-82 22z m830-787v36q0 8-5 13t-13 5h-821q-8 0-13-5t-5-13v-36q0-8 5-13t13-5h821q8 0 13 5t5 13z" horiz-adv-x="857.1" />
200
202
 
203
+ <glyph glyph-name="table-1" unicode="&#xf0ce;" d="M286 82v107q0 8-5 13t-13 5h-179q-7 0-12-5t-6-13v-107q0-8 6-13t12-5h179q8 0 13 5t5 13z m0 214v108q0 7-5 12t-13 5h-179q-7 0-12-5t-6-12v-108q0-7 6-12t12-5h179q8 0 13 5t5 12z m285-214v107q0 8-5 13t-12 5h-179q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h179q7 0 12 5t5 13z m-285 429v107q0 8-5 13t-13 5h-179q-7 0-12-5t-6-13v-107q0-8 6-13t12-5h179q8 0 13 5t5 13z m285-215v108q0 7-5 12t-12 5h-179q-8 0-13-5t-5-12v-108q0-7 5-12t13-5h179q7 0 12 5t5 12z m286-214v107q0 8-5 13t-13 5h-178q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h178q8 0 13 5t5 13z m-286 429v107q0 8-5 13t-12 5h-179q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h179q7 0 12 5t5 13z m286-215v108q0 7-5 12t-13 5h-178q-8 0-13-5t-5-12v-108q0-7 5-12t13-5h178q8 0 13 5t5 12z m0 215v107q0 8-5 13t-13 5h-178q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h178q8 0 13 5t5 13z m72 178v-607q0-37-27-63t-63-26h-750q-36 0-63 26t-26 63v607q0 37 26 63t63 27h750q37 0 63-27t27-63z" horiz-adv-x="928.6" />
204
+
201
205
  <glyph glyph-name="columns" unicode="&#xf0db;" d="M89-7h340v643h-358v-625q0-7 6-13t12-5z m768 18v625h-357v-643h339q8 0 13 5t5 13z m72 678v-678q0-37-27-63t-63-27h-750q-36 0-63 27t-26 63v678q0 37 26 63t63 27h750q37 0 63-27t27-63z" horiz-adv-x="928.6" />
202
206
 
203
207
  <glyph glyph-name="sort-1" unicode="&#xf0dc;" d="M571 237q0-15-10-25l-250-250q-11-11-25-11t-25 11l-250 250q-11 10-11 25t11 25 25 11h500q14 0 25-11t10-25z m0 214q0-14-10-25t-25-11h-500q-15 0-25 11t-11 25 11 25l250 250q10 11 25 11t25-11l250-250q10-10 10-25z" horiz-adv-x="571.3" />
@@ -206,6 +210,8 @@
206
210
 
207
211
  <glyph glyph-name="paste" unicode="&#xf0ea;" d="M429-85h500v358h-233q-22 0-37 15t-16 38v232h-214v-643z m142 804v36q0 7-5 12t-12 6h-393q-7 0-13-6t-5-12v-36q0-7 5-13t13-5h393q7 0 12 5t5 13z m143-375h167l-167 167v-167z m286-71v-375q0-23-16-38t-38-16h-535q-23 0-38 16t-16 38v89h-303q-23 0-38 16t-16 37v750q0 23 16 38t38 16h607q22 0 38-16t15-38v-183q12-7 20-15l228-228q16-15 27-42t11-49z" horiz-adv-x="1000" />
208
212
 
213
+ <glyph glyph-name="bell-alt" unicode="&#xf0f3;" d="M509-96q0 8-9 8-33 0-57 24t-23 57q0 9-9 9t-9-9q0-41 29-70t69-28q9 0 9 9z m455 160q0-29-21-50t-50-21h-250q0-59-42-101t-101-42-101 42-42 101h-250q-29 0-50 21t-21 50q28 24 51 49t47 67 42 89 27 115 11 145q0 84 66 157t171 89q-5 10-5 21 0 23 16 38t38 16 38-16 16-38q0-11-5-21 106-16 171-89t66-157q0-78 11-145t28-115 41-89 48-67 50-49z" horiz-adv-x="1000" />
214
+
209
215
  <glyph glyph-name="circle-empty" unicode="&#xf10c;" d="M429 648q-83 0-153-41t-110-111-41-152 41-152 110-111 153-41 152 41 110 111 41 152-41 152-110 111-152 41z m428-304q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z" horiz-adv-x="857.4" />
210
216
 
211
217
  <glyph glyph-name="circle" unicode="&#xf111;" d="M857 344q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z" horiz-adv-x="857.4" />
@@ -238,6 +244,8 @@
238
244
 
239
245
  <glyph glyph-name="youtube-play" unicode="&#xf16a;" d="M397 221l270 139-270 141v-280z m103 481q94 0 181-3t128-5l41-2q0 0 9-1t13-2 13-2 16-5 16-7 17-11 16-15q4-3 9-10t16-33 15-56q4-36 7-76t3-64v-98q1-81-10-162-4-30-14-55t-18-35l-8-9q-7-8-16-15t-17-10-16-7-16-5-13-2-13-2-9-1q-140-11-350-11-115 2-201 4t-111 4l-28 3-20 2q-20 3-30 5t-29 12-31 23q-4 3-9 10t-16 33-15 56q-4 36-7 76t-3 64v98q-1 81 10 162 4 31 14 55t18 35l8 9q8 9 16 15t17 11 16 7 16 5 13 2 13 2 9 1q140 10 350 10z" horiz-adv-x="1000" />
240
246
 
247
+ <glyph glyph-name="trello" unicode="&#xf181;" d="M393 100v571q0 8-5 13t-13 5h-268q-8 0-13-5t-5-13v-571q0-8 5-13t13-5h268q8 0 13 5t5 13z m375 214v357q0 8-5 13t-13 5h-268q-8 0-13-5t-5-13v-357q0-7 5-12t13-6h268q8 0 13 6t5 12z m89 429v-786q0-14-10-25t-26-11h-785q-15 0-25 11t-11 25v786q0 14 11 25t25 11h785q15 0 26-11t10-25z" horiz-adv-x="857.1" />
248
+
241
249
  <glyph glyph-name="dot-circled" unicode="&#xf192;" d="M571 344q0-59-41-101t-101-42-101 42-42 101 42 101 101 42 101-42 41-101z m-142 304q-83 0-153-41t-110-111-41-152 41-152 110-111 153-41 152 41 110 111 41 152-41 152-110 111-152 41z m428-304q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z" horiz-adv-x="857.4" />
242
250
 
243
251
  <glyph glyph-name="header" unicode="&#xf1dc;" d="M939-79q-25 0-74 2t-75 2q-24 0-73-2t-74-2q-13 0-21 12t-7 25q0 18 9 26t22 9 29 4 25 9q18 11 18 78l0 218q0 12-1 17-7 3-28 3h-376q-22 0-29-3 0-5 0-17l-1-207q0-79 21-91 9-6 26-8t32-2 25-8 11-26q0-14-6-26t-21-13q-26 0-78 2t-77 2q-24 0-71-2t-71-2q-13 0-20 12t-7 25q0 17 9 25t20 10 26 4 24 9q18 13 18 80l-1 31v454q0 2 1 15t0 20-1 21-2 24-4 20-6 18-9 10q-8 5-25 7t-29 1-23 7-10 26q0 14 6 26t20 13q26 0 78-2t77-2q23 0 71 2t70 2q14 0 21-13t7-26q0-17-9-25t-22-8-27-2-24-7q-20-12-20-90l1-178q0-12 0-18 7-2 22-2h390q14 0 21 2 1 6 1 18l0 178q0 78-19 90-10 6-33 7t-37 7-14 28q0 14 7 26t21 13q24 0 74-2t73-2q24 0 72 2t72 2q14 0 21-13t7-26q0-17-10-25t-22-8-29-2-24-7q-20-13-20-90l1-526q0-66 19-78 9-6 25-8t30-2 23-9 10-25q0-14-6-26t-20-13z" horiz-adv-x="1000" />
Binary file
Binary file
Binary file