import{registerTemplate as e,freezeTemplate as t,registerDecorators as s,registerComponent as i}from"@kdcloudjs/kwc";import l from"./shadowBaseClassPrivate.js";import{i as r}from"../ssr-C2pjZzfv.js";import"../observable-tloG64m6.js";import"../i18n-B98kiI7M.js";import{d as a}from"../utilsPrivate-CI3EeA5x.js";import"../client-Ddi3i8XR.js";import"../empty_html-CjXB8rB4.js";import"./iso8601Utils.js";import"../colorValid-qIPgkqGp.js";var o=[function(e,t,s){return"slot"+(e?"["+e+"]":"")+" {display: inline-block;}"}];const d={key:0},p=[];function n(e,t,s,i){const{s:l}=e;return[l("",d,p,s)]}var h=e(n);n.slots=[""],n.stylesheets=[],n.stylesheetToken="kwc-6pr764mu7ia",n.legacyStylesheetToken="D:\\new_workspace\\workspace\\kingdee-base-components\\src\\modules\\kd\\primitiveFileDroppableZone-undefined_primitiveFileDroppableZone",o&&n.stylesheets.push.apply(n.stylesheets,o),t(n);class m extends l{get disabled(){return this._disabled||!1}set disabled(e){this._disabled=a(e)}get multiple(){return this._multiple||!1}set multiple(e){this._multiple=a(e)}constructor(){super(),this._disabled=void 0,this._multiple=void 0,r&&(this.template.addEventListener("dragover",this.allowDrop.bind(this)),this.template.addEventListener("dragleave",this.handleDragLeave.bind(this)),this.template.addEventListener("drop",this.handleOnDrop.bind(this)))}connectedCallback(){this.classList.add("kdds-file-selector__dropzone")}setDragOver(e){this.classList.toggle("kdds-has-drag-over",e)}handleDragLeave(){this.setDragOver(!1)}handleOnDrop(e){e.preventDefault(),this.setDragOver(!1),this.disabled?e.stopPropagation():this.meetsMultipleCriteria(e)||e.stopPropagation()}allowDrop(e){e.preventDefault(),this.disabled||this.setDragOver(!0)}meetsMultipleCriteria(e){const{files:t}=e.dataTransfer;return!(t.length>1&&!this.multiple)}}m.validationOptOut=["class"],s(m,{publicProps:{disabled:{config:3},multiple:{config:3}},track:{_disabled:1,_multiple:1}});const c=i(m,{tmpl:h,sel:"D:\\new_workspace\\workspace\\kingdee-base-components\\src\\modules\\kd\\primitiveFileDroppableZone-",apiVersion:63});export{c as default};
