@farris/ui-vue 1.7.0-beta.3 → 1.7.0-beta.4

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.
Files changed (99) hide show
  1. package/components/avatar/index.esm.js +10 -1
  2. package/components/avatar/index.umd.cjs +1 -1
  3. package/components/calendar/index.esm.js +178 -176
  4. package/components/calendar/index.umd.cjs +2 -2
  5. package/components/collection-property-editor/index.esm.js +48 -46
  6. package/components/collection-property-editor/index.umd.cjs +2 -2
  7. package/components/combo-list/index.esm.js +319 -300
  8. package/components/combo-list/index.umd.cjs +1 -1
  9. package/components/comment/index.esm.js +2287 -1161
  10. package/components/comment/index.umd.cjs +7 -7
  11. package/components/component/index.esm.js +3 -1
  12. package/components/component/index.umd.cjs +2 -2
  13. package/components/condition/index.esm.js +926 -901
  14. package/components/condition/index.umd.cjs +2 -2
  15. package/components/data-view/index.esm.js +898 -899
  16. package/components/data-view/index.umd.cjs +1 -1
  17. package/components/drawer/index.esm.js +3 -1
  18. package/components/drawer/index.umd.cjs +2 -2
  19. package/components/dynamic-form/index.esm.js +239 -221
  20. package/components/dynamic-form/index.umd.cjs +1 -1
  21. package/components/dynamic-resolver/index.esm.js +11 -9
  22. package/components/dynamic-resolver/index.umd.cjs +2 -2
  23. package/components/expression-editor/index.esm.js +1299 -1279
  24. package/components/expression-editor/index.umd.cjs +4 -4
  25. package/components/filter-bar/index.esm.js +731 -678
  26. package/components/filter-bar/index.umd.cjs +2 -2
  27. package/components/filter-condition-editor/index.esm.js +1792 -1772
  28. package/components/filter-condition-editor/index.umd.cjs +4 -4
  29. package/components/image/index.esm.js +246 -240
  30. package/components/image/index.umd.cjs +2 -2
  31. package/components/language-textbox/index.esm.js +9 -7
  32. package/components/language-textbox/index.umd.cjs +2 -2
  33. package/components/list-view/index.esm.js +1 -1
  34. package/components/list-view/index.umd.cjs +1 -1
  35. package/components/locale/index.esm.js +2009 -886
  36. package/components/locale/index.umd.cjs +6 -6
  37. package/components/number-range/index.esm.js +190 -181
  38. package/components/number-range/index.umd.cjs +1 -1
  39. package/components/order/index.esm.js +734 -714
  40. package/components/order/index.umd.cjs +5 -5
  41. package/components/property-panel/index.esm.js +60 -49
  42. package/components/property-panel/index.umd.cjs +3 -3
  43. package/components/query-solution/index.esm.js +2461 -2500
  44. package/components/query-solution/index.umd.cjs +6 -6
  45. package/components/radio-group/index.esm.js +30 -30
  46. package/components/radio-group/index.umd.cjs +1 -1
  47. package/components/schema-selector/index.esm.js +238 -238
  48. package/components/schema-selector/index.umd.cjs +4 -4
  49. package/components/section/index.esm.js +217 -302
  50. package/components/section/index.umd.cjs +2 -2
  51. package/components/sort-condition-editor/index.esm.js +1793 -1773
  52. package/components/sort-condition-editor/index.umd.cjs +4 -4
  53. package/components/transfer/index.esm.js +155 -155
  54. package/components/transfer/index.umd.cjs +3 -3
  55. package/designer/data-grid/index.esm.js +895 -867
  56. package/designer/data-grid/index.umd.cjs +5 -5
  57. package/designer/data-view/index.esm.js +145 -144
  58. package/designer/data-view/index.umd.cjs +2 -2
  59. package/designer/drawer/index.esm.js +73 -71
  60. package/designer/drawer/index.umd.cjs +2 -2
  61. package/designer/dynamic-form/index.esm.js +87 -65
  62. package/designer/dynamic-form/index.umd.cjs +2 -2
  63. package/designer/farris-designer.all.esm.js +14 -3
  64. package/designer/farris-designer.all.umd.cjs +3 -3
  65. package/designer/input-group/index.esm.js +34 -14
  66. package/designer/input-group/index.umd.cjs +1 -1
  67. package/designer/list-view/index.esm.js +1 -1
  68. package/designer/list-view/index.umd.cjs +1 -1
  69. package/designer/radio-group/index.esm.js +15 -2
  70. package/designer/radio-group/index.umd.cjs +1 -1
  71. package/designer/section/index.esm.js +129 -119
  72. package/designer/section/index.umd.cjs +1 -1
  73. package/designer/time-picker/index.esm.js +140 -131
  74. package/designer/time-picker/index.umd.cjs +1 -1
  75. package/farris.all.esm.js +13578 -12394
  76. package/farris.all.umd.cjs +26 -26
  77. package/index.css +1 -1
  78. package/locales/data-grid/ui/en.json +2 -1
  79. package/locales/data-grid/ui/zh-CHS.json +2 -1
  80. package/locales/data-grid/ui/zh-CHT.json +2 -1
  81. package/locales/designer/en.json +12 -10
  82. package/locales/designer/zh-CHS.json +19 -17
  83. package/locales/designer/zh-CHT.json +19 -17
  84. package/locales/ui/en.json +4 -2
  85. package/locales/ui/zh-CHS.json +11 -9
  86. package/locales/ui/zh-CHT.json +11 -9
  87. package/package.json +1 -1
  88. package/package.zip +0 -0
  89. package/types/combo-list/src/composition/types.d.ts +1 -0
  90. package/types/condition/src/composition/condition-value/number-spinner-value.d.ts +1 -1
  91. package/types/condition/src/composition/use-field-config.d.ts +1 -1
  92. package/types/condition/src/condition.props.d.ts +1 -1
  93. package/types/data-view/designer/property-config/use-command-option.d.ts +12 -0
  94. package/types/image/src/property-config/image.property-config.d.ts +5 -5
  95. package/types/locale/src/lib/locale.service.d.ts +2 -2
  96. package/types/property-panel/src/composition/entity/input-base-property.d.ts +7 -0
  97. package/types/query-solution/src/designer/query-solution-config/composition/use-util.d.ts +0 -20
  98. package/types/section/src/designer/section.design.props.d.ts +17 -0
  99. package/types/section/src/section.props.d.ts +0 -25
