PHP Classes

File: resources/assets/js/atk-vue-item-search.min.js

Recommend this page to a friend!
  Classes of Francesco Danti   ATK Wordpress Plugin   resources/assets/js/atk-vue-item-search.min.js   Download  
File: resources/assets/js/atk-vue-item-search.min.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: ATK Wordpress Plugin
Components to build WordPress plugins
Author: By
Last change:
Date: 1 month ago
Size: 1,826 bytes
 

Contents

Class file image Download
"use strict";(self.webpackChunkatk=self.webpackChunkatk||[]).push([[590],{89848:(t,e,n)=>{n.r(e),n.d(e,{default:()=>r});var s=n(21145),i=n.n(s),u=n(86157);const r={name:"atk-item-search",template:'<div class="atk-item-search" :class="inputCss">\n <input class="ui"\n v-model="query"\n type="text" placeholder="Search..."\n @keyup="onKeyup"\n @keyup.esc="onEscape"\n name="atk-vue-search" />\n <i class="atk-search-icon" :class="classIcon"></i><span style="width: 12px; cursor: pointer;" @click="onClear"></span>\n </div>\n',props:{context:String,url:String,q:String,reload:String,queryArg:String,options:Object},data:function(){return{query:this.q,temp:this.q,isActive:!1,extraQuery:null,inputCss:this.options.inputCss}},computed:{classIcon:function(){return{"search icon":null===this.query||""===this.query,"remove icon":null!==this.query}}},methods:{onKeyup:function(){this.onKeyup.debouncedFx||(this.onKeyup.debouncedFx=u.Z.createDebouncedFx((t=>{this.onKeyup.debouncedFx=null,this.query!==this.temp&&(""===this.query&&(this.query=null),this.sendQuery(),this.temp=this.query)}),this.options.inputTimeOut)),this.onKeyup.debouncedFx.call(this)},onEscape:function(){null!==this.query&&(this.query=null,this.temp=null,this.sendQuery())},onEnter:function(){null!==this.query&&(this.query=null,this.temp=null,this.sendQuery())},onClear:function(){this.query&&(this.query=null,this.temp=null,this.sendQuery())},sendQuery:function(){const t=this,e=i().extend({},this.extraQuery,{__atk_reload:this.reload,[this.queryArg]:this.query}),n=i()("#"+this.reload);this.isActive=!0,n.api({on:"now",url:this.url,data:e,method:"GET",stateContext:this.context?i()(this.context):i()(this.$el),onComplete:function(e,n){t.isActive=!1}})}}}}}]); //# sourceMappingURL=atk-vue-item-search.min.js.map