@smart-webcomponents-angular/button
Advanced tools
Comparing version 14.2.0 to 15.0.2
{ | ||
"name": "@smart-webcomponents-angular/button", | ||
"version": "14.2.0", | ||
"version": "15.0.2", | ||
"preferGlobal": true, | ||
@@ -5,0 +5,0 @@ "keywords": [ |
/* Smart UI v14.2.72 (2022-08-30) | ||
Copyright (c) 2011-2022 jQWidgets. | ||
/* Smart UI v15.0.2 (2023-01-24) | ||
Copyright (c) 2011-2023 jQWidgets. | ||
License: https://htmlelements.com/license/ */ // | ||
@@ -5,0 +5,0 @@ |
/* Smart UI v14.2.72 (2022-08-30) | ||
Copyright (c) 2011-2021 jQWidgets. | ||
/* Smart UI v15.0.2 (2023-01-24) | ||
Copyright (c) 2011-2023 jQWidgets. | ||
License: https://htmlelements.com/license/ */ // | ||
Smart("smart-button",class extends Smart.ContentElement{static get properties(){return{value:{type:"string"},name:{type:"string"},type:{value:"button",type:"string"},clickMode:{allowedValues:["hover","press","release","pressAndRelease"],type:"string",value:"release"}}}static get styleUrls(){return["smart.button.css"]}template(){return"<button class=\"smart-button smart-unselectable\" inner-h-t-m-l='[[innerHTML]]' id='button' type='[[type]]' name='[[name]]' value='[[value]]' disabled='[[disabled]]' role=\"presentation\"></button>"}refresh(){}static get listeners(){return{"button.down":"_downHandler","button.mouseenter":"_mouseEnterHandler","button.mouseleave":"_mouseLeaveHandler","button.touchend":"_touchEndHandler","button.click":"_clickHandler","button.up":"_upHandler",up:"_upHandler","button.focus":"_focusHandler","button.blur":"_blurHandler"}}focus(){const e=this;e.$.button?e.$.button.focus():HTMLElement.prototype.focus.call(e)}blur(){const e=this;e.$.button?e.$.button.blur():HTMLElement.prototype.blur.call(e)}_upHandler(e){const t=this;if(e.stopPropagation(),t.$.setAttributeValue("active",!1),t.dataset.target){const n=document.querySelector(t.dataset.target);let a=t.dataset.toggle;const r="smart-window".toLowerCase();if(n&&n.nodeName.toLowerCase()===r&&"modal"===a&&(a="openModal"),"tab"===a||"pill"===a||"list"===a){const e=this.closest(".nav, .list-group"),a='[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',r=!e||"UL"!==e.nodeName&&"OL"!==e.nodeName?e.children(".active"):e.querySelectorAll("li > .active");if(e){const n=e.querySelectorAll(a);for(let e=0;e<n.length;e++)n[e].classList.remove("primary");for(let e=0;e<r.length;e++)r[e].classList.remove("active");let i=t.parentNode;for(;i;){if("LI"===i.nodeName){i.classList.add("active");break}i=i.parentNode}t.classList.add("primary")}return n.parentNode.querySelectorAll(".active").forEach((e=>{e.classList.remove("active"),e.classList.add("smart-hidden")})),n.classList.add("active"),void n.classList.remove("smart-hidden")}a&&n&&!n[a]&&"collapse"===a&&(setTimeout((()=>{n.classList.contains("smart-hidden")?n.classList.remove("smart-hidden"):n.classList.add("smart-hidden")})),e.originalEvent.preventDefault()),a&&n&&!n[a]&&"dropdown"===a?(setTimeout((()=>{n.opened=!n.opened})),e.originalEvent.preventDefault()):a&&n&&n[a]&&(setTimeout((()=>{n[a]()}),50),e.originalEvent.preventDefault())}}_focusHandler(){this.$.setAttributeValue("focus",!0),this.$.fireEvent("focus")}_blurHandler(){this.$.setAttributeValue("focus",!1),this.$.fireEvent("blur")}_clickHandler(e){const t=this;("release"!==t.clickMode&&"pressAndRelease"!==t.clickMode||t.readonly)&&(e.preventDefault(),e.stopPropagation())}_downHandler(e){const t=this;if(!(t.disabled||(t.hasRippleAnimation&&Smart.Utilities.Animation.Ripple.animate(t,e.pageX,e.pageY),t.$.setAttributeValue("active",!0),"press"!==t.clickMode&&"pressAndRelease"!==t.clickMode||t.readonly))){if(t.hasAttribute("smart-blazor"))return void t.$.dispatchEvent(new Event("click"));const n="buttons"in e?e.buttons:e.which;t.$.fireEvent("click",{buttons:n,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY,screenX:e.screenX,screenY:e.screenY})}}_mouseEnterHandler(e){const t=this;if(!t.readonly&&(t.$button.setAttributeValue("hover",!0),t.$.setAttributeValue("hover",!0),"hover"===t.clickMode)){const n="buttons"in e?e.buttons:e.which;if(t.hasAttribute("smart-blazor"))return void t.$.dispatchEvent(new Event("click"));t.$.fireEvent("click",{buttons:n,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY,screenX:e.screenX,screenY:e.screenY})}}_touchEndHandler(){const e=this;setTimeout((function(){e.$button.setAttributeValue("hover",!1),e.$.setAttributeValue("hover",!1)}),300)}_mouseLeaveHandler(){this.$button.setAttributeValue("hover",!1),this.$.setAttributeValue("hover",!1)}propertyChangedHandler(e,t,n){super.propertyChangedHandler(e,t,n);const a=this;"disabled"===e?(a._setFocusable(),a.$button&&a.$button.setAttributeValue("hover",!1),a.$.setAttributeValue("hover",!1),a instanceof Smart.RepeatButton&&a._stopRepeat()):"unfocusable"===e&&a._setFocusable()}_setFocusable(){const e=this,t=e.$.button?e.$.button:e;if(e.disabled||e.unfocusable)return t.removeAttribute("tabindex"),void(t.tabIndex=-1);t.tabIndex=e.tabIndex>0?e.tabIndex:0}ready(){const e=this;super.ready(),e.setAttribute("role","button"),e._setFocusable(),e.enableShadowDOM&&e.$.hiddenInput&&e.appendChild(e.$.hiddenInput)}}),Smart("smart-repeat-button",class extends Smart.Button{static get properties(){return{delay:{value:50,type:"number"},initialDelay:{value:150,type:"number"}}}static get listeners(){return{"button.down":"_startRepeat","button.mouseenter":"_overriddenHandler","button.mouseleave":"_overriddenHandler","button.pointerenter":"_updateInBoundsFlag","button.pointerleave":"_updateInBoundsFlag","button.touchmove":"_touchmoveHandler","document.up":"_stopRepeat"}}_clickHandler(e){const t=this;("release"!==t.clickMode||t.preventDefaultClick||t.readonly||t.disabled)&&(e.preventDefault(),e.stopPropagation(),t.preventDefaultClick=!1)}_updateInBoundsFlag(e){const t=this;-1!==e.type.indexOf("leave")?(t._isPointerInBounds=!1,t.$button.setAttributeValue("hover",!1),t.$.setAttributeValue("hover",!1)):(t._isPointerInBounds=!0,t.$button.setAttributeValue("hover",!0),t.$.setAttributeValue("hover",!0)),1!==("buttons"in e?e.buttons:e.which)&&t._stopRepeat(e)}_startRepeat(e){const t=this;t.setAttribute("active",""),t._initialTimer||t.readonly||(t._initialTimer=setTimeout((function(){t._repeatTimer=setInterval((()=>{if(t._isPointerInBounds){if(t.hasAttribute("smart-blazor"))return t.$.dispatchEvent(new Event("click")),void(t.preventDefaultClick=!0);const n="buttons"in e?e.buttons:e.which;t.$.fireEvent("click",{buttons:n,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY,screenX:e.screenX,screenY:e.screenY}),t.preventDefaultClick=!0}}),t.delay)}),t.initialDelay))}_stopRepeat(e){const t=this;t.readonly||e&&("pointercancel"===e.type||e.originalEvent&&"pointercancel"===e.originalEvent.type)||(t.$.setAttributeValue("active",!1),t._repeatTimer&&(clearInterval(t._repeatTimer),t._repeatTimer=null),t._initialTimer&&(clearTimeout(t._initialTimer),t._initialTimer=null))}_touchmoveHandler(e){this.preventDefaultClick&&e.cancelable&&(e.preventDefault(),e.stopPropagation())}_overriddenHandler(){}}),Smart("smart-toggle-button",class extends Smart.Button{static get properties(){return{checked:{value:!1,type:"boolean?"},falseContent:{value:"",reflectToAttribute:!1,type:"string"},indeterminateContent:{value:"",reflectToAttribute:!1,type:"string"},indeterminate:{value:!1,type:"boolean"},trueContent:{value:"",reflectToAttribute:!1,type:"string"},indeterminateTemplate:{value:null,type:"any"},trueTemplate:{value:null,type:"any"},falseTemplate:{value:null,type:"any"},type:{value:"toggle",type:"string",defaultReflectToAttribute:!0,readonly:!0}}}static get listeners(){return{keydown:"_keyHandler",keyup:"_keyHandler",dragstart:"_dragStartHandler","button.click":"_buttonClickHandler","button.mouseenter":"_buttonMouseEnterHandler","button.mouseleave":"_buttonMouseLeaveHandler","document.up":"_documentUpHandler"}}ready(){super.ready(),this._setAriaState(),this._updateGroupValue()}_setAriaState(){const e=this,t=e.checked;null!==t?e.setAttribute("aria-pressed",t):e.setAttribute("aria-pressed","mixed")}_buttonClickHandler(){}_buttonMouseLeaveHandler(){this.removeAttribute("hover")}_buttonMouseEnterHandler(){const e=this;e.setAttribute("hover",""),e.disabled||e.readonly||"hover"!==e.clickMode||(e._changeCheckState("pointer"),e.focus(),e._updateHidenInputNameAndValue())}_documentUpHandler(e){const t=this;t._pressed&&(t._pressed=!1,t.disabled||t.readonly||"press"===t.clickMode||"pointercancel"===e.originalEvent.type||(t._changeCheckState("pointer"),t.focus(),t._updateHidenInputNameAndValue()))}_downHandler(e){const t=this;t.disabled||t.readonly||(t.hasRippleAnimation&&Smart.Utilities.Animation.Ripple.animate(t,e.pageX,e.pageY),t._pressed=!0,"press"!==t.clickMode&&"pressAndRelease"!==t.clickMode||(t._changeCheckState("pointer"),t.hasAttribute("smart-blazor")?t.$.dispatchEvent(new Event("click")):t.$.fireEvent("click"),t._updateHidenInputNameAndValue()),"press"===t.clickMode&&(e.preventDefault(),e.stopPropagation()))}_dragStartHandler(e){e.preventDefault()}_keyHandler(e){const t=this;if(!0!==t.disabled&&!t.readonly&&32===e.keyCode){if("keydown"===e.type)return void e.preventDefault();if("none"===t.switchMode)return;t._changeCheckState("keyboard"),t._updateHidenInputNameAndValue()}}_updateGroupValue(){const e=this;if(e.dataset.target){const t=document.querySelector(e.dataset.target);if(t){const n=document.querySelectorAll('[data-target="'+e.dataset.target+'"]'),a=[];if(e.checked){const n=e.dataset.property,a=e.dataset.value;if(n&&void 0!==t[n]){let e=a;"true"===e&&(e=!0),"false"===e&&(e=!1),t[n]=e}}for(let t=0;t<n.length;t++){const r=n[t];r.checked&&(r.name?(a.push(r.name),e.id&&r.setAttribute("data-id",e.id)):e.id&&a.push(e.id))}t.value=a.toString(),e._targetDispatchTimer&&clearTimeout(e._targetDispatchTimer),e._targetDispatchTimer=setTimeout((()=>{t.dispatchEvent(new Event("change"))}),100)}}}_changeCheckState(e){const t=this;let n=null;null===t.checked?t.checked=!0:(n=t.checked,t.checked=!t.checked),t._handleTextSelection(),t.$.fireEvent("change",{value:t.checked,oldValue:n,changeType:e}),t.checked?t.$.fireEvent("checkValue",{changeType:e}):t.$.fireEvent("uncheckValue",{changeType:e}),t._updateGroupValue(),t._setAriaState()}_handleTextSelection(){const e=this;e.$.addClass("smart-unselectable"),e.timer&&clearTimeout(e.timer),e.timer=setTimeout((()=>e.$.removeClass("smart-unselectable")),500)}propertyChangedHandler(e,t,n){super.propertyChangedHandler(e,t,n);const a=this;if("checked"===e)return a.$.fireEvent("change",{value:n,oldValue:t,changeType:"api"}),void a._setAriaState();switch(e){case"trueTemplate":a._handleTemplate(!0);break;case"falseTemplate":a._handleTemplate(!1);break;case"indeterminateTemplate":a._handleTemplate()}}_htmlBindOnInitialization(){const e=this;e._bindContentProperty("trueContent","smart-true-content"),e._bindContentProperty("falseContent","smart-false-content"),e._bindContentProperty("indeterminateContent","smart-indeterminate-content")}_bindContentProperty(e,t){const n=this;if(!n.$[e+"Container"])return;let a=document.createElement("div");a.innerHTML=n.innerHTML;let r,i=a.getElementsByClassName(t);if(i.length>0)for(let e=0;e<i.length;e++)r=i[e];""===n[e]&&(n[e]=void 0===r?"":r.outerHTML),n.$[e+"Container"].innerHTML=n[e]}_updateContentProperties(){const e=this;function t(t){e.$[t+"Container"]&&(e[t]=e.$[t+"Container"].innerHTML)}t("trueContent"),t("falseContent"),t("indeterminateContent")}_updateHidenInputValue(){const e=this;if(!e.$.hiddenInput)return;let t;t=null===e.checked?"null":!1===e.checked?"off":e.value||"on",e.$.hiddenInput.setAttribute("value",t)}_updateHidenInputName(){const e=this;if(!e.$.hiddenInput)return;let t=!1===e.checked?"":e.name||"";e.$.hiddenInput.setAttribute("name",t)}_updateHidenInputNameAndValue(){this._updateHidenInputName(),this._updateHidenInputValue()}_handleTemplate(e,t){const n=this;let a,r,i;if(!0===e?(a=n.trueTemplate,r=n.$.trueContentContainer,i=n.trueContent):!1===e?(a=n.falseTemplate,r=n.$.falseContentContainer,i=n.falseContent):(a=n.indeterminateTemplate,r=n.$.indeterminateContentContainer,i=n.indeterminateContent),t&&(r.innerHTML=i||""),null===a||!a)return;if("function"==typeof a)return void a(r,{value:i});if(!("content"in document.createElement("template")))return void n.error(n.localize("htmlTemplateNotSuported",{elementType:n.nodeName.toLowerCase()}));if(a=document.getElementById(a),null===a||!("content"in a))return void n.error(n.localize("invalidTemplate",{elementType:n.nodeName.toLowerCase(),property:"template"}));const o=a.content,l=o.childNodes.length,s=/{{\w+}}/g;let u,d=[];for(let e=0;e<l;e++)for(u=s.exec(o.childNodes[e].innerHTML);u;)d.push({childNodeIndex:e,bindingString:u[0]}),u=s.exec(o.childNodes[e].innerHTML);const c=d.length;let p,h,m=document.importNode(a.content,!0);for(let e=0;e<c;e++){p=m.childNodes[d[e].childNodeIndex],h=d.length;for(let t=0;t<h;t++)p.innerHTML=p.innerHTML.replace(d[e].bindingString,i)}r.innerHTML="";for(let e=0;e<m.childNodes.length;e++)m.childNodes[e].outerHTML&&(r.innerHTML+=m.childNodes[e].outerHTML)}}); |
/* Smart UI v14.2.72 (2022-08-30) | ||
Copyright (c) 2011-2021 jQWidgets. | ||
/* Smart UI v15.0.2 (2023-01-24) | ||
Copyright (c) 2011-2023 jQWidgets. | ||
License: https://htmlelements.com/license/ */ // | ||
Smart("smart-check-box",class extends Smart.ToggleButton{static get properties(){return{checkMode:{value:"both",allowedValues:["both","input","label"],type:"string"},type:{value:"checkbox",type:"string",defaultReflectToAttribute:!0,readonly:!0}}}template(){return"<div id='container' class='smart-container' role=\"presentation\">\n <div class='smart-overlay' role=\"presentation\"></div>\n <span id='checkBoxInput' class='smart-input' aria-hidden=\"true\"></span>\n <span id='checkBoxLabel' inner-h-t-m-l='[[innerHTML]]' class='smart-label'><content></content></span>\n <input id='hiddenInput' class='smart-hidden-input' type='hidden'>\n </div>"}static get listeners(){return{down:"_downHandler","document.up":"_documentUpHandler","checkBoxInput.mouseenter":"_mouseEnterHandler","checkBoxInput.mouseleave":"_mouseLeaveHandler",focus:"_focusHandler",blur:"_blurHandler"}}static get styleUrls(){return["smart.toggle.css"]}_focusHandler(){this.$.setAttributeValue("focus",!0)}_blurHandler(){this.$.setAttributeValue("focus",!1)}_mouseEnterHandler(){this.$.setAttributeValue("hover",!0)}_mouseLeaveHandler(){this.$.setAttributeValue("hover",!1)}ready(){const e=this;super.ready(),e.setAttribute("role","checkbox"),e.indeterminate&&(e._valueCache=e.checked,e.checked=null,e._setAriaState()),e.classList.add("smart-toggle-box"),e._updateHidenInputNameAndValue()}propertyChangedHandler(e,t,a){super.propertyChangedHandler(e,t,a);const n=this;switch(n._updateContentProperties(),e){case"indeterminate":a?(n._valueCache=n.checked,n.checked=null):n.checked=n._valueCache,n._setAriaState(),n._updateHidenInputNameAndValue();break;case"value":case"checked":n._updateHidenInputNameAndValue();break;case"name":n._updateHidenInputName()}}_documentUpHandler(e){const t=this;if(!t._pressed||"pointercancel"===e.originalEvent.type)return;const a=t.enableShadowDOM?e.originalEvent.composedPath()[0]:e.originalEvent.target;if(t._pressed=!1,t.$.setAttributeValue("active",!1),!(t.disabled||t.readonly||"input"===t.checkMode&&a!==t.$.checkBoxInput||"label"===t.checkMode&&a!==t.$.checkBoxLabel)){if("press"===t.clickMode)return e.preventDefault(),void e.stopPropagation();t._changeCheckState("pointer"),t.focus(),t._handleTextSelection(),t._updateHidenInputNameAndValue()}}_downHandler(e){const t=this,a=t.enableShadowDOM?e.originalEvent.composedPath()[0]:e.originalEvent.target;if(!(t.disabled||t.readonly||"input"===t.checkMode&&a!==t.$.checkBoxInput||"label"===t.checkMode&&a!==t.$.checkBoxLabel)){if(t.$.setAttributeValue("active",!0),t.hasRippleAnimation){const e=t.$.checkBoxInput.getBoundingClientRect(),a=window.scrollX||window.pageXOffset,n=window.scrollY||window.pageYOffset;Smart.Utilities.Animation.Ripple.animate(t.$.checkBoxInput,e.left+e.width/2+a,e.top+e.height/2+n)}t._pressed=!0,"press"!==t.clickMode&&"pressAndRelease"!==t.clickMode||(t._changeCheckState("pointer"),t.$.fireEvent("click"),t.focus(),t._updateHidenInputNameAndValue())}}_setAriaState(){const e=this,t=e.checked;null!==t?e.setAttribute("aria-checked",t):e.setAttribute("aria-checked","mixed")}}); |
/* Smart UI v14.2.72 (2022-08-30) | ||
Copyright (c) 2011-2021 jQWidgets. | ||
/* Smart UI v15.0.2 (2023-01-24) | ||
Copyright (c) 2011-2023 jQWidgets. | ||
License: https://htmlelements.com/license/ */ // | ||
Smart("smart-drop-down-button",class extends Smart.ContentElement{static get properties(){return{autoCloseDelay:{value:100,type:"number"},placeholderTemplate:{value:"",type:"any"},dropDownAppendTo:{value:null,type:"any"},dropDownButtonPosition:{allowedValues:["none","left","right","top","bottom"],value:"right",type:"string"},dropDownHeight:{value:"",type:"any",validator:"_propertyValidator"},dropDownMaxHeight:{value:"",type:"any",validator:"_propertyValidator"},dropDownMaxWidth:{value:"",type:"any",validator:"_propertyValidator"},dropDownMinHeight:{value:"",type:"any",validator:"_propertyValidator"},dropDownMinWidth:{value:"",type:"any",validator:"_propertyValidator"},dropDownOpenMode:{allowedValues:["none","default","dropDownButton","auto"],value:"default",type:"string"},dropDownOverlay:{value:!1,type:"boolean"},dropDownPlaceholder:{value:"No Items",type:"string"},dropDownPosition:{allowedValues:["auto","top","bottom","overlay-top","overlay-center","overlay-bottom","center-bottom","center-top"],value:"auto",type:"string"},dropDownWidth:{value:"",type:"any",validator:"_propertyValidator"},hint:{value:"",type:"string"},horizontalScrollBarVisibility:{type:"string",value:"auto",allowedValues:["auto","disabled","hidden","visible"]},label:{value:"",type:"string"},messages:{extend:!0,value:{en:{invalidNode:'smart-drop-down-button: Invalid parameter "{{node}}" when calling {{method}}.'}},type:"object"},name:{value:"",type:"string"},opened:{value:!1,type:"boolean"},placeholder:{value:"",type:"string"},resizeIndicator:{value:!1,type:"boolean"},resizeMode:{value:"none",allowedValues:["none","horizontal","vertical","both"],type:"string"},verticalScrollBarVisibility:{type:"string",value:"auto",allowedValues:["auto","disabled","hidden","visible"]}}}static get listeners(){return{"actionButton.down":"_buttonsDownHandler","actionButton.mouseenter":"_buttonsMouseEventsHandler","actionButton.mouseleave":"_buttonsMouseEventsHandler","document.selectstart":"_selectStartHandler","document.dragstart":"_dragStartHandler","document.down":"_documentDownHandler","document.up":"_documentUpHandler","document.move":"_documentMoveHandler","dropDownButton.down":"_buttonsDownHandler","dropDownButton.mouseenter":"_buttonsMouseEventsHandler","dropDownButton.mouseleave":"_buttonsMouseEventsHandler",keydown:"_keyDownHandler",keyup:"_keyUpHandler",focus:"_focusEventHandler",blur:"_blurEventHandler","dropDownContainer.transitionend":"_dropDownTransitionendHandler",mouseenter:"_mouseEnterHandler",mouseleave:"_mouseLeaveHandler",resize:"_resizeHandler","resizeBar.move":"_resizeBarMoveHandler",styleChanged:"_styleChangedHandler"}}template(){return'<div id="container" role="presentation">\n <span class="smart-label" id="label">[[label]]</span>\n <div id="content" class="smart-content" role="presentation">\n <div id="buttonsContainer" class="smart-buttons-container" role="presentation">\n <span id="actionButton" class="smart-action-button">[[placeholder]]</span>\n <span id="dropDownButton" class="smart-drop-down-button">\n <span class="smart-drop-down-button-icon" id="arrow" aria-hidden="true"></span>\n </span>\n </div>\n <div id="dropDownContainer" class="smart-drop-down smart-drop-down-container smart-visibility-hidden" role="dialog">\n <smart-scroll-viewer id="scrollViewer" inner-h-t-m-l=\'[[innerHTML]]\'\n right-to-left="[[rightToLeft]]"\n horizontal-scroll-bar-visibility="[[horizontalScrollBarVisibility]]"\n vertical-scroll-bar-visibility="[[verticalScrollBarVisibility]]">\n <content></content>\n </smart-scroll-viewer>\n <div id="resizeBar" class="smart-drop-down-resize-bar" aria-label="Resize">\n <div></div>\n </div>\n </div>\n </div>\n <span class="smart-hidden smart-hint" id="hint">[[hint]]</span>\n </div>'}static get styleUrls(){return["smart.scrollviewer.css","smart.dropdown.css","smart.dropdownbutton.css"]}attached(){const e=this;super.attached(),e.isCompleted&&e.$.dropDownContainer&&(e._positionDetection.dropDownAttached("_setDropDownSize"),e._positionDetection.checkBrowserBounds())}detached(){const e=this;super.detached(),e.$.dropDownContainer&&(e.close(),e._positionDetection.dropDownDetached())}propertyChangedHandler(e,t,o){const n=this;switch(e){case"disabled":case"unfocusable":n._setFocusable();break;case"dropDownAppendTo":n._positionDetection.dropDownAppendToChangedHandler();break;case"dropDownHeight":case"dropDownMaxHeight":case"dropDownMaxWidth":case"dropDownMinHeight":case"dropDownMinWidth":case"dropDownWidth":n._setDropDownSize();break;case"dropDownOpenMode":n._setFocusable(),n.close(),n._setAriaRelations();break;case"dropDownOverlay":o||n._positionDetection.removeOverlay();break;case"dropDownPlaceholder":n.$.dropDownContainer.hasAttribute("empty")&&(n.$.scrollViewer.$.scrollViewerContentContainer.innerHTML=o,n.opened&&n.$.scrollViewer.refresh());break;case"dropDownPosition":n._positionDetection.dropDownPositionChangedHandler();break;case"innerHTML":""===o.trim()?(n.$.dropDownContainer.setAttribute("empty",""),requestAnimationFrame((()=>n.$.scrollViewer.$.scrollViewerContentContainer.innerHTML=n.dropDownPlaceholder))):(n.$.dropDownContainer.removeAttribute("empty"),n.$.scrollViewer.$.scrollViewerContentContainer.innerHTML=o),n.opened&&n.$.scrollViewer.refresh();break;case"opened":o?n.open():n.close();break;case"placeholder":""!==t&&""!==o||n._setFocusable();break;case"resizeIndicator":o?n.$.dropDownContainer.setAttribute("resize-indicator",""):n.$.dropDownContainer.removeAttribute("resize-indicator");break;case"resizeMode":n.$.dropDownContainer.setAttribute("resize-mode",n.resizeMode),n.opened&&n.$.scrollViewer.refresh();break;case"label":o?n._ariaButton.setAttribute("aria-labelledby",n.$.label.id):"DropDownButton"===n.elementName&&n._ariaButton.setAttribute("aria-labelledby",n.$.actionButton.id)}}appendChild(e){const t=this;if(!t.isCompleted||e instanceof HTMLElement&&e.classList.contains("smart-resize-trigger-container")){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.appendChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}e?(t.$.scrollViewer.appendChild(e),t.opened&&t.$.scrollViewer.refresh()):t.error(t.localize("invalidNode",{method:"removeChild",node:"node"}))}removeChild(e){const t=this;if(!t.isCompleted||e instanceof HTMLElement&&e.classList.contains("smart-resize-trigger-container")){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.removeChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}e?t.$.dropDownContainer.contains(e)&&(t.$.scrollViewer.removeChild(e),t.opened&&t.$.scrollViewer.refresh()):t.error(t.localize("invalidNode",{method:"removeChild",node:"node"}))}removeAll(){const e=this;e.isCompleted&&e.$.scrollViewer.removeAll()}_open(){const e=this;if(!e.disabled&&e.offsetHeight&&e.$dropDownContainer.hasClass("smart-visibility-hidden")){if(e.$dropDownContainer.hasClass("not-in-view")&&e.$dropDownContainer.removeClass("not-in-view"),e.$.dropDownContainer.style.transition=null,e.dropDownAppendTo&&e.dropDownAppendTo.length>0){const t=e.getBoundingClientRect();if(e.$.container.contains(e.$.dropDownContainer)){let t=0;const o=setInterval((function(){const n=e.getBoundingClientRect();t++,n.top===e._positionTop&&t<10||(e.open(),clearInterval(o),e._positionTop=n.top)}),100);return}t.top!==e._positionTop&&(e._positionTop=t.top)}e.$.fireEvent("opening").defaultPrevented||(e.opened=!0,e._ariaButton.setAttribute("aria-expanded",!0),e._positionDetection.placeOverlay(),e._positionDetection.checkBrowserBounds("vertically"),e._positionDetection.positionDropDown(),e._positionDetection.checkBrowserBounds("horizontally"),e.$dropDownContainer.removeClass("smart-visibility-hidden"),e.$.fireEvent("open"),e.$.dropDownButton&&("dropDownButton"===e.dropDownOpenMode?e.$.dropDownButton.setAttribute("selected",""):e.$.dropDownButton.removeAttribute("selected")),e.$.input&&e.$.input.focus())}}toggle(){const e=this;e.opened?e.close():e.open()}open(){const e=this,t=document.querySelectorAll("smart-drop-down-button, smart-color-picker");for(let o=0;o<t.length;o++)t[o]!==e&&t[o].opened&&t[o].close();e._open(),e.$.scrollViewer.refresh()}scrollTo(e,t){this.isCompleted&&this.$.scrollViewer.scrollTo(e,t)}ready(){super.ready()}_applyPlaceholderTemplate(){const e=this;if(e.placeholderTemplate){const t=document.createElement("div");let o;if("string"==typeof e.placeholderTemplate&&e.placeholderTemplate.startsWith("#")&&(o=document.querySelector(e.placeholderTemplate)),"function"==typeof e.placeholderTemplate){const t=e.placeholderTemplate();t&&(e.$.actionButton.innerHTML=t)}o instanceof HTMLTemplateElement?t.appendChild(o.content.cloneNode(!0)):o instanceof HTMLElement?t.appendChild(o):t.innerHTML=e.placeholderTemplate,e.$.actionButton.innerHTML=t.innerHTML}}render(){const e=this;if(e.rightToLeft&&(e.dropDownButtonPosition="right"===e.dropDownButtonPosition?"left":"right"),e.classList.add("smart-drop-down-box"),e._edgeMacFF=Smart.Utilities.Core.Browser.Edge||Smart.Utilities.Core.Browser.Firefox&&-1!==navigator.platform.toLowerCase().indexOf("mac"),e._positionDetection=new Smart.Utilities.PositionDetection(e,e.$.dropDownContainer,e.$.container,"close"),e._positionDetection.getDropDownParent(!0),e._positionDetection.setDropDownPosition(),e._calculateDropDownSize(),e.$.dropDownContainer.setAttribute("resize-mode",e.resizeMode),e.resizeIndicator&&e.$.dropDownContainer.setAttribute("resize-indicator",""),e._positionDetection.handleAutoPositioning(),e.$.label&&!e.$.label.id&&(e.$.label.id=e.id+"Label"),e.$.actionButton&&!e.$.actionButton.id&&(e.$.actionButton.id=e.id+"ActionButton"),e.$.hint&&!e.$.hint.id&&(e.$.hint.id=e.id+"Hint"),e.dropDownAppendTo)for(let t=0;t<e.classList.length;t++){const o=e.classList[t];e.$.dropDownContainer.classList.add(o)}e._applyPlaceholderTemplate(),e._createElement(),e.opened?e.open():e.hasAnimation&&e._edgeMacFF&&e.$dropDownContainer.addClass("not-in-view"),e._positionTop=e.getBoundingClientRect().top,super.render()}_setAriaRelations(e){const t=this;let o,n;"dropDownButton"!==t.dropDownOpenMode?(o=t.$.dropDownButton,o.setAttribute("aria-hidden",!0),n=t,t.$.actionButton.removeAttribute("role")):(o=t,n=t.$.dropDownButton,n.removeAttribute("aria-hidden"),t.$.actionButton.setAttribute("role","button")),t._ariaButton=n,n.setAttribute("role","button"),n.setAttribute("aria-haspopup","dialog"),n.setAttribute("aria-owns",t.$.dropDownContainer.id),n.setAttribute("aria-describedby",t.$.hint.id),t.label?n.setAttribute("aria-labelledby",t.$.label.id):"DropDownButton"===t.elementName&&n.setAttribute("aria-labelledby",t.$.actionButton.id),o.setAttribute("role","presentation"),o.removeAttribute("aria-owns"),e?n.setAttribute("aria-expanded",t.opened):(o.removeAttribute("aria-describedby"),o.removeAttribute("aria-expanded"),o.removeAttribute("aria-haspopup"),o.removeAttribute("aria-labelledby"))}_setDropDownSize(){const e=this;e._dropDownSize||e._calculateDropDownSize(),["dropDownMinWidth","dropDownMinHeight","dropDownMaxWidth","dropDownMaxHeight"].forEach((t=>{e.$.dropDownContainer.style[t.replace("dropDown","").replace(/^./,"m")]=e[t]?e[t]+(e[t].toString().endsWith("%")?"%":"px"):null})),e.dropDownWidth?"auto"!==e.dropDownWidth?e.$.dropDownContainer.style.width=("initial"===e.dropDownWidth?e.offsetWidth:parseFloat(e.dropDownWidth))+"px":e.$.dropDownContainer.style.width="auto":e.$.dropDownContainer.style.width="auto"===e._dropDownSize.width?"auto":(parseFloat(e._dropDownSize.width)||0)+"px",e.dropDownHeight&&"auto"!==e.dropDownHeight?e.$.dropDownContainer.style.height=parseFloat(e.dropDownHeight)+((e.dropDownHeight+"").indexOf("%")>-1?"%":"px"):e.$.dropDownContainer.style.height=e._dropDownSize.height}_setFocusable(){const e=this;if(e.disabled||e.unfocusable)return e.removeAttribute("tabindex"),e.$.actionButton.removeAttribute("tabindex"),void e.$.dropDownButton.removeAttribute("tabindex");let t=e.tabIndex>0?e.tabIndex:0;"dropDownButton"===e.dropDownOpenMode?(e.removeAttribute("tabindex"),e.$.actionButton.setAttribute("tabindex",t),e.$.dropDownButton.setAttribute("tabindex",t)):(e.$.actionButton.removeAttribute("tabindex"),e.$.dropDownButton.removeAttribute("tabindex"),e.tabIndex=t)}_calculateDropDownSize(){const e=this;e._dropDownSize={};const t=window.getComputedStyle(e.$.dropDownContainer),o=parseFloat(t.getPropertyValue("border-top-width").trim()),n=parseFloat(t.getPropertyValue("border-bottom-width").trim()),r=parseFloat(t.getPropertyValue("margin-top").trim()),i=parseFloat(t.getPropertyValue("margin-bottom").trim()),a=parseFloat(t.getPropertyValue("padding-top").trim()),s=parseFloat(t.getPropertyValue("padding-bottom").trim());Smart.Utilities.Core.CSSVariablesSupport()&&(e._dropDownSize.width=t.getPropertyValue("--smart-drop-down-list-drop-down-width").trim(),e._dropDownSize.height=t.getPropertyValue("--smart-drop-down-list-drop-down-height").trim()),(!e._dropDownSize.width||e._dropDownSize.width.indexOf("initial")>-1)&&(e._dropDownSize.width=e.offsetWidth),e._dropDownSize.height||(e._dropDownSize.height="auto"),e._dropDownSize.minHeight=parseFloat(t.getPropertyValue("min-height").trim()),e._dropDownSize.maxHeight=parseFloat(t.getPropertyValue("max-height").trim()),e._dropDownSize.borderWidth=(isNaN(o)?0:o)+(isNaN(n)?0:n),e._dropDownSize.paddingWidth=(isNaN(a)?0:a)+(isNaN(s)?0:s),e._dropDownSize.marginWidth=(isNaN(r)?0:r)+(isNaN(i)?0:i)}_createElement(){const e=this;""===e.innerHTML.trim()&&(e.$.dropDownContainer.setAttribute("empty",""),e.$.scrollViewer.$.scrollViewerContentContainer.innerHTML=e.dropDownPlaceholder),e._setDropDownSize(),e._setFocusable(),e._setAriaRelations(!0),e.$.arrow.noRipple=!0}_dragStartHandler(e){this._resizeDetails&&this._resizeDetails.started&&e.preventDefault()}_dropDownTransitionendHandler(){const e=this;e._edgeMacFF&&!e.opened&&e.hasAnimation&&(e.$.dropDownContainer.style.top=e.$.dropDownContainer.style.left="",e.$dropDownContainer.addClass("not-in-view"))}_blurEventHandler(){const e=this;e.hasAttribute("focus")&&(e.$.dropDownButton&&(e.removeAttribute("focus"),e.$.dropDownButton.removeAttribute("focus")),e.$.actionButton&&(e.removeAttribute("focus"),e.$.actionButton.removeAttribute("focus")),e.$.fireEvent("blur"))}_focusEventHandler(){const e=this;e.hasAttribute("focus")||(e.$.dropDownButton&&(e.setAttribute("focus",""),e.$.dropDownButton.setAttribute("focus","")),e.$.actionButton&&(e.setAttribute("focus",""),e.$.actionButton.setAttribute("focus","")),e.$.fireEvent("focus"))}_getUpEventTarget(e){const t=this;let o=e;if(o===t.$.dropDownContainer)return"dropDownContainer";for(o=void 0===o.parentElement?o.getRootNode().host:o.parentElement;o;){if(o===t.$.dropDownContainer){o="dropDownContainer";break}o=void 0===o.parentElement?o.getRootNode().host:o.parentElement}return o}close(){const e=this;e.$dropDownContainer.hasClass("smart-visibility-hidden")||e.$.fireEvent("closing").defaultPrevented||(e.$dropDownContainer.addClass("smart-visibility-hidden"),e.$.fireEvent("close"),e.$.dropDownButton&&e.$.dropDownButton.removeAttribute("selected"),e.opened=!1,e._ariaButton.setAttribute("aria-expanded",!1),e._preventDropDownClose=!1,e._positionDetection.removeOverlay(!0),e._edgeMacFF&&!e.hasAnimation&&(e.$.dropDownContainer.style.top=e.$.dropDownContainer.style.left="",e.$dropDownContainer.addClass("not-in-view")))}_documentUpHandler(e){const t=this,o=t.hasAttribute("resizing");if(t.$.actionButton.removeAttribute("active"),t._resizeDetails&&t._resizeDetails.started)return t._resizeDetails.started=t._resizeDetails.resizeEventFired=!1,t.removeAttribute("resizing"),t._preventDropDownClose=!1,t.focus(),void t.$.fireEvent("resizeEnd",{position:{left:e.pageX,top:e.pageY}});if(t.disabled||t._isDropDownClicked||t.readonly)return void delete t._isDropDownClicked;if(t._overlayDown)return t.close(),void delete t._overlayDown;let n=e.originalEvent.target;if(t.isInShadowDOM&&(n=e.originalEvent.composedPath()[0]),t._preventsSelectStart=!1,void 0===n||n===t.$.resizeBar)return;const r=n.closest(".smart-action-button");let i;if(t._buttonClicked&&("dropDownButton"===t.dropDownOpenMode&&r&&t._buttonClicked===t.$.actionButton?t.$.fireEvent("actionButtonClick"):n.closest(".smart-drop-down-button")!==t._buttonClicked&&r!==t._buttonClicked||(i=!0,t.$.fireEvent("dropDownButtonClick"))),t._buttonClicked=void 0,!t.editable&&r===t.$.actionButton||n.closest(".smart-drop-down-button")===t.$.dropDownButton)return"dropDownButton"===t.dropDownOpenMode&&r===t.$.actionButton?void t.close():void(t.$dropDownContainer.hasClass("smart-visibility-hidden")&&"none"!==t.dropDownOpenMode&&i&&"pointercancel"!==e.originalEvent.type?t.open():t.close());n=t._getUpEventTarget(n),void 0!==n&&(("dropDownContainer"!==n&&"item"!==n||"item"===n&&"checkBox"!==t.selectionMode&&t.selectionMode.indexOf("Many")<0)&&t.close(),o&&t.$.scrollViewer&&t.$.scrollViewer.refresh())}_keyDownHandler(e){const t=this,o=(t.shadowRoot||t.getRootNode()).activeElement||document.activeElement;if(!(t.disabled||t.readonly||o!==t&&o!==t.$.dropDownButton&&o!==t.$.actionButton))switch(e.key){case"Enter":case" ":e.preventDefault(),e.target!==t.$.actionButton&&(t.opened&&"Enter"===e.key?t.close():t.opened||t.readonly||"none"===t.dropDownOpenMode||t.open()),"dropDownButton"===t.dropDOwnOpenMode&&e.target.setAttribute("active","");break;case"End":t.$.scrollViewer.scrollTop=t.$.scrollViewer.scrollHeight;break;case"Home":t.$.scrollViewer.scrollTop=0;break;case"PageUp":case"PageDown":t.$.scrollViewer.scrollTop+=(e.key.indexOf("Down")>-1?1:-1)*t.$.dropDownContainer.offsetHeight;break;case"ArrowUp":case"ArrowDown":if(e.altKey)return void(t.disabled||t.readonly||"none"===t.dropDownOpenMode||(t.$dropDownContainer.hasClass("smart-visibility-hidden")?t.open():t.close()));e.preventDefault(),t.$.scrollViewer.scrollTop+=10*(e.key.indexOf("Down")>-1?1:-1);break;case"Escape":e.preventDefault(),t.close()}}_keyUpHandler(e){const t=this.isInShadowDOM?e.composedPath()[0]:e.target;"Enter"!==e.key&&" "!==e.key||t.removeAttribute("active")}_propertyValidator(e,t){return"number"!=typeof t&&"string"!=typeof t?e:t}_mouseEnterHandler(){const e=this;e._isElementHovered=!0,"auto"!==e.dropDownOpenMode||e.disabled||e.readonly||e.open()}_mouseLeaveHandler(){const e=this;e.removeAttribute("hover"),e._isElementHovered=!1,"auto"!==e.dropDownOpenMode||e.disabled||e.readonly||e._autoClose()}_autoClose(){const e=this;e._autoCloseTimeout=setTimeout(function(){e._isElementHovered||e.close(),clearTimeout(e._autoCloseTimeout)}.bind(e),e.autoCloseDelay)}_documentMoveHandler(e){const t=this,o=t.isInShadowDOM?e.originalEvent.composedPath()[0]:e.originalEvent.target;if("auto"===t.dropDownOpenMode&&null!==t.dropDownAppendTo&&(t.contains(o)||t.$.dropDownContainer.contains(o)?t._isElementHovered=!0:(t._isElementHovered=!1,t._autoClose())),!t._resizeDetails||t._resizeDetails&&!t._resizeDetails.started)return;t.setAttribute("resizing",""),t._resizeDetails.resizeEventFired||(t.$.fireEvent("resizeStart",{position:{left:e.pageX,top:e.pageY}}),t._resizeDetails.resizeEventFired=!0);const n=document.documentElement,r=t.$.dropDownContainer.getBoundingClientRect(),i=t.getBoundingClientRect(),a=t.$.dropDownContainer.hasAttribute("top")?"top":"bottom";let s;function l(){if(s=e.pageY-t._resizeDetails.y,"bottom"===a)t._resizeDetails.height=Math.min(n.clientHeight-r.top-6,Math.max(0,t._resizeDetails.height+s)),t._resizeDetails.y=Math.max(r.top+n.scrollTop-t._resizeDetails.offsetY,Math.min(n.clientHeight+n.scrollTop-1.5*t._resizeDetails.offsetY,e.pageY));else{if(t._resizeDetails.height=Math.min(t._dropDownSize.maxHeight,Math.max(0,Math.min(i.top,t._resizeDetails.height-s))),s=Math.max(0,r.top+(r.height-Math.max(t._dropDownSize.minHeight,t._resizeDetails.height))),t.dropDownAppendTo&&t.dropDownAppendTo.length>0){const e=Math.abs(parseFloat(getComputedStyle(t.$.dropDownContainer).getPropertyValue("margin-bottom")))||0;t.$.dropDownContainer.style.top=t.dropDownAppendTo&&t.dropDownAppendTo.length>0?e+s+"px":""}const o=i.top+n.scrollTop+t._resizeDetails.offsetYtop;t._resizeDetails.y=Math.max(t._resizeDetails.offsetYtop,Math.min(o,Math.max(o-t._dropDownSize.maxHeight,e.pageY)))}t.$.dropDownContainer.style.height=t._resizeDetails.height+"px"}function d(){s=e.pageX-t._resizeDetails.x,t._resizeDetails.width=Math.min(n.clientWidth-r.left-6,Math.max(0,t._resizeDetails.width+s)),t.$.dropDownContainer.style.width=t._resizeDetails.width+"px",t._resizeDetails.x=Math.max(r.left+n.scrollLeft-t._resizeDetails.offsetXR,Math.min(n.clientWidth+n.scrollLeft-1.5*t._resizeDetails.offsetXR,e.pageX))}switch(t.resizeMode){case"vertical":l();break;case"horizontal":d();break;case"both":d(),l()}}_documentDownHandler(e){const t=this;if(t.disabled||t.readonly)return;let o=e.originalEvent.target;if(o===t._overlay&&(t._overlayDown=!0),t.isInShadowDOM){o=e.originalEvent.composedPath()[0];let n=o;for(;n;){if(n.closest(".smart-drop-down-container")===t.$.dropDownContainer){t._isDropDownClicked=!0;break}n=n.getRootNode().host}}else t._isDropDownClicked=o.closest(".smart-drop-down-container")===t.$.dropDownContainer;if(t._buttonClicked=o.closest(".smart-action-button")||o.closest(".smart-drop-down-button"),t._isDropDownClicked&&(t._preventDropDownClose=!0),o!==t.$.resizeBar||"none"===t.resizeMode)return;t._resizeDetails||(t._resizeDetails={});const n=t.$.dropDownContainer.getBoundingClientRect();t._resizeDetails.started=!0,t._resizeDetails.x=e.pageX,t._resizeDetails.y=e.pageY,t._resizeDetails.width=t.$.dropDownContainer.offsetWidth,t._resizeDetails.height=t.$.dropDownContainer.offsetHeight,t._resizeDetails.offsetXL=e.clientX-n.left,t._resizeDetails.offsetXR=n.left+t.$.dropDownContainer.offsetWidth-e.clientX,t._resizeDetails.offsetY=n.top+t.$.dropDownContainer.offsetHeight-e.clientY,t._resizeDetails.offsetYtop=e.clientY-n.top,t._preventDropDownClose=!0}_resizeHandler(){this.refresh()}refresh(){const e=this;"none"===e.resizeMode&&(e._calculateDropDownSize(),e._setDropDownSize())}_resizeBarMoveHandler(e){"touchmove"===e.originalEvent.type&&e.originalEvent.preventDefault()}_styleChangedHandler(e){const t=this;if(t.dropDownAppendTo&&t.dropDownAppendTo.length>0){const o=e.detail.styleProperties,n=["font-size","font-family","font-style","font-weight"];for(let e=0;e<n.length;e++)o[n[e]]&&(t.$.dropDownContainer.style[n[e]]=o[n[e]].value)}t._dropDownSize&&"auto"===t._dropDownSize.height&&t._setDropDownSize()}_buttonsDownHandler(e){const t=this;if(!t.disabled){if(t.hasRippleAnimation)if("dropDownButton"===t.dropDownOpenMode)Smart.Utilities.Animation.Ripple.animate(e.target,e.pageX,e.pageY);else if(e.target===t.$.dropDownButton||!t.editable){const o=t.$.buttonsContainer;o.firstElementChild.noRipple=!0,Smart.Utilities.Animation.Ripple.animate(o,e.pageX,e.pageY),o.firstElementChild.noRipple=!1}t._preventsSelectStart=!0,"dropDownButton"===t.dropDownOpenMode&&e.target===t.$.actionButton&&"smart-drop-down-button"===t.tagName.toLowerCase()&&t.$.actionButton.setAttribute("active",""),t.opened&&(t._preventDropDownClose=!0)}}_buttonsMouseEventsHandler(e){const t=this;t.disabled||("mouseenter"===e.type?(t.setAttribute("hover",""),e.target.setAttribute("hover","")):(t.removeAttribute("hover"),e.target.removeAttribute("hover")))}_selectStartHandler(e){this._preventsSelectStart&&e.preventDefault()}}); |
/* Smart UI v14.2.72 (2022-08-30) | ||
Copyright (c) 2011-2021 jQWidgets. | ||
/* Smart UI v15.0.2 (2023-01-24) | ||
Copyright (c) 2011-2023 jQWidgets. | ||
License: https://htmlelements.com/license/ */ // | ||
Smart("smart-led",class extends Smart.ToggleButton{static get properties(){return{shape:{value:"round",allowedValues:["round","square"],type:"string"}}}static get styleUrls(){return["smart.led.css"]}template(){return"<div id='container' class='smart-container' role=\"presentation\">\n <div id='ledAnimation' class='smart-animation' role=\"presentation\"></div>\n <div id='button' class='smart-input' role=\"presentation\">\n <span id='falseContentContainer' inner-h-t-m-l='[[falseContent]]' class='smart-false-content-container'></span>\n <span id='indeterminateContentContainer' inner-h-t-m-l='[[indeterminateContent]]' class='smart-indeterminate-content-container'></span>\n <span id='trueContentContainer' inner-h-t-m-l='[[trueContent]]' class='smart-true-content-container'></span>\n </div>\n <input id='hiddenInput' class='smart-hidden-input' type='hidden'>\n </div>"}ready(){const e=this;super.ready(),e._htmlBindOnInitialization(),e.indeterminate&&(e._valueCashe=e.checked,e.checked=null),e._handleTemplate(!0),e._handleTemplate(!1),e._handleTemplate(),e._updateHidenInputNameAndValue()}propertyChangedHandler(e,n,t){super.propertyChangedHandler(e,n,t);const a=this;switch(e){case"indeterminate":t?(a._valueCashe=a.checked,a.checked=null):a.checked=a._valueCashe,a._updateHidenInputNameAndValue();break;case"trueContent":a.trueContent=t,a._handleTemplate(!0);break;case"falseContent":a.falseContent=t,a._handleTemplate(!1);break;case"indeterminateContent":a.indeterminateContent=t,a._handleTemplate();break;case"value":case"checked":a._updateHidenInputNameAndValue();break;case"name":a._updateHidenInputName()}}_documentUpHandler(e){const n=this;if(n._pressed&&!n.readonly){if("press"===n.clickMode)return e.preventDefault(),e.stopPropagation(),void(n._pressed=!1);super._documentUpHandler(e),n.indeterminate=!1,n._updateHidenInputNameAndValue(),n._pressed=!1}}_mouseDownHandler(){const e=this;e.readonly||e.disabled||(e._pressed=!0,"press"!==e.clickMode&&"pressAndRelease"!==e.clickMode||(e._changeCheckState("pointer"),e.$.fireEvent("click"),e.indeterminate=!1,e._updateHidenInputNameAndValue()))}}); |
/* Smart UI v14.2.72 (2022-08-30) | ||
Copyright (c) 2011-2021 jQWidgets. | ||
/* Smart UI v15.0.2 (2023-01-24) | ||
Copyright (c) 2011-2023 jQWidgets. | ||
License: https://htmlelements.com/license/ */ // | ||
Smart("smart-power-button",class extends Smart.ToggleButton{static get styleUrls(){return["smart.powerbutton.css"]}template(){return"<div id='container' class='smart-container'>\n <div id='powerButtonAnimation' class='smart-animation'></div>\n <span id='button' class='smart-input' aria-hidden=\"true\"></span>\n <input id='hiddenInput' class='smart-hidden-input' type='hidden'>\n </div>"}ready(){super.ready(),this._updateHidenInputNameAndValue()}}); |
/* Smart UI v14.2.72 (2022-08-30) | ||
Copyright (c) 2011-2021 jQWidgets. | ||
/* Smart UI v15.0.2 (2023-01-24) | ||
Copyright (c) 2011-2023 jQWidgets. | ||
License: https://htmlelements.com/license/ */ // | ||
Smart("smart-radio-button",class extends Smart.ToggleButton{static get properties(){return{checkMode:{value:"both",allowedValues:["both","input","label"],type:"string"},type:{value:"radio",type:"string",defaultReflectToAttribute:!0,readonly:!0},groupName:{value:"",type:"string"}}}template(){return"<div id='container' class='smart-container'>\n <div class ='smart-overlay'></div>\n <span id='radioButtonInput' class ='smart-input'></span>\n <span id='radioButtonLabel' inner-h-t-m-l='[[innerHTML]]' class ='smart-label'><content></content></span>\n <input id='hiddenInput' class ='smart-hidden-input' type='hidden'>\n </div>"}static get listeners(){return{down:"_downHandler","document.up":"_documentUpHandler",mouseenter:"_elementMouseEnterHandler","radioButtonInput.mouseenter":"_radioMouseEnterHandler","radioButtonInput.mouseleave":"_radioMouseLeaveHandler",focus:"_focusHandler",blur:"_blurHandler"}}static get styleUrls(){return["smart.toggle.css"]}_radioMouseEnterHandler(){this.$.setAttributeValue("hover",!0)}_radioMouseLeaveHandler(){this.$.setAttributeValue("hover",!1)}_focusHandler(){this.$.setAttributeValue("focus",!0)}_blurHandler(){this.$.setAttributeValue("focus",!1)}_mouseEnterHandler(){this.$.setAttributeValue("hover",!0)}_mouseLeaveHandler(){this.$.setAttributeValue("hover",!1)}ready(){const e=this;super.ready(),e.classList.add("smart-toggle-box"),e._handleMultipleCheckedInstances(),e._updateHidenInputNameAndValue(),e._updateGroupValue()}_downHandler(e){const t=this,a=t.enableShadowDOM?e.originalEvent.composedPath()[0]:e.originalEvent.target;if(!(t.disabled||t.readonly||"input"===t.checkMode&&a!==t.$.radioButtonInput||"label"===t.checkMode&&a!==t.$.radioButtonLabel)){if(t.$.setAttributeValue("active",!0),t.hasRippleAnimation){const e=t.$.radioButtonInput.getBoundingClientRect(),a=window.scrollX||window.pageXOffset,n=window.scrollY||window.pageYOffset;Smart.Utilities.Animation.Ripple.animate(t.$.radioButtonInput,e.left+e.width/2+a,e.top+e.height/2+n)}t._preventAction?t._preventAction=!1:("release"!==t.clickMode&&"pressAndRelease"!==t.clickMode||(t._pressed=!0),"press"!==t.clickMode&&"pressAndRelease"!==t.clickMode||("pressAndRelease"===t.clickMode&&(""===t.groupName?t._checkedBeforeChange=t.parentNode.querySelector("smart-radio-button[checked]"):t._checkedBeforeChange=document.querySelector('smart-radio-button[group-name="'+t.groupName+'"][checked]')),t._handleMouseInteraction()))}}_elementMouseEnterHandler(){const e=this;"hover"!==e.clickMode||e.disabled||e.readonly||e._handleMouseInteraction()}_documentUpHandler(e){const t=this,a=t.enableShadowDOM?e.originalEvent.composedPath()[0]:e.originalEvent.target;!t._pressed||t.disabled||t.readonly||"input"===t.checkMode&&a!==t.$.radioButtonInput||"label"===t.checkMode&&a!==t.$.radioButtonLabel||"pointercancel"===e.originalEvent.type||("release"===t.clickMode?t._handleMouseInteraction():(null===t._checkedBeforeChange?(t.$.fireEvent("change",{value:!1,oldValue:!0,changeType:"pointer"}),t.$.fireEvent("uncheckValue",{changeType:"pointer"}),t.checked=!1):t._checkedBeforeChange._changeCheckState("pointer"),t.focus(),t._updateHidenInputNameAndValue()),t.$.setAttributeValue("active",!1),t._pressed=!1)}_handleMouseInteraction(){const e=this;e._handleTextSelection(),e._changeCheckState("pointer"),e.focus(),e._updateHidenInputNameAndValue()}_handleMultipleCheckedInstances(){const e=Array.from(document.querySelectorAll('smart-radio-button[group-name="'+this.groupName+'"][checked]')),t=Array.from(document.querySelectorAll('smart-ui-radio-button[group-name="'+this.groupName+'"][checked]')),a=e.length+t.length;a<2||e.concat(...t).forEach(((e,t)=>t<a-1&&(e.checked=!1)))}_changeCheckState(e){const t=this;let a=document.querySelectorAll('smart-radio-button[group-name="'+t.groupName+'"]'),n=document.querySelectorAll('smart-ui-radio-button[group-name="'+t.groupName+'"]'),o=Array.from(a).concat(...n);if(!0===t.checked&&"api"===e||!1===t.checked)if(o.length>0)t._changeCheckStateInGroup(o,e);else{let r=t.parentNode;t.getRootNode().host?(r=t.getRootNode().host.parentNode,a=r.querySelectorAll("smart-radio-button:not([group-name])"),n=r.querySelectorAll("smart-ui-radio-button:not([group-name])"),o=Array.from(a).concat(...n)):o=r.querySelectorAll("smart-radio-button:not([group-name])"),t._changeCheckStateInGroup(o,e)}}_updateGroupValue(){const e=this;if(e.dataset.target){const t=document.querySelector(e.dataset.target);if(t&&e.checked){const a=e.dataset.property,n=e.dataset.value;if(a&&void 0!==t[a]){let e=n;"true"===e&&(e=!0),"false"===e&&(e=!1),t[a]=e}else e.name?(t.value=e.name,e.id&&t.setAttribute("data-id",e.id)):e.id&&(t.value=e.id),e._targetDispatchTimer&&clearTimeout(e._targetDispatchTimer),e._targetDispatchTimer=setTimeout((()=>{t.dispatchEvent(new Event("change"))}),100)}}}_changeCheckStateInGroup(e,t){const a=this,n=a.getRootNode().host?a.getRootNode().host:a;for(let t=0;t<e.length;t++)e[t]._isUpdating=!0,e[t]===n?n.checked=!0:e[t].checked&&(e[t].checked=!1),e[t]._isUpdating=!1;n.nativeElement?(n.nativeElement.$.fireEvent("change",{value:!0,oldValue:!1,changeType:t}),n.nativeElement.$.fireEvent("checkValue",{changeType:t})):(n.$.fireEvent("change",{value:!0,oldValue:!1,changeType:t}),n.$.fireEvent("checkValue",{changeType:t})),a._updateGroupValue()}propertyChangedHandler(e,t,a){const n=this;switch(e){case"value":n._updateHidenInputNameAndValue();break;case"checked":n._isUpdating||n._changeCheckState("api"),n._updateHidenInputNameAndValue();break;case"name":n._updateHidenInputName();break;default:super.propertyChangedHandler(e,t,a)}}}); |
/* Smart UI v14.2.72 (2022-08-30) | ||
Copyright (c) 2011-2021 jQWidgets. | ||
/* Smart UI v15.0.2 (2023-01-24) | ||
Copyright (c) 2011-2023 jQWidgets. | ||
License: https://htmlelements.com/license/ */ // | ||
Smart("smart-switch-button",class extends Smart.ToggleButton{static get properties(){return{inverted:{value:!1,type:"boolean"},orientation:{value:"horizontal",allowedValues:["horizontal","vertical"],type:"string"},switchMode:{value:"default",allowedValues:["default","click","drag","none"],type:"string"},clickMode:{value:"release",allowedValues:["press","release","pressAndRelease"],type:"string"}}}static get listeners(){return{"container.down":"_mouseDownHandler","document.move":"_drag","container.move":"_moveHandler","document.up":"_switchThumbDropHandler",mouseenter:"_switchButtonOnMouseEnter",mouseleave:"_switchButtonOnMouseLeave",resize:"_resizeHandler","container.resize":"_resizeHandler","document.selectstart":"_selectStartHandler"}}static get styleUrls(){return["smart.switchbutton.css"]}propertyChangedHandler(e,t,n){const i=this;switch(super.propertyChangedHandler(e,t,n),i._updateContentProperties(),e){case"indeterminate":n?(i._valueCache=i.checked,i.checked=null):i.checked=i._valueCache,i._setAriaState();break;case"trueContent":i.trueContent=n;break;case"falseContent":i.falseContent=n;break;case"orientation":i._resizeHandler()}i._getContainersSizeAndBreakPoint(),i._removeDragStyles(),i._resizeHandler()}template(){return"<div id='container' class='smart-container' role=\"presentation\">\n <div id='innerContainer' class='smart-inner-container' role=\"presentation\">\n <span id='falseContentContainer' inner-h-t-m-l='[[falseContent]]' class='smart-false-content-container'></span>\n <span id='switchThumb' class='smart-thumb' role=\"presentation\"></span>\n <span id='trueContentContainer' inner-h-t-m-l='[[trueContent]]' class='smart-true-content-container'></span>\n </div>\n <input id='hiddenInput' class='smart-hidden-input' type='hidden'>\n </div>"}ready(){const e=this;super.ready(),e.setAttribute("role","switch");let t=e.animation;e.hasAnimation&&(e.animation="none"),e._supportCSSVariables=Smart.Utilities.Core.CSSVariablesSupport()&&Boolean(window.getComputedStyle(e.$.container).getPropertyValue("--smart-switch-button-default-width")),e._htmlBindOnInitialization(),e._resizeHandler(),e._initializePrivateVariables(),e._getContainersSizeAndBreakPoint(),e.indeterminate&&(e._valueCache=e.checked,e.checked=null),e._setAriaState(),e._handleTemplate(!0),e._handleTemplate(!1),e._handleTemplate(),e._updateHidenInputNameAndValue(),e._updateThumbPosition(),e.animation=t}_mouseDownHandler(e){const t=this;t.disabled||t.readonly||"none"===t.switchMode||(e.originalEvent.target.closest(".smart-thumb")!==t.$.switchThumb||"default"!==t.switchMode&&"drag"!==t.switchMode||t._switchThumbDragStartHandler(e),t._isSwitchClicked=t,t._updateContentProperties(),"release"!==t.clickMode&&"click"===t.switchMode&&(t._updateStateOnClick(),t.$.fireEvent("click"),t.indeterminate=!1,t._updateHidenInputNameAndValue()))}_updateStateOnClick(){this._changeCheckState(),this.focus()}_drag(e){this._mouseDown&&(Smart.Utilities.Core.isMobile&&e.originalEvent.preventDefault(),this._switchThumbDragHandler(e))}_switchThumbDragStartHandler(e){const t=this;t.disabled||("click"===t.switchMode&&"release"!==t.clickMode&&(e.preventDefault(),e.stopPropagation()),t._isInactiveOn("drag")||(t._mouseDown=!0,t._getContainersSizeAndBreakPoint(),t._pointerPosition="vertical"===t.orientation?e.pageY:e.pageX,e.preventDefault()))}_selectStartHandler(e){this._mouseDown&&e.preventDefault()}_switchThumbDragHandler(e){const t=this;if(t._isInactiveOn("drag"))return;if(!1===t._mouseDown)return void t._removeDragStyles();if(!t.hasAttribute("dragged")){if(Math.abs(("vertical"===t.orientation?e.pageY:e.pageX)-t._pointerPosition)<=1.5)return;t.setAttribute("dragged","")}let n=t.$.innerContainer,i=t.$.container.getBoundingClientRect(),r="vertical"===t.orientation?document.body.scrollTop||document.documentElement.scrollTop:document.body.scrollLeft||document.documentElement.scrollLeft,a="vertical"===t.orientation?i.top+r:i.left+r,o="vertical"===t.orientation?t._pointerPosition-n.offsetTop:t._pointerPosition-n.offsetLeft,s=t._pointerPosition>=a&&t._pointerPosition<=a+t._switchContainerSize;const l=-1*(t.offsetWidth-t.$.switchThumb.offsetWidth),c=-1*(t.offsetHeight-t.$.switchThumb.offsetHeight);if(t._pointerPosition="vertical"===t.orientation?e.pageY:e.pageX,s){let e=t._pointerPosition-o;e<-t._switchTrackLength&&(e=-t._switchTrackLength),e>0&&(e=0),"vertical"===t.orientation?t.$.innerContainer.style.top=Math.max(c,e)+"px":t.$.innerContainer.style.left=Math.max(l,e)+"px"}}_switchThumbDropHandler(){const e=this;e.hasAttribute("dragged")?e._endDrag():e._isSwitchClicked&&e._endClick(),e._mouseDown=!1,delete e._isSwitchClicked}_endDrag(){const e=this,t=e.inverted&&!e.rightToLeft||!e.inverted&&e.rightToLeft;if(e.indeterminate=!1,e._updateHidenInputNameAndValue(),e._isInactiveOn("drag")||!e._mouseDown)return;e.removeAttribute("dragged"),delete e._pointerPosition;const n=("vertical"===e.orientation?e.$.innerContainer.offsetTop+e.$.switchThumb.offsetTop+e.$.switchThumb.clientHeight/2:e.$.innerContainer.offsetLeft+e.$.switchThumb.offsetLeft+e.$.switchThumb.clientWidth/2)>e._switchBreakPoint;null!==e.checked?!t==(n===e.checked)&&e._changeCheckState(!e.checked):n?e._changeCheckState(t):e._changeCheckState(!t),e._removeDragStyles(),e._updateThumbPosition()}_endClick(){const e=this;e._resizeHandler(),e.disabled||e.readonly||e._isInactiveOn("click")||("release"!==e.clickMode&&"pressAndRelease"!==e.clickMode||e._updateStateOnClick(),e.indeterminate=!1,e._updateHidenInputNameAndValue())}_switchButtonOnMouseEnter(){const e=this;e.disabled||e.readonly||e.$.addClass("hovered")}_switchButtonOnMouseLeave(){const e=this;e.disabled||e.readonly||e.$.removeClass("hovered")}_isInactiveOn(e){const t=this,n=t.disabled||t.readonly||t.switchMode!==e;return"default"!==t.switchMode&&n}_keyUpHandler(e){const t=this;t.disabled||t.readonly||32!==e.keyCode||"none"===t.switchMode||(t._getContainersSizeAndBreakPoint(),t._changeCheckState())}_initializePrivateVariables(){const e=this;e._switchContainerSize=e._switchTrackLength=e._switchBreakPoint=e._pointerPosition=0,e._mouseDown=!1}_changeCheckState(e){const t=this;let n=t.checked;if(null===n&&void 0!==e)return t.$.fireEvent("change",{value:e,oldValue:null,changeType:"pointer"}),t.$.fireEvent("uncheckValue",{changeType:"pointer"}),t.checked=e,void t._updateThumbPosition();null===t.checked?t.checked=!0:t.checked=!t.checked,t._setAriaState(),t._updateThumbPosition(),t.$.fireEvent("change",{value:t.checked,oldValue:n,changeType:"pointer"}),t.checked?t.$.fireEvent("checkValue",{changeType:"pointer"}):t.$.fireEvent("uncheckValue",{changeType:"pointer"}),t._updateHidenInputNameAndValue()}_getContainersSizeAndBreakPoint(){const e=this;e._switchContainerSize="vertical"===e.orientation?e.$.container.offsetHeight:e.$.container.offsetWidth,e._switchTrackLength="vertical"===e.orientation?e._switchContainerSize-e.$.switchThumb.offsetHeight:e._switchContainerSize-e.$.switchThumb.offsetWidth,e._switchBreakPoint=e._switchContainerSize/2}_removeDragStyles(){const e=this;e._supportCSSVariables?e.$.innerContainer.removeAttribute("style"):e.$.innerContainer.style.left="",e._supportCSSVariables?e.$.innerContainer.removeAttribute("style"):e.$.innerContainer.style.top="",e._mouseDown=!1}_moveHandler(e){"touchmove"===e.originalEvent.type&&e.originalEvent.preventDefault()}_resizeHandler(){const e=this;if(!document.body.contains(e))return;const t=window.getComputedStyle(e,null),n=parseInt(t.getPropertyValue("border-top-width")),i=parseInt(t.getPropertyValue("border-right-width")),r=parseInt(t.getPropertyValue("border-bottom-width")),a=parseInt(t.getPropertyValue("border-left-width")),o="vertical"===e.orientation?e.offsetHeight-(n+r):e.offsetWidth-(a+i);e._getContainersSizeAndBreakPoint(),e._supportCSSVariables?e.$.container.style.setProperty("--smart-switch-button-default-width",o+"px"):(e._innerContainerSize=o,e.$.innerContainer.style.height=e.$.innerContainer.style.width="",e.$.trueContentContainer.style.height=e.$.trueContentContainer.style.width="",e.$.falseContentContainer.style.height=e.$.falseContentContainer.style.width="","horizontal"===e.orientation?(e.$.innerContainer.style.setProperty("width",2*o-e.$.switchThumb.clientWidth+"px"),e.$.trueContentContainer.style.setProperty("width",e._switchTrackLength+"px"),e.$.falseContentContainer.style.setProperty("width",e._switchTrackLength+"px")):(e.$.innerContainer.style.setProperty("height",2*o-e.$.switchThumb.clientHeight+"px"),e.$.trueContentContainer.style.setProperty("height",e._switchTrackLength+"px"),e.$.falseContentContainer.style.setProperty("height",e._switchTrackLength+"px")),e._updateThumbPosition())}_updateThumbPosition(){const e=this,t=e.inverted&&!e.rightToLeft||!e.inverted&&e.rightToLeft;!e._supportCSSVariables&&(t?!0!==e.checked:!1!==e.checked)&&e._innerContainerSize?((t?!1===e.checked:e.checked)&&("horizontal"===e.orientation?(e.$.innerContainer.style.left=-1*(e._innerContainerSize-e.$.switchThumb.offsetWidth)+"px",e.$.innerContainer.style.top=""):(e.$.innerContainer.style.top=-1*(e._innerContainerSize-e.$.switchThumb.offsetHeight)+"px",e.$.innerContainer.style.left="")),null===e.checked&&("horizontal"===e.orientation?(e.$.innerContainer.style.left=-1*(e._innerContainerSize/2-e.$.switchThumb.offsetWidth/2)+"px",e.$.innerContainer.style.top=""):(e.$.innerContainer.style.top=-1*(e._innerContainerSize/2-e.$.switchThumb.offsetHeight/2)+"px",e.$.innerContainer.style.left=""))):e.$.innerContainer.style.left=e.$.innerContainer.style.top=""}_setAriaState(){const e=this,t=!!e.checked;e.setAttribute("aria-checked",t),t?(e.$.falseContentContainer.setAttribute("aria-hidden",!0),e.$.trueContentContainer.removeAttribute("aria-hidden")):(e.$.trueContentContainer.setAttribute("aria-hidden",!0),e.$.falseContentContainer.removeAttribute("aria-hidden"))}}); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 3 instances in 1 package
2997628
39686
2