import e from"./adaptivedropdowncomponents-e71364a7.js";import{q as t}from"./constants-da6cacac.js";import{E as s}from"./eventhelper-8bcec49f.js";import{D as o,L as i}from"./dx-dropdown-list-box-de1f2153.js";import{k as r}from"./key-a66127fc.js";import{isFocusableElement as a,addFocusHiddenAttribute as n}from"./focus-utils-1fc0087c.js";import{x as p}from"./dom-utils-bf33c859.js";import{C as l}from"./css-classes-1103f305.js";import{c as m}from"./text-editor-3db5f940.js";import"./dropdowncomponents-5264d5da.js";import"./dropdown-91641129.js";import"./tslib.es6-d65164b3.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"./property-4ec0b52d.js";import"./custom-element-267f9a21.js";import"./lit-element-462e7ad3.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"./_commonjsHelpers-41cdd1e7.js";import"./string-2448bf95.js";import"./browser-3fc721b7.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"./thumb-31d768d7.js";import"./query-44b9267f.js";import"./disposable-d2c2d283.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"./input-bbb44fe6.js";import"./single-slot-element-base-bbf951b4.js";import"./constants-f2324760.js";import"./dx-scroll-viewer-27dbfc56.js";import"./dx-html-element-base-aa396eca.js";import"./scroll-viewer-css-classes-cc34804c.js";import"./dx-list-box-events-d2bd0dc2.js";import"./dx-virtual-scroll-viewer-295ab656.js";import"./grid-scroll-utils-de7854f2.js";var c;class d{}c=d,d.TagClass=l.Prefix+"-tag",d.TagTemplateClass=c.TagClass+"-tmpl",d.TagCloseButtonClass=c.TagClass+"-btn-close";class u extends o{constructor(){super()}connectedCallback(){super.connectedCallback()}isFocusableElementInMainElementTemplate(e){return!(!p(e,`.${d.TagTemplateClass}`)||!a(e))||super.isFocusableElementInMainElementTemplate(e)}disconnectedCallback(){super.disconnectedCallback()}get isSearchActive(){return this.searchMode!==i.None}processPointerDown(e){var t;const o=s.containsInComposedPath(e,this.isTagCloseButtonElement),i=s.containsInComposedPath(e,m.isClearButtonElement),r=s.containsInComposedPath(e,m.isEditorButtonElement),a=e.target===this.fieldElement,p=!o&&!this.isFocusableElementInMainElementTemplate(e.target);return(a||p)&&this.toggleDropDownVisibility(),n(this),r&&this.focused&&this.raiseFieldChange(),(i||r||o)&&e.preventDefault(),this.focused||!r||this.useAdaptiveLayout||null===(t=this.editBoxElement)||void 0===t||t.focus(),!0}applyTextPropertyCore(){super.applyTextPropertyCore(),this.fieldElementValue&&(this.selectAll(),this.raiseFieldText()),this.setInputSizeAttribute()}onFieldReady(e,t){super.onFieldReady(e,t),t&&this.setInputSizeAttribute()}updatePlaceholder(){super.updatePlaceholder(),this.setInputSizeAttribute()}onTextInput(e){super.onTextInput(e),this.setInputSizeAttribute()}tryProcessKeyDown(e){return!!super.tryProcessKeyDown(e)||r.KeyUtils.getEventKeyCode(e)===r.KeyCode.Backspace&&(!this.fieldElementValue&&(this.dispatchKeyDownEvent(e),!0))}setInputSizeAttribute(){this.inputElement&&this.inputElement.setAttribute("size",this.getInputSize().toString())}getInputSize(){return this.fieldElementValue?this.fieldElementValue.length:this.placeholder?this.placeholder.length:1}isTagTemplateElement(e){var t;return!!e&&(null===(t=e.classList)||void 0===t?void 0:t.contains(d.TagTemplateClass))}isTagCloseButtonElement(e){var t;return!!e&&(null===(t=e.classList)||void 0===t?void 0:t.contains(d.TagCloseButtonClass))}}customElements.define(t,u);const b={loadModule:function(){},adaptiveDropdownComponents:e};export{u as DxTagBox2,b as default};
