-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.js
4 lines (4 loc) · 8.14 KB
/
index.js
1
2
3
4
(function(){"use strict";function r(s,t,n,e,l,i,u,Q){var a=typeof s=="function"?s.options:s;t&&(a.render=t,a.staticRenderFns=n,a._compiled=!0),e&&(a.functional=!0),i&&(a._scopeId="data-v-"+i);var c;if(u?(c=function(o){o=o||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!o&&typeof __VUE_SSR_CONTEXT__<"u"&&(o=__VUE_SSR_CONTEXT__),l&&l.call(this,o),o&&o._registeredComponents&&o._registeredComponents.add(u)},a._ssrRegister=c):l&&(c=Q?function(){l.call(this,(a.functional?this.parent:this).$root.$options.shadowRoot)}:l),c)if(a.functional){a._injectStyles=c;var Y=a.render;a.render=function(Z,d){return c.call(d),Y(Z,d)}}else{var p=a.beforeCreate;a.beforeCreate=p?[].concat(p,c):[c]}return{exports:s,options:a}}const _={extends:"k-multiselect-field"};var f=function(){var t=this,n=t._self._c;return n("k-field",t._b({staticClass:"k-multiselect-field",attrs:{input:t._uid,counter:null}},"k-field",t.$props,!1),[t.hasNoOptions?n("k-empty",{attrs:{icon:t.icon,text:t.$t("options.none")}}):n("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"icon"}},"k-input",t.$props,!1),t.$listeners))],1)},k=[],v=r(_,f,k,!1,null,null,null,null);const h=v.exports,m={extends:"k-multiselect-input"};var g=function(){var t=this,n=t._self._c;return n("div",{staticClass:"k-multiselect-input"},[n("k-icon-tags",t._b({ref:"tags",on:{input:function(e){return t.$emit("input",e)}},nativeOn:{click:function(e){return e.stopPropagation(),t.open.apply(null,arguments)}}},"k-icon-tags",t.$props,!1),[!t.max||t.value.length<t.max?n("k-button",{ref:"toggle",staticClass:"k-multiselect-input-toggle k-tags-navigatable",attrs:{id:t.id,autofocus:t.autofocus,disabled:t.disabled,size:"xs",icon:"triangle-down"},nativeOn:{keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"delete",[8,46],e.key,["Backspace","Delete","Del"])?null:t.$refs.tags.focus("prev")},focus:function(e){return t.open.apply(null,arguments)}}}):t._e()],1),n("k-icon-picklist-dropdown",t._b({ref:"dropdown",attrs:{options:t.options},on:{input:function(e){return t.$emit("input",e)}}},"k-icon-picklist-dropdown",t.$props,!1))],1)},b=[],y=r(m,g,b,!1,null,null,null,null);const $=y.exports,j="",x={extends:"k-tags",methods:{findSvg(s){var t;return((t=this.options.find(n=>n.value===s))==null?void 0:t.svg)??null},remove(s){this.tags.splice(s,1),this.input()}},computed:{isDraggable(){return!(this.$attrs.max===1||this.sort===!0||this.draggable===!1||this.tags.length===0||this.disabled===!0)}}};var C=function(){var t=this,n=t._self._c;return n("k-navigate",{ref:"navigation",attrs:{axis:t.layout==="list"?"y":"x"}},[n("k-draggable",{staticClass:"k-tags",attrs:{list:t.tags,options:t.dragOptions,"data-layout":t.layout},on:{end:t.save},scopedSlots:t._u([{key:"footer",fn:function(){return[t._t("default")]},proxy:!0}],null,!0)},t._l(t.tags,function(e,l){return n("k-tag",{key:l,class:t.$attrs.max==1?"k-tag-single":null,attrs:{disabled:t.disabled,image:e.image,removable:!t.disabled,name:"tag"},on:{remove:function(i){return t.remove(l,e)}},nativeOn:{keypress:function(i){return!i.type.indexOf("key")&&t._k(i.keyCode,"enter",13,i.key,"Enter")?null:t.edit(l,e,i)},click:function(i){t.max==1?t.edit(l,e,i):i.preventDefault()},dblclick:function(i){return t.edit(l,e,i)}}},[t.findSvg(e.value)?n("span",{staticClass:"k-tag-text-icon",domProps:{innerHTML:t._s(t.findSvg(e.value))}}):t._e(),n("span",{staticClass:"k-tag-text-label",domProps:{innerHTML:t._s(e.text)}})])}),1)],1)},w=[],O=r(x,C,w,!1,null,null,null,null);const F=O.exports,R={extends:"k-picklist-dropdown"};var I=function(){var t=this,n=t._self._c;return n("k-dropdown-content",{ref:"dropdown",staticClass:"k-picklist-dropdown",attrs:{"align-x":"start",disabled:t.disabled,navigate:!1},nativeOn:{click:function(e){e.stopPropagation()}}},[n("k-icon-picklist-input",t._b({on:{create:t.add,input:t.input,escape:function(e){return t.$refs.dropdown.close()}},nativeOn:{click:function(e){e.stopPropagation()}}},"k-icon-picklist-input",t.$props,!1))],1)},P=[],T=r(R,I,P,!1,null,null,null,null);const D=T.exports,S={extends:"k-picklist-input",computed:{isFull(){return this.max>1&&this.value.length>=this.max}}};var E=function(){var t=this,n=t._self._c;return n("k-navigate",{staticClass:"k-picklist-input",attrs:{element:"nav",axis:"y",select:"input[type=search], label, .k-picklist-input-body button"},on:{prev:function(e){return t.$emit("escape")}}},[t.search?n("header",{staticClass:"k-picklist-input-header"},[n("div",{staticClass:"k-picklist-input-search"},[n("k-search-input",{ref:"search",attrs:{autofocus:t.autofocus,disabled:t.disabled,placeholder:t.placeholder,value:t.query},on:{input:function(e){t.query=e}},nativeOn:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"escape",void 0,e.key,void 0)?null:(e.preventDefault(),t.escape.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),t.add.apply(null,arguments))}]}})],1)]):t._e(),t.filteredOptions.length?[n("div",{staticClass:"k-picklist-input-body"},[n("k-icon-choices-input",t._b({ref:"options",staticClass:"k-picklist-input-options",attrs:{disabled:t.disabled,options:t.choices,value:t.value},on:{input:t.input},nativeOn:{keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),t.enter.apply(null,arguments))}}},"k-icon-choices-input",t.$props,!1)),t.display!==!0&&t.filteredOptions.length>t.display?n("k-button",{staticClass:"k-picklist-input-more",attrs:{icon:"angle-down"},on:{click:function(e){t.display=!0}}},[t._v(" "+t._s(t.$t("options.all",{count:t.filteredOptions.length}))+" ")]):t._e()],1)]:t.showEmpty?[n("div",{staticClass:"k-picklist-input-body"},[n("p",{staticClass:"k-picklist-input-empty"},[t._v(" "+t._s(t.$t("options.none"))+" ")])])]:t._e()],2)},H=[],L=r(S,E,H,!1,null,null,null,null);const M=L.exports,q={extends:"k-checkboxes-input",computed:{choices(){return this.options.map((s,t)=>({...s,autofocus:this.autofocus&&t===0,checked:this.selected.includes(s.value),disabled:this.disabled||s.disabled,name:this.name??this.id,type:this.max===1?"radio":"checkbox",label:s.text}))}},methods:{input(s,t){if(this.max===1&&(this.selected=[]),t===!0)this.selected.push(s);else{const n=this.selected.indexOf(s);n!==-1&&this.selected.splice(n,1)}this.$emit("input",this.selected)}}};var N=function(){var t=this,n=t._self._c;return n("ul",{staticClass:"k-checkboxes-input k-grid",style:{"--columns":t.columns},attrs:{"data-variant":"choices"}},t._l(t.choices,function(e,l){return n("li",{key:l},[n("k-icon-choice-input",t._b({on:{input:function(i){return t.input(e.value,i)}}},"k-icon-choice-input",e,!1))],1)}),0)},z=[],U=r(q,N,z,!1,null,null,null,null);const V=U.exports,tt="",X={extends:"k-choice-input"};var B=function(){var t=this,n=t._self._c;return n("label",{staticClass:"k-choice-input k-icon-choice-input",attrs:{"aria-disabled":t.disabled}},[n("input",t._b({class:{"sr-only":t.variant==="invisible"},attrs:{"data-variant":t.variant},on:{input:function(e){return t.$emit("input",e.target.checked)}}},"input",{autofocus:t.autofocus,id:t.id,checked:t.checked,disabled:t.disabled,name:t.name,required:t.required,type:t.type,value:t.value},!1)),t.label||t.info?n("span",{staticClass:"k-choice-input-label k-icon-choice-input-label"},[t.$attrs.svg?n("span",{staticClass:"k-choice-input-label-icon",domProps:{innerHTML:t._s(t.$attrs.svg)}}):t._e(),n("span",{staticClass:"k-choice-input-label-text",domProps:{innerHTML:t._s(t.label)}}),t.info?n("span",{staticClass:"k-choice-input-label-info",domProps:{innerHTML:t._s(t.info)}}):t._e()]):t._e()])},W=[],A=r(X,B,W,!1,null,null,null,null);const G=A.exports,et="";var J=r({extends:"k-bubbles-field-preview",methods:{findSvg(s){var t;return((t=this.field.options.find(n=>n.value===s))==null?void 0:t.svg)??null}},computed:{html(){return!0},bubbles(){return this.value?this.value.map(s=>({text:`<span class="k-icon-field-bubble">
${this.findSvg(s)}
<span>${s}</span>
</span>`})):[]}}},null,null,!1,null,null,null,null);const K=J.exports;panel.plugin("tobimori/icon-field",{fields:{icon:h},components:{"k-icon-field-preview":K,"k-icon-input":$,"k-icon-tags":F,"k-icon-picklist-dropdown":D,"k-icon-picklist-input":M,"k-icon-choices-input":V,"k-icon-choice-input":G}})})();