@farris/ui-vue 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/combo-list/index.esm.js +495 -493
- package/combo-list/index.umd.js +1 -1
- package/condition/index.esm.js +1927 -1925
- package/condition/index.umd.js +1 -1
- package/data-grid/index.esm.js +1927 -1925
- package/data-grid/index.umd.js +1 -1
- package/designer-canvas/index.esm.js +1630 -1628
- package/designer-canvas/index.umd.js +1 -1
- package/dynamic-form/index.esm.js +1927 -1925
- package/dynamic-form/index.umd.js +1 -1
- package/dynamic-view/index.esm.js +1158 -1156
- package/dynamic-view/index.umd.js +1 -1
- package/farris.all.esm.js +2180 -2178
- package/farris.all.umd.js +5 -5
- package/order/index.esm.js +598 -596
- package/order/index.umd.js +1 -1
- package/package.json +4 -4
package/combo-list/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(A,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(A=typeof globalThis<"u"?globalThis:A||self,t(A["combo-list"]={},A.Vue))})(this,function(A,t){"use strict";const te={};function K(e){const{properties:n}=e;return Object.keys(n).reduce((l,o)=>(l[o]=n[o].type==="object"&&n[o].properties?K(n[o]):n[o].default,l),{})}function de(e){const n=te[e];return n?K(n):null}function fe(e,n){const a=K(n);return Object.keys(e).reduce((l,o)=>(l[o]=e[o],l),a),a}function pe(e,n){return Object.keys(e).filter(l=>e[l]!=null).reduce((l,o)=>{if(n.has(o)){const c=n.get(o);if(typeof c=="string")l[c]=e[o];else{const i=c(o,e[o]);Object.assign(l,i)}}else l[o]=e[o];return l},{})}function me(e,n,a=new Map){const l=fe(e,n);return pe(l,a)}function ne(e,n,a=new Map){return te[n.title]=n,l=>{const o=me(l,n,a),c=Object.keys(e).reduce((i,s)=>(i[s]=e[s].default,i),{});return Object.assign(c,o)}}function oe(e,n){return{customClass:n.class}}const ge=new Map([["appearance",oe]]),he={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/combo-list.schema.json",title:"combo-list",description:"A Farris Input Component",type:"object",properties:{id:{description:"The unique identifier for a combo list",type:"string"},type:{description:"The type string of number combo list component",type:"string",default:"combo-list"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},editable:{description:"",type:"boolean",default:!0},enableLinkLabel:{description:"",type:"boolean",default:!1},label:{description:"",type:"string",default:""},lableWidth:{description:"",type:"number"},placeHolder:{description:"",type:"string",default:""},readonly:{description:"",type:"boolean",default:!1},required:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},textAlign:{description:"",type:"string",enum:["left","middle","right"],default:"left"},visible:{description:"",type:"boolean",default:!0},onBlur:{description:"",type:"string",default:""},onClickLinkLabel:{description:"",type:"sting",default:""}},required:["id","type"]};var ae=(e=>(e.Text="text",e.Tag="tag",e))(ae||{}),le=(e=>(e.top="top",e.bottom="bottom",e.auto="auto",e))(le||{});const X={id:{type:String},data:{type:Array,default:[]},displayText:{type:String,default:""},disabled:{default:!1,type:Boolean},dropDownIcon:{type:String,default:'<span class="f-icon f-icon-arrow-60-down"></span>'},editable:{default:!1,type:Boolean},enableClear:{default:!0,type:Boolean},enableSearch:{type:Boolean,default:!1},enableTitle:{default:!0,type:Boolean},forcePlaceholder:{default:!1,type:Boolean},hidePanelOnClear:{default:!0,type:Boolean},idField:{default:"id",type:String},mapFields:{type:Object},maxHeight:{default:350,type:Number},maxLength:{type:Number},multiSelect:{default:!1,type:Boolean},modelValue:{type:String,default:""},placeholder:{type:String},placement:{type:String,default:"auto"},readonly:{default:!1,type:Boolean},remote:{default:null,type:Object},remoteSearch:{default:!1,type:Boolean},separator:{default:",",type:String},tabIndex:{type:Number,default:-1},textField:{default:"name",type:String},valueField:{default:"id",type:String},viewType:{default:"text",type:String}},J=ne(X,he,ge),ye={dataSource:{type:Array,default:[]},enableSearch:{type:Boolean,default:!1},idField:{type:String,default:"id"},multiSelect:{default:!1,type:Boolean},selectedValues:{type:String,default:""},separator:{type:String,default:","},textField:{type:String,default:"name"},width:{type:Number,default:300},valueField:{type:String,default:"id"}},ve={data:{type:Array,default:[]},draggable:{type:Boolean,default:!1},multiSelect:{Type:Boolean,default:!1},multiSelectMode:{Type:String,default:"OnCheck"},idField:{Type:String,default:"id"},valueField:{Type:String,default:"id"},textField:{Type:String,default:"name"},view:{Type:String,default:"ContentView"},size:{Type:String,default:"default"},placeholder:{type:String,default:""},header:{Type:String,default:"ContentHeader"},headerClass:{Type:String,default:""},itemClass:{Type:String,default:""},selectionValues:{type:Array,default:[]},keepOrder:{type:Boolean,default:!1},disableField:{type:String,default:"disabled"}};function be(e,n,a,l,o){const c=t.ref(e.idField),i=t.ref(e.disableField),s=t.ref(e.draggable),h=t.ref(e.itemClass),r=t.ref(e.multiSelect),f=t.ref(e.multiSelectMode);t.ref(!0);const{isDragging:u}=a,{activeIndex:d,focusedItemId:v,hoverIndex:g}=l,{clearSelection:p,selectedItems:k,toggleSelectItem:x}=o;function I(b,O){const P={"f-list-view-group-item":!0,"f-list-view-draggable-item":s.value,"f-un-click":!!b.unClick,"f-un-select":!!b[i.value],"f-listview-active":b.__fv_index__===d.value,"f-listview-hover":!u.value&&O===g.value,moving:!!b.moving};return h.value.split(" ").reduce((W,F)=>(W[F]=!0,W),P),P}function y(b,O){return b[c.value]||""}const w=t.computed(()=>!r.value);function S(b,O){b.unClick||b[i.value]||(w.value&&(v.value=b[c.value]),x(b,O))}const B=t.computed(()=>r.value&&f.value==="OnCheckClearByClick"),j=t.computed(()=>!r.value||r.value&&(f.value==="OnCheckAndClick"||f.value==="OnClick"));function M(b,O,P){if(O.unClick||O[i.value]){b.preventDefault(),b.stopPropagation();return}v.value=O[c.value],d.value=P,B.value&&p(),j.value&&x(O,P),n.emit("clickItem",{data:k.value,index:P})}return{getKey:y,listViewItemClass:I,onCheckItem:S,onClickItem:M}}function Ce(e,n,a){const l=t.ref(e.idField),o=t.ref(e.multiSelect);t.ref(e.multiSelectMode);const{getSelectionItems:c}=a,i=t.ref(c(e.selectionValues));t.watch(()=>e.selectionValues,d=>{i.value=t.ref(c(d)).value});const s=t.computed(()=>!o.value);function h(d){return d[l.value]||""}function r(d){return i.value.findIndex(g=>h(g)===h(d))}function f(){i.value.forEach(d=>{d.checked=!1}),i.value=[]}function u(d,v){s.value&&f();const g=r(d);g>-1?(i.value.splice(g,1),d.checked=!1):(i.value.push(d),d.checked=!0),n.emit("selectionChange",i.value)}return{clearSelection:f,findIndexInSelectedItems:r,selectedItems:i,toggleSelectItem:u}}function we(e,n){function a(c){const i=[];let s=c.nextNode();for(;s;)i.push(s),s=c.nextNode();return i}function l(c,i){const s=document.createTreeWalker(c,NodeFilter.SHOW_TEXT);return a(s).map(u=>({textNode:u,text:(u.textContent||"").toLocaleLowerCase()})).map(({textNode:u,text:d})=>{const v=[];let g=0;for(;g<d.length;){const p=d.indexOf(i,g);if(p===-1)break;v.push(p),g=p+i.length}return v.map(p=>{const k=new Range;return k.setStart(u,p),k.setEnd(u,p+i.length),k})}).flat()}function o(c){if(!CSS.highlights||(CSS.highlights.clear(),!c||!n))return;const i=l(n.value,c.toLocaleLowerCase()),s=new Highlight(...i);CSS.highlights.set("search-result",s)}return{search:o}}const Te={checked:{Type:Boolean,default:!1},id:{Type:String,default:""},disabled:{Type:Boolean,default:!1},modelValue:{Type:Boolean,default:!1}},Q=t.defineComponent({name:"FListViewCheckBox",props:Te,emits:["change","update:modelValue"],setup(e,n){const a=t.ref(e.checked),l=t.ref(e.disabled),o=t.ref(e.id);function c(i){i.stopPropagation(),i.preventDefault(),l.value||(a.value=!a.value,n.emit("change",{originalEvent:i,checked:a.value}))}return t.watch(()=>e.checked,i=>{a.value=i}),()=>t.createVNode("div",{class:"custom-control custom-checkbox custom-control-inline listview-checkbox"},[t.withDirectives(t.createVNode("input",{id:o.value,title:o.value,type:"checkbox",class:"custom-control-input","onUpdate:modelValue":i=>a.value=i,onChange:i=>console.log(i)},null),[[t.vModelCheckbox,a.value]]),t.createVNode("label",{for:o.value,class:"custom-control-label",onClick:i=>c(i)},null)])}});function ie(e,n,a,l,o,c,i,s){const h=t.ref(e.size),r=t.ref(e.textField),f=t.ref(e.multiSelect),u=t.ref(e.disableField),{onMouseenterItem:d,onMouseoverItem:v,onMouseoutItem:g}=o,{getKey:p,listViewItemClass:k,onCheckItem:x,onClickItem:I}=c,y=t.computed(()=>({margin:h.value==="small"?"0.25rem 0":"10px 0"}));function w(S,B,j){return S.checked=i.findIndexInSelectedItems(S)>-1,t.createVNode("li",{class:k(S,B),id:p(S,B),key:p(S,B),onClick:M=>I(M,S,B),onMouseenter:M=>d(M,S,B),onMouseover:M=>v(M,S,B),onMouseout:M=>g(M,S,B)},[f.value&&t.createVNode("div",{class:"f-list-select",onClick:M=>M.stopPropagation()},[t.createVNode(Q,{id:"list-"+p(S,B),disabled:S[u.value]||S.unClick,checked:S.checked,onChange:M=>x(S,B)},null)]),t.createVNode("div",{class:"f-list-content"},[t.createVNode("div",{style:y.value},[S[r.value]])])])}return{renderItem:w}}function Se(e,n,a,l,o,c,i,s){const h=t.ref(e.multiSelect),r=t.ref(e.disableField),{onMouseenterItem:f,onMouseoverItem:u,onMouseoutItem:d}=o,{getKey:v,listViewItemClass:g,onCheckItem:p,onClickItem:k}=c;function x(y,w,S){return n.slots.content?t.createVNode(t.Fragment,null,[n.slots.content&&n.slots.content({item:y,index:w,selectedItem:S})]):t.createVNode("div",{style:"margin: 10px 0;"},[y.name])}function I(y,w,S){return t.createVNode("li",{class:g(y,w),id:v(y,w),key:v(y,w),onClick:B=>k(B,y,w),onMouseenter:B=>f(B,y,w),onMouseover:B=>u(B,y,w),onMouseout:B=>d(B,y,w)},[h.value&&t.createVNode("div",{class:"f-list-select",onClick:B=>B.stopPropagation()},[t.createVNode(Q,{id:"list-"+v(y,w),disabled:y[r.value]||y.unClick,checked:y.checked,onChange:B=>p(y,w)},null)]),t.createVNode("div",{class:"f-list-content"},[x(y,w,S)])])}return{renderItem:I}}function Be(e,n,a,l,o,c,i,s){const h=t.ref(e.multiSelect),r=t.ref(e.disableField),{onMouseenterItem:f,onMouseoverItem:u,onMouseoutItem:d}=o,{getKey:v,listViewItemClass:g,onCheckItem:p,onClickItem:k}=c,{dragstart:x,dragenter:I,dragover:y,dragend:w}=l,{removeItem:S}=s,B=t.computed(()=>({margin:h.value?"10px 0":"10px 0px 10px 14px"}));function j(P){return t.createVNode("div",{style:B.value},[P.name])}function M(){return n.slots.itemContent?n.slots.itemContent:j}const b=M();function O(P,L,W){return t.createVNode("li",{class:g(P,L),id:v(P,L),key:v(P,L),onClick:F=>k(F,P,L),onMouseenter:F=>f(F,P,L),onMouseover:F=>u(F,P,L),onMouseout:F=>d(F,P,L),draggable:"true",onDragstart:F=>x(F,P,L),onDragenter:F=>I(F,L),onDragend:F=>w(F,P),onDragover:F=>y(F,L)},[h.value&&t.createVNode("div",{class:"f-list-select",onClick:F=>F.stopPropagation()},[t.createVNode(Q,{id:"list-"+v(P,L),disabled:P[r.value]||P.unClick,checked:P.checked,onChange:F=>p(P,L)},null)]),t.createVNode("div",{class:"f-list-content"},[b(P)]),t.createVNode("div",{class:"f-list-remove",onClick:F=>S(L)},[t.createVNode("div",{class:"f-list-remove-icon"},[t.createVNode("i",{class:"f-icon f-icon-remove_face"},null)])]),t.createVNode("div",{class:"f-list-handle"},[t.createVNode("div",null,[t.createVNode("i",{class:"f-icon f-icon-drag-vertical"},null)])])])}return{renderItem:O}}function Ie(e,n,a){function l(){return n.slots.header&&t.createVNode("div",{class:"f-list-view-header"},[n.slots.header()])}return{renderHeader:l}}function ce(e,n,a){const l=t.ref(e.headerClass),o=t.ref(e.placeholder),c=t.ref(""),i=t.computed(()=>!c.value),s=t.computed(()=>!!c.value);function h(d){c.value=""}t.watch(c,d=>{a.search(d)});const r=t.computed(()=>{const d={"form-group":!0,"farris-form-group":!0};return l.value&&l.value.split(" ").reduce((g,p)=>(g[p]=!0,g),d),d});function f(d){}function u(){return t.createVNode("div",{class:"f-list-view-header",onClick:t.withModifiers(f,["prevent","stop"])},[t.createVNode("div",{class:r.value},[t.createVNode("div",{class:"farris-input-wrap"},[t.createVNode("div",{class:"f-cmp-inputgroup"},[t.createVNode("div",{class:"input-group f-state-editable"},[t.withDirectives(t.createVNode("input",{class:"form-control f-utils-fill text-left","onUpdate:modelValue":d=>c.value=d,name:"input-group-value",type:"text",placeholder:o.value,autocomplete:"off"},null),[[t.vModelText,c.value]]),t.createVNode("div",{class:"input-group-append"},[s.value&&t.createVNode("span",{class:"input-group-text input-group-clear",onClick:d=>h()},[t.createVNode("i",{class:"f-icon f-icon-close-circle"},null)]),i.value&&t.createVNode("span",{class:"input-group-text"},[t.createVNode("span",{class:"f-icon f-icon-search"},null)])])])])])])])}return{renderHeader:u}}const St="";function ke(e,n){const a=t.ref(e.idField),l=t.ref(e.data),o=t.ref(e.data),c=t.ref(e.keepOrder);function i(){const r=l.value.map((f,u)=>typeof f!="object"?{__fv_index__:u,name:f}:(f.__fv_index__=u,f));return o.value=r,r}const s=t.ref(i());t.watch(()=>e.data,r=>{if(c.value){const f=r.reduce((g,p)=>(g.set(p.id,!0),g),new Map),u=l.value.reduce((g,p)=>(g.set(p.id,!0),g),new Map),d=s.value.filter(g=>f.has(g.id)),v=r.filter(g=>!u.has(g.id));l.value=[...d,...v]}else l.value=r;s.value=i()});function h(r){return r.map(u=>{const d=o.value.findIndex(v=>v[a.value]===u);return d>-1?o.value[d]:null}).filter(u=>u!=null)}return{dataView:s,getSelectionItems:h}}function Ve(e,n,a,l){const o=t.ref(e.idField),{dataView:c}=a,i=t.ref(-1),s=t.ref(!1),{activeIndex:h,focusedItemId:r,hoverIndex:f,resumeHover:u,suspendHover:d}=l;function v(x,I,y){x.stopPropagation(),d(),I&&setTimeout(()=>{i.value=y,s.value=!0,I.moving=!0})}function g(x,I){if(x.preventDefault(),i.value!==I){const y=c.value[i.value],w=c.value;w.splice(i.value,1),w.splice(I,0,y),i.value=I}}function p(x,I){x.preventDefault(),x.dataTransfer&&(x.dataTransfer.dropEffect="move")}function k(x,I){I&&(I.moving=!1),c.value.forEach((y,w)=>{y.__fv_index__=w}),s.value=!1,u(),f.value=I.__fv_index__,h.value=I.__fv_index__,r.value=I[o.value],n.emit("change",c.value)}return{dragstart:v,dragenter:g,dragover:p,dragend:k,isDragging:s}}function xe(e,n,a){const{dataView:l}=a;function o(c){if(c>-1&&c<l.value.length){const i=l.value.splice(c,1);n.emit("removeItem",i[0])}}return{removeItem:o}}function Ne(){const e=t.ref(-1),n=t.ref(""),a=t.ref(-1),l=t.ref(!1);function o(r,f,u){a.value=u}function c(r,f,u){l.value||(a.value=u)}function i(r,f,u){a.value=-1}function s(){l.value=!0}function h(){l.value=!1}return{activeIndex:e,focusedItemId:n,hoverIndex:a,onMouseenterItem:o,onMouseoverItem:c,onMouseoutItem:i,resumeHover:h,suspendHover:s}}const Pe=t.defineComponent({name:"FListView",props:ve,emits:["checkValuesChange","clickItem","selectionChange","removeItem","change"],setup(e,n){const a=t.ref(),l=t.ref(e.view),o=t.ref(e.header),c=t.ref(e.multiSelect),i=t.ref(e.view==="CardView"),s=t.ref(!0),h=t.ref({}),r=t.ref("暂无数据");t.ref(!0),t.ref(!1),t.ref("id");const f=ke(e),{dataView:u}=f,d=t.computed(()=>{const V={"f-list-view":!0,"f-list-view-multiple":c.value};return e.size!=="default"&&(V[`${e.size}-item`]=!0),V}),v=t.computed(()=>({"f-list-view-group":!0,"d-flex":i.value,"flex-wrap":i.value})),g=t.computed(()=>!!u.value&&u.value.length>0),p=Ne(),k=Ce(e,n,f),x=Ve(e,n,f,p),I=xe(e,n,f),y=be(e,n,x,p,k),w=we(e,a),S=t.computed(()=>u.value.length===0),B=t.computed(()=>S.value&&!n.slots.empty),j=t.computed(()=>!!n.slots.footer||s.value);function M(){return l.value==="SingleView"?ie:l.value==="DraggableView"?Be:l.value==="ContentView"&&n.slots.content?Se:ie}const b=M(),{renderItem:O}=b(e,n,f,x,p,y,k,I);function P(){return o.value==="SearchBar"?ce:o.value==="ContentHeader"?Ie:ce}const L=P(),{renderHeader:W}=L(e,n,w);function F(V){w.search(V)}n.expose({search:F});function N(V){c.value&&(V.preventDefault(),V.stopPropagation())}return()=>t.createVNode("div",{class:d.value,onClick:N},[W(),t.createVNode("div",{ref:a,class:"f-list-view-content"},[t.createVNode("ul",{class:v.value,style:"list-style: none;"},[g.value&&u.value.map((V,D)=>O(V,D,h)),B.value&&t.createVNode("div",{class:"f-list-view-emptydata"},[t.createVNode("p",{class:"f-empty-title"},[r.value])]),n.slots.empty&&n.slots.empty()])]),j.value&&t.createVNode("div",{class:"f-list-view-footer"},[n.slots.footer&&n.slots.footer()])])}}),Me=t.defineComponent({name:"FComboListContainer",props:ye,emits:["selectionChange"],setup(e,n){const a=t.ref(e.dataSource),l=t.ref([]),o=t.ref(e.separator),c=t.ref(e.selectedValues.split(o.value));t.watch(e.dataSource,()=>{a.value=e.dataSource});const i=t.computed(()=>e.enableSearch?"SearchBar":"ContentHeader");function s(h){l.value=h.map(r=>Object.assign({},r)),c.value=h.map(r=>r[e.idField]),n.emit("selectionChange",l.value)}return()=>t.createVNode("div",{class:"f-combo-list-container"},[t.createVNode(Pe,{size:"small",itemClass:"f-combo-list-item",header:i.value,headerClass:"f-combo-list-search-box",data:a.value,idField:e.idField,textField:e.textField,multiSelect:e.multiSelect,multiSelectMode:"OnCheckAndClick","selection-values":c.value,onSelectionChange:s},null)])}}),Fe=new Map([["appearance",oe]]),Oe={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/button-edit.schema.json",title:"button-edit",description:"A Farris Input Component",type:"object",properties:{id:{description:"The unique identifier for a Input Group",type:"string"},type:{description:"The type string of Input Group component",type:"string",default:"button-edit"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},disable:{type:"string",default:!1},editable:{description:"",type:"boolean",default:!0},enableLinkLabel:{description:"",type:"boolean",default:!1},label:{description:"",type:"string",default:""},lableWidth:{description:"",type:"number"},placeHolder:{description:"",type:"string",default:""},readonly:{description:"",type:"boolean",default:!1},require:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},textAlign:{description:"",type:"string",enum:["left","middle","right"],default:"left"},visible:{description:"",type:"boolean",default:!0},onBlur:{description:"",type:"string",default:""},onClickLinkLabel:{description:"",type:"sting",default:""},autoComplete:{description:"",type:"boolean",default:!1},buttonContent:{description:"",type:"string",default:""},enableClear:{description:"",type:"boolean",default:!0},inputType:{description:"",type:"string",enum:["text","tag"],default:"text"},multiSelect:{description:"",type:"boolean",default:!1},popup:{description:"",type:"object",properties:{footerButtons:{type:"array",default:[]},height:{type:"number",default:600},dataMapping:{type:"object"},contents:{type:"array",default:[]},showMaxButton:{type:"boolean",default:!0},showCloseButton:{type:"boolean",default:!0},showFooter:{type:"boolean",default:!0},title:{type:"string",default:""},width:{type:"number",default:800}}},separator:{type:"string",default:","},showButtonWhenDisabled:{description:"",type:"boolean",default:!1},wrapText:{type:"boolean",default:!1},onClear:{description:"",type:"string",default:""}},required:["id","type"]},re={id:String,buttonContent:{type:String,default:'<i class="f-icon f-icon-lookup"></i>'},buttonBehavior:{type:String,default:"Popup"},autoComplete:{type:Boolean,default:!1},customClass:{type:String,default:""},disable:{type:Boolean,default:!1},editable:{type:Boolean,default:!0},enableClear:{type:Boolean,default:!1},modelValue:{type:String,default:""},readonly:{type:Boolean,default:!1},textAlign:{type:String,default:"left"},showButtonWhenDisabled:{type:Boolean,default:!1},enableTitle:{type:Boolean,default:!1},inputType:{type:String,default:"text"},forcePlaceholder:{type:Boolean,default:!1},placeholder:{type:String,default:""},minLength:Number,maxLength:Number,tabIndex:Number,popupHost:{type:Object},popupRightBoundary:{type:Object},popupOffsetX:{type:Object},popupOnInput:{type:Boolean,default:!1},popupOnFocus:{type:Boolean,default:!1},popupMinWidth:{type:Number,default:320},wrapText:{type:Boolean,default:!1},multiSelect:{type:Boolean,default:!1},separator:{type:String,default:","}};ne(re,Oe,Fe);const Le={popupContentPosition:{type:Object,default:{left:0,top:0}},host:{type:Object}},De=t.defineComponent({name:"FOverlay",props:Le,emits:["click"],setup(e,n){const a=t.ref(e.popupContentPosition),l=t.ref(e.host);function o(s){n.emit("click"),s.preventDefault(),s.stopPropagation()}const c=t.computed(()=>{const s=l.value;if(s){const h=s.getBoundingClientRect(),{left:r,top:f,height:u}=h;return{left:r,top:f+u}}return a.value}),i=t.computed(()=>({position:"relative",left:`${c.value.left}px`,top:`${c.value.top}px`}));return()=>t.createVNode(t.Teleport,{to:"body"},{default:()=>{var s,h;return[t.createVNode("div",{class:"overlay-container",style:"pointer-events: auto;",onClick:r=>o(r)},[t.createVNode("div",{style:i.value},[(h=(s=n.slots).default)==null?void 0:h.call(s)])])]}})}});function je(e){if(e.content&&e.content.render)return e.content.render;if(e.render&&typeof e.render=="function")return e.render}function Re(e){const n=document.createElement("div");n.style.display="contents";let a;const l=e.onClickCallback||(()=>{}),o=()=>{l(),a&&a.unmount()};return a=t.createApp({setup(){t.onUnmounted(()=>{document.body.removeChild(n)});const c=je(e);return()=>t.createVNode(De,{"popup-content-position":e.popupPosition,host:e.host,onClick:o},{default:()=>[c&&c()]})}}),document.body.appendChild(n),a.mount(n),a}class Ae{static show(n){return Re(n)}}function Ee(e,n,a,l){const o=t.ref(e.buttonBehavior),c=t.ref(e.popupOnInput),i=t.computed(()=>({"input-group-append":!0,"append-force-show":e.showButtonWhenDisabled&&(e.readonly||e.disable)})),s=t.computed(()=>e.showButtonWhenDisabled||(!e.editable||!e.readonly)&&!e.disable);async function h(d){if(s.value){const v=!!n.slots.default;o.value==="Overlay"&&Ae.show({host:a.value,render:()=>{if(n.slots.default)return n.slots.default()}}),v&&o.value==="Popup"&&l.togglePopup(),v&&c.value&&l.hidePopup(),n.emit("clickButton",{origin:d,value:e.modelValue})}d.stopPropagation()}function r(d){n.emit("mouseEnterIcon",d)}function f(d){n.emit("mouseLeaveIcon",d)}function u(){n.emit("mouseOverButton")}return{buttonClass:i,onClickButton:h,onMouseEnterButton:r,onMouseLeaveButton:f,onMouseOverButton:u}}function $e(e,n,a,l,o,c){const i=t.ref(!1),s=t.computed(()=>e.enableClear&&!e.readonly&&!e.disable),{changeTextBoxValue:h}=c;function r(v){i.value=v}t.watch(o,()=>{l.value?r(!!o.value):r(!1)});function f(v){const g=!e.readonly&&!e.disable&&e.editable,p=!e.editable;v.stopPropagation(),(g||p)&&(h("",!1),r(!i.value),n.emit("clear"))}function u(v){if(s.value){if(!a.value){r(!1);return}(!e.editable||!e.readonly)&&!e.disable&&r(!0)}}function d(v){s.value&&r(!1)}return{enableClearButton:s,showClearButton:i,onClearValue:f,onMouseEnterTextBox:u,onMouseLeaveTextBox:d}}function He(e,n,a,l,o){const c=t.ref(e.popupOnInput),i=t.ref(e.popupOnFocus),{shouldPopupContent:s}=o,h=t.computed(()=>e.enableTitle?a.value:""),r=t.computed(()=>(e.disable||e.readonly)&&!e.forcePlaceholder?"":e.placeholder),f=t.computed(()=>e.readonly||!e.editable);let u=!1;const d=t.computed(()=>!e.disable&&u),v=t.computed(()=>({"text-left":e.textAlign==="left","text-center":e.textAlign==="center","text-right":e.textAlign==="right","form-control":!0,"f-utils-fill":!0})),g=t.computed(()=>({"input-group":!0,"f-state-disable":e.disable,"f-state-editable":e.editable&&!e.disable&&!e.readonly,"f-state-readonly":e.readonly&&!e.disable,"f-state-focus":d.value}));function p(b,O=!0){a.value!==b&&(a.value=b,O&&n.emit("change",b),n.emit("update:modelValue",b))}function k(b){s.value=!1,p(b,!0)}t.watch(()=>e.modelValue,b=>{a.value=b,n.emit("change",b)});function x(b){u=!1,n.emit("blur",b),b.stopPropagation()}function I(b){n.emit("click",b)}function y(b){if(e.disable){u=!0;return}u=!0,f.value||(n.emit("focus",b),i.value&&!s.value&&o.popup())}function w(b){n.emit("input",b.target.value);const O=b.target.value;l.value=O,a.value!==O&&p(O,!1),c.value&&!s.value&&o.popup()}function S(b){b.target.tagName!=="INPUT"&&b.preventDefault(),b.stopPropagation()}function B(b){n.emit("keydown",b)}function j(b){b.key==="Enter"&&(c.value||i.value)&&o.hidePopup(),n.emit("keyup",b)}function M(b){const O=b.target.value;b.stopPropagation(),p(O)}return{hasFocusedTextBox:d,isTextBoxReadonly:f,textBoxClass:v,textBoxPlaceholder:r,textBoxTitle:h,inputGroupClass:g,changeTextBoxValue:p,commitValue:k,onBlurTextBox:x,onClickTextBox:I,onFocusTextBox:y,onInput:w,onKeyDownTextBox:B,onKeyUpTextBox:j,onMouseDownTextBox:S,onTextBoxValueChange:M}}function We(e,n,a){const l=t.ref(),o=t.ref(!1);function c(){const r=l.value;r&&r.show(a.value)}async function i(){!!n.slots.default&&(o.value=!o.value,await t.nextTick(),c())}async function s(){!!n.slots.default&&(o.value=!0,await t.nextTick(),c())}function h(){o.value=!1}return{hidePopup:h,popup:s,shouldPopupContent:o,togglePopup:i,popoverRef:l}}function _e(e,n,a){const{isTextBoxReadonly:l,textBoxClass:o,textBoxPlaceholder:c,textBoxTitle:i,onBlurTextBox:s,onClickTextBox:h,onFocusTextBox:r,onInput:f,onKeyDownTextBox:u,onKeyUpTextBox:d,onMouseDownTextBox:v,onTextBoxValueChange:g}=a;return()=>t.createVNode("input",{name:"input-group-value",autocomplete:e.autoComplete?"on":"off",class:o.value,disabled:e.disable,maxlength:e.maxLength,minlength:e.minLength,placeholder:c.value,readonly:l.value,tabindex:e.tabIndex,title:i.value,type:e.inputType,value:n.value,onBlur:s,onChange:g,onClick:h,onFocus:r,onInput:f,onKeydown:u,onKeyup:d,onMousedown:v},null)}const ze={activeTag:{Type:String,default:""},addButtonText:{Type:String,default:""},customClass:{Type:String,default:""},customStyle:{Type:String,default:""},data:{type:Array,default:[]},enableAddButton:{Type:Boolean,default:!1},placeholder:{Type:String,default:""},selectable:{Type:Boolean,default:!1},showAddButton:{Type:Boolean,default:!1},showClose:{Type:Boolean,default:!1},showColor:{Type:Boolean,default:!1},showInput:{Type:Boolean,default:!1},tagType:{Type:String,default:""},tagStyle:{Type:String,default:""},wrapText:{Type:Boolean,default:!1},draggable:{Type:Boolean,default:!1}},Mt="";function qe(e,n,a,l){const o=t.ref(-1),c=t.ref(!1);function i(f,u,d){f.stopPropagation(),u&&setTimeout(()=>{o.value=d,c.value=!0,u.moving=!0})}function s(f,u){if(f.preventDefault(),o.value!==u){const d=l.value[o.value],v=l.value;v.splice(o.value,1),v.splice(u,0,d),o.value=u}}function h(f,u){f.preventDefault(),f.dataTransfer&&(f.dataTransfer.dropEffect="move")}function r(f,u){u&&(u.moving=!1),a.value=l.value.filter(d=>d.type==="Tag").map(d=>d.payload),c.value=!1,n.emit("change",a.value)}return{dragstart:i,dragenter:s,dragover:h,dragend:r,isDragging:c}}const Xe=t.defineComponent({name:"FTags",props:ze,emits:["remove","selectionChange","change"],setup(e,n){const a=t.ref(e.selectable),l=t.ref(e.customClass),o=t.ref(e.data),c=t.ref(e.tagType),i=t.ref(e.tagStyle),s=t.ref(e.showColor),h=t.ref(e.activeTag),r=t.ref(e.customStyle),f=t.ref(e.showClose),u=t.ref(e.showAddButton),d=t.ref(e.showInput),v=t.ref(e.addButtonText),g=t.ref(e.enableAddButton);t.ref(e.placeholder),t.ref(""),t.ref();const p=t.ref(),k=t.ref(e.wrapText),x=t.ref();function I(){const m=o.value.map(C=>({type:"Tag",payload:C}));return u.value&&m.push({type:"AddButton"}),m}const y=t.ref(I());function w(m){o.value=m,y.value=I()}const S=t.computed(()=>y.value.findIndex(m=>m.type==="Input")),B=qe(e,n,o,y),{dragstart:j,dragenter:M,dragover:b,dragend:O}=B;t.watch(()=>e.data,m=>w(m));const P=t.computed(()=>{const m={"farris-tags":!0,"farris-tags-checkable":a.value,"farris-tags-nowrap":!k.value};return l.value.split(" ").reduce((C,T)=>(C[T]=!0,C),m),m});function L(m){const C={"farris-tag-item":!0,"farris-tag-item-checked":a.value&&m.checked,"farris-tag-item-checkable":a.value,"farris-tag-item-has-color":s.value,"farris-tag-item-actived":h.value===m.name};if(c.value){const T=`farris-tag-item-${c.value}`;C[T]=!0}return C}const W=t.computed(()=>{const m={};return r.value&&r.value.split(";").reduce((C,T)=>{const R=T.split(":");return C[R[0]]=R[1],C},m),m});function F(m,C){a.value&&C.selectable&&(C.checked=!C.checked,h.value=C.checked?C.name:"",C.checked&&o.value.filter(T=>T.name!==C.name).forEach(T=>{T.checked=!C.checked}),n.emit("change",o.value),n.emit("selectionChange",C))}function N(m,C){let T;switch(m.key){case"Backspace":o.value=o.value.filter(R=>R.name!==C.name),n.emit("change",o.value);break;case"ArrowLeft":T=Math.max(p.value.scrollLeft+20,0),p.value.scrollLeft=T;break;case"ArrowRight":T=Math.max(p.value.scrollLeft-20,0),p.value.scrollLeft=T}}function V(m,C){const T=o.value.findIndex(R=>R.name===C.name);if(T>-1){const[R]=o.value.splice(T,1);y.value=I(),n.emit("change",o.value),n.emit("remove",o.value,R,T)}m.stopPropagation()}const D=t.computed(()=>({"farris-tag-item":!0,"farris-tag-add-button":!0,"farris-tag-add-button-disabled":!g.value}));function $(m){}function E(){return t.createVNode("li",{class:D.value,onClick:m=>void 0},[t.createVNode("span",{class:"f-icon f-icon-amplification"},null),t.createVNode("span",{class:"farris-tag-add-text"},[v.value])])}function H(m){if(m&&!m.innerText){const C=S.value;if(C>0){const[T]=o.value.splice(C-1,1);y.value.splice(C-1,1),n.emit("remove",o.value,T,C-1)}}}function q(m,C,T){m>-1&&(o.value.splice(m,0,{name:C,value:T,selectable:a.value}),y.value=I(),n.emit("change",o.value))}function U(m){if(m&&m.innerText){const C=m.innerText,T=S.value;q(T,C,C),m.innerText=""}}function Y(m){const C=m.target;C&&(C.innerText?U(C):n.emit("change",o.value))}function it(m){m.key==="Enter"&&U(m.target),m.key==="Backspace"&&(H(m.target),t.nextTick(()=>{x.value&&x.value.focus()}))}function ct(){return t.createVNode("li",{class:"farris-tag-input-box"},[t.createVNode("div",{ref:x,class:"form-control",contenteditable:"true",onKeyup:it,onBlur:Y},null)])}function rt(m,C){return t.createVNode("li",{class:L(m),style:W.value,tabindex:0,id:m.name,key:m.name,onClick:T=>F(T,m),onKeydown:T=>N(T,m),draggable:"true",onDragstart:T=>j(T,m,C),onDragenter:T=>M(T,C),onDragend:T=>O(T,m),onDragover:T=>b(T,C)},[t.createVNode("div",{title:m.name,class:"tag-box"},[m.name]),f.value&&t.createVNode("span",{class:"tag-delete"},[t.createVNode("i",{class:"f-icon f-icon-close",onClick:T=>V(T,m)},null)])])}function st(){return y.value.map((m,C)=>{switch(m.type){case"Tag":return rt(m.payload,C);case"AddButton":return E();case"Input":return ct()}})}const ut=t.computed(()=>({"farris-tags-item-container":!0,"farris-tag-item-capsule":i.value==="capsule"}));function dt(m){const C=Math.max(p.value.scrollLeft-m.deltaX,0);p.value.scrollLeft=C}function ft(m){const C=p.value,T=o.value.length-1;if(C){const R=Array.from(C.children).filter(_=>_.className.indexOf("farris-tag-item")>-1).findIndex(_=>{const z=_.getBoundingClientRect(),Z=window.getComputedStyle(_),ue=parseInt(Z["margin-left"],10)+z.width+parseInt(Z["margin-right"],10);return z.left+ue>m});if(R>-1)return R}return T}function pt(m){if(d.value){const T=ft(m.clientX)+1,_=y.value.filter(z=>z.type!=="Input");_.splice(T,0,{type:"Input"}),y.value=_,t.nextTick(()=>{x.value&&x.value.focus()})}}function mt(m){var T;m.preventDefault(),m.stopPropagation();const C=(T=m.dataTransfer)==null?void 0:T.getData("Text");if(C){const R=C.split(":"),_=R[0],z=R[1];[...o.value].findIndex(ee=>(console.log(`${ee.value} === ${z} is ${ee.value===z}`),ee.value===z))>-1||q(o.value.length,_,z)}}function gt(m){m.preventDefault()}return()=>t.createVNode("div",{class:P.value,onClick:pt,onDrop:mt,onDragover:gt},[t.createVNode("ul",{ref:p,class:ut.value,onWheel:m=>dt(m)},[st()])])}});function Ge(e,n,a){const l=t.ref(e.separator),{changeTextBoxValue:o}=a,c=t.computed(()=>n.value?n.value.split(l.value).map(s=>({name:s,selectable:!0})):[]);function i(s){o(s.map(h=>h.name).join(l.value),!0)}return()=>t.createVNode(Xe,{class:"form-control",data:c.value,showClose:!0,showInput:!0,onChange:i},null)}function Ue(e,n,a){const{buttonClass:l,onClickButton:o,onMouseEnterButton:c,onMouseLeaveButton:i}=n,{enableClearButton:s,showClearButton:h,onClearValue:r}=a;return()=>t.createVNode("div",{class:l.value},[s.value&&t.withDirectives(t.createVNode("span",{class:"input-group-text input-group-clear",onClick:r},[t.createVNode("i",{class:"f-icon modal_close"},null)]),[[t.vShow,h.value]]),e.buttonContent&&t.createVNode("span",{class:"input-group-text input-group-append-button",innerHTML:e.buttonContent,onClick:o,onMouseenter:c,onMouseleave:i},null)])}const Ke={title:{type:String},placement:{type:String,default:"bottom"},reference:{type:Object},host:{type:Object},leftBoundary:{type:Object},rightBoundary:{type:Object},visible:{type:Boolean,default:!1},class:{type:String},offsetX:{type:Object,default:t.ref(0)},zIndex:{type:Number,default:-1},keepWidthWithReference:{type:Boolean,default:!1},fitContent:{type:Boolean,default:!1},minWidth:{type:Number,default:-1}},Ft="";function Je(e){const n=e.host?e.host:"body",a=t.computed(()=>n==="body"?0:n?n.getBoundingClientRect().top:0),l=t.computed(()=>n==="body"?0:n?n.getBoundingClientRect().left:0),o=t.computed(()=>n==="body"?document.body.getBoundingClientRect().width:n?n.getBoundingClientRect().width-(e.rightBoundary?e.rightBoundary.getBoundingClientRect().width:0):document.body.getBoundingClientRect().width);return{host:n,hostLeft:l,hostTop:a,hostWidth:o}}function Qe(e,n,a,l){var F;const o=t.ref(0),c=t.ref(((F=e.offsetX)==null?void 0:F.value)||0),i=t.ref(-1),s=t.ref(-1),h=t.ref(-1),r=t.ref(e.placement),f=t.ref(0),u=t.ref(0),d=t.ref(0),v=t.ref(document.documentElement.scrollLeft),g=t.ref(document.documentElement.scrollTop),{hostLeft:p,hostTop:k,hostWidth:x}=l;t.watch(e.offsetX,N=>{o.value=N-c.value});const I=t.computed(()=>{const N={left:`${u.value}px`,top:`${d.value}px`,transform:`translateX(${o.value}px)`};return e.zIndex!==-1&&(N["z-index"]=e.zIndex),i.value!==-1&&(N.width=`${i.value}px`),N}),y=t.computed(()=>({left:`${f.value}px`}));function w(N){if(N&&e.keepWidthWithReference){const V=N.getBoundingClientRect();i.value=Math.max(e.minWidth,V.width)}}function S(N,V){const D=x.value-N.width-4;return D>0?D:V}function B(N,V,D){const $=f.value,E=V.left-p.value+V.width/2+v.value,H=V.top-k.value-(N.height+D.height)+g.value;return{popoverLeft:E,popoverTop:H,arrowLeft:$}}function j(N,V,D){return V.top-k.value+(V.height+D.height)+g.value}function M(N,V){const D=S(V,N),$=N<=D?f.value:N-D;return{popoverLeft:Math.min(N,D),arrowLeft:$}}function b(N,V,D){const $=V.left-p.value+V.width/2-(D.width/2-(N.left-p.value))+v.value,{arrowLeft:E,popoverLeft:H}=M($,N),q=j(N,V,D);return{popoverLeft:H,popoverTop:q,arrowLeft:E}}function O(N,V,D){const $=V.left-p.value+v.value,{arrowLeft:E,popoverLeft:H}=M($,N),q=j(N,V,D);return{popoverLeft:H,popoverTop:q,arrowLeft:E}}const P=new Map([["top",B],["bottom",b],["bottom-left",O]]);function L(N){var H;const V=N.getBoundingClientRect();s.value=V.top,h.value=V.left;const D=n.value.getBoundingClientRect(),$=(H=a.value)==null?void 0:H.getBoundingClientRect(),E=P.get(r.value);if(E){const{arrowLeft:q,popoverLeft:U,popoverTop:Y}=E($,V,D);f.value=q,u.value=U,d.value=Y}e.keepWidthWithReference&&w(N)}function W(N){if(N){const V=N.getBoundingClientRect();(V.left!==h.value||V.top!==s.value)&&L(N)}}return{arrowStyle:y,popoverStyle:I,position:r,popoverWidth:i,fitToReference:w,followToReferencePosition:W,locateToReference:L}}function Ye(e,n,a,l,o,c,i){const s=t.ref(e.visible),h=t.computed(()=>s.value),{fitToReference:r,locateToReference:f}=i;let u;function d(){s.value=!1,document.body.removeEventListener("click",u),n.emit("hidden")}u=g=>{if(!o.value.contains(g.target)){const p=o.value.closest(".popover");p&&p.removeEventListener("click",u),d()}};async function v(g){if(l.value&&a.value&&g){s.value=!0,o.value=g,await t.nextTick(),f(g),c.value&&r(g),document.body.addEventListener("click",u);const p=g.closest(".popover");p&&p.addEventListener("click",u),n.emit("shown")}}return n.expose({hide:d,show:v,shown:h}),{showPopover:s,hidePopverOnClickBodyHandler:u}}function Ze(e,n,a,l,o){const{popoverWidth:c,fitToReference:i,followToReferencePosition:s}=o;function h(){if(a.value){s(a.value);const r=a.value.getBoundingClientRect();l.value&&r.width!==c.value&&i(a.value)}}return{onResize:h}}const et=t.defineComponent({name:"FPopover",props:Ke,emits:["shown","hidden"],setup(e,n){const a=t.ref(),l=t.ref(),o=t.ref(e.reference),c=t.ref(e.keepWidthWithReference),i=t.computed(()=>!!e.title),s=Je(e),{host:h}=s,r=Qe(e,a,l,s),{position:f,arrowStyle:u,popoverStyle:d,fitToReference:v,locateToReference:g}=r,{showPopover:p,hidePopverOnClickBodyHandler:k}=Ye(e,n,a,l,o,c,r),{onResize:x}=Ze(e,n,o,c,r),I=t.computed(()=>{const w=`popover in popover-${f.value}`,S=`bs-popover-${f.value}`,B={"popover-fitcontent":e.fitContent};return B[w]=!0,B[S]=!0,(e.class||"").split(" ").reduce((M,b)=>(M[b]=!0,M),B),B}),y=t.computed(()=>({"popover-content":!0,"popover-body":!0}));return t.onMounted(()=>{e.reference&&g(o.value),c.value&&v(o.value),window.addEventListener("resize",x)}),t.onUnmounted(()=>{document.body.removeEventListener("click",k),window.removeEventListener("resize",x)}),()=>t.createVNode(t.Teleport,{to:h},{default:()=>{var w;return[t.withDirectives(t.createVNode("div",{ref:l,class:I.value,style:d.value,onClick:S=>{S.stopPropagation()}},[t.createVNode("div",{ref:a,class:"popover-arrow arrow",style:u.value},null),i.value&&t.createVNode("h3",{class:"popover-title popover-header"},[e.title]),t.createVNode("div",{class:y.value},[n.slots.default&&((w=n.slots)==null?void 0:w.default())])]),[[t.vShow,p.value]])]}})}});function tt(e,n,a){const l=t.ref(e.popupMinWidth),{hidePopup:o,popoverRef:c}=a;return()=>t.createVNode(et,{ref:c,visible:!0,placement:"bottom-left",host:e.popupHost,"keep-width-with-reference":!0,fitContent:!0,"right-boundary":e.popupRightBoundary,minWidth:l.value,offsetX:e.popupOffsetX,onHidden:o},{default:()=>{var i,s;return[(s=(i=n.slots).default)==null?void 0:s.call(i)]}})}const Ot="",se=t.defineComponent({name:"FButtonEdit",props:re,emits:["updateExtendInfo","clear","change","click","clickButton","blur","focus","mouseEnterIcon","mouseLeaveIcon","keyup","keydown","inputClick","input","update:modelValue"],setup(e,n){const a=t.ref(),l=t.ref(e.customClass),o=t.ref(e.modelValue),c=We(e,n,a),{shouldPopupContent:i,hidePopup:s}=c,h=Ee(e,n,a,c),r=t.ref(""),f=He(e,n,o,r,c),{hasFocusedTextBox:u,commitValue:d,inputGroupClass:v}=f,g=$e(e,n,o,u,r,f),{onMouseEnterTextBox:p,onMouseLeaveTextBox:k}=g,x=t.computed(()=>{const j={"f-button-edit":!0,"f-cmp-inputgroup":!0,"f-button-edit-nowrap":!e.wrapText};return l.value&&l.value.split(" ").reduce((M,b)=>(M[b]=!0,M),j),j});function I(){return e.multiSelect&&e.inputType==="tag"?Ge(e,o,f):_e(e,o,f)}let y=I();t.watch([()=>e.multiSelect,()=>e.inputType],()=>{y=I()});const w=Ue(e,h,g),S=tt(e,n,c),B={commitValue:d,elementRef:a,hidePopup:s};return t.onMounted(()=>{a.value.componentInstance=B}),n.expose(B),()=>t.createVNode(t.Fragment,null,[t.createVNode("div",t.mergeProps(n.attrs,{ref:a,class:x.value,id:e.id}),[t.createVNode("div",{class:v.value,onMouseenter:p,onMouseleave:k},[y(),w()])]),i.value&&S()])}}),Lt="";function nt(e){const n=t.ref(""),a=t.ref(e.modelValue),l=t.ref(e.data||[]),o=t.ref(e.editable);function c(r){const f=r.split(e.separator).map(d=>[d,!0]),u=new Map(f);return l.value.filter(d=>u.has(d[e.valueField]))}function i(r){const f=c(r).map(u=>u[e.textField]).join(e.separator);n.value=o.value?f||r:f}function s(r){const f=r.split(e.separator).map(d=>[d,!0]),u=new Map(f);return l.value.filter(d=>u.has(d[e.textField]))}function h(){const{url:r,method:f="GET",headers:u={},body:d=null}=e.remote;fetch(r,{method:f,headers:u,body:d}).then(g=>{if(g.status===200)return g.json();throw new Error(g.statusText)}).then(g=>{l.value=g}).catch(g=>{console.error(g)})}return e.remote&&h(),t.watch(()=>e.data,()=>{l.value=e.data}),t.watch([l],([r])=>{if(e.modelValue){const f=r.find(u=>u[e.valueField]===e.modelValue);f&&(n.value=f[e.textField])}}),t.watch(()=>e.modelValue,r=>{a.value=r,i(r)}),i(e.modelValue),{dataSource:l,displayText:n,editable:o,modelValue:a,getItemsByDisplayText:s,getItemsByValue:c}}const G=t.defineComponent({name:"FComboList",props:X,emits:["clear","update:modelValue","change"],setup(e,n){const a=t.ref(),{dataSource:l,displayText:o,editable:c,modelValue:i,getItemsByDisplayText:s}=nt(e),h=t.computed(()=>e.multiSelect);function r(){!h.value&&a.value&&a.value.hidePopup()}function f(p){o.value=p.map(k=>k[e.textField]).join(e.separator),i.value=p.map(k=>k[e.valueField]).join(e.separator),n.emit("update:modelValue",i.value),n.emit("change",p),r()}function u(p){i.value="",n.emit("update:modelValue",""),n.emit("clear")}function d(p){i.value=p,n.emit("update:modelValue",i.value);const k={};k[e.idField]=p,k[e.textField]=p,n.emit("change",[k])}function v(p){if(c.value){d(p);return}const k=s(p);f(k)}function g(){return o.value}return n.expose({getDisplayText:g}),()=>t.createVNode(se,{ref:a,id:e.id,disable:e.disabled,readonly:e.readonly,forcePlaceholder:e.forcePlaceholder,editable:c.value,buttonContent:e.dropDownIcon,placeholder:e.placeholder,enableClear:e.enableClear,maxLength:e.maxLength,tabIndex:e.tabIndex,enableTitle:e.enableTitle,multiSelect:e.multiSelect,inputType:e.multiSelect?"tag":"text",modelValue:o.value,"onUpdate:modelValue":p=>o.value=p,onClear:u,onChange:v},{default:()=>[t.createVNode(Me,{idField:e.idField,valueField:e.valueField,textField:e.textField,dataSource:l.value,selectedValues:i.value,multiSelect:e.multiSelect,enableSearch:e.enableSearch,onSelectionChange:f},null)]})}});function ot(e,n,a){var I;const l=a==null?void 0:a.checkIsInFixedContextRules(),o=a&&a.getStyles&&a.getStyles()||"";function c(){return!(n.schema.componentType||l)}function i(){return!1}function s(){return!(n.schema.componentType||l)}function h(){return!!l}function r(y){if(!y)return null;if(y.schema.type==="Component")return y;const w=r(y.parent);return w||null}function f(y,w,S){return!!a&&a.canAccepts()}function u(){return n.schema.label||n.schema.title||n.schema.name}function d(){}function v(y,w){w&&(a==null||a.onAcceptMovedChildElement(w))}function g(y,w){const S=String(y.getAttribute("data-controltype"));return de(S)}function p(y){return y.contents?y.contents.length:-1}function k(y){}const x={canMove:c(),canSelectParent:i(),canDelete:s(),canNested:!h(),contents:n.schema.contents,elementRef:e,parent:(I=n.parent)==null?void 0:I.componentInstance.value,schema:n.schema,styles:o,canAccepts:f,getBelongedComponentInstance:r,getDraggingDisplayText:u,getDragScopeElement:d,onAcceptMovedChildElement:v,onAcceptNewChildElement:g,onAddNewChildElement:p,onChildElementMovedOut:k,triggerBelongedComponentToMoveWhenMoved:!!a&&a.triggerBelongedComponentToMoveWhenMoved};return t.ref(x)}const at=t.defineComponent({name:"FComboListDesign",props:X,emits:["clear","update:modelValue","change"],setup(e,n){const a=t.ref(),l=t.inject("design-item-context"),o=ot(a,l);return t.onMounted(()=>{a.value.componentInstance=o}),n.expose(o.value),()=>t.createVNode(se,{ref:a,id:e.id,disable:e.disabled,readonly:e.readonly,forcePlaceholder:e.forcePlaceholder,editable:e.editable,buttonContent:e.dropDownIcon,placeholder:e.placeholder,enableClear:e.enableClear,maxLength:e.maxLength,tabIndex:e.tabIndex,enableTitle:e.enableTitle,multiSelect:e.multiSelect,inputType:e.multiSelect?"tag":"text"},null)}}),lt={install(e){e.component(G.name,G)},register(e,n){e["combo-list"]=G,n["combo-list"]=J},registerDesigner(e,n){e["combo-list"]=at,n["combo-list"]=J}};A.FComboList=G,A.Placement=le,A.ViewType=ae,A.comboListProps=X,A.default=lt,A.propsResolver=J,Object.defineProperties(A,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(A,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(A=typeof globalThis<"u"?globalThis:A||self,t(A["combo-list"]={},A.Vue))})(this,function(A,t){"use strict";const te={};function K(e){const{properties:n}=e;return Object.keys(n).reduce((l,o)=>(l[o]=n[o].type==="object"&&n[o].properties?K(n[o]):n[o].default,l),{})}function de(e){const n=te[e];return n?K(n):null}function fe(e,n){const a=K(n);return Object.keys(e).reduce((l,o)=>(l[o]=e[o],l),a),a}function pe(e,n){return Object.keys(e).filter(l=>e[l]!=null).reduce((l,o)=>{if(n.has(o)){const c=n.get(o);if(typeof c=="string")l[c]=e[o];else{const i=c(o,e[o]);Object.assign(l,i)}}else l[o]=e[o];return l},{})}function me(e,n,a=new Map){const l=fe(e,n);return pe(l,a)}function ne(e,n,a=new Map){return te[n.title]=n,l=>{const o=me(l,n,a),c=Object.keys(e).reduce((i,s)=>(i[s]=e[s].default,i),{});return Object.assign(c,o)}}function oe(e,n){return{customClass:n.class}}const ge=new Map([["appearance",oe]]),he={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/combo-list.schema.json",title:"combo-list",description:"A Farris Input Component",type:"object",properties:{id:{description:"The unique identifier for a combo list",type:"string"},type:{description:"The type string of number combo list component",type:"string",default:"combo-list"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},editable:{description:"",type:"boolean",default:!0},enableLinkLabel:{description:"",type:"boolean",default:!1},label:{description:"",type:"string",default:""},lableWidth:{description:"",type:"number"},placeHolder:{description:"",type:"string",default:""},readonly:{description:"",type:"boolean",default:!1},required:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},textAlign:{description:"",type:"string",enum:["left","middle","right"],default:"left"},visible:{description:"",type:"boolean",default:!0},onBlur:{description:"",type:"string",default:""},onClickLinkLabel:{description:"",type:"sting",default:""}},required:["id","type"]};var ae=(e=>(e.Text="text",e.Tag="tag",e))(ae||{}),le=(e=>(e.top="top",e.bottom="bottom",e.auto="auto",e))(le||{});const X={id:{type:String},data:{type:Array,default:[]},displayText:{type:String,default:""},disabled:{default:!1,type:Boolean},dropDownIcon:{type:String,default:'<span class="f-icon f-icon-arrow-60-down"></span>'},editable:{default:!1,type:Boolean},enableClear:{default:!0,type:Boolean},enableSearch:{type:Boolean,default:!1},enableTitle:{default:!0,type:Boolean},forcePlaceholder:{default:!1,type:Boolean},hidePanelOnClear:{default:!0,type:Boolean},idField:{default:"id",type:String},mapFields:{type:Object},maxHeight:{default:350,type:Number},maxLength:{type:Number},multiSelect:{default:!1,type:Boolean},modelValue:{type:String,default:""},placeholder:{type:String},placement:{type:String,default:"auto"},readonly:{default:!1,type:Boolean},remote:{default:null,type:Object},remoteSearch:{default:!1,type:Boolean},separator:{default:",",type:String},tabIndex:{type:Number,default:-1},textField:{default:"name",type:String},valueField:{default:"id",type:String},viewType:{default:"text",type:String}},J=ne(X,he,ge),ye={dataSource:{type:Array,default:[]},enableSearch:{type:Boolean,default:!1},idField:{type:String,default:"id"},multiSelect:{default:!1,type:Boolean},selectedValues:{type:String,default:""},separator:{type:String,default:","},textField:{type:String,default:"name"},width:{type:Number,default:300},valueField:{type:String,default:"id"}},ve={data:{type:Array,default:[]},draggable:{type:Boolean,default:!1},multiSelect:{Type:Boolean,default:!1},multiSelectMode:{Type:String,default:"OnCheck"},idField:{Type:String,default:"id"},valueField:{Type:String,default:"id"},textField:{Type:String,default:"name"},view:{Type:String,default:"ContentView"},size:{Type:String,default:"default"},placeholder:{type:String,default:""},header:{Type:String,default:"ContentHeader"},headerClass:{Type:String,default:""},itemClass:{Type:String,default:""},selectionValues:{type:Array,default:[]},keepOrder:{type:Boolean,default:!1},disableField:{type:String,default:"disabled"}};function be(e,n,a,l,o){const c=t.ref(e.idField),i=t.ref(e.disableField),s=t.ref(e.draggable),h=t.ref(e.itemClass),r=t.ref(e.multiSelect),u=t.ref(e.multiSelectMode);t.ref(!0);const{isDragging:d}=a,{activeIndex:f,focusedItemId:b,hoverIndex:g}=l,{clearSelection:y,selectedItems:N,toggleSelectItem:k}=o;function I(C,O){const P={"f-list-view-group-item":!0,"f-list-view-draggable-item":s.value,"f-un-click":!!C.unClick,"f-un-select":!!C[i.value],"f-listview-active":C.__fv_index__===f.value,"f-listview-hover":!d.value&&O===g.value,moving:!!C.moving};return h.value.split(" ").reduce((W,F)=>(W[F]=!0,W),P),P}function p(C,O){return C[c.value]||""}const v=t.computed(()=>!r.value);function S(C,O){C.unClick||C[i.value]||(v.value&&(b.value=C[c.value]),k(C,O))}const B=t.computed(()=>r.value&&u.value==="OnCheckClearByClick"),j=t.computed(()=>!r.value||r.value&&(u.value==="OnCheckAndClick"||u.value==="OnClick"));function M(C,O,P){if(O.unClick||O[i.value]){C.preventDefault(),C.stopPropagation();return}b.value=O[c.value],f.value=P,B.value&&y(),j.value&&k(O,P),n.emit("clickItem",{data:N.value,index:P})}return{getKey:p,listViewItemClass:I,onCheckItem:S,onClickItem:M}}function Ce(e,n,a){const l=t.ref(e.idField),o=t.ref(e.multiSelect);t.ref(e.multiSelectMode);const{getSelectionItems:c}=a,i=t.ref(c(e.selectionValues));t.watch(()=>e.selectionValues,f=>{i.value=t.ref(c(f)).value});const s=t.computed(()=>!o.value);function h(f){return f[l.value]||""}function r(f){return i.value.findIndex(g=>h(g)===h(f))}function u(){i.value.forEach(f=>{f.checked=!1}),i.value=[]}function d(f,b){s.value&&u();const g=r(f);g>-1?(i.value.splice(g,1),f.checked=!1):(i.value.push(f),f.checked=!0),n.emit("selectionChange",i.value)}return{clearSelection:u,findIndexInSelectedItems:r,selectedItems:i,toggleSelectItem:d}}function we(e,n){function a(c){const i=[];let s=c.nextNode();for(;s;)i.push(s),s=c.nextNode();return i}function l(c,i){const s=document.createTreeWalker(c,NodeFilter.SHOW_TEXT);return a(s).map(d=>({textNode:d,text:(d.textContent||"").toLocaleLowerCase()})).map(({textNode:d,text:f})=>{const b=[];let g=0;for(;g<f.length;){const y=f.indexOf(i,g);if(y===-1)break;b.push(y),g=y+i.length}return b.map(y=>{const N=new Range;return N.setStart(d,y),N.setEnd(d,y+i.length),N})}).flat()}function o(c){if(!CSS.highlights||(CSS.highlights.clear(),!c||!n))return;const i=l(n.value,c.toLocaleLowerCase()),s=new Highlight(...i);CSS.highlights.set("search-result",s)}return{search:o}}const Te={checked:{Type:Boolean,default:!1},id:{Type:String,default:""},disabled:{Type:Boolean,default:!1},modelValue:{Type:Boolean,default:!1}},Q=t.defineComponent({name:"FListViewCheckBox",props:Te,emits:["change","update:modelValue"],setup(e,n){const a=t.ref(e.checked),l=t.ref(e.disabled),o=t.ref(e.id);function c(i){i.stopPropagation(),i.preventDefault(),l.value||(a.value=!a.value,n.emit("change",{originalEvent:i,checked:a.value}))}return t.watch(()=>e.checked,i=>{a.value=i}),()=>t.createVNode("div",{class:"custom-control custom-checkbox custom-control-inline listview-checkbox"},[t.withDirectives(t.createVNode("input",{id:o.value,title:o.value,type:"checkbox",class:"custom-control-input","onUpdate:modelValue":i=>a.value=i,onChange:i=>console.log(i)},null),[[t.vModelCheckbox,a.value]]),t.createVNode("label",{for:o.value,class:"custom-control-label",onClick:i=>c(i)},null)])}});function ie(e,n,a,l,o,c,i,s){const h=t.ref(e.size),r=t.ref(e.textField),u=t.ref(e.multiSelect),d=t.ref(e.disableField),{onMouseenterItem:f,onMouseoverItem:b,onMouseoutItem:g}=o,{getKey:y,listViewItemClass:N,onCheckItem:k,onClickItem:I}=c,p=t.computed(()=>({margin:h.value==="small"?"0.25rem 0":"10px 0"}));function v(S,B,j){return S.checked=i.findIndexInSelectedItems(S)>-1,t.createVNode("li",{class:N(S,B),id:y(S,B),key:y(S,B),onClick:M=>I(M,S,B),onMouseenter:M=>f(M,S,B),onMouseover:M=>b(M,S,B),onMouseout:M=>g(M,S,B)},[u.value&&t.createVNode("div",{class:"f-list-select",onClick:M=>M.stopPropagation()},[t.createVNode(Q,{id:"list-"+y(S,B),disabled:S[d.value]||S.unClick,checked:S.checked,onChange:M=>k(S,B)},null)]),t.createVNode("div",{class:"f-list-content"},[t.createVNode("div",{style:p.value},[S[r.value]])])])}return{renderItem:v}}function Se(e,n,a,l,o,c,i,s){const h=t.ref(e.multiSelect),r=t.ref(e.disableField),{onMouseenterItem:u,onMouseoverItem:d,onMouseoutItem:f}=o,{getKey:b,listViewItemClass:g,onCheckItem:y,onClickItem:N}=c;function k(p,v,S){return n.slots.content?t.createVNode(t.Fragment,null,[n.slots.content&&n.slots.content({item:p,index:v,selectedItem:S})]):t.createVNode("div",{style:"margin: 10px 0;"},[p.name])}function I(p,v,S){return t.createVNode("li",{class:g(p,v),id:b(p,v),key:b(p,v),onClick:B=>N(B,p,v),onMouseenter:B=>u(B,p,v),onMouseover:B=>d(B,p,v),onMouseout:B=>f(B,p,v)},[h.value&&t.createVNode("div",{class:"f-list-select",onClick:B=>B.stopPropagation()},[t.createVNode(Q,{id:"list-"+b(p,v),disabled:p[r.value]||p.unClick,checked:p.checked,onChange:B=>y(p,v)},null)]),t.createVNode("div",{class:"f-list-content"},[k(p,v,S)])])}return{renderItem:I}}function Be(e,n,a,l,o,c,i,s){const h=t.ref(e.multiSelect),r=t.ref(e.disableField),{onMouseenterItem:u,onMouseoverItem:d,onMouseoutItem:f}=o,{getKey:b,listViewItemClass:g,onCheckItem:y,onClickItem:N}=c,{dragstart:k,dragenter:I,dragover:p,dragend:v}=l,{removeItem:S}=s,B=t.computed(()=>({margin:h.value?"10px 0":"10px 0px 10px 14px"}));function j(P){return t.createVNode("div",{style:B.value},[P.name])}function M(){return n.slots.itemContent?n.slots.itemContent:j}const C=M();function O(P,L,W){return t.createVNode("li",{class:g(P,L),id:b(P,L),key:b(P,L),onClick:F=>N(F,P,L),onMouseenter:F=>u(F,P,L),onMouseover:F=>d(F,P,L),onMouseout:F=>f(F,P,L),draggable:"true",onDragstart:F=>k(F,P,L),onDragenter:F=>I(F,L),onDragend:F=>v(F,P),onDragover:F=>p(F,L)},[h.value&&t.createVNode("div",{class:"f-list-select",onClick:F=>F.stopPropagation()},[t.createVNode(Q,{id:"list-"+b(P,L),disabled:P[r.value]||P.unClick,checked:P.checked,onChange:F=>y(P,L)},null)]),t.createVNode("div",{class:"f-list-content"},[C(P)]),t.createVNode("div",{class:"f-list-remove",onClick:F=>S(L)},[t.createVNode("div",{class:"f-list-remove-icon"},[t.createVNode("i",{class:"f-icon f-icon-remove_face"},null)])]),t.createVNode("div",{class:"f-list-handle"},[t.createVNode("div",null,[t.createVNode("i",{class:"f-icon f-icon-drag-vertical"},null)])])])}return{renderItem:O}}function Ie(e,n,a){function l(){return n.slots.header&&t.createVNode("div",{class:"f-list-view-header"},[n.slots.header()])}return{renderHeader:l}}function ce(e,n,a){const l=t.ref(e.headerClass),o=t.ref(e.placeholder),c=t.ref(""),i=t.computed(()=>!c.value),s=t.computed(()=>!!c.value);function h(f){c.value=""}t.watch(c,f=>{a.search(f)});const r=t.computed(()=>{const f={"form-group":!0,"farris-form-group":!0};return l.value&&l.value.split(" ").reduce((g,y)=>(g[y]=!0,g),f),f});function u(f){}function d(){return t.createVNode("div",{class:"f-list-view-header",onClick:t.withModifiers(u,["prevent","stop"])},[t.createVNode("div",{class:r.value},[t.createVNode("div",{class:"farris-input-wrap"},[t.createVNode("div",{class:"f-cmp-inputgroup"},[t.createVNode("div",{class:"input-group f-state-editable"},[t.withDirectives(t.createVNode("input",{class:"form-control f-utils-fill text-left","onUpdate:modelValue":f=>c.value=f,name:"input-group-value",type:"text",placeholder:o.value,autocomplete:"off"},null),[[t.vModelText,c.value]]),t.createVNode("div",{class:"input-group-append"},[s.value&&t.createVNode("span",{class:"input-group-text input-group-clear",onClick:f=>h()},[t.createVNode("i",{class:"f-icon f-icon-close-circle"},null)]),i.value&&t.createVNode("span",{class:"input-group-text"},[t.createVNode("span",{class:"f-icon f-icon-search"},null)])])])])])])])}return{renderHeader:d}}const St="";function ke(e,n){const a=t.ref(e.idField),l=t.ref(e.data),o=t.ref(e.data),c=t.ref(e.keepOrder);function i(){const r=l.value.map((u,d)=>typeof u!="object"?{__fv_index__:d,name:u}:(u.__fv_index__=d,u));return o.value=r,r}const s=t.ref(i());t.watch(()=>e.data,r=>{if(c.value){const u=r.reduce((g,y)=>(g.set(y.id,!0),g),new Map),d=l.value.reduce((g,y)=>(g.set(y.id,!0),g),new Map),f=s.value.filter(g=>u.has(g.id)),b=r.filter(g=>!d.has(g.id));l.value=[...f,...b]}else l.value=r;s.value=i()});function h(r){return r.map(d=>{const f=o.value.findIndex(b=>b[a.value]===d);return f>-1?o.value[f]:null}).filter(d=>d!=null)}return{dataView:s,getSelectionItems:h}}function Ve(e,n,a,l){const o=t.ref(e.idField),{dataView:c}=a,i=t.ref(-1),s=t.ref(!1),{activeIndex:h,focusedItemId:r,hoverIndex:u,resumeHover:d,suspendHover:f}=l;function b(k,I,p){k.stopPropagation(),f(),I&&setTimeout(()=>{i.value=p,s.value=!0,I.moving=!0})}function g(k,I){if(k.preventDefault(),i.value!==I){const p=c.value[i.value],v=c.value;v.splice(i.value,1),v.splice(I,0,p),i.value=I}}function y(k,I){k.preventDefault(),k.dataTransfer&&(k.dataTransfer.dropEffect="move")}function N(k,I){I&&(I.moving=!1),c.value.forEach((p,v)=>{p.__fv_index__=v}),s.value=!1,d(),u.value=I.__fv_index__,h.value=I.__fv_index__,r.value=I[o.value],n.emit("change",c.value)}return{dragstart:b,dragenter:g,dragover:y,dragend:N,isDragging:s}}function xe(e,n,a){const{dataView:l}=a;function o(c){if(c>-1&&c<l.value.length){const i=l.value.splice(c,1);n.emit("removeItem",i[0])}}return{removeItem:o}}function Ne(){const e=t.ref(-1),n=t.ref(""),a=t.ref(-1),l=t.ref(!1);function o(r,u,d){a.value=d}function c(r,u,d){l.value||(a.value=d)}function i(r,u,d){a.value=-1}function s(){l.value=!0}function h(){l.value=!1}return{activeIndex:e,focusedItemId:n,hoverIndex:a,onMouseenterItem:o,onMouseoverItem:c,onMouseoutItem:i,resumeHover:h,suspendHover:s}}const Pe=t.defineComponent({name:"FListView",props:ve,emits:["checkValuesChange","clickItem","selectionChange","removeItem","change"],setup(e,n){const a=t.ref(),l=t.ref(e.view),o=t.ref(e.header),c=t.ref(e.multiSelect),i=t.ref(e.view==="CardView"),s=t.ref(!0),h=t.ref({}),r=t.ref("暂无数据");t.ref(!0),t.ref(!1),t.ref("id");const u=ke(e),{dataView:d}=u,f=t.computed(()=>{const V={"f-list-view":!0,"f-list-view-multiple":c.value};return e.size!=="default"&&(V[`${e.size}-item`]=!0),V}),b=t.computed(()=>({"f-list-view-group":!0,"d-flex":i.value,"flex-wrap":i.value})),g=t.computed(()=>!!d.value&&d.value.length>0),y=Ne(),N=Ce(e,n,u),k=Ve(e,n,u,y),I=xe(e,n,u),p=be(e,n,k,y,N),v=we(e,a),S=t.computed(()=>d.value.length===0),B=t.computed(()=>S.value&&!n.slots.empty),j=t.computed(()=>!!n.slots.footer||s.value);function M(){return l.value==="SingleView"?ie:l.value==="DraggableView"?Be:l.value==="ContentView"&&n.slots.content?Se:ie}const C=M(),{renderItem:O}=C(e,n,u,k,y,p,N,I);function P(){return o.value==="SearchBar"?ce:o.value==="ContentHeader"?Ie:ce}const L=P(),{renderHeader:W}=L(e,n,v);function F(V){v.search(V)}n.expose({search:F});function x(V){c.value&&(V.preventDefault(),V.stopPropagation())}return()=>t.createVNode("div",{class:f.value,onClick:x},[W(),t.createVNode("div",{ref:a,class:"f-list-view-content"},[t.createVNode("ul",{class:b.value,style:"list-style: none;"},[g.value&&d.value.map((V,D)=>O(V,D,h)),B.value&&t.createVNode("div",{class:"f-list-view-emptydata"},[t.createVNode("p",{class:"f-empty-title"},[r.value])]),n.slots.empty&&n.slots.empty()])]),j.value&&t.createVNode("div",{class:"f-list-view-footer"},[n.slots.footer&&n.slots.footer()])])}}),Me=t.defineComponent({name:"FComboListContainer",props:ye,emits:["selectionChange"],setup(e,n){const a=t.ref(e.dataSource),l=t.ref([]),o=t.ref(e.separator),c=t.ref(e.selectedValues.split(o.value));t.watch(e.dataSource,()=>{a.value=e.dataSource});const i=t.computed(()=>e.enableSearch?"SearchBar":"ContentHeader");function s(h){l.value=h.map(r=>Object.assign({},r)),c.value=h.map(r=>r[e.idField]),n.emit("selectionChange",l.value)}return()=>t.createVNode("div",{class:"f-combo-list-container"},[t.createVNode(Pe,{size:"small",itemClass:"f-combo-list-item",header:i.value,headerClass:"f-combo-list-search-box",data:a.value,idField:e.idField,textField:e.textField,multiSelect:e.multiSelect,multiSelectMode:"OnCheckAndClick","selection-values":c.value,onSelectionChange:s},null)])}}),Fe=new Map([["appearance",oe]]),Oe={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/button-edit.schema.json",title:"button-edit",description:"A Farris Input Component",type:"object",properties:{id:{description:"The unique identifier for a Input Group",type:"string"},type:{description:"The type string of Input Group component",type:"string",default:"button-edit"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},disable:{type:"string",default:!1},editable:{description:"",type:"boolean",default:!0},enableLinkLabel:{description:"",type:"boolean",default:!1},label:{description:"",type:"string",default:""},lableWidth:{description:"",type:"number"},placeHolder:{description:"",type:"string",default:""},readonly:{description:"",type:"boolean",default:!1},require:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},textAlign:{description:"",type:"string",enum:["left","middle","right"],default:"left"},visible:{description:"",type:"boolean",default:!0},onBlur:{description:"",type:"string",default:""},onClickLinkLabel:{description:"",type:"sting",default:""},autoComplete:{description:"",type:"boolean",default:!1},buttonContent:{description:"",type:"string",default:""},enableClear:{description:"",type:"boolean",default:!0},inputType:{description:"",type:"string",enum:["text","tag"],default:"text"},multiSelect:{description:"",type:"boolean",default:!1},popup:{description:"",type:"object",properties:{footerButtons:{type:"array",default:[]},height:{type:"number",default:600},dataMapping:{type:"object"},contents:{type:"array",default:[]},showMaxButton:{type:"boolean",default:!0},showCloseButton:{type:"boolean",default:!0},showFooter:{type:"boolean",default:!0},title:{type:"string",default:""},width:{type:"number",default:800}}},separator:{type:"string",default:","},showButtonWhenDisabled:{description:"",type:"boolean",default:!1},wrapText:{type:"boolean",default:!1},onClear:{description:"",type:"string",default:""}},required:["id","type"]},re={id:String,buttonContent:{type:String,default:'<i class="f-icon f-icon-lookup"></i>'},buttonBehavior:{type:String,default:"Popup"},autoComplete:{type:Boolean,default:!1},customClass:{type:String,default:""},disable:{type:Boolean,default:!1},editable:{type:Boolean,default:!0},enableClear:{type:Boolean,default:!1},modelValue:{type:String,default:""},readonly:{type:Boolean,default:!1},textAlign:{type:String,default:"left"},showButtonWhenDisabled:{type:Boolean,default:!1},enableTitle:{type:Boolean,default:!1},inputType:{type:String,default:"text"},forcePlaceholder:{type:Boolean,default:!1},placeholder:{type:String,default:""},minLength:Number,maxLength:Number,tabIndex:Number,popupHost:{type:Object},popupRightBoundary:{type:Object},popupOffsetX:{type:Object},popupOnInput:{type:Boolean,default:!1},popupOnFocus:{type:Boolean,default:!1},popupMinWidth:{type:Number,default:320},wrapText:{type:Boolean,default:!1},multiSelect:{type:Boolean,default:!1},separator:{type:String,default:","}};ne(re,Oe,Fe);const Le={popupContentPosition:{type:Object,default:{left:0,top:0}},host:{type:Object}},De=t.defineComponent({name:"FOverlay",props:Le,emits:["click"],setup(e,n){const a=t.ref(e.popupContentPosition),l=t.ref(e.host);function o(s){n.emit("click"),s.preventDefault(),s.stopPropagation()}const c=t.computed(()=>{const s=l.value;if(s){const h=s.getBoundingClientRect(),{left:r,top:u,height:d}=h;return{left:r,top:u+d}}return a.value}),i=t.computed(()=>({position:"relative",left:`${c.value.left}px`,top:`${c.value.top}px`}));return()=>t.createVNode(t.Teleport,{to:"body"},{default:()=>{var s,h;return[t.createVNode("div",{class:"overlay-container",style:"pointer-events: auto;",onClick:r=>o(r)},[t.createVNode("div",{style:i.value},[(h=(s=n.slots).default)==null?void 0:h.call(s)])])]}})}});function je(e){if(e.content&&e.content.render)return e.content.render;if(e.render&&typeof e.render=="function")return e.render}function Re(e){const n=document.createElement("div");n.style.display="contents";let a;const l=e.onClickCallback||(()=>{}),o=()=>{l(),a&&a.unmount()};return a=t.createApp({setup(){t.onUnmounted(()=>{document.body.removeChild(n)});const c=je(e);return()=>t.createVNode(De,{"popup-content-position":e.popupPosition,host:e.host,onClick:o},{default:()=>[c&&c()]})}}),document.body.appendChild(n),a.mount(n),a}class Ae{static show(n){return Re(n)}}function Ee(e,n,a,l){const o=t.ref(e.buttonBehavior),c=t.ref(e.popupOnInput),i=t.computed(()=>({"input-group-append":!0,"append-force-show":e.showButtonWhenDisabled&&(e.readonly||e.disable)})),s=t.computed(()=>e.showButtonWhenDisabled||(!e.editable||!e.readonly)&&!e.disable);async function h(f){if(s.value){const b=!!n.slots.default;o.value==="Overlay"&&Ae.show({host:a.value,render:()=>{if(n.slots.default)return n.slots.default()}}),b&&o.value==="Popup"&&l.togglePopup(),b&&c.value&&l.hidePopup(),n.emit("clickButton",{origin:f,value:e.modelValue})}f.stopPropagation()}function r(f){n.emit("mouseEnterIcon",f)}function u(f){n.emit("mouseLeaveIcon",f)}function d(){n.emit("mouseOverButton")}return{buttonClass:i,onClickButton:h,onMouseEnterButton:r,onMouseLeaveButton:u,onMouseOverButton:d}}function $e(e,n,a,l,o,c){const i=t.ref(!1),s=t.computed(()=>e.enableClear&&!e.readonly&&!e.disable),{changeTextBoxValue:h}=c;function r(b){i.value=b}t.watch(o,()=>{l.value?r(!!o.value):r(!1)});function u(b){const g=!e.readonly&&!e.disable&&e.editable,y=!e.editable;b.stopPropagation(),(g||y)&&(h("",!1),r(!i.value),n.emit("clear"))}function d(b){if(s.value){if(!a.value){r(!1);return}(!e.editable||!e.readonly)&&!e.disable&&r(!0)}}function f(b){s.value&&r(!1)}return{enableClearButton:s,showClearButton:i,onClearValue:u,onMouseEnterTextBox:d,onMouseLeaveTextBox:f}}function He(e,n,a,l,o){const c=t.ref(e.popupOnInput),i=t.ref(e.popupOnFocus),{shouldPopupContent:s}=o,h=t.computed(()=>e.enableTitle?a.value:""),r=t.computed(()=>(e.disable||e.readonly)&&!e.forcePlaceholder?"":e.placeholder),u=t.computed(()=>e.readonly||!e.editable);let d=!1;const f=t.computed(()=>!e.disable&&d),b=t.computed(()=>({"text-left":e.textAlign==="left","text-center":e.textAlign==="center","text-right":e.textAlign==="right","form-control":!0,"f-utils-fill":!0})),g=t.computed(()=>({"input-group":!0,"f-state-disable":e.disable,"f-state-editable":e.editable&&!e.disable&&!e.readonly,"f-state-readonly":e.readonly&&!e.disable,"f-state-focus":f.value}));function y(C,O=!0){a.value!==C&&(a.value=C,O&&n.emit("change",C),n.emit("update:modelValue",C))}function N(C){s.value=!1,y(C,!0)}t.watch(()=>e.modelValue,C=>{a.value=C,n.emit("change",C)});function k(C){d=!1,n.emit("blur",C),C.stopPropagation()}function I(C){n.emit("click",C)}function p(C){if(e.disable){d=!0;return}d=!0,u.value||(n.emit("focus",C),i.value&&!s.value&&o.popup())}function v(C){n.emit("input",C.target.value);const O=C.target.value;l.value=O,a.value!==O&&y(O,!1),c.value&&!s.value&&o.popup()}function S(C){C.target.tagName!=="INPUT"&&C.preventDefault(),C.stopPropagation()}function B(C){n.emit("keydown",C)}function j(C){C.key==="Enter"&&(c.value||i.value)&&o.hidePopup(),n.emit("keyup",C)}function M(C){const O=C.target.value;C.stopPropagation(),y(O)}return{hasFocusedTextBox:f,isTextBoxReadonly:u,textBoxClass:b,textBoxPlaceholder:r,textBoxTitle:h,inputGroupClass:g,changeTextBoxValue:y,commitValue:N,onBlurTextBox:k,onClickTextBox:I,onFocusTextBox:p,onInput:v,onKeyDownTextBox:B,onKeyUpTextBox:j,onMouseDownTextBox:S,onTextBoxValueChange:M}}function We(e,n,a){const l=t.ref(),o=t.ref(!1);function c(){const r=l.value;r&&r.show(a.value)}async function i(){!!n.slots.default&&(o.value=!o.value,await t.nextTick(),c())}async function s(){!!n.slots.default&&(o.value=!0,await t.nextTick(),c())}function h(){o.value=!1}return{hidePopup:h,popup:s,shouldPopupContent:o,togglePopup:i,popoverRef:l}}function _e(e,n,a){const{isTextBoxReadonly:l,textBoxClass:o,textBoxPlaceholder:c,textBoxTitle:i,onBlurTextBox:s,onClickTextBox:h,onFocusTextBox:r,onInput:u,onKeyDownTextBox:d,onKeyUpTextBox:f,onMouseDownTextBox:b,onTextBoxValueChange:g}=a;return()=>t.createVNode("input",{name:"input-group-value",autocomplete:e.autoComplete?"on":"off",class:o.value,disabled:e.disable,maxlength:e.maxLength,minlength:e.minLength,placeholder:c.value,readonly:l.value,tabindex:e.tabIndex,title:i.value,type:e.inputType,value:n.value,onBlur:s,onChange:g,onClick:h,onFocus:r,onInput:u,onKeydown:d,onKeyup:f,onMousedown:b},null)}const ze={activeTag:{Type:String,default:""},addButtonText:{Type:String,default:""},customClass:{Type:String,default:""},customStyle:{Type:String,default:""},data:{type:Array,default:[]},enableAddButton:{Type:Boolean,default:!1},placeholder:{Type:String,default:""},selectable:{Type:Boolean,default:!1},showAddButton:{Type:Boolean,default:!1},showClose:{Type:Boolean,default:!1},showColor:{Type:Boolean,default:!1},showInput:{Type:Boolean,default:!1},tagType:{Type:String,default:""},tagStyle:{Type:String,default:""},wrapText:{Type:Boolean,default:!1},draggable:{Type:Boolean,default:!1}},Mt="";function qe(e,n,a,l){const o=t.ref(-1),c=t.ref(!1);function i(u,d,f){u.stopPropagation(),d&&setTimeout(()=>{o.value=f,c.value=!0,d.moving=!0})}function s(u,d){if(u.preventDefault(),o.value!==d){const f=l.value[o.value],b=l.value;b.splice(o.value,1),b.splice(d,0,f),o.value=d}}function h(u,d){u.preventDefault(),u.dataTransfer&&(u.dataTransfer.dropEffect="move")}function r(u,d){d&&(d.moving=!1),a.value=l.value.filter(f=>f.type==="Tag").map(f=>f.payload),c.value=!1,n.emit("change",a.value)}return{dragstart:i,dragenter:s,dragover:h,dragend:r,isDragging:c}}const Xe=t.defineComponent({name:"FTags",props:ze,emits:["remove","selectionChange","change"],setup(e,n){const a=t.ref(e.selectable),l=t.ref(e.customClass),o=t.ref(e.data),c=t.ref(e.tagType),i=t.ref(e.tagStyle),s=t.ref(e.showColor),h=t.ref(e.activeTag),r=t.ref(e.customStyle),u=t.ref(e.showClose),d=t.ref(e.showAddButton),f=t.ref(e.showInput),b=t.ref(e.addButtonText),g=t.ref(e.enableAddButton);t.ref(e.placeholder),t.ref(""),t.ref();const y=t.ref(),N=t.ref(e.wrapText),k=t.ref();function I(){const m=o.value.map(w=>({type:"Tag",payload:w}));return d.value&&m.push({type:"AddButton"}),m}const p=t.ref(I());function v(m){o.value=m,p.value=I()}const S=t.computed(()=>p.value.findIndex(m=>m.type==="Input")),B=qe(e,n,o,p),{dragstart:j,dragenter:M,dragover:C,dragend:O}=B;t.watch(()=>e.data,m=>v(m));const P=t.computed(()=>{const m={"farris-tags":!0,"farris-tags-checkable":a.value,"farris-tags-nowrap":!N.value};return l.value.split(" ").reduce((w,T)=>(w[T]=!0,w),m),m});function L(m){const w={"farris-tag-item":!0,"farris-tag-item-checked":a.value&&m.checked,"farris-tag-item-checkable":a.value,"farris-tag-item-has-color":s.value,"farris-tag-item-actived":h.value===m.name};if(c.value){const T=`farris-tag-item-${c.value}`;w[T]=!0}return w}const W=t.computed(()=>{const m={};return r.value&&r.value.split(";").reduce((w,T)=>{const R=T.split(":");return w[R[0]]=R[1],w},m),m});function F(m,w){a.value&&w.selectable&&(w.checked=!w.checked,h.value=w.checked?w.name:"",w.checked&&o.value.filter(T=>T.name!==w.name).forEach(T=>{T.checked=!w.checked}),n.emit("change",o.value),n.emit("selectionChange",w))}function x(m,w){let T;switch(m.key){case"Backspace":o.value=o.value.filter(R=>R.name!==w.name),n.emit("change",o.value);break;case"ArrowLeft":T=Math.max(y.value.scrollLeft+20,0),y.value.scrollLeft=T;break;case"ArrowRight":T=Math.max(y.value.scrollLeft-20,0),y.value.scrollLeft=T}}function V(m,w){const T=o.value.findIndex(R=>R.name===w.name);if(T>-1){const[R]=o.value.splice(T,1);p.value=I(),n.emit("change",o.value),n.emit("remove",o.value,R,T)}m.stopPropagation()}const D=t.computed(()=>({"farris-tag-item":!0,"farris-tag-add-button":!0,"farris-tag-add-button-disabled":!g.value}));function $(m){}function E(){return t.createVNode("li",{class:D.value,onClick:m=>void 0},[t.createVNode("span",{class:"f-icon f-icon-amplification"},null),t.createVNode("span",{class:"farris-tag-add-text"},[b.value])])}function H(m){if(m&&!m.innerText){const w=S.value;if(w>0){const[T]=o.value.splice(w-1,1);p.value.splice(w-1,1),n.emit("remove",o.value,T,w-1)}}}function q(m,w,T){m>-1&&(o.value.splice(m,0,{name:w,value:T,selectable:a.value}),p.value=I(),n.emit("change",o.value))}function U(m){if(m&&m.innerText){const w=m.innerText,T=S.value;q(T,w,w),m.innerText=""}}function Y(m){const w=m.target;w&&(w.innerText?U(w):n.emit("change",o.value))}function it(m){m.key==="Enter"&&U(m.target),m.key==="Backspace"&&(H(m.target),t.nextTick(()=>{k.value&&k.value.focus()}))}function ct(){return t.createVNode("li",{class:"farris-tag-input-box"},[t.createVNode("div",{ref:k,class:"form-control",contenteditable:"true",onKeyup:it,onBlur:Y},null)])}function rt(m,w){return t.createVNode("li",{class:L(m),style:W.value,tabindex:0,id:m.name,key:m.name,onClick:T=>F(T,m),onKeydown:T=>x(T,m),draggable:"true",onDragstart:T=>j(T,m,w),onDragenter:T=>M(T,w),onDragend:T=>O(T,m),onDragover:T=>C(T,w)},[t.createVNode("div",{title:m.name,class:"tag-box"},[m.name]),u.value&&t.createVNode("span",{class:"tag-delete"},[t.createVNode("i",{class:"f-icon f-icon-close",onClick:T=>V(T,m)},null)])])}function st(){return p.value.map((m,w)=>{switch(m.type){case"Tag":return rt(m.payload,w);case"AddButton":return E();case"Input":return ct()}})}const ut=t.computed(()=>({"farris-tags-item-container":!0,"farris-tag-item-capsule":i.value==="capsule"}));function dt(m){const w=Math.max(y.value.scrollLeft-m.deltaX,0);y.value.scrollLeft=w}function ft(m){const w=y.value,T=o.value.length-1;if(w){const R=Array.from(w.children).filter(_=>_.className.indexOf("farris-tag-item")>-1).findIndex(_=>{const z=_.getBoundingClientRect(),Z=window.getComputedStyle(_),ue=parseInt(Z["margin-left"],10)+z.width+parseInt(Z["margin-right"],10);return z.left+ue>m});if(R>-1)return R}return T}function pt(m){if(f.value){const T=ft(m.clientX)+1,_=p.value.filter(z=>z.type!=="Input");_.splice(T,0,{type:"Input"}),p.value=_,t.nextTick(()=>{k.value&&k.value.focus()})}}function mt(m){var T;m.preventDefault(),m.stopPropagation();const w=(T=m.dataTransfer)==null?void 0:T.getData("Text");if(w){const R=w.split(":"),_=R[0],z=R[1];[...o.value].findIndex(ee=>(console.log(`${ee.value} === ${z} is ${ee.value===z}`),ee.value===z))>-1||q(o.value.length,_,z)}}function gt(m){m.preventDefault()}return()=>t.createVNode("div",{class:P.value,onClick:pt,onDrop:mt,onDragover:gt},[t.createVNode("ul",{ref:y,class:ut.value,onWheel:m=>dt(m)},[st()])])}});function Ge(e,n,a){const l=t.ref(e.separator),{changeTextBoxValue:o}=a,c=t.computed(()=>n.value?n.value.split(l.value).map(s=>({name:s,selectable:!0})):[]);function i(s){o(s.map(h=>h.name).join(l.value),!0)}return()=>t.createVNode(Xe,{class:"form-control",data:c.value,showClose:!0,showInput:!0,onChange:i},null)}function Ue(e,n,a){const{buttonClass:l,onClickButton:o,onMouseEnterButton:c,onMouseLeaveButton:i}=n,{enableClearButton:s,showClearButton:h,onClearValue:r}=a;return()=>t.createVNode("div",{class:l.value},[s.value&&t.withDirectives(t.createVNode("span",{class:"input-group-text input-group-clear",onClick:r},[t.createVNode("i",{class:"f-icon modal_close"},null)]),[[t.vShow,h.value]]),e.buttonContent&&t.createVNode("span",{class:"input-group-text input-group-append-button",innerHTML:e.buttonContent,onClick:o,onMouseenter:c,onMouseleave:i},null)])}const Ke={title:{type:String},placement:{type:String,default:"bottom"},reference:{type:Object},host:{type:Object},leftBoundary:{type:Object},rightBoundary:{type:Object},visible:{type:Boolean,default:!1},class:{type:String},offsetX:{type:Object,default:t.ref(0)},zIndex:{type:Number,default:-1},keepWidthWithReference:{type:Boolean,default:!1},fitContent:{type:Boolean,default:!1},minWidth:{type:Number,default:-1}},Ft="";function Je(e){const n=e.host?e.host:"body",a=t.computed(()=>n==="body"?0:n?n.getBoundingClientRect().top:0),l=t.computed(()=>n==="body"?0:n?n.getBoundingClientRect().left:0),o=t.computed(()=>n==="body"?document.body.getBoundingClientRect().width:n?n.getBoundingClientRect().width-(e.rightBoundary?e.rightBoundary.getBoundingClientRect().width:0):document.body.getBoundingClientRect().width);return{host:n,hostLeft:l,hostTop:a,hostWidth:o}}function Qe(e,n,a,l){var F;const o=t.ref(0),c=t.ref(((F=e.offsetX)==null?void 0:F.value)||0),i=t.ref(-1),s=t.ref(-1),h=t.ref(-1),r=t.ref(e.placement),u=t.ref(0),d=t.ref(0),f=t.ref(0),b=t.ref(document.documentElement.scrollLeft),g=t.ref(document.documentElement.scrollTop),{hostLeft:y,hostTop:N,hostWidth:k}=l;t.watch(e.offsetX,x=>{o.value=x-c.value});const I=t.computed(()=>{const x={left:`${d.value}px`,top:`${f.value}px`,transform:`translateX(${o.value}px)`};return e.zIndex!==-1&&(x["z-index"]=e.zIndex),i.value!==-1&&(x.width=`${i.value}px`),x}),p=t.computed(()=>({left:`${u.value}px`}));function v(x){if(x&&e.keepWidthWithReference){const V=x.getBoundingClientRect();i.value=Math.max(e.minWidth,V.width)}}function S(x,V){const D=k.value-x.width-4;return D>0?D:V}function B(x,V,D){const $=u.value,E=V.left-y.value+V.width/2+b.value,H=V.top-N.value-(x.height+D.height)+g.value;return{popoverLeft:E,popoverTop:H,arrowLeft:$}}function j(x,V,D){return V.top-N.value+(V.height+D.height)+g.value}function M(x,V){const D=S(V,x),$=x<=D?u.value:x-D;return{popoverLeft:Math.min(x,D),arrowLeft:$}}function C(x,V,D){const $=V.left-y.value+V.width/2-(D.width/2-(x.left-y.value))+b.value,{arrowLeft:E,popoverLeft:H}=M($,x),q=j(x,V,D);return{popoverLeft:H,popoverTop:q,arrowLeft:E}}function O(x,V,D){const $=V.left-y.value+b.value,{arrowLeft:E,popoverLeft:H}=M($,x),q=j(x,V,D);return{popoverLeft:H,popoverTop:q,arrowLeft:E}}const P=new Map([["top",B],["bottom",C],["bottom-left",O]]);function L(x){var H;const V=x.getBoundingClientRect();s.value=V.top,h.value=V.left;const D=n.value.getBoundingClientRect(),$=(H=a.value)==null?void 0:H.getBoundingClientRect(),E=P.get(r.value);if(E){const{arrowLeft:q,popoverLeft:U,popoverTop:Y}=E($,V,D);u.value=q,d.value=U,f.value=Y}e.keepWidthWithReference&&v(x)}function W(x){if(x){const V=x.getBoundingClientRect();(V.left!==h.value||V.top!==s.value)&&L(x)}}return{arrowStyle:p,popoverStyle:I,position:r,popoverWidth:i,fitToReference:v,followToReferencePosition:W,locateToReference:L}}function Ye(e,n,a,l,o,c,i){const s=t.ref(e.visible),h=t.computed(()=>s.value),{fitToReference:r,locateToReference:u}=i;let d;function f(){s.value=!1,document.body.removeEventListener("click",d),n.emit("hidden")}d=g=>{if(!o.value.contains(g.target)){const y=o.value.closest(".popover");y&&y.removeEventListener("click",d),f()}};async function b(g){if(l.value&&a.value&&g){s.value=!0,o.value=g,await t.nextTick(),u(g),c.value&&r(g),document.body.addEventListener("click",d);const y=g.closest(".popover");y&&y.addEventListener("click",d),n.emit("shown")}}return n.expose({hide:f,show:b,shown:h}),{showPopover:s,hidePopverOnClickBodyHandler:d}}function Ze(e,n,a,l,o){const{popoverWidth:c,fitToReference:i,followToReferencePosition:s}=o;function h(){if(a.value){s(a.value);const r=a.value.getBoundingClientRect();l.value&&r.width!==c.value&&i(a.value)}}return{onResize:h}}const et=t.defineComponent({name:"FPopover",props:Ke,emits:["shown","hidden"],setup(e,n){const a=t.ref(),l=t.ref(),o=t.ref(e.reference),c=t.ref(e.keepWidthWithReference),i=t.computed(()=>!!e.title),s=Je(e),{host:h}=s,r=Qe(e,a,l,s),{position:u,arrowStyle:d,popoverStyle:f,fitToReference:b,locateToReference:g}=r,{showPopover:y,hidePopverOnClickBodyHandler:N}=Ye(e,n,a,l,o,c,r),{onResize:k}=Ze(e,n,o,c,r),I=t.computed(()=>{const v=`popover in popover-${u.value}`,S=`bs-popover-${u.value}`,B={"popover-fitcontent":e.fitContent};return B[v]=!0,B[S]=!0,(e.class||"").split(" ").reduce((M,C)=>(M[C]=!0,M),B),B}),p=t.computed(()=>({"popover-content":!0,"popover-body":!0}));return t.onMounted(()=>{e.reference&&g(o.value),c.value&&b(o.value),window.addEventListener("resize",k)}),t.onUnmounted(()=>{document.body.removeEventListener("click",N),window.removeEventListener("resize",k)}),()=>t.createVNode(t.Teleport,{to:h},{default:()=>{var v;return[t.withDirectives(t.createVNode("div",{ref:l,class:I.value,style:f.value,onClick:S=>{S.stopPropagation()}},[t.createVNode("div",{ref:a,class:"popover-arrow arrow",style:d.value},null),i.value&&t.createVNode("h3",{class:"popover-title popover-header"},[e.title]),t.createVNode("div",{class:p.value},[n.slots.default&&((v=n.slots)==null?void 0:v.default())])]),[[t.vShow,y.value]])]}})}});function tt(e,n,a){const l=t.ref(e.popupMinWidth),{hidePopup:o,popoverRef:c}=a;return()=>t.createVNode(et,{ref:c,visible:!0,placement:"bottom-left",host:e.popupHost,"keep-width-with-reference":!0,fitContent:!0,"right-boundary":e.popupRightBoundary,minWidth:l.value,offsetX:e.popupOffsetX,onHidden:o},{default:()=>{var i,s;return[(s=(i=n.slots).default)==null?void 0:s.call(i)]}})}const Ot="",se=t.defineComponent({name:"FButtonEdit",props:re,emits:["updateExtendInfo","clear","change","click","clickButton","blur","focus","mouseEnterIcon","mouseLeaveIcon","keyup","keydown","inputClick","input","update:modelValue"],setup(e,n){const a=t.ref(),l=t.ref(e.customClass),o=t.ref(e.modelValue),c=We(e,n,a),{shouldPopupContent:i,hidePopup:s}=c,h=Ee(e,n,a,c),r=t.ref(""),u=He(e,n,o,r,c),{hasFocusedTextBox:d,commitValue:f,inputGroupClass:b}=u,g=$e(e,n,o,d,r,u),{onMouseEnterTextBox:y,onMouseLeaveTextBox:N}=g,k=t.computed(()=>{const j={"f-button-edit":!0,"f-cmp-inputgroup":!0,"f-button-edit-nowrap":!e.wrapText};return l.value&&l.value.split(" ").reduce((M,C)=>(M[C]=!0,M),j),j});function I(){return e.multiSelect&&e.inputType==="tag"?Ge(e,o,u):_e(e,o,u)}let p=I();t.watch([()=>e.multiSelect,()=>e.inputType],()=>{p=I()});const v=Ue(e,h,g),S=tt(e,n,c),B={commitValue:f,elementRef:a,hidePopup:s};return t.onMounted(()=>{a.value.componentInstance=B}),n.expose(B),()=>t.createVNode(t.Fragment,null,[t.createVNode("div",t.mergeProps(n.attrs,{ref:a,class:k.value,id:e.id}),[t.createVNode("div",{class:b.value,onMouseenter:y,onMouseleave:N},[p(),v()])]),i.value&&S()])}}),Lt="";function nt(e){const n=t.ref(""),a=t.ref(e.modelValue),l=t.ref(e.data||[]),o=t.ref(e.editable);function c(r){const u=r.split(e.separator).map(f=>[f,!0]),d=new Map(u);return l.value.filter(f=>d.has(f[e.valueField]))}function i(r){const u=c(r).map(d=>d[e.textField]).join(e.separator);n.value=o.value?u||r:u}function s(r){const u=r.split(e.separator).map(f=>[f,!0]),d=new Map(u);return l.value.filter(f=>d.has(f[e.textField]))}function h(){const{url:r,method:u="GET",headers:d={},body:f=null}=e.remote;fetch(r,{method:u,headers:d,body:f}).then(g=>{if(g.status===200)return g.json();throw new Error(g.statusText)}).then(g=>{l.value=g}).catch(g=>{console.error(g)})}return e.remote&&h(),t.watch(()=>e.data,()=>{l.value=e.data}),t.watch([l],([r])=>{if(e.modelValue){const u=r.find(d=>d[e.valueField]===e.modelValue);u&&(n.value=u[e.textField])}}),t.watch(()=>e.modelValue,r=>{a.value=r,i(r)}),i(e.modelValue),{dataSource:l,displayText:n,editable:o,modelValue:a,getItemsByDisplayText:s,getItemsByValue:c}}const G=t.defineComponent({name:"FComboList",props:X,emits:["clear","update:modelValue","change"],setup(e,n){const a=t.ref(),l=t.ref(e.disabled),o=t.ref(e.enableClear),c=t.ref(e.enableSearch),i=t.ref(e.readonly),{dataSource:s,displayText:h,editable:r,modelValue:u,getItemsByDisplayText:d}=nt(e),f=t.computed(()=>e.multiSelect);function b(){!f.value&&a.value&&a.value.hidePopup()}function g(p){h.value=p.map(v=>v[e.textField]).join(e.separator),u.value=p.map(v=>v[e.valueField]).join(e.separator),n.emit("update:modelValue",u.value),n.emit("change",p),b()}function y(p){u.value="",n.emit("update:modelValue",""),n.emit("clear")}function N(p){u.value=p,n.emit("update:modelValue",u.value);const v={};v[e.idField]=p,v[e.textField]=p,n.emit("change",[v])}function k(p){if(r.value){N(p);return}const v=d(p);g(v)}function I(){return h.value}return n.expose({getDisplayText:I}),t.watch([()=>e.disabled,()=>e.editable,()=>e.enableClear,()=>e.enableSearch,()=>e.readonly],([p,v,S,B,j])=>{l.value=p,r.value=v,o.value=S,c.value=B,i.value=j}),()=>t.createVNode(se,{ref:a,id:e.id,disable:l.value,readonly:i.value,forcePlaceholder:e.forcePlaceholder,editable:r.value,buttonContent:e.dropDownIcon,placeholder:e.placeholder,enableClear:o.value,maxLength:e.maxLength,tabIndex:e.tabIndex,enableTitle:e.enableTitle,multiSelect:e.multiSelect,inputType:e.multiSelect?"tag":"text",modelValue:h.value,"onUpdate:modelValue":p=>h.value=p,onClear:y,onChange:k},{default:()=>[t.createVNode(Me,{idField:e.idField,valueField:e.valueField,textField:e.textField,dataSource:s.value,selectedValues:u.value,multiSelect:e.multiSelect,enableSearch:c.value,onSelectionChange:g},null)]})}});function ot(e,n,a){var I;const l=a==null?void 0:a.checkIsInFixedContextRules(),o=a&&a.getStyles&&a.getStyles()||"";function c(){return!(n.schema.componentType||l)}function i(){return!1}function s(){return!(n.schema.componentType||l)}function h(){return!!l}function r(p){if(!p)return null;if(p.schema.type==="Component")return p;const v=r(p.parent);return v||null}function u(p,v,S){return!!a&&a.canAccepts()}function d(){return n.schema.label||n.schema.title||n.schema.name}function f(){}function b(p,v){v&&(a==null||a.onAcceptMovedChildElement(v))}function g(p,v){const S=String(p.getAttribute("data-controltype"));return de(S)}function y(p){return p.contents?p.contents.length:-1}function N(p){}const k={canMove:c(),canSelectParent:i(),canDelete:s(),canNested:!h(),contents:n.schema.contents,elementRef:e,parent:(I=n.parent)==null?void 0:I.componentInstance.value,schema:n.schema,styles:o,canAccepts:u,getBelongedComponentInstance:r,getDraggingDisplayText:d,getDragScopeElement:f,onAcceptMovedChildElement:b,onAcceptNewChildElement:g,onAddNewChildElement:y,onChildElementMovedOut:N,triggerBelongedComponentToMoveWhenMoved:!!a&&a.triggerBelongedComponentToMoveWhenMoved};return t.ref(k)}const at=t.defineComponent({name:"FComboListDesign",props:X,emits:["clear","update:modelValue","change"],setup(e,n){const a=t.ref(),l=t.inject("design-item-context"),o=ot(a,l);return t.onMounted(()=>{a.value.componentInstance=o}),n.expose(o.value),()=>t.createVNode(se,{ref:a,id:e.id,disable:e.disabled,readonly:e.readonly,forcePlaceholder:e.forcePlaceholder,editable:e.editable,buttonContent:e.dropDownIcon,placeholder:e.placeholder,enableClear:e.enableClear,maxLength:e.maxLength,tabIndex:e.tabIndex,enableTitle:e.enableTitle,multiSelect:e.multiSelect,inputType:e.multiSelect?"tag":"text"},null)}}),lt={install(e){e.component(G.name,G)},register(e,n){e["combo-list"]=G,n["combo-list"]=J},registerDesigner(e,n){e["combo-list"]=at,n["combo-list"]=J}};A.FComboList=G,A.Placement=le,A.ViewType=ae,A.comboListProps=X,A.default=lt,A.propsResolver=J,Object.defineProperties(A,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|