/**
@license
Copyright (c) 2017 Vaadin Ltd.
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
*/
import"../../../@polymer/polymer/polymer-legacy.js";import"../../vaadin-text-field/src/vaadin-text-field.js";import{html as e}from"../../../@polymer/polymer/lib/utils/html-tag.js";import{Debouncer as t}from"../../../@polymer/polymer/lib/utils/debounce.js";import{timeOut as i}from"../../../@polymer/polymer/lib/utils/async.js";import{PolymerElement as r}from"../../../@polymer/polymer/polymer-element.js";class GridFilterElement extends r{static get template(){return e`
    <style>
      :host {
        display: inline-flex;
        max-width: 100%;
      }

      #filter {
        width: 100%;
        box-sizing: border-box;
      }
    </style>
    <slot name="filter">
      <vaadin-text-field id="filter" value="{{value}}"></vaadin-text-field>
    </slot>
`}static get is(){return"vaadin-grid-filter"}static get properties(){return{path:String,value:{type:String,notify:!0},_connected:Boolean}}connectedCallback(){super.connectedCallback(),this._connected=!0}static get observers(){return["_filterChanged(path, value, _connected)"]}ready(){super.ready();const e=this.firstElementChild;e&&"filter"!==e.getAttribute("slot")&&(console.warn('Make sure you have assigned slot="filter" to the child elements of <vaadin-grid-filter>'),e.setAttribute("slot","filter"))}_filterChanged(e,r,l){void 0!==e&&void 0!==r&&l&&(void 0===this._previousValue&&""===r||(this._previousValue=r,this._debouncerFilterChanged=t.debounce(this._debouncerFilterChanged,i.after(200),(()=>{this.dispatchEvent(new CustomEvent("filter-changed",{bubbles:!0}))}))))}focus(){this.$.filter.focus()}}customElements.define(GridFilterElement.is,GridFilterElement);export{GridFilterElement};