cnhis-design-vue 3.2.8-release.1 → 3.2.8-release.2

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 (104) hide show
  1. package/es/components/ai-chat/index.d.ts +75 -0
  2. package/es/components/ai-chat/index.js +1 -0
  3. package/es/components/ai-chat/src/Index.vue.d.ts +77 -0
  4. package/es/components/ai-chat/src/Index.vue.js +1 -0
  5. package/es/components/ai-chat/src/Index.vue2.js +1 -0
  6. package/es/components/ai-chat/src/components/ChatFooter.vue.d.ts +14 -0
  7. package/es/components/ai-chat/src/components/ChatFooter.vue.js +1 -0
  8. package/es/components/ai-chat/src/components/ChatFooter.vue2.js +1 -0
  9. package/es/components/ai-chat/src/components/ChatMain.d.ts +8 -0
  10. package/es/components/ai-chat/src/components/ChatMain.js +1 -0
  11. package/es/components/ai-chat/src/types/index.d.ts +20 -0
  12. package/es/components/ai-chat/src/types/index.js +1 -0
  13. package/es/components/ai-chat/style/index.css +1 -0
  14. package/es/components/annotation-edit/src/AnnotationEdit.js +1 -1
  15. package/es/components/audio-sdk/src/components/recordingDialog.vue2.js +1 -1
  16. package/es/components/button-print/index.d.ts +38 -0
  17. package/es/components/button-print/src/ButtonPrint.vue.d.ts +38 -0
  18. package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
  19. package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +17 -0
  20. package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
  21. package/es/components/button-print/src/components/OldPrintComponent.vue.d.ts +9 -0
  22. package/es/components/button-print/src/components/OldPrintComponent.vue2.js +1 -1
  23. package/es/components/button-print/src/utils/print.js +1 -1
  24. package/es/components/button-print/style/index.css +1 -1
  25. package/es/components/calendar/src/Calendar.vue2.js +1 -1
  26. package/es/components/callback/src/components/render/popupMaps.d.ts +3 -2
  27. package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
  28. package/es/components/field-set/src/FieldColor.vue.d.ts +10 -1
  29. package/es/components/field-set/src/FieldFilter.vue.d.ts +10 -1
  30. package/es/components/field-set/src/FieldSet.vue.d.ts +21 -2
  31. package/es/components/field-set/src/FieldSet.vue2.js +1 -1
  32. package/es/components/field-set/src/components/condition.vue2.js +1 -1
  33. package/es/components/field-set/src/components/edit-dialog.vue2.js +1 -1
  34. package/es/components/field-set/src/components/table-row.vue.d.ts +10 -1
  35. package/es/components/field-set/src/components/table-row.vue2.js +1 -1
  36. package/es/components/field-set/src/utils/index.d.ts +1 -1
  37. package/es/components/field-set/src/utils/index.js +1 -1
  38. package/es/components/form-config/index.d.ts +6 -4
  39. package/es/components/form-config/src/FormConfig.vue.d.ts +6 -4
  40. package/es/components/form-config/src/FormConfig.vue2.js +1 -1
  41. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +3 -2
  42. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +3 -2
  43. package/es/components/form-config/src/components/FormConfigEventSetting.vue2.js +1 -1
  44. package/es/components/form-render/index.d.ts +3 -2
  45. package/es/components/form-render/src/FormRender.vue.d.ts +2 -1
  46. package/es/components/form-render/src/FormRender.vue2.js +1 -1
  47. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +3 -2
  48. package/es/components/form-render/src/FormRenderWrapper.vue2.js +1 -1
  49. package/es/components/form-render/src/components/renderer/formItem.js +1 -1
  50. package/es/components/form-render/src/components/renderer/levelSearchCascader/index.js +1 -1
  51. package/es/components/form-render/src/components/renderer/searchCascade.js +1 -1
  52. package/es/components/form-render/src/components/renderer/select.js +1 -1
  53. package/es/components/form-render/src/hooks/useFormContext.js +1 -1
  54. package/es/components/form-render/src/hooks/useFormEvent.d.ts +1 -1
  55. package/es/components/form-render/src/hooks/useFormRenderOptions.js +1 -1
  56. package/es/components/form-render/src/types/index.d.ts +1 -0
  57. package/es/components/guide/src/renderer.js +1 -1
  58. package/es/components/iho-chat/index.d.ts +3 -0
  59. package/es/components/iho-chat/src/Index.vue.d.ts +3 -0
  60. package/es/components/iho-chat/src/Index.vue2.js +1 -1
  61. package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
  62. package/es/components/iho-chat/src/components/ChatFile.vue2.js +1 -1
  63. package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +4 -0
  64. package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
  65. package/es/components/iho-chat/src/components/ChatRecord.vue2.js +1 -1
  66. package/es/components/iho-chat/src/components/ChatSearch.vue2.js +1 -1
  67. package/es/components/iho-chat/src/components/ChatSet.vue2.js +1 -1
  68. package/es/components/iho-chat/src/hooks/useSearchUserList.js +1 -1
  69. package/es/components/iho-chat/style/index.css +1 -1
  70. package/es/components/iho-table/src/IhoTable.vue2.js +1 -1
  71. package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin.js +1 -1
  72. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/levelSearchCascadePlugin/levelSearchCascade.vue2.js +1 -1
  73. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
  74. package/es/components/index.css +1 -1
  75. package/es/components/index.d.ts +2 -1
  76. package/es/components/index.js +1 -1
  77. package/es/components/info-header/index.d.ts +6 -4
  78. package/es/components/info-header/src/InfoHeader.vue.d.ts +6 -4
  79. package/es/components/info-header/src/InfoHeader.vue2.js +1 -1
  80. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +3 -2
  81. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +3 -2
  82. package/es/components/keyboard/src/Keyboard.vue2.js +1 -1
  83. package/es/components/search-cascader/src/SearchCascader.vue2.js +1 -1
  84. package/es/components/shortcut-provider/src/ShortcutProvider.vue2.js +1 -1
  85. package/es/components/shortcut-setter/index.d.ts +3 -2
  86. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +3 -2
  87. package/es/components/shortcut-setter/src/ShortcutSetter.vue2.js +1 -1
  88. package/es/components/step-notice/src/StepNotice.vue2.js +1 -1
  89. package/es/components/step-notice/src/hooks/useTheme.js +1 -1
  90. package/es/components/steps-wheel/src/StepsWheel.vue2.js +1 -1
  91. package/es/components/time-picker/src/TimePicker.vue2.js +1 -1
  92. package/es/components/tooth-bitmap/src/ToothBitmap.vue2.js +1 -1
  93. package/es/shared/assets/img/ai__avatar.png.js +1 -0
  94. package/es/shared/hooks/index.d.ts +1 -0
  95. package/es/shared/hooks/index.js +1 -1
  96. package/es/shared/hooks/selectHooks/useOptionFiltered.js +1 -1
  97. package/es/shared/hooks/selectHooks/useSearchContent.js +1 -1
  98. package/es/shared/hooks/selectHooks/useSelectRenders.js +1 -1
  99. package/es/shared/hooks/useFormRequest/index.js +1 -1
  100. package/es/shared/hooks/useLevelSearchCascader.js +1 -1
  101. package/es/shared/package.json.js +1 -1
  102. package/package.json +2 -2
  103. /package/es/{components/iho-chat/src → shared}/hooks/useScrollLoading.d.ts +0 -0
  104. /package/es/{components/iho-chat/src → shared}/hooks/useScrollLoading.js +0 -0
