var __awaiter=this&&this.__awaiter||function(e,t,n,i){function l(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,r){function o(e){try{c(i.next(e))}catch(e){r(e)}}function a(e){try{c(i["throw"](e))}catch(e){r(e)}}function c(e){e.done?n(e.value):l(e.value).then(o,a)}c((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,l,r,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return c([e,t])}}function c(o){if(i)throw new TypeError("Generator is already executing.");while(n)try{if(i=1,l&&(r=o[0]&2?l["return"]:o[0]?l["throw"]||((r=l["return"])&&r.call(l),0):l.next)&&!(r=r.call(l,o[1])).done)return r;if(l=0,r)o=[o[0]&2,r.value];switch(o[0]){case 0:case 1:r=o;break;case 4:n.label++;return{value:o[1],done:false};case 5:n.label++;l=o[1];o=[0];continue;case 7:o=n.ops.pop();n.trys.pop();continue;default:if(!(r=n.trys,r=r.length>0&&r[r.length-1])&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!r||o[1]>r[0]&&o[1]<r[3])){n.label=o[1];break}if(o[0]===6&&n.label<r[1]){n.label=r[1];r=o;break}if(r&&n.label<r[2]){n.label=r[2];n.ops.push(o);break}if(r[2])n.ops.pop();n.trys.pop();continue}o=t.call(e,n)}catch(e){o=[6,e];l=0}finally{i=r=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-b7735e0d.js";var dvnFieldInputCellSingleChoiceCss="dvn-field-input-cell-single-choice{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;height:100%}";var DvnFieldInputCellSingleChoice=function(){function e(e){registerInstance(this,e);this.cellFormCancel=createEvent(this,"cellFormCancel",7);this.cellFormSubmit=createEvent(this,"cellFormSubmit",7)}e.prototype.focus=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(n){(t=(e=this.el.querySelector("dvn-select"))===null||e===void 0?void 0:e.focusOnInput)===null||t===void 0?void 0:t.call(e);return[2]}))}))};e.prototype.render=function(){var e=this;var t=this,n=t.field,i=t.value;var l=n.options,r=l===void 0?[]:l;return h(Host,null,h("dvn-select",{dataAdapter:n.dataAdapter,dataProvider:n.dataProvider,disabled:n.disabled,leaned:true,value:i,width:"100%",scale:"small",onClick:function(e){e.stopImmediatePropagation()},onBlur:function(t){t.stopImmediatePropagation();e.cellFormCancel.emit()},onChange:function(t){t.stopImmediatePropagation();e.cellFormSubmit.emit({value:t.detail});e.cellFormCancel.emit()}},r.map((function(e){return h("dvn-select-option",{value:e.value},e.label)}))))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();DvnFieldInputCellSingleChoice.style=dvnFieldInputCellSingleChoiceCss;export{DvnFieldInputCellSingleChoice as dvn_field_input_cell_single_choice};