-
Notifications
You must be signed in to change notification settings - Fork 0
/
p-bbbaab16.entry.js
5 lines (5 loc) · 2.66 KB
/
p-bbbaab16.entry.js
1
2
3
4
5
/*!
* Built by BASIS
* Copyright BASIS International Ltd.
*/
import{r as t,c as i,h as s,H as e,g as n}from"./p-00e3df8e.js";import{h}from"./p-3e9fe89f.js";const a=class{constructor(s){t(this,s),this.modifiedEvent=i(this,"dwc-modified",7),this.spinedEvent=i(this,"dwc-spun",7),this.disabled=!1,this.readonly=!1,this.list=[],this.listIndex=0,this.wrap=!0}handleAttributesChanged(){this.handleSlotChange()}connectedCallback(){this.handleSlotChange=this.handleSlotChange.bind(this)}handleSpinedUp(){this.doSpin("up")}handleSpinedDown(){this.doSpin("down")}handleRequiredPropsChanged(t){t.stopPropagation();const{disabled:i,readonly:s}=t.detail;this.disabled=i,this.readonly=s}async setFocus(){await this.$inpute.setFocus()}async removeFocus(){await this.$inpute.removeFocus()}async spin(t){this.doSpin(t?"up":"down",!1)}doSpin(t,i=!0){if(!this.$inpute)return;if((this.readonly||this.disabled)&&1==i)return;const s=this.list.length-1,e=this.listIndex;let n;switch(t){case"up":n=e+1,n>s&&(n=this.wrap?0:e);break;case"down":n=e-1,n<0&&(n=this.wrap?s:e)}this.listIndex=n,i&&this.fireModifiedEvent(),this.fireSpinEvent()}fireSpinEvent(){this.readonly||this.disabled||this.spinedEvent.emit(this.$inpute.value)}fireModifiedEvent(){this.readonly||this.disabled||this.modifiedEvent.emit(this.$inpute.value)}handleSlotChange(){this.$inpute=this.el.querySelector("dwc-textfield"),this.listIndex>=0&&this.listIndex<this.list.length&&(this.$inpute.value=this.list[this.listIndex]),this.$inpute.showSpinners=!0,this.$inpute.spinnable=!0,this.disabled=this.$inpute.disabled,this.readonly=this.$inpute.readonly}render(){return s(e,{key:"123a3b1a3234d7595044cb38b3eb9029cc413c77",class:h({BBjControl:!0,BBjSpinner:!0,BBjInputESpinner:!0,"bbj-disabled":this.disabled,"bbj-readonly":this.readonly})},s("slot",{key:"96e4a8bbbf1aa83fbfbdf18fde6274f552690fd6",onSlotchange:this.handleSlotChange}))}get el(){return n(this)}static get watchers(){return{list:["handleAttributesChanged"],listIndex:["handleAttributesChanged"]}}};a.style="@media (prefers-reduced-motion: reduce){*,::before,::after{animation-delay:-1ms !important;animation-duration:1ms !important;animation-iteration-count:1 !important;background-attachment:initial !important;scroll-behavior:auto !important;transition-delay:0s !important;transition-duration:0s !important}}:host{box-sizing:border-box;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;position:relative;-webkit-tap-highlight-color:transparent;text-size-adjust:100%}:host *,:host *::before,:host *::after{box-sizing:inherit}:host{cursor:pointer;display:inline-block}:host(:focus),:host(:active){outline:none}:host ::slotted(dwc-textfield){height:100%;width:100%}";export{a as dwc_textfield_spinner}