@@ -1 +1 @@
1
- (function(g,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("vue"),require("../button-edit/index.umd.js"),require("../locale/index.umd.js"),require("../dynamic-resolver/index.umd.js"),require("lodash-es"),require("../list-view/index.umd.js"),require("../../designer/button-edit/index.umd.js"),require("../designer-canvas/index.umd.js"),require("../common/index.umd.js"),require("../property-panel/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","../button-edit/index.umd.js","../locale/index.umd.js","../dynamic-resolver/index.umd.js","lodash-es","../list-view/index.umd.js","../../designer/button-edit/index.umd.js","../designer-canvas/index.umd.js","../common/index.umd.js","../property-panel/index.umd.js"],i):(g=typeof globalThis<"u"?globalThis:g||self,i(g["combo-list"]={},g.Vue,g.FButtonEdit,g.locale,g.dynamicResolver,g.LodashES,g.FListView,g.FButtonEditDesign,g.designerCanvas,g.common,g.propertyPanel))})(this,function(g,i,G,R,E,U,W,J,_,M,z){"use strict";const K=new Map([["appearance",E.resolveAppearance]]),Q={$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:{}},disabled:{description:"",type:"boolean",default:!1},enableClear:{description:"",type:"boolean",default:!1},editable:{description:"",type:"boolean",default:!1},enableLinkLabel:{description:"",type:"boolean",default:!1},label:{description:"",type:"string",default:""},lableWidth:{description:"",type:"number"},placeholder:{description:"",type:"string",default:"请选择"},idField:{description:"",type:"string",default:"id"},valueField:{description:"",type:"string",default:"id"},titleField:{description:"",type:"string",default:"name"},textField:{description:"",type:"string",default:"name"},dataSourceType:{description:"",type:"string",default:"static"},data:{description:"",type:"array"},remote:{description:"",type:"string"},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"},multiSelect:{description:"",type:"boolean",default:!1},maxLength:{description:"",type:"number",default:null},visible:{description:"",type:"boolean",default:!0},onBlur:{description:"",type:"string",default:""},onClickLinkLabel:{description:"",type:"string",default:""},maxHeight:{description:"",type:"number",default:350},minPanelWidth:{description:"",type:"number",default:160},popupOnClick:{description:"",type:"boolean",default:!0},separator:{description:"",type:"string",default:","},viewType:{description:"",type:"string",default:"tag"},enableSearch:{description:"启用搜索",type:"boolean",default:!0},enableHighlightSearch:{description:"启用高亮搜索",type:"boolean",default:!1},beforeOpen:{description:"打卡面板前回调",type:"string"},onChange:{description:"值变化事件",type:"string",default:""},onInput:{description:"输入事件",type:"string",default:""},onClear:{description:"清空事件",type:"string",default:""}},required:["type"],ignore:["id","appearance","binding","visible"]};function X(e,t,l){return t}function Y(){function e(t,l,o){const d={};return d.beforeOpen=r=>l.call("beforeOpen",t,[r,t],o),d}return{resolve:e}}var k=(e=>(e.top="top",e.bottom="bottom",e.auto="auto",e))(k||{});const I={id:{type:String},data:{type:Array,default:[]},disabled:{default:!1,type:Boolean},dropDownIcon:{type:String,default:'<span class="f-icon f-icon-arrow-chevron-down"></span>'},editable:{default:!1,type:Boolean},enableClear:{default:!0,type:Boolean},enableSearch:{type:Boolean,default:!1},enableTitle:{default:!0,type:Boolean},fitEditor:{default:!1,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:{type:Boolean,default:!1},modelValue:{},placeholder:{type:String,default:"请选择"},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},titleField:{default:"name",type:String},valueField:{default:"id",type:String},viewType:{default:"tag",type:String},change:{type:Function,default:()=>{}},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1},autoHeight:{type:Boolean,default:!0},beforeOpen:{type:Function,default:null},load:{type:Function},searchOption:{type:[Boolean,Function],default:!1},enableHighlightSearch:{type:Boolean,default:!0},minPanelWidth:{type:Number,default:160},popupOnClick:{type:Boolean,default:!0}},j=Object.assign({},I,{readonly:{}}),L=E.createPropsResolver(I,Q,K,X),H=Y(),Z={dataSource:{type:Array,default:[]},enableSearch:{type:Boolean,default:!1},idField:{type:String,default:"id"},multiSelect:{type:Boolean,default:!1},selectedValues:{type:String,default:""},separator:{type:String,default:","},textField:{type:String,default:"name"},titleField:{type:String,default:"name"},width:{type:Number},maxHeight:{type:Number},valueField:{type:String,default:"id"},onSelectionChange:{type:Function,default:()=>{}},searchOption:{type:[Boolean,Function],default:!1},enableHighlightSearch:{type:Boolean,default:!0}},A=i.defineComponent({name:"FComboListContainer",props:Z,emits:["selectionChange"],setup(e,t){const l=i.ref(),o=i.ref(e.dataSource),d=i.ref([]),r=i.ref(e.separator),y=i.ref(e.width),c=i.ref(e.maxHeight),f=i.ref(String(e.selectedValues).split(r.value)),S=i.computed(()=>e.multiSelect),x=i.computed(()=>({enableSelectRow:!0,multiSelect:e.multiSelect,multiSelectMode:"OnCheckAndClick",showCheckbox:S.value,showSelectAll:!1,showSelection:!0}));i.watch(e.dataSource,()=>{o.value=e.dataSource}),i.computed(()=>e.enableSearch?"SearchBar":"ContentHeader");const n=i.computed(()=>{const u={};return y.value!==void 0&&(u.width=`${y.value}px`),c.value!==void 0&&c.value>0&&(u.maxHeight=`${c.value}px`),u});function a(u){l.value.search(u)}function s(u){d.value=u.map(m=>Object.assign({},m)),f.value=u.map(m=>m[e.idField]),t.emit("selectionChange",d.value)}function F(u){if(e.enableHighlightSearch)return;let m=[];const{searchOption:C}=e;typeof C=="function"?m=o.value.filter(v=>C(u,v)):m=o.value.filter(v=>v[e.valueField].indexOf(u)>-1||v[e.textField].indexOf(u)>-1),l.value.updateDataSource(m)}i.watch([()=>e.selectedValues],([u])=>{e.multiSelect?f.value=u.split(r.value):f.value=[u]});function w(u){l.value.activeRowById(u)}return i.onMounted(()=>{var u,m;if(!e.multiSelect){const C=(u=f.value)==null?void 0:u[0];let v=C;if(!U.isUndefined(C)){const V=typeof C,T=typeof((m=o.value[0])==null?void 0:m[e.valueField||e.idField]);T==="number"&&V!==T&&(v=Number(C)),T==="boolean"&&V!==T&&(v=C==="true"?!0:C==="false"?!1:C),w(v)}}}),t.expose({search:a,activeRowById:w}),()=>i.createVNode("div",{class:"f-combo-list-container",style:n.value},[i.createVNode(W,{ref:l,size:"small",itemClass:"f-combo-list-item",itemContentClass:"text-truncate",header:"ContentHeader",headerClass:"f-combo-list-search-box",data:o.value,idField:e.idField,textField:e.textField,titleField:e.titleField,multiSelect:e.multiSelect,selection:x.value,enableHighlightSearch:e.enableHighlightSearch,selectionValues:f.value,onSelectionUpdate:s,onAfterSearch:F},null)])}});function q(e){const t=i.ref(""),l=i.ref(e.modelValue),o=i.ref(e.data||[]),d=i.ref(e.editable);function r(n){const a=e.multiSelect?String(n).split(e.separator):[String(n)],s=a.map(u=>[u,!0]),F=new Map(s);return o.value.filter(u=>F.has(String(u[e.valueField]))).sort((u,m)=>{const C=a.indexOf(u[e.valueField]),v=a.indexOf(m[e.valueField]);return C-v})}function y(n){const a=r(n).map(s=>s[e.textField]).join(e.separator);t.value=d.value?a||n:a}function c(n){if(e.multiSelect){const a=n.split(e.separator).map(F=>[F,!0]),s=new Map(a);return o.value.filter(F=>s.has(F[e.textField]))}return o.value.filter(a=>""+a[e.textField]===n)}function f(n){const a={};return a[e.idField]=n,a[e.textField]=n,[a]}function S(n){let a=c(n);const s=a&&a.length>0;return d.value&&!s&&(a=f(n)),a}function x(){const{url:n,method:a="GET",headers:s={"Content-Type":"application/json;charset=utf-8;"},body:F=null}=e.remote;if(!n)return;const w=a.toLowerCase()==="get"?{method:a,headers:s}:{method:a,headers:s,body:F};let u=!1;fetch(new Request(n,w)).then(m=>{var v,V;if(m.status===200)return u=!!((V=(v=m.headers)==null?void 0:v.get("content-type"))!=null&&V.includes("application/json")),u?m.text():m.json();throw m.status===405?new Error(R.LocaleService.getLocaleValue("comboList.remoteError")):new Error(m.statusText)}).then(m=>{m.length&&(o.value=u?JSON.parse(m):m)}).catch(m=>{console.warn(m)})}return e.remote&&(e.load?e.load().then(n=>{o.value=n}).catch(n=>{console.log(n)}):x()),i.watch(()=>e.data,()=>{o.value=e.data}),i.watch([o],([n])=>{if(e.modelValue!=null){const a=n.find(s=>s[e.valueField]===e.modelValue);a&&(t.value=a[e.textField])}}),i.watch(()=>e.modelValue,n=>{l.value=n,y(n)}),y(e.modelValue),{dataSource:o,displayText:t,editable:d,modelValue:l,getItemsByDisplayText:c,getItemsByValue:r,getSelectedItemsByDisplayText:S}}const P=i.defineComponent({name:"FComboList",props:I,emits:["clear","update:modelValue","change","input"],setup(e,t){const l=i.ref(),o=i.ref(),d=i.ref(e.disabled||e.readonly),r=i.ref(e.enableClear),y=i.ref(e.enableSearch),c=i.ref(e.readonly),{dataSource:f,displayText:S,editable:x,modelValue:n,getSelectedItemsByDisplayText:a,getItemsByDisplayText:s,getItemsByValue:F}=q(e),w=i.ref(e.dropDownIcon);w.value==='<span class="f-icon f-icon-arrow-chevron-down"></span>'&&(w.value='<span id="'+e.id+'-icon-dropdown" class="f-icon f-icon-arrow-chevron-down"></span>');const u=i.computed(()=>e.multiSelect),m=i.computed(()=>o.value?o.value.elementRef.getBoundingClientRect().width:0);function C(){!u.value&&o.value&&o.value.hidePopup()}function v(h){S.value=h.map(p=>p[e.textField]).join(e.separator);let b="";h.length===1?b=h[0][e.valueField]:b=h.map(p=>p[e.valueField]).join(e.separator),n.value!==b&&(n.value=b,t.emit("update:modelValue",n.value),t.emit("change",h,n.value))}function V(){const h=F(n.value);v(h)}function T(){c.value||S.value}function ne(h){var b;n.value="",(b=l.value)==null||b.activeRowById(""),t.emit("update:modelValue",""),t.emit("change",[],""),t.emit("clear")}function le(h){var b,p;e.enableSearch&&e.enableHighlightSearch&&((b=l.value)==null||b.search(h)),(p=l.value)==null||p.activeRowById(h),t.emit("change",[n.value],n.value)}function ae(h){if(e.multiSelect){const b=s(h);e.viewType;const B=b.map(O=>O[e.idField||e.valueField]).join(e.separator);n.value!==B&&(n.value=B,t.emit("update:modelValue",n.value),t.emit("change",b,n.value))}}function oe(){return S.value}function de(h){const{value:b}=h.target;le(b),t.emit("input",b)}function re(){o.value.hidePopup()}function ue(h){f.value=h}function se(){return f.value}const N={getDisplayText:oe,hidePopup:re,updateDataSource:ue,getData:se};t.expose(N);function ce(h){const b=typeof e.beforeOpen=="function";return!e.beforeOpen||!b?Promise.resolve(!0):Promise.resolve().then(()=>e.beforeOpen({instance:N})).then(p=>typeof(p==null?void 0:p.canOpen)=="boolean"?p==null?void 0:p.canOpen:!0)}return i.watch([()=>e.disabled,()=>e.editable,()=>e.enableClear,()=>e.enableSearch,()=>e.readonly],([h,b,p,B,O])=>{d.value=h,x.value=b,r.value=p,y.value=B,c.value=O}),()=>i.createVNode(G,{ref:o,id:e.id,disable:d.value,readonly:c.value,forcePlaceholder:e.forcePlaceholder,editable:x.value,buttonContent:w.value,placeholder:e.placeholder==="请选择"?R.LocaleService.getLocaleValue("comboList.placeholder"):e.placeholder,enableClear:r.value,maxLength:e.maxLength,tabIndex:e.tabIndex,enableTitle:e.enableTitle,multiSelect:e.multiSelect,inputType:e.multiSelect?e.viewType:"text",modelValue:S.value,"onUpdate:modelValue":h=>S.value=h,focusOnCreated:e.focusOnCreated,selectOnCreated:e.selectOnCreated,onClear:ne,onClick:T,onChange:ae,onBlur:V,onInput:de,beforeOpen:ce,placement:e.placement,popupMinWidth:e.minPanelWidth,popupClass:"f-combo-list-wrapper",popupOnClick:e.popupOnClick,limitContentBySpace:!0},{default:()=>[i.createVNode(A,{ref:l,idField:e.idField,valueField:e.valueField,textField:e.textField,titleField:e.titleField,dataSource:f.value,selectedValues:n.value,separator:e.separator,multiSelect:e.multiSelect,enableSearch:y.value,maxHeight:e.maxHeight,enableHighlightSearch:e.enableHighlightSearch,width:e.fitEditor?m.value:void 0,onSelectionChange:h=>{v(h),C()}},null)]})}}),$={convertFrom:(e,t)=>(e.editor.remote||{})[t],convertTo:(e,t,l)=>{e.editor.remote=e.editor.remote||{},e.editor.remote[t]=l}};class D extends z.InputBaseProperty{constructor(t,l){super(t,l)}getCommonEditorProperties(t){var l,o,d;return{viewType:{visible:!!((l=t.editor)!=null&&l.multiSelect),description:"数据展示类型,有标签和文本两种方式",title:"数据展示类型",type:"enum",editor:{data:[{id:"tag",name:"标签"},{id:"text",name:"文本"}]},refreshPanelAfterChanged:!0},separator:{visible:!!((o=t.editor)!=null&&o.multiSelect)&&((d=t.editor)==null?void 0:d.viewType)==="text",description:"下拉列表启用多选且数据展示类型为文本时的分隔符",title:"分隔符",type:"enum",editor:{data:[{id:",",name:"逗号(,)"},{id:"#",name:"井号(#)"},{id:".",name:"句号(.)"},{id:"|",name:"竖线(|)"}]}},editable:{description:"",title:"允许编辑",type:"boolean",refreshPanelAfterChanged:!0,readonly:!0}}}getEditorProperties(t){var r,y;const l=this;let o="";if(((r=t==null?void 0:t.binding)==null?void 0:r.type)==="Form"){const c=this.schemaService.getFieldByIDAndVMID(t.binding.field,this.viewModelId);(y=c==null?void 0:c.schemaField)!=null&&y.type&&(o=c.schemaField.type.$type)}return l.getComponentConfig(t,{type:"combo-list"},{enableClear:{description:"",title:"启用清空",type:"boolean"},dataSourceType:{description:"",title:"数据源类型",type:"enum",editor:{default:"static",data:[{id:"static",name:"静态"},{id:"dynamic",name:"动态"}]},refreshPanelAfterChanged:!0},data:{description:"",title:"数据",type:"array",visible:!t.editor.dataSourceType||t.editor.dataSourceType==="static",...l.getItemCollectionEditor(t,t.editor.valueField,t.editor.textField),refreshPanelAfterChanged:!0},url:{visible:t.editor.dataSourceType==="dynamic",$converter:$,description:"",title:"服务端API",type:"string"},body:{visible:!1,$converter:$,description:"",title:"服务端API参数",type:"string"},textField:{description:"",title:"数据源显示字段",type:"string",readonly:t.editor.dataSourceType!=="dynamic"},valueField:{description:"",title:"数据源值字段",type:"string",readonly:t.editor.dataSourceType!=="dynamic"},multiSelect:{description:"",title:"启用多选",visible:!o||o==="StringType",type:"boolean",refreshPanelAfterChanged:!0},maxLength:{description:"",title:"最大输入长度",type:"number",editor:{nullable:!0,min:0,useThousands:!1,needValid:!0}},...this.getCommonEditorProperties(t)},(c,f)=>{if(!c||!f.editor)return;const S=this;switch(c.propertyID){case"dataSourceType":{c.propertyValue==="static"?(f.editor.valueField="value",f.editor.textField="name",f.editor.remote=null):c.propertyValue==="dynamic"&&(f.editor.remote={method:"GET"},f.editor.valueField="value",f.editor.textField="name");break}case"data":{!S.checkEnumDataReadonly(f)&&f.formatter&&(f.formatter.data=[...c.propertyValue]);break}case"viewType":c.propertyValue==="tag"&&(f.editor.editable=!1)}})}getGridFieldEdtiorProperties(t,l){var y,c,f,S,x,n;const o=this;let d="";if(((y=t==null?void 0:t.binding)==null?void 0:y.type)==="Form"){const a=this.schemaService.getFieldByIDAndVMID(t.binding.field,this.viewModelId);(c=a==null?void 0:a.schemaField)!=null&&c.type&&(d=a.schemaField.type.$type)}return o.getComponentConfig(t,{type:"combo-list"},{enableClear:{description:"",title:"启用清空",type:"boolean"},dataSourceType:{description:"",title:"数据源类型",type:"enum",editor:{default:"static",data:[{id:"static",name:"静态"},{id:"dynamic",name:"动态"}]},refreshPanelAfterChanged:!0},data:{description:"",title:"数据",type:"array",visible:!((f=t.editor)!=null&&f.dataSourceType)||((S=t.editor)==null?void 0:S.dataSourceType)==="static",...o.getItemCollectionEditor(t,(x=t.editor)==null?void 0:x.valueField,(n=t.editor)==null?void 0:n.textField),refreshPanelAfterChanged:!0},textField:{description:"",title:"数据源显示字段",type:"string",readonly:!0},valueField:{description:"",title:"数据源值字段",type:"string",readonly:!0},multiSelect:{description:"",title:"启用多选",visible:d==="StringType",type:"boolean",refreshPanelAfterChanged:!0},maxLength:{description:"",title:"最大输入长度",type:"number",editor:{nullable:!0,min:0,useThousands:!1,needValid:!0}},...this.getCommonEditorProperties(t)},(a,s)=>{if(!a||!s.editor)return;const F=this;switch(a.propertyID){case"dataSourceType":{a.propertyValue==="static"?(s.editor.valueField="value",s.editor.textField="name",s.editor.remote=null):a.propertyValue==="dynamic"&&(s.editor.remote={method:"GET"},s.editor.valueField="value",s.editor.textField="name");break}case"data":{!F.checkEnumDataReadonly(s)&&s.formatter&&(s.formatter.data=[...a.propertyValue]);break}}})}setEditorPropertyRelates(t,l,o){if(!t||!l.editor)return;const d=this;switch(t.propertyID){case"dataSourceType":{t.propertyValue==="static"&&(l.editor.valueField="value",l.editor.textField="name",l.editor.remote={});break}case"data":{!d.checkEnumDataReadonly(l)&&l.formatter&&(l.formatter.data=[...t.propertyValue]);break}}}changeBindingField(t,l,o){var r;super.changeBindingField(t,l);const d=o;t.editor&&((r=d==null?void 0:d.type)==null?void 0:r.$type)===M.FormSchemaEntityFieldType$Type.EnumType&&(t.editor.data=d.type.enumValues||[])}getEventPropertyConfig(t,l="card",o,d){const r=this;let y=[{label:"onChange",name:"值变化事件"},{label:"onClear",name:"清空事件"},{label:"beforeOpen",name:"打开下拉面板前"}];o&&(y=y.concat(o)),this.appendFieldValueChangeEvents(t,y);const c=r.eventsEditorUtils.formProperties(t,r.viewModelId,y);return{title:"事件",hideTitle:!0,properties:r.createBaseEventProperty(c),tabId:"commands",tabName:"交互",setPropertyRelates(x,n){const a=x.propertyValue;delete t[r.viewModelId],a&&(a.setPropertyRelates=this.setPropertyRelates,r.eventsEditorUtils.saveRelatedParameters(t,r.viewModelId,a.events,a)),d&&d(x,n,a);const s=r.designViewModelUtils.getDgViewModel(r.viewModelId);s&&r.designViewModelField&&s.changeField(r.designViewModelField.id,{valueChanging:t.fieldValueChanging,valueChanged:t.fieldValueChanged}),t.editor.beforeOpen!==t.beforeOpen&&(t.editor.beforeOpen=t.beforeOpen),t.editor.onChange!==t.onChange&&(t.editor.onChange=t.onChange),t.editor.onClear!==t.onClear&&(t.editor.onClear=t.onClear)}}}}function ee(e,t){const l=e.schema;function o(d,r){return new D(d,t).getPropertyConfig(l,r)}return{getPropsConfig:o}}const te=i.defineComponent({name:"FComboListDesign",props:j,emits:["clear","update:modelValue","change"],setup(e,t){const l=i.ref(),o=i.inject("designer-host-service"),d=i.inject("design-item-context"),r=ee(d,o),y=_.useDesignerComponent(l,d,r);return i.onMounted(()=>{l.value.componentInstance=y}),t.expose(y.value),()=>i.createVNode(J,{ref:l,buttonContent:e.dropDownIcon,readonly:!0,editable:!1,forcePlaceholder:!0,placeholder:e.placeholder,enableClear:!0},null)}});P.register=(e,t,l,o)=>{e["combo-list"]=P,t["combo-list"]=L,o["combo-list"]={callbackResolver:H}},P.registerDesigner=(e,t,l)=>{e["combo-list"]=te,t["combo-list"]=L};const ie=M.withInstall(P);g.FComboList=P,g.FComboListContainer=A,g.Placement=k,g.callbackResolver=H,g.comboListDesignProps=j,g.comboListProps=I,g.default=ie,g.propsResolver=L,g.useDataSource=q,Object.defineProperties(g,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(s,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("vue"),require("../button-edit/index.umd.js"),require("../locale/index.umd.js"),require("../dynamic-resolver/index.umd.js"),require("lodash-es"),require("../list-view/index.umd.js"),require("../../designer/button-edit/index.umd.js"),require("../designer-canvas/index.umd.js"),require("../common/index.umd.js"),require("../property-panel/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","../button-edit/index.umd.js","../locale/index.umd.js","../dynamic-resolver/index.umd.js","lodash-es","../list-view/index.umd.js","../../designer/button-edit/index.umd.js","../designer-canvas/index.umd.js","../common/index.umd.js","../property-panel/index.umd.js"],l):(s=typeof globalThis<"u"?globalThis:s||self,l(s["combo-list"]={},s.Vue,s.FButtonEdit,s.locale,s.dynamicResolver,s.LodashES,s.FListView,s.FButtonEditDesign,s.designerCanvas,s.common,s.propertyPanel))})(this,function(s,l,W,k,j,J,_,z,K,H,Q){"use strict";const X=new Map([["appearance",j.resolveAppearance]]),Y={$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:{}},disabled:{description:"",type:"boolean",default:!1},enableClear:{description:"",type:"boolean",default:!1},editable:{description:"",type:"boolean",default:!1},enableLinkLabel:{description:"",type:"boolean",default:!1},label:{description:"",type:"string",default:""},lableWidth:{description:"",type:"number"},placeholder:{description:"",type:"string",default:"请选择"},idField:{description:"",type:"string",default:"id"},valueField:{description:"",type:"string",default:"id"},titleField:{description:"",type:"string",default:"name"},textField:{description:"",type:"string",default:"name"},dataSourceType:{description:"",type:"string",default:"static"},data:{description:"",type:"array"},remote:{description:"",type:"string"},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"},multiSelect:{description:"",type:"boolean",default:!1},maxLength:{description:"",type:"number",default:null},visible:{description:"",type:"boolean",default:!0},onBlur:{description:"",type:"string",default:""},onClickLinkLabel:{description:"",type:"string",default:""},maxHeight:{description:"",type:"number",default:350},minPanelWidth:{description:"",type:"number",default:160},popupOnClick:{description:"",type:"boolean",default:!0},separator:{description:"",type:"string",default:","},viewType:{description:"",type:"string",default:"tag"},enableSearch:{description:"启用搜索",type:"boolean",default:!0},enableHighlightSearch:{description:"启用高亮搜索",type:"boolean",default:!1},beforeOpen:{description:"打卡面板前回调",type:"string"},onChange:{description:"值变化事件",type:"string",default:""},onInput:{description:"输入事件",type:"string",default:""},onClear:{description:"清空事件",type:"string",default:""}},required:["type"],ignore:["id","appearance","binding","visible"]};function Z(e,t,a){return t}function D(){function e(t,a,n){const d={};return d.beforeOpen=r=>a.call("beforeOpen",t,[r,t],n),d}return{resolve:e}}var A=(e=>(e.top="top",e.bottom="bottom",e.auto="auto",e))(A||{});const L={id:{type:String},data:{type:Array,default:[]},disabled:{default:!1,type:Boolean},dropDownIcon:{type:String,default:'<span class="f-icon f-icon-arrow-chevron-down"></span>'},editable:{default:!1,type:Boolean},enableClear:{default:!0,type:Boolean},enableSearch:{type:Boolean,default:!1},enableTitle:{default:!0,type:Boolean},fitEditor:{default:!1,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:{type:Boolean,default:!1},modelValue:{},placeholder:{type:String,default:"请选择"},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},titleField:{default:"name",type:String},valueField:{default:"id",type:String},viewType:{default:"tag",type:String},change:{type:Function,default:()=>{}},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1},autoHeight:{type:Boolean,default:!0},beforeOpen:{type:Function,default:null},load:{type:Function},searchOption:{type:[Boolean,Function],default:!1},enableHighlightSearch:{type:Boolean,default:!0},minPanelWidth:{type:Number,default:160},popupOnClick:{type:Boolean,default:!0}},q=Object.assign({},L,{readonly:{}}),E=j.createPropsResolver(L,Y,X,Z),$=D(),ee={dataSource:{type:Array,default:[]},enableSearch:{type:Boolean,default:!1},idField:{type:String,default:"id"},multiSelect:{type:Boolean,default:!1},selectedValues:{type:String,default:""},separator:{type:String,default:","},textField:{type:String,default:"name"},titleField:{type:String,default:"name"},width:{type:Number},maxHeight:{type:Number},valueField:{type:String,default:"id"},onSelectionChange:{type:Function,default:()=>{}},searchOption:{type:[Boolean,Function],default:!1},enableHighlightSearch:{type:Boolean,default:!0}},N=l.defineComponent({name:"FComboListContainer",props:ee,emits:["selectionChange"],setup(e,t){const a=l.ref(),n=l.ref(e.dataSource),d=l.ref([]),r=l.ref(e.separator),f=l.ref(e.width),u=l.ref(e.maxHeight),h=l.computed(()=>e.multiSelect),p=l.ref(e.multiSelect?String(e.selectedValues).split(r.value):[e.selectedValues]),w=l.computed(()=>({enableSelectRow:!0,multiSelect:e.multiSelect,multiSelectMode:"OnCheckAndClick",showCheckbox:h.value,showSelectAll:!1,showSelection:!0}));l.watch(e.dataSource,()=>{n.value=e.dataSource}),l.computed(()=>e.enableSearch?"SearchBar":"ContentHeader");const g=l.computed(()=>{const i={};return f.value!==void 0&&(i.width=`${f.value}px`),u.value!==void 0&&u.value>0&&(i.maxHeight=`${u.value}px`),i});function y(i){a.value.search(i)}function S(i){d.value=i.map(c=>Object.assign({},c)),p.value=i.map(c=>c[e.idField]),t.emit("selectionChange",d.value)}function P(i){if(e.enableHighlightSearch)return;let c=[];const{searchOption:b}=e;typeof b=="function"?c=n.value.filter(F=>b(i,F)):c=n.value.filter(F=>F[e.valueField].indexOf(i)>-1||F[e.textField].indexOf(i)>-1),a.value.updateDataSource(c)}l.watch([()=>e.selectedValues],([i])=>{e.multiSelect?p.value=i.split(r.value):p.value=[i]});function o(i){a.value.activeRowById(i)}return l.onMounted(()=>{var i,c;if(!e.multiSelect){const b=(i=p.value)==null?void 0:i[0];let F=b;const x=n.value.map(v=>v[e.valueField||e.idField]);if(!J.isUndefined(b)&&x.includes(b)){const v=typeof b,V=typeof((c=n.value[0])==null?void 0:c[e.valueField||e.idField]);V==="number"&&v!==V&&(F=Number(b)),V==="boolean"&&v!==V&&(F=b==="true"?!0:b==="false"?!1:b),o(F)}}}),t.expose({search:y,activeRowById:o}),()=>l.createVNode("div",{class:"f-combo-list-container",style:g.value},[l.createVNode(_,{ref:a,size:"small",itemClass:"f-combo-list-item",itemContentClass:"text-truncate",header:"ContentHeader",headerClass:"f-combo-list-search-box",data:n.value,idField:e.idField,textField:e.textField,titleField:e.titleField,multiSelect:e.multiSelect,selection:w.value,enableHighlightSearch:e.enableHighlightSearch,selectionValues:p.value,onSelectionUpdate:S,onAfterSearch:P},null)])}});function G(e){const t=l.ref(""),a=l.ref(e.modelValue),n=l.ref(e.data||[]),d=l.ref(e.editable);function r(o){const i=e.multiSelect?String(o).split(e.separator):[String(o)],c=i.map(x=>[x,!0]),b=new Map(c);return n.value.filter(x=>b.has(String(x[e.valueField]))).sort((x,v)=>{const V=i.indexOf(x[e.valueField]),I=i.indexOf(v[e.valueField]);return V-I})}function f(o){const i=r(o).map(c=>c[e.textField]).join(e.separator);t.value=d.value?i||o:i}function u(o){if(e.multiSelect){const i=o.split(e.separator).map(b=>[b,!0]),c=new Map(i);return n.value.filter(b=>c.has(b[e.textField]))}return n.value.filter(i=>""+i[e.textField]===o)}function h(o){const i={};return i[e.idField]=o,i[e.textField]=o,[i]}function p(o){let i=u(o);const c=i&&i.length>0;return d.value&&!c&&(i=h(o)),i}function w(){const{url:o,method:i="GET",headers:c={"Content-Type":"application/json;charset=utf-8;"},body:b=null}=e.remote;if(!o)return;const F=i.toLowerCase()==="get"?{method:i,headers:c}:{method:i,headers:c,body:b};let x=!1;fetch(new Request(o,F)).then(v=>{var I,O;if(v.status===200)return x=!!((O=(I=v.headers)==null?void 0:I.get("content-type"))!=null&&O.includes("application/json")),x?v.text():v.json();throw v.status===405?new Error(k.LocaleService.getLocaleValue("comboList.remoteError")):new Error(v.statusText)}).then(v=>{v.length&&(n.value=x?JSON.parse(v):v)}).catch(v=>{console.warn(v)})}e.remote&&(e.load?e.load().then(o=>{n.value=o}).catch(o=>{console.log(o)}):w()),l.watch(()=>e.data,()=>{n.value=e.data}),l.watch([n],([o])=>{if(e.modelValue!=null){const i=o.find(c=>c[e.valueField]===e.modelValue);i&&(t.value=i[e.textField])}}),l.watch(()=>e.modelValue,o=>{a.value=o,f(o)});function g(o){n.value=o}function y(){return n.value}function S(){return t.value}function P(){const o=typeof e.beforeOpen=="function";return!e.beforeOpen||!o?Promise.resolve(!0):Promise.resolve().then(()=>e.beforeOpen({instance:{updateDataSource:g,getData:y,getDisplayText:S}})).then(i=>typeof(i==null?void 0:i.canOpen)=="boolean"?i==null?void 0:i.canOpen:!0)}return e.beforeOpen?P().then(o=>{o&&f(e.modelValue)}):f(e.modelValue),{dataSource:n,displayText:t,editable:d,modelValue:a,beforeOpenList:P,getItemsByDisplayText:u,getItemsByValue:r,getSelectedItemsByDisplayText:p}}const B=l.defineComponent({name:"FComboList",props:L,emits:["clear","update:modelValue","change","input"],setup(e,t){const a=l.ref(),n=l.ref(),d=l.ref(e.disabled||e.readonly),r=l.ref(e.enableClear),f=l.ref(e.enableSearch),u=l.ref(e.readonly),{dataSource:h,displayText:p,editable:w,modelValue:g,getItemsByDisplayText:y,getItemsByValue:S,beforeOpenList:P}=G(e),o=l.ref(e.dropDownIcon);o.value==='<span class="f-icon f-icon-arrow-chevron-down"></span>'&&(o.value='<span id="'+e.id+'-icon-dropdown" class="f-icon f-icon-arrow-chevron-down"></span>');const i=l.computed(()=>e.multiSelect),c=l.computed(()=>n.value?n.value.elementRef.getBoundingClientRect().width:0);function b(){!i.value&&n.value&&n.value.hidePopup()}function F(m){p.value=m.map(T=>T[e.textField]).join(e.separator);let C="";m.length===1?C=m[0][e.valueField]:C=m.map(T=>T[e.valueField]).join(e.separator),g.value!==C&&(g.value=C,t.emit("update:modelValue",g.value),t.emit("change",m,g.value))}function x(){const m=S(g.value);F(m)}function v(){u.value||p.value}function V(m){var C;g.value="",(C=a.value)==null||C.activeRowById(""),t.emit("update:modelValue",""),t.emit("change",[],""),t.emit("clear")}function I(m){var C,T;e.enableSearch&&e.enableHighlightSearch&&((C=a.value)==null||C.search(m)),(T=a.value)==null||T.activeRowById(m),t.emit("change",[g.value],g.value)}function O(m){if(e.multiSelect){const C=y(m);e.viewType;const R=C.map(M=>M[e.idField||e.valueField]).join(e.separator);g.value!==R&&(g.value=R,t.emit("update:modelValue",g.value),t.emit("change",C,g.value))}}function ae(){return p.value}function oe(m){const{value:C}=m.target;I(C),t.emit("input",C)}function de(){n.value.hidePopup()}function re(m){h.value=m}function ue(){return h.value}const ce={getDisplayText:ae,hidePopup:de,updateDataSource:re,getData:ue};return t.expose(ce),l.watch([()=>e.disabled,()=>e.editable,()=>e.enableClear,()=>e.enableSearch,()=>e.readonly],([m,C,T,R,M])=>{d.value=m,w.value=C,r.value=T,f.value=R,u.value=M}),()=>l.createVNode(W,{ref:n,id:e.id,disable:d.value,readonly:u.value,forcePlaceholder:e.forcePlaceholder,editable:w.value,buttonContent:o.value,placeholder:e.placeholder==="请选择"?k.LocaleService.getLocaleValue("comboList.placeholder"):e.placeholder,enableClear:r.value,maxLength:e.maxLength,tabIndex:e.tabIndex,enableTitle:e.enableTitle,multiSelect:e.multiSelect,inputType:e.multiSelect?e.viewType:"text",modelValue:p.value,"onUpdate:modelValue":m=>p.value=m,focusOnCreated:e.focusOnCreated,selectOnCreated:e.selectOnCreated,onClear:V,onClick:v,onChange:O,onBlur:x,onInput:oe,beforeOpen:P,placement:e.placement,popupMinWidth:e.minPanelWidth,popupClass:"f-combo-list-wrapper",popupOnClick:e.popupOnClick,limitContentBySpace:!0},{default:()=>[l.createVNode(N,{ref:a,idField:e.idField,valueField:e.valueField,textField:e.textField,titleField:e.titleField,dataSource:h.value,selectedValues:g.value,separator:e.separator,multiSelect:e.multiSelect,enableSearch:f.value,maxHeight:e.maxHeight,enableHighlightSearch:e.enableHighlightSearch,width:e.fitEditor?c.value:void 0,onSelectionChange:m=>{F(m),b()}},null)]})}}),U={convertFrom:(e,t)=>(e.editor.remote||{})[t],convertTo:(e,t,a)=>{e.editor.remote=e.editor.remote||{},e.editor.remote[t]=a}};class te extends Q.InputBaseProperty{constructor(t,a){super(t,a)}getCommonEditorProperties(t){var a,n,d;return{viewType:{visible:!!((a=t.editor)!=null&&a.multiSelect),description:"数据展示类型,有标签和文本两种方式",title:"数据展示类型",type:"enum",editor:{data:[{id:"tag",name:"标签"},{id:"text",name:"文本"}]},refreshPanelAfterChanged:!0},separator:{visible:!!((n=t.editor)!=null&&n.multiSelect)&&((d=t.editor)==null?void 0:d.viewType)==="text",description:"下拉列表启用多选且数据展示类型为文本时的分隔符",title:"分隔符",type:"enum",editor:{data:[{id:",",name:"逗号(,)"},{id:"#",name:"井号(#)"},{id:".",name:"句号(.)"},{id:"|",name:"竖线(|)"}]}},editable:{description:"",title:"允许编辑",type:"boolean",refreshPanelAfterChanged:!0,readonly:!0}}}getEditorProperties(t){var r,f;const a=this;let n="";if(((r=t==null?void 0:t.binding)==null?void 0:r.type)==="Form"){const u=this.schemaService.getFieldByIDAndVMID(t.binding.field,this.viewModelId);(f=u==null?void 0:u.schemaField)!=null&&f.type&&(n=u.schemaField.type.$type)}return a.getComponentConfig(t,{type:"combo-list"},{enableClear:{description:"",title:"启用清空",type:"boolean"},dataSourceType:{description:"",title:"数据源类型",type:"enum",editor:{default:"static",data:[{id:"static",name:"静态"},{id:"dynamic",name:"动态"}]},refreshPanelAfterChanged:!0},data:{description:"",title:"数据",type:"array",visible:!t.editor.dataSourceType||t.editor.dataSourceType==="static",...a.getItemCollectionEditor(t,t.editor.valueField,t.editor.textField),refreshPanelAfterChanged:!0},url:{visible:t.editor.dataSourceType==="dynamic",$converter:U,description:"",title:"服务端API",type:"string"},body:{visible:!1,$converter:U,description:"",title:"服务端API参数",type:"string"},textField:{description:"",title:"数据源显示字段",type:"string",readonly:t.editor.dataSourceType!=="dynamic"},valueField:{description:"",title:"数据源值字段",type:"string",readonly:t.editor.dataSourceType!=="dynamic"},multiSelect:{description:"",title:"启用多选",visible:!n||n==="StringType",type:"boolean",refreshPanelAfterChanged:!0},maxLength:{description:"",title:"最大输入长度",type:"number",editor:{nullable:!0,min:0,useThousands:!1,needValid:!0}},...this.getCommonEditorProperties(t)},(u,h)=>{if(!u||!h.editor)return;const p=this;switch(u.propertyID){case"dataSourceType":{u.propertyValue==="static"?(h.editor.valueField="value",h.editor.textField="name",h.editor.remote=null):u.propertyValue==="dynamic"&&(h.editor.remote={method:"GET"},h.editor.valueField="value",h.editor.textField="name");break}case"data":{!p.checkEnumDataReadonly(h)&&h.formatter&&(h.formatter.data=[...u.propertyValue]);break}case"viewType":u.propertyValue==="tag"&&(h.editor.editable=!1)}})}getGridFieldEdtiorProperties(t,a){var f,u,h,p,w,g;const n=this;let d="";if(((f=t==null?void 0:t.binding)==null?void 0:f.type)==="Form"){const y=this.schemaService.getFieldByIDAndVMID(t.binding.field,this.viewModelId);(u=y==null?void 0:y.schemaField)!=null&&u.type&&(d=y.schemaField.type.$type)}return n.getComponentConfig(t,{type:"combo-list"},{enableClear:{description:"",title:"启用清空",type:"boolean"},data:{description:"",title:"数据",type:"array",visible:!((h=t.editor)!=null&&h.dataSourceType)||((p=t.editor)==null?void 0:p.dataSourceType)==="static",...n.getItemCollectionEditor(t,(w=t.editor)==null?void 0:w.valueField,(g=t.editor)==null?void 0:g.textField),refreshPanelAfterChanged:!0},textField:{description:"",title:"数据源显示字段",type:"string",readonly:!0},valueField:{description:"",title:"数据源值字段",type:"string",readonly:!0},multiSelect:{description:"",title:"启用多选",visible:d==="StringType",type:"boolean",refreshPanelAfterChanged:!0},maxLength:{description:"",title:"最大输入长度",type:"number",editor:{nullable:!0,min:0,useThousands:!1,needValid:!0}},...this.getCommonEditorProperties(t)},(y,S)=>{if(!y||!S.editor)return;const P=this;switch(y.propertyID){case"dataSourceType":{y.propertyValue==="static"?(S.editor.valueField="value",S.editor.textField="name",S.editor.remote=null):y.propertyValue==="dynamic"&&(S.editor.remote={method:"GET"},S.editor.valueField="value",S.editor.textField="name");break}case"data":{!P.checkEnumDataReadonly(S)&&S.formatter&&(S.formatter.data=[...y.propertyValue]);break}}})}setEditorPropertyRelates(t,a,n){if(!t||!a.editor)return;const d=this;switch(t.propertyID){case"dataSourceType":{t.propertyValue==="static"&&(a.editor.valueField="value",a.editor.textField="name",a.editor.remote={});break}case"data":{!d.checkEnumDataReadonly(a)&&a.formatter&&(a.formatter.data=[...t.propertyValue]);break}}}changeBindingField(t,a,n){var r;super.changeBindingField(t,a);const d=n;t.editor&&((r=d==null?void 0:d.type)==null?void 0:r.$type)===H.FormSchemaEntityFieldType$Type.EnumType&&(t.editor.data=d.type.enumValues||[])}getEventPropertyConfig(t,a="card",n,d){const r=this;let f=[{label:"onChange",name:"值变化事件"},{label:"beforeOpen",name:"下拉面板前事件"}];n&&(f=f.concat(n)),this.appendFieldValueChangeEvents(t,f);const u=r.eventsEditorUtils.formProperties(t,r.viewModelId,f);return{title:"事件",hideTitle:!0,properties:r.createBaseEventProperty(u),tabId:"commands",tabName:"交互",setPropertyRelates(w,g){const y=w.propertyValue;delete t[r.viewModelId],y&&(y.setPropertyRelates=this.setPropertyRelates,r.eventsEditorUtils.saveRelatedParameters(t,r.viewModelId,y.events,y)),d&&d(w,g,y);const S=r.designViewModelUtils.getDgViewModel(r.viewModelId);S&&r.designViewModelField&&S.changeField(r.designViewModelField.id,{valueChanging:t.fieldValueChanging,valueChanged:t.fieldValueChanged}),t.editor.beforeOpen!==t.beforeOpen&&(t.editor.beforeOpen=t.beforeOpen),t.editor.onChange!==t.onChange&&(t.editor.onChange=t.onChange),t.editor.onClear!==t.onClear&&(t.editor.onClear=t.onClear)}}}}function ie(e,t){const a=e.schema;function n(d,r){return new te(d,t).getPropertyConfig(a,r)}return{getPropsConfig:n}}const ne=l.defineComponent({name:"FComboListDesign",props:q,emits:["clear","update:modelValue","change"],setup(e,t){const a=l.ref(),n=l.inject("designer-host-service"),d=l.inject("design-item-context"),r=ie(d,n),f=K.useDesignerComponent(a,d,r);return l.onMounted(()=>{a.value.componentInstance=f}),t.expose(f.value),()=>l.createVNode(z,{ref:a,buttonContent:e.dropDownIcon,readonly:!0,editable:!1,forcePlaceholder:!0,placeholder:e.placeholder,enableClear:!0},null)}});B.register=(e,t,a,n)=>{e["combo-list"]=B,t["combo-list"]=E,n["combo-list"]={callbackResolver:$}},B.registerDesigner=(e,t,a)=>{e["combo-list"]=ne,t["combo-list"]=E};const le=H.withInstall(B);s.FComboList=B,s.FComboListContainer=N,s.Placement=A,s.callbackResolver=$,s.comboListDesignProps=q,s.comboListProps=L,s.default=le,s.propsResolver=E,s.useDataSource=G,Object.defineProperties(s,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});