import{_ as e}from"./tslib.es6-d65164b3.js";import{DxComboBox as t}from"./dx-combobox-fbbccb45.js";import{k as s}from"./key-a66127fc.js";import{g as o}from"./constants-da6cacac.js";import{n as r}from"./property-4ec0b52d.js";import{e as i}from"./custom-element-267f9a21.js";import"./browser-3fc721b7.js";import"./_commonjsHelpers-41cdd1e7.js";import"./adaptivedropdowncomponents-e71364a7.js";import"./dropdowncomponents-5264d5da.js";import"./dropdown-91641129.js";import"./popup-e76e963a.js";import"./layouthelper-67dd777a.js";import"./point-e4ec110e.js";import"./constants-7c047c0d.js";import"./rafaction-bba7928b.js";import"./screenhelper-e9ec6e3e.js";import"./transformhelper-ebad0156.js";import"./positiontracker-754c1e75.js";import"./branch-aebd078a.js";import"./lit-element-462e7ad3.js";import"./eventhelper-8bcec49f.js";import"./logicaltreehelper-67db40f1.js";import"./portal-e7c7352c.js";import"./data-qa-utils-8be7c726.js";import"./constants-38572198.js";import"./const-90026e45.js";import"./dx-html-element-pointer-events-helper-6dda355e.js";import"./dom-4684d8d6.js";import"./string-2448bf95.js";import"./devices-17b9ba08.js";import"./dx-ui-element-b777832b.js";import"./lit-element-base-b20b52b2.js";import"./dx-license-e00a5bc7.js";import"./capture-manager-fb670c21.js";import"./focushelper-2eea96ca.js";import"./nameof-factory-64d95f5b.js";import"./custom-events-helper-e7f279d3.js";import"./focustrap-d11cfef9.js";import"./tabbable-a2ae89a6.js";import"./keyboard-navigation-strategy-0cccb7d5.js";import"./dom-utils-bf33c859.js";import"./css-classes-1103f305.js";import"./focus-utils-1fc0087c.js";import"./disposable-d2c2d283.js";import"./thumb-31d768d7.js";import"./query-44b9267f.js";import"./popupportal-e116a31b.js";import"./events-interseptor-a522582a.js";import"./modalcomponents-b90ec245.js";import"./dx-dropdown-base3-1c428ec0.js";import"./masked-input-28fa62bb.js";import"./text-editor-3db5f940.js";import"./single-slot-element-base-bbf951b4.js";import"./input-bbb44fe6.js";import"./constants-f2324760.js";import"./dx-listbox-21340eec.js";let n=class extends t{constructor(){super(),this.customTagsEnable=!1,this.inputValue=""}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}onTextInput(e){this.inputValue=e.target.value,this.fitInputWidth(),super.onTextInput(e)}processFocusOut(e){var t;if(!this.inputElement)return;const s=null===(t=this.inputElement)||void 0===t?void 0:t.value,o=s&&""!==s;super.processFocusOut(e),!this.focused&&o&&this.setInputValue("")}fitInputWidth(){if(!this.inputElement)return;const e=this.inputValue.length;this.inputElement.setAttribute("size",0===e?"1":e.toString())}forceInputValue(e,t){this.setInputValue(e),t&&this.highlightInputText()}highlightInputText(){this.inputElement&&this.inputElement.select()}applyTextPropertyCore(){}processKeyDownServerCommand(e){return this.isKeyDownPreventingDefaultNeeded(e)&&e.preventDefault(),super.processKeyDownServerCommand(e)}isKeyDownPreventingDefaultNeeded(e){var t;if(e.keyCode!==s.KeyCode.Enter)return!1;const o=null===(t=this.inputElement)||void 0===t?void 0:t.value;return!(!o||0===o.length)}requireSendKeyCommandToServer(e){if(super.requireSendKeyCommandToServer(e))return!0;switch(e.keyCode){case s.KeyCode.Esc:return!0;case s.KeyCode.Backspace:return!this.inputElement||0===this.inputElement.value.length}return!1}setInputValue(e){this.inputElement&&(this.inputElement.value=e,this.inputValue=e&&""!==e?e:this.inputElement.placeholder),this.fitInputWidth()}};function p(e,t,s){e.forceInputValue(t,s)}e([r({type:Boolean,attribute:"custom-tags-enable"})],n.prototype,"customTagsEnable",void 0),n=e([i(o)],n);const a={loadModule:function(){},forceInputValue:p};export{a as default,p as forceInputValue};