@@ -1 +1 @@
1
- import{isObject as e,isFunction as t,cloneDeep as i}from"lodash-es";import{toRaw as o,h as l}from"vue";import{HIGHEST_PRIORITY as s,IHO_TABLE_FIXED_STATUS as n,WIDGET_TYPE as d}from"../constants/index.js";import{defineTablePlugin as r}from"../hooks/useTablePlugin.js";import{getDefaultValue as a}from"./rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.js";import{IhoTableStatusHelper as f,IhoTableUtils as c}from"../utils/index.js";function m(){const m="lowCodeFieldAdaptorPlugin";return r({name:m,apply(r){r.fieldHooks.field.tap({name:m,stage:s},((s,r,m)=>{const p=s,u={className:p.bold?"iho-table__boldCell":"",field:p.columnName,showOverflow:"ellipsis",visible:f.notNegative(p.isShow),minWidth:p.colWidth,sortable:f.isPositive(p.isSort),fixed:n[p.isFixed],...p,title:p.alias||p.title};return function(e,i){const o={default:i.slotFn,header:i.headerSlotFn,edit:i.editSlotFn,footer:i.footerSlotFn,...i.slots};if(t(i.checkEditStatus)){const{default:e}=o;t(e)&&(o.default=t=>i.checkEditStatus(t)?e(t):[l("span",null,a(t.row,t.column.editRender.props))])}e.slots=o}(u,p),function(l,s,n){var r,a;const m=i(o(s));m.componentProps={size:"mini"===n.size?"small":n.size,...m.componentProps},n.forceClearable&&(m.componentProps.clearable=!0);l.editRender={name:c.getCellType(s),...l.editRender,props:m},l.editRender.enabled=!Reflect.get(d,l.editRender.name),!l.editRender.enabled&&t(null==(r=l.slots)?void 0:r.default)&&(l.editRender.enabled=t(null==(a=l.slots)?void 0:a.edit));if(!e(s.settingObj))return;Reflect.has(s.settingObj,"isHide")&&(l.visible=l.visible&&f.notPositive(s.settingObj.isHide))}(u,p,m),u})),r.fieldHooks.field.tap({name:m+"After",stage:1e3},(t=>(e(t.slots)&&Object.entries(t.slots).forEach((([e,i])=>{null==i&&Reflect.deleteProperty(t.slots,e)})),t)))}})}export{m as lowCodeFieldAdaptorPlugin};
1
+ import{isObject as e,isFunction as t,cloneDeep as i}from"lodash-es";import{toRaw as l,h as o}from"vue";import{HIGHEST_PRIORITY as s,IHO_TABLE_FIXED_STATUS as n,WIDGET_TYPE as d}from"../constants/index.js";import{defineTablePlugin as r}from"../hooks/useTablePlugin.js";import{getDefaultValue as a}from"./rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.js";import{IhoTableStatusHelper as f,IhoTableUtils as c}from"../utils/index.js";function m(){const m="lowCodeFieldAdaptorPlugin";return r({name:m,apply(r){r.fieldHooks.field.tap({name:m,stage:s},((s,r,m)=>{const u=s,p={className:u.bold?"iho-table__boldCell":"",field:u.columnName,showOverflow:"ellipsis",visible:f.notNegative(u.isShow),minWidth:u.colWidth,sortable:f.isPositive(u.isSort),fixed:n[u.isFixed],...u,title:u.alias||u.title};return function(e,i){const l={default:i.slotFn,header:i.headerSlotFn,edit:i.editSlotFn,footer:i.footerSlotFn,...i.slots};if(t(i.checkEditStatus)){const{default:e}=l;t(e)&&(l.default=t=>i.checkEditStatus(t)?e(t):[o("span",null,a(t.row,t.column.editRender.props))])}e.slots=l}(p,u),function(o,s,n){var r,a,m;const u=i(l(s));u.componentProps={size:"mini"===n.size?"small":n.size,...u.componentProps},n.forceClearable&&(u.componentProps.clearable=!0);o.editRender={name:c.getCellType(s),...o.editRender,props:u},null==(null==(r=o.editRender)?void 0:r.enabled)&&(o.editRender.enabled=!Reflect.get(d,o.editRender.name),!o.editRender.enabled&&t(null==(a=o.slots)?void 0:a.default)&&(o.editRender.enabled=t(null==(m=o.slots)?void 0:m.edit)));if(!e(s.settingObj))return;Reflect.has(s.settingObj,"isHide")&&(o.visible=o.visible&&f.notPositive(s.settingObj.isHide))}(p,u,m),p})),r.fieldHooks.field.tap({name:m+"After",stage:1e3},(t=>(e(t.slots)&&Object.entries(t.slots).forEach((([e,i])=>{null==i&&Reflect.deleteProperty(t.slots,e)})),t)))}})}export{m as lowCodeFieldAdaptorPlugin};
@@ -1 +1 @@
1
- import{defineComponent as e,inject as a,openBlock as t,createBlock as o,unref as r,isRef as s,withCtx as u,createVNode as i}from"vue";import l from"../../../../../../../shared/components/no-data/NoData.vue.js";import"../../../../../../../shared/utils/index.js";import"naive-ui";import"@vueuse/core";import"date-fns";import"lodash-es";import"@vue/shared";import{useLevelSearchCascader as p}from"../../../../../../../shared/hooks/useLevelSearchCascader.js";import"@vueuse/shared";import"../../../../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{InjectionTableAsyncQueue as n}from"../../../../constants/index.js";import d from"../../../../../../search-cascader/index.js";var c=e({__name:"levelSearchCascade",props:{options:{type:Array,default:()=>[]},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},autograph:{type:String,required:!0},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},wordbook:{type:Object,required:!0},value:{type:[String,Array]},fieldKey:{type:String,required:!0},payload:{type:Object,required:!0}},emits:["update:value","click"],setup(e,{emit:c}){const y=e,h=a(n),{valueKey:m,valueRef:f,labelKey:v,optionsRef:k,showRef:j,fetchData:S,menuWidth:b,searchCascaderRef:g}=p(y,c,{fieldKey:y.fieldKey,asyncQueue:h,getRequestPayload:()=>y.payload});function q(){b.value=150}function w(e){c("click",e)}return(e,a)=>(t(),o(r(d),{ref_key:"searchCascaderRef",ref:g,value:r(f),"onUpdate:value":a[0]||(a[0]=e=>s(f)?f.value=e:null),show:r(j),"onUpdate:show":a[1]||(a[1]=e=>s(j)?j.value=e:null),options:r(k),"label-key":r(v),"value-key":r(m),search:r(S),"menu-width":r(b),"input-props":{onClick:w},onFocus:q},{empty:u((()=>[i(r(l))])),_:1},8,["value","show","options","label-key","value-key","search","menu-width","input-props"]))}});export{c as default};
1
+ import{defineComponent as e,inject as a,openBlock as t,createBlock as o,unref as r,isRef as s,withCtx as i,createVNode as u}from"vue";import l from"../../../../../../../shared/components/no-data/NoData.vue.js";import"../../../../../../../shared/utils/index.js";import"naive-ui";import"@vueuse/core";import"date-fns";import"lodash-es";import"@vue/shared";import{useLevelSearchCascader as p}from"../../../../../../../shared/hooks/useLevelSearchCascader.js";import"@vueuse/shared";import"../../../../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import"../../../../../../../shared/hooks/useScrollLoading.js";import{InjectionTableAsyncQueue as n}from"../../../../constants/index.js";import d from"../../../../../../search-cascader/index.js";var c=e({__name:"levelSearchCascade",props:{options:{type:Array,default:()=>[]},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},autograph:{type:String,required:!0},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},wordbook:{type:Object,required:!0},value:{type:[String,Array]},fieldKey:{type:String,required:!0},payload:{type:Object,required:!0}},emits:["update:value","click"],setup(e,{emit:c}){const h=e,m=a(n),{valueKey:y,valueRef:f,labelKey:v,optionsRef:k,showRef:j,fetchData:S,menuWidth:g,searchCascaderRef:b}=p(h,c,{fieldKey:h.fieldKey,asyncQueue:m,getRequestPayload:()=>h.payload});function q(){g.value=150}function w(e){c("click",e)}return(e,a)=>(t(),o(r(d),{ref_key:"searchCascaderRef",ref:b,value:r(f),"onUpdate:value":a[0]||(a[0]=e=>s(f)?f.value=e:null),show:r(j),"onUpdate:show":a[1]||(a[1]=e=>s(j)?j.value=e:null),options:r(k),"label-key":r(v),"value-key":r(y),search:r(S),"menu-width":r(g),"input-props":{onClick:w},onFocus:q},{empty:i((()=>[u(r(l))])),_:1},8,["value","show","options","label-key","value-key","search","menu-width","input-props"]))}});export{c as default};
@@ -1 +1 @@
1
- import{defineComponent as e,inject as l,ref as o,computed as t,onBeforeUnmount as a,nextTick as n,createVNode as r,toRaw as u}from"vue";import{arrayed as i}from"../../../../../../../shared/utils/index.js";import{NSelect as s}from"naive-ui";import{useVModel as d,useDebounceFn as c}from"@vueuse/core";import"date-fns";import{isFunction as p,isEmpty as v,isArray as f,isObject as y,omit as m,cloneDeep as h,xor as w}from"lodash-es";import"@vue/shared";import{useSelectAllowModify as b}from"../../../../../../../shared/hooks/selectHooks/useSelectAllowModify.js";import{useOptionFiltered as g}from"../../../../../../../shared/hooks/selectHooks/useOptionFiltered.js";import"../../../../../../../shared/hooks/selectHooks/useSearchContent.js";import{useSelectRenders as F}from"../../../../../../../shared/hooks/selectHooks/useSelectRenders.js";import{useMenuWidthAuto as S}from"../../../../../../../shared/hooks/selectHooks/useMenuWidthAuto.js";import{InjectionIhoTableUUID as k,InjectionIhoTableConfig as O}from"../../../../constants/index.js";import{useIhoTableFormEvent as A}from"../../../../utils/index.js";import{getSelectOptions as B,selectOptionsMap as j}from"../hooks/useSelectOption.js";var x=e({name:"EditSelect",props:{value:{type:[Array,String,Number]},column:{type:Object,required:!0},row:{type:Object,required:!0},rowIndex:{type:Number,required:!0},options:{type:Array,default:()=>[]},queryOptions:{type:Function},placeholder:{type:String,default:"请选择"},allowModify:{type:Boolean},allowCreate:{type:Boolean},shouldSave:{type:Boolean},consistentMenuWidth:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},searchField:{type:Array},aliasField:{type:String},menuProps:{type:Object},multiple:{type:Boolean},deletable:{type:Boolean,default:!0},selectAll:{type:Boolean,default:!0},searchByValue:{type:Boolean}},emits:["update:value"],setup(e,{emit:x}){const C=l("$xetable"),K=d(e,"value",x),$=o(null),{emitFormChangeWithParams:q}=A({...e,$table:C}),R=t((()=>e.labelField)),M=t((()=>e.valueField)),D=t((()=>e.aliasField)),H=t((()=>e.searchField)),{fullOptions:P,filterOptions:_,searchContent:E,remoteOptions:T}=g(e,{labelKey:R,valueKey:M,searchKey:H}),{modifyEvent:V,modifyAbleRef:W,getOptionsWithCreated:L}=b(e,{searchContent:E,labelKey:R,valueKey:M,valueRef:K,fullOptions:P}),I=t((()=>L(W.value?P.value:_.value))),{setMenuWith:U}=S(e,{selectRef:$,options:I}),N=o(!1),z=c((async function(l=""){E.value=l;try{if(N.value=!0,!p(e.queryOptions)||!v(e.options))return;T.value=await e.queryOptions({keyword:l,row:e.row,column:e.column,rowIndex:e.rowIndex})}catch(l){console.log(`获取${e.column.field}options错误`)}finally{N.value=!1}}),400),G=l(k);a((()=>X(!0)));const J=o(!1);function Q(e){J.value=e,X(),z(),e&&U()}async function X(l=!1){var o,t,a;if(!e.multiple)return;await n();const{refTableLeftBody:r,refTableBody:u}=C.getRefMaps(),i=null==(o=null==r?void 0:r.value)?void 0:o.$el;if(!i)return;const s=null==(t=null==u?void 0:u.value)?void 0:t.$el,d=C.getRowid(e.row),c=null==(a=s.querySelector(`.vxe-body--row[rowid="${d}"]`))?void 0:a.clientHeight;i.querySelector(`.vxe-body--row[rowid="${d}"]`).style.height=l?"unset":c+"px"}async function Y(l,o){var t,a;const n=e.value;await V.updateValue(l,o);const r=B(G,e.column.field,e.row,C);G&&f(r)&&i(o).forEach((e=>{if(!y(e))return;const l=e;l.created&&l.shouldSave&&r.push(m(u(l),["created","shouldSave"]))}));const s=null==(t=e.column.editRender)?void 0:t.props;if(G&&(null==s?void 0:s.connectField)){const o=null==(a=s.connectField)?void 0:a.split(","),t=j.get(G);o.forEach((async o=>{var a;const{tableColumn:n}=C.reactData,r=n.find((e=>e.field===o)),u=null==(a=null==r?void 0:r.editRender)?void 0:a.props;if(null==u?void 0:u.queryOptions){const a=l?`${o}__${e.column.field}-${l}`:o;if(t[a])return;t[a]=await u.queryOptions({row:e.row,column:r,isFullData:!0,connectColumn:e.column})}}))}return q({oldValue:n,option:h(o)}),X()}const Z=l(O);function ee(){var e,l;return null==(l=null==(e=Z.value)?void 0:e.keyboardConfig)?void 0:l.forceArrowKey}const le=o(!0);function oe(e){var l,o,t;if($.value)if("Tab"===e.code||ee()&&(t=e.key,["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t)))J.value?null==(o=(l=$.value).handleKeydown)||o.call(l,{...e,key:"Enter",preventDefault:e.preventDefault.bind(e)}):C.internalData.isActivated=!0;else if("Backspace"===e.code&&ee()){""===$.value.pattern&&(K.value=null,le.value=!1)}else le.value=!0}const{renderTag:te,renderLabel:ae,renderSelectAll:ne}=F(e,{labelKey:R,valueKey:M,valueRef:K,showKey:D,searchContent:E});function re(l){if(!e.multiple)return;const o=l?I.value.map((e=>e[M.value])):[];if(!w(o,K.value).length)return;const t=K.value;K.value=o,q({oldValue:t,option:l?I.value:[]})}const ue=()=>({class:"iho-table__selectOption"}),ie=t((()=>{var l,o;return{...e.menuProps,class:`iho-table__selectMenu ${null!=(o=null==(l=e.menuProps)?void 0:l.class)?o:""}`}}));return()=>{const l={};return e.multiple&&e.selectAll&&(l.action=()=>ne(re)),r(s,{ref:$,placeholder:e.placeholder,labelField:e.labelField,valueField:e.valueField,loading:N.value,options:I.value,multiple:e.multiple,value:e.value,remote:!0,onSearch:z,clearable:!0,filterable:!0,keyboard:le.value,nodeProps:ue,menuProps:ie.value,renderTag:te,renderLabel:ae,show:J.value,onUpdateShow:Q,onUpdateValue:Y,onKeydownCapture:oe,onFocus:V.focus,onBlur:V.blur},l)}}});export{x as default};
1
+ import{defineComponent as e,inject as l,ref as o,computed as t,onBeforeUnmount as a,nextTick as n,createVNode as r,toRaw as u}from"vue";import{arrayed as i}from"../../../../../../../shared/utils/index.js";import{NSelect as s}from"naive-ui";import{useVModel as d,useDebounceFn as c}from"@vueuse/core";import"date-fns";import{isFunction as p,isEmpty as v,isArray as f,isObject as m,omit as y,cloneDeep as h,xor as w}from"lodash-es";import"@vue/shared";import{useSelectAllowModify as b}from"../../../../../../../shared/hooks/selectHooks/useSelectAllowModify.js";import{useOptionFiltered as g}from"../../../../../../../shared/hooks/selectHooks/useOptionFiltered.js";import"../../../../../../../shared/hooks/selectHooks/useSearchContent.js";import{useSelectRenders as F}from"../../../../../../../shared/hooks/selectHooks/useSelectRenders.js";import{useMenuWidthAuto as S}from"../../../../../../../shared/hooks/selectHooks/useMenuWidthAuto.js";import"../../../../../../../shared/hooks/useScrollLoading.js";import{InjectionIhoTableUUID as k,InjectionIhoTableConfig as O}from"../../../../constants/index.js";import{useIhoTableFormEvent as A}from"../../../../utils/index.js";import{getSelectOptions as j,selectOptionsMap as B}from"../hooks/useSelectOption.js";var x=e({name:"EditSelect",props:{value:{type:[Array,String,Number]},column:{type:Object,required:!0},row:{type:Object,required:!0},rowIndex:{type:Number,required:!0},options:{type:Array,default:()=>[]},queryOptions:{type:Function},placeholder:{type:String,default:"请选择"},allowModify:{type:Boolean},allowCreate:{type:Boolean},shouldSave:{type:Boolean},consistentMenuWidth:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},searchField:{type:Array},aliasField:{type:String},menuProps:{type:Object},multiple:{type:Boolean},deletable:{type:Boolean,default:!0},selectAll:{type:Boolean,default:!0},searchByValue:{type:Boolean}},emits:["update:value"],setup(e,{emit:x}){const C=l("$xetable"),K=d(e,"value",x),$=o(null),{emitFormChangeWithParams:q}=A({...e,$table:C}),R=t((()=>e.labelField)),M=t((()=>e.valueField)),D=t((()=>e.aliasField)),H=t((()=>e.searchField)),{fullOptions:P,filterOptions:_,searchContent:E,remoteOptions:L}=g(e,{labelKey:R,valueKey:M,searchKey:H}),{modifyEvent:T,modifyAbleRef:V,getOptionsWithCreated:W}=b(e,{searchContent:E,labelKey:R,valueKey:M,valueRef:K,fullOptions:P}),I=t((()=>W(V.value?P.value:_.value))),{setMenuWith:U}=S(e,{selectRef:$,options:I}),N=o(!1),z=c((async function(l=""){E.value=l;try{if(N.value=!0,!p(e.queryOptions)||!v(e.options))return;L.value=await e.queryOptions({keyword:l,row:e.row,column:e.column,rowIndex:e.rowIndex})}catch(l){console.log(`获取${e.column.field}options错误`)}finally{N.value=!1}}),400),G=l(k);a((()=>X(!0)));const J=o(!1);function Q(e){J.value=e,X(),z(),e&&U()}async function X(l=!1){var o,t,a;if(!e.multiple)return;await n();const{refTableLeftBody:r,refTableBody:u}=C.getRefMaps(),i=null==(o=null==r?void 0:r.value)?void 0:o.$el;if(!i)return;const s=null==(t=null==u?void 0:u.value)?void 0:t.$el,d=C.getRowid(e.row),c=null==(a=s.querySelector(`.vxe-body--row[rowid="${d}"]`))?void 0:a.clientHeight;i.querySelector(`.vxe-body--row[rowid="${d}"]`).style.height=l?"unset":c+"px"}async function Y(l,o){var t,a;const n=e.value;await T.updateValue(l,o);const r=j(G,e.column.field,e.row,C);G&&f(r)&&i(o).forEach((e=>{if(!m(e))return;const l=e;l.created&&l.shouldSave&&r.push(y(u(l),["created","shouldSave"]))}));const s=null==(t=e.column.editRender)?void 0:t.props;if(G&&(null==s?void 0:s.connectField)){const o=null==(a=s.connectField)?void 0:a.split(","),t=B.get(G);o.forEach((async o=>{var a;const{tableColumn:n}=C.reactData,r=n.find((e=>e.field===o)),u=null==(a=null==r?void 0:r.editRender)?void 0:a.props;if(null==u?void 0:u.queryOptions){const a=l?`${o}__${e.column.field}-${l}`:o;if(t[a])return;t[a]=await u.queryOptions({row:e.row,column:r,isFullData:!0,connectColumn:e.column})}}))}return q({oldValue:n,option:h(o)}),X()}const Z=l(O);function ee(){var e,l;return null==(l=null==(e=Z.value)?void 0:e.keyboardConfig)?void 0:l.forceArrowKey}const le=o(!0);function oe(e){var l,o,t;if($.value)if("Tab"===e.code||ee()&&(t=e.key,["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t)))J.value?null==(o=(l=$.value).handleKeydown)||o.call(l,{...e,key:"Enter",preventDefault:e.preventDefault.bind(e)}):C.internalData.isActivated=!0;else if("Backspace"===e.code&&ee()){""===$.value.pattern&&(K.value=null,le.value=!1)}else le.value=!0}const{renderTag:te,renderLabel:ae,renderSelectAll:ne}=F(e,{labelKey:R,valueKey:M,valueRef:K,showKey:D,searchContent:E});function re(l){if(!e.multiple)return;const o=l?I.value.map((e=>e[M.value])):[];if(!w(o,K.value).length)return;const t=K.value;K.value=o,q({oldValue:t,option:l?I.value:[]})}const ue=()=>({class:"iho-table__selectOption"}),ie=t((()=>{var l,o;return{...e.menuProps,class:`iho-table__selectMenu ${null!=(o=null==(l=e.menuProps)?void 0:l.class)?o:""}`}}));return()=>{const l={};return e.multiple&&e.selectAll&&(l.action=()=>ne(re)),r(s,{ref:$,placeholder:e.placeholder,labelField:e.labelField,valueField:e.valueField,loading:N.value,options:I.value,multiple:e.multiple,value:e.value,remote:!0,onSearch:z,clearable:!0,filterable:!0,keyboard:le.value,nodeProps:ue,menuProps:ie.value,renderTag:te,renderLabel:ae,show:J.value,onUpdateShow:Q,onUpdateValue:Y,onKeydownCapture:oe,onFocus:T.focus,onBlur:T.blur},l)}}});export{x as default};