cnhis-design-vue 3.1.51-release.5 → 3.1.52-beta.0
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/README.md +87 -87
- package/es/components/callback/src/components/render/popupMaps.d.ts +4 -1
- package/es/components/expand-field/src/components/form.vue2.js +1 -1
- package/es/components/field-set/index.d.ts +2 -0
- package/es/components/field-set/src/FieldSet.vue.d.ts +3 -1
- package/es/components/field-set/src/FieldSet.vue2.js +1 -1
- package/es/components/field-set/src/utils/index.d.ts +2 -0
- package/es/components/field-set/src/utils/index.js +1 -1
- package/es/components/field-set/style/index.css +1 -1
- package/es/components/form-config/index.d.ts +8 -2
- package/es/components/form-config/src/FormConfig.vue.d.ts +8 -2
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +4 -1
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +4 -1
- package/es/components/form-render/index.d.ts +4 -1
- package/es/components/form-render/src/FormRender.vue.d.ts +4 -1
- package/es/components/form-render/src/FormRender.vue2.js +1 -1
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +4 -1
- package/es/components/form-render/src/hooks/useWordbookSetting.d.ts +2 -1
- package/es/components/form-render/src/hooks/useWordbookSetting.js +1 -1
- package/es/components/form-render/src/types/index.d.ts +1 -0
- package/es/components/iho-table/src/plugins/defaultValuePlugin.js +1 -1
- package/es/components/iho-table/src/plugins/filterVisibleEventPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/headerPlugin.d.ts +1 -0
- package/es/components/iho-table/src/plugins/headerPlugin.js +1 -0
- package/es/components/iho-table/src/plugins/index.js +1 -1
- package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +1 -1
- package/es/components/iho-table/src/utils/index.js +1 -1
- package/es/components/index.css +1 -1
- package/es/components/info-header/index.d.ts +8 -2
- package/es/components/info-header/src/InfoHeader.vue.d.ts +8 -2
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +4 -1
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +4 -1
- package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
- package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
- package/es/components/select-person/src/SearchMultiple.vue.d.ts +6 -0
- package/es/components/shortcut-setter/index.d.ts +4 -1
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +4 -1
- package/es/components/table-export-field/src/components/ExportModal.vue.d.ts +0 -3
- package/es/env.d.ts +25 -25
- package/es/shared/assets/img/failure.png.js +1 -1
- package/es/shared/assets/img/no-permission.png.js +1 -1
- package/es/shared/assets/img/nodata.png.js +1 -1
- package/es/shared/assets/img/notfound.png.js +1 -1
- package/es/shared/assets/img/qr.png.js +1 -1
- package/es/shared/assets/img/success.png.js +1 -1
- package/es/shared/assets/img/video.png.js +1 -1
- package/es/shared/assets/img/video_default_cover.png.js +1 -1
- package/es/shared/assets/img/xb_big.png.js +1 -1
- package/es/shared/assets/img/xb_small.png.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
- package/es/shared/utils/fabricjs/index.d.ts +0 -6823
- package/es/shared/utils/tapable/index.d.ts +0 -139
|
@@ -1 +1 @@
|
|
|
1
|
-
import{format as e}from"date-fns";import"../../index.js";import{EDITABLE_WIDGET_TYPE as t}from"../constants/index.js";import{getLowCodeFieldFromField as a}from"../utils/index.js";import{defineTablePlugin as
|
|
1
|
+
import{format as e}from"date-fns";import"../../index.js";import{EDITABLE_WIDGET_TYPE as t}from"../constants/index.js";import{getLowCodeFieldFromField as a}from"../utils/index.js";import{defineTablePlugin as l}from"../hooks/useTablePlugin.js";function n(){const n="defaultValuePlugin",o=new Map([[[t.TIME],({defaultValue:t,valueFormat:a="HH:mm"})=>"current"===t?e(Date.now(),a):t],[[t.DATE],({defaultValue:t,valueFormat:a="yyyy-MM-dd HH:mm:ss"})=>"current"===t?e(Date.now(),a):t]]);return l({name:n,apply(e){let t=[];e.fieldHooks.fieldList.tap(n,(e=>(t=e,e))),e.dataHooks.data.tap(n,(e=>{t.length&&t.forEach((t=>{var l;const n=a(t);if(null==(null==n?void 0:n.defaultValue))return;const d=null==(l=t.editRender)?void 0:l.name,[,u]=[...o.entries()].find((([e])=>e.includes(d)))||[];null==e[t.field]&&(e[t.field]=u?u(n):n.defaultValue)}))})),e.dataHooks.dataEnd.tap(n,(()=>{t=[]}))}})}export{n as defaultValuePlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{nextTick as e}from"vue";import"../../index.js";import{defineTablePlugin as t}from"../hooks/useTablePlugin.js";function i(){const i="filterVisibleEventPlugin";return t({name:i,apply(t){t.eventHooks.onFilterVisible.tap(i,(({$table:t,visible:i})=>{i&&e((()=>{const e=t.getRefMaps().refTableFilter.value.$el,i=null==e?void 0:e.getBoundingClientRect(),n=Math.min(document.documentElement.clientHeight,window.innerHeight),l=parseFloat(t.reactData.filterStore.style.top)
|
|
1
|
+
import{nextTick as e}from"vue";import"../../index.js";import{defineTablePlugin as t}from"../hooks/useTablePlugin.js";function i(){const i="filterVisibleEventPlugin";return t({name:i,apply(t){t.eventHooks.onFilterVisible.tap(i,(({$table:t,visible:i})=>{i&&e((()=>{const e=t.getRefMaps().refTableFilter.value.$el,i=null==e?void 0:e.getBoundingClientRect(),n=Math.min(document.documentElement.clientHeight,window.innerHeight),l=parseFloat(t.reactData.filterStore.style.top),{top:o,height:r}=i,a=n-o-l;a<r&&o>a&&(e.style.transform=`translateY(${-(r+l)}px)`)}))}))}})}export{i as filterVisibleEventPlugin};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function HeaderPlugin(): import("../../../../../es/components/iho-table").TablePlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{inject as e,createVNode as t}from"vue";import{arrayed as l,widthAppend as n}from"../../../../shared/utils/index.js";import{isObject as o,isString as a,isFunction as i}from"lodash-es";import r from"../../../annotation-edit/index.js";import"../../index.js";import{InjectionIhoTableAnnotation as s,InjectionIhoTableConfig as u}from"../constants/index.js";import{getLowCodeFieldFromField as d,IhoTableRenderHelper as m}from"../utils/index.js";import{defineTablePlugin as c}from"../hooks/useTablePlugin.js";function p(){const p="headerPlugin";return c({name:p,apply(c){c.fieldHooks.field.tap(p,(c=>{var p;const f=null==(p=c.slots)?void 0:p.header;return c.slots={...c.slots,header:p=>function(d,c,p){var f;const h=e(s),v=e(u),x=e("$xetable"),b=d.column||{},j=o(null==h?void 0:h.value)&&!1!==c.annotation,g=m.isEditableColumn(v.value,b),w=m.hasFilter(c)||m.hasDateFiler(c),W=null==(f=c.titlePrefix)?void 0:f.content,y=a(p)?p:i(p)?p(d):null;let D=!1;if(v.value){const e=v.value.editRules&&v.value.editRules[b.field];e&&(D=l(e).some((e=>e.required)))}const M=v.value.border?Math.max(2,Math.ceil(x.reactData.scrollbarWidth/x.reactData.tableColumn.length)):1,P=n(Math.max(0,b.renderWidth-20-M-(D?14:0)-(j?18:0)-(w?23:0)-(g?22:0)-(W?20:0)-(b.sortable?23:0)));return t("section",{class:"iho-table__headerWrapper"},[t("section",{style:{width:P}},[null!=y?y:t("div",{style:{maxWidth:"100%",textOverflow:"ellipsis",whiteSpace:"nowrap"}},[function(){const e=b.title,l=/\\n|\n|\r/g;if(!l.test(e))return e;const n=e.replace(l,"<br>").split("<br>");return n.map(((e,l)=>[e,l===n.length-1?null:t("br",null,null)]))}()])]),j?t(r,{modelValue:h.value[b.field],"onUpdate:modelValue":e=>h.value[b.field]=e},null):null])}(p,d(c),f)},c}))}})}export{p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"./anchorPlugin/index.js";import*as r from"./bindEventSettingPlugin/index.js";import*as i from"./defaultConfigPlugin/index.js";import*as n from"./defaultValuePlugin.js";import*as s from"./filterDaterangeRenderPlugin/index.js";import*as t from"./filterRenderPlugin/index.js";import*as d from"./filterVisibleEventPlugin.js";import*as l from"./
|
|
1
|
+
import*as e from"./anchorPlugin/index.js";import*as r from"./bindEventSettingPlugin/index.js";import*as i from"./defaultConfigPlugin/index.js";import*as n from"./defaultValuePlugin.js";import*as s from"./filterDaterangeRenderPlugin/index.js";import*as t from"./filterRenderPlugin/index.js";import*as d from"./filterVisibleEventPlugin.js";import*as l from"./headerPlugin.js";import*as g from"./highLightSetPlugin.js";import*as u from"./keyboardEventPlugin/index.js";import*as o from"./lowCodeFieldAdaptorPlugin/index.js";import*as a from"./maxCheckSizePlugin.js";import*as P from"./operationalFormPlugin/index.js";import*as m from"./rendererPlugins/editableWidgets/dateRendererPlugin/index.js";import*as x from"./rendererPlugins/editableWidgets/inputRendererPlugin.js";import*as f from"./rendererPlugins/editableWidgets/numberRendererPlugin.js";import*as p from"./rendererPlugins/editableWidgets/radioRendererPlugin.js";import*as j from"./rendererPlugins/editableWidgets/selectRendererPlugin/index.js";import*as R from"./rendererPlugins/editableWidgets/separateRendererPlugin/index.js";import*as b from"./rendererPlugins/editableWidgets/timeRendererPlugin/index.js";import*as w from"./rendererPlugins/widgets/checkRendererPlugin.js";import*as h from"./rendererPlugins/widgets/colorRendererPlugin.js";import*as c from"./rendererPlugins/widgets/defaultRendererPlugin.js";import*as W from"./rendererPlugins/widgets/htmlRendererPlugin.js";import*as v from"./rendererPlugins/widgets/labelRendererPlugin.js";import*as k from"./rendererPlugins/widgets/pictureRendererPlugin.js";import*as C from"./rendererPlugins/widgets/seqRendererPlugin.js";import*as S from"./rowClickPlugin/index.js";import*as E from"./rowDragPlugin/index.js";import*as D from"./rowGroupSettingPlugin/index.js";import*as F from"./varialbleHeightPlugin/index.js";import*as V from"./virtualTreePlugin/index.js";import{separateMetaModule as q}from"../../../../shared/utils/index.js";var y=q(Object.assign({"./anchorPlugin/index.tsx":e,"./bindEventSettingPlugin/index.ts":r,"./defaultConfigPlugin/index.ts":i,"./defaultValuePlugin.ts":n,"./filterDaterangeRenderPlugin/index.tsx":s,"./filterRenderPlugin/index.tsx":t,"./filterVisibleEventPlugin.ts":d,"./headerPlugin.tsx":l,"./highLightSetPlugin.tsx":g,"./keyboardEventPlugin/index.ts":u,"./lowCodeFieldAdaptorPlugin/index.tsx":o,"./maxCheckSizePlugin.ts":a,"./operationalFormPlugin/index.ts":P,"./rendererPlugins/editableWidgets/dateRendererPlugin/index.tsx":m,"./rendererPlugins/editableWidgets/inputRendererPlugin.tsx":x,"./rendererPlugins/editableWidgets/numberRendererPlugin.tsx":f,"./rendererPlugins/editableWidgets/radioRendererPlugin.tsx":p,"./rendererPlugins/editableWidgets/selectRendererPlugin/index.tsx":j,"./rendererPlugins/editableWidgets/separateRendererPlugin/index.tsx":R,"./rendererPlugins/editableWidgets/timeRendererPlugin/index.tsx":b,"./rendererPlugins/widgets/checkRendererPlugin.tsx":w,"./rendererPlugins/widgets/colorRendererPlugin.tsx":h,"./rendererPlugins/widgets/defaultRendererPlugin.tsx":c,"./rendererPlugins/widgets/htmlRendererPlugin.tsx":W,"./rendererPlugins/widgets/labelRendererPlugin.tsx":v,"./rendererPlugins/widgets/pictureRendererPlugin.tsx":k,"./rendererPlugins/widgets/seqRendererPlugin.tsx":C,"./rowClickPlugin/index.ts":S,"./rowDragPlugin/index.ts":E,"./rowGroupSettingPlugin/index.ts":D,"./varialbleHeightPlugin/index.tsx":F,"./virtualTreePlugin/index.ts":V}));export{y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
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,LOWEST_PRIORITY as d,WIDGET_TYPE as r}from"../../constants/index.js";import{defineTablePlugin as a}from"../../hooks/useTablePlugin.js";import{IhoTableStatusHelper as f,IhoTableUtils as c}from"../../utils/index.js";import{getDefaultValue as m}from"../rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.js";function p(){const p="lowCodeFieldAdaptorPlugin";return a({name:p,apply(a){a.fieldHooks.field.tap({name:p,stage:s},((s,d,a)=>{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,m(t.row,t.column.editRender.props))])}e.slots=o}(u,p),function(l,s,n){var d,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(r,l.editRender.name),!l.editRender.enabled&&t(null==(d=l.slots)?void 0:d.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,a),u})),a.fieldHooks.field.tap({name:p+"After",stage:d},(t=>(e(t.slots)&&Object.entries(t.slots).forEach((([e,i])=>{null==i&&Reflect.deleteProperty(t.slots,e)})),t)))}})}export{p as lowCodeFieldAdaptorPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,inject as l,ref as t,computed as o,
|
|
1
|
+
import{defineComponent as e,inject as l,ref as t,computed as o,onBeforeUnmount as n,watch as a,nextTick as u,createVNode as i,toRaw as r,Fragment as d,createTextVNode as s}from"vue";import{keywordMatcher as c,arrayed as p}from"../../../../../../../shared/utils/index.js";import{NSelect as v,NTooltip as f,NIcon as m,NTag as y,NButton as h}from"naive-ui";import{HelpCircleSharp as b}from"@vicons/ionicons5";import{InjectionIhoTableUUID as w}from"../../../../constants/index.js";import{getSelectOptions as F,selectOptionsMap as g}from"../hooks/useSelectOption.js";import{useIhoTableFormEvent as S}from"../../../../utils/index.js";import{useDebounceFn as q}from"@vueuse/core";import{isEmpty as O,isFunction as $,isArray as x,isObject as C,omit as B,cloneDeep as _}from"lodash-es";var j=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:"请选择"},allowCreate:{type:Boolean,default:!1},shouldSave:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},aliasField:{type:String},menuProps:{type:Object},multiple:{type:Boolean,default:!1},deletable:{type:Boolean,default:!0},selectAll:{type:Boolean,default:!0}},emits:["update:value"],setup(e,{emit:j}){const k=l("$xetable"),P=t(null);function M(e){P.value=e}const W=t(!1),{emitFormChangeWithParams:A}=S({...e,$table:k}),D=t("");function E(){return U()}const R=t([]),T=o((()=>{let l=O(R.value)?e.options:R.value;return D.value?(l=l.filter((l=>l[e.labelField]&&l[e.labelField].includes(D.value)||c(D.value,l.keyword))),!e.allowCreate||l.some((l=>l[e.labelField]===D.value))?l:[...l,{[e.labelField]:D.value,[e.valueField]:D.value,created:!0,shouldSave:e.shouldSave}]):l})),I=t(!1),U=q((async function(l=""){D.value=l;try{if(I.value=!0,!$(e.queryOptions)||!O(e.options))return;R.value=await e.queryOptions({keyword:l,row:e.row,column:e.column,rowIndex:e.rowIndex})}catch(l){console.log(`获取${e.column.field}options错误`)}finally{I.value=!1}}),400),V=l(w);function z(l=!1){e.multiple&&u((()=>{var t,o,n;const{refTableLeftBody:a,refTableBody:u}=k.getRefMaps(),i=null==(t=null==a?void 0:a.value)?void 0:t.$el;if(!i)return;const r=null==(o=null==u?void 0:u.value)?void 0:o.$el,d=k.getRowid(e.row),s=null==(n=r.querySelector(`.vxe-body--row[rowid="${d}"]`))?void 0:n.clientHeight,c=i.querySelector(`.vxe-body--row[rowid="${d}"]`),p=l?"unset":s+"px";c.style.height=p}))}function K(l,t){var o,n;const a=e.value;j("update:value",l);const u=F(V,e.column.field,e.row,k);V&&x(u)&&p(t).forEach((e=>{if(!C(e))return;const l=e;l.created&&l.shouldSave&&u.push(B(r(l),["created","shouldSave"]))}));const i=null==(o=e.column.editRender)?void 0:o.props;if(V&&(null==i?void 0:i.connectField)){const t=null==(n=i.connectField)?void 0:n.split(","),o=g.get(V);t.forEach((async t=>{var n;const{tableColumn:a}=k.reactData,u=a.find((e=>e.field===t)),i=null==(n=null==u?void 0:u.editRender)?void 0:n.props;if(null==i?void 0:i.queryOptions){const n=l?`${t}__${e.column.field}-${l}`:t;if(o[n])return;const a=await i.queryOptions({row:e.row,column:u,isFullData:!0,connectColumn:e.column});o[n]=a}}))}A({oldValue:a,option:_(t)}),z()}function N(e){var l,t;"Tab"===e.key&&P.value&&(null==(t=(l=P.value).handleKeydown)||t.call(l,{...e,key:"Enter",preventDefault:e.preventDefault.bind(e)}))}function H(l){const t=l?T.value.map((l=>l[e.valueField])):[],o=e.value,n=x(o)?o.length:0;t.length!==n&&(j("update:value",t),A({oldValue:o,option:l?_(T.value):[]}))}function L({node:e,option:l}){return l.desc?i("div",{class:"iho-table__selectOptionWrapper"},[[e,i(f,null,{trigger:()=>i(m,{component:b},null),default:()=>l.desc})]]):e}function G({option:l,handleClose:t}){var o;const n=null!=(o=e.aliasField&&l[e.aliasField])?o:l[e.labelField];return x(e.value)?e.deletable?i(y,{closable:!0,onClose:e=>{e.stopPropagation(),t()}},{default:()=>n}):`${n} ;`:i(d,null,[n])}function J(){return i(d,null,[i(h,{quaternary:!0,type:"primary",size:"tiny",onClick:()=>H(!0)},{default:()=>[s("全选")]}),i(h,{quaternary:!0,type:"primary",size:"tiny",onClick:()=>H(!1)},{default:()=>[s("清空")]})])}n((()=>{z(!0)})),a((()=>W.value),(e=>{z()}),{immediate:!0});const Q=()=>({class:"iho-table__selectOption"}),X=o((()=>{var l,t;return{...e.menuProps,class:`iho-table__selectMenu ${null!=(t=null==(l=e.menuProps)?void 0:l.class)?t:""}`}}));return()=>{const l={};return e.multiple&&e.selectAll&&(l.action=J),i(v,{ref:M,show:W.value,"onUpdate:show":e=>W.value=e,consistentMenuWidth:e.consistentMenuWidth,placeholder:e.placeholder,labelField:e.labelField,valueField:e.valueField,loading:I.value,options:T.value,multiple:e.multiple,value:e.value,remote:!0,onSearch:U,clearable:!0,filterable:!0,nodeProps:Q,menuProps:X.value,renderTag:G,renderOption:L,onUpdateShow:E,onUpdateValue:K,onKeydown:N},l)}}});export{j as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{reactive as e,inject as o,createVNode as t,mergeProps as n,onBeforeUnmount as l}from"vue";import{arrayed as i}from"../../../../../../../shared/utils/index.js";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as r,InjectionIhoTableUUID as s}from"../../../../constants/index.js";import{useAutoFocus as d}from"../hooks/useAutoFocus.js";import{createIhoTableClearActivedInterceptor as u,getTitle as c,IhoTableRenderHelper as a,IhoTableUtils as p}from"../../../../utils/index.js";import f from"./editSelect.js";import{getDefaultValue as m,isConnectField as v,getArray as E}from"./selectUtils.js";import{getSelectOptions as g,selectOptionsMap as
|
|
1
|
+
import{reactive as e,inject as o,createVNode as t,mergeProps as n,onBeforeUnmount as l}from"vue";import{arrayed as i}from"../../../../../../../shared/utils/index.js";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as r,InjectionIhoTableUUID as s}from"../../../../constants/index.js";import{useAutoFocus as d}from"../hooks/useAutoFocus.js";import{createIhoTableClearActivedInterceptor as u,getTitle as c,IhoTableRenderHelper as a,IhoTableUtils as p}from"../../../../utils/index.js";import f from"./editSelect.js";import{getDefaultValue as m,isConnectField as v,getArray as E}from"./selectUtils.js";import{getSelectOptions as g,selectOptionsMap as C}from"../hooks/useSelectOption.js";import{cloneDeep as h,isEqual as b}from"lodash-es";import{defineTablePlugin as w}from"../../../../hooks/useTablePlugin.js";function y(){const y="selectRendererPlugin",x=e(new Map);return w({name:y,vxe(e){e.interceptor.add("event.clearActived",u(r.SELECT,(e=>e.classList.contains("iho-table__selectMenu")))),e.renderer.add(r.SELECT,{renderCell({props:e},{row:n,column:l,$table:r}){var d;const u=o(s),a=g(u,l.field,n,r),p=m(n,e,a),f=i(p).join(","),v=e&&(!0===(E=e.variableHeight)||"1"===E||(null==(d=e.componentProps)?void 0:d.indexedText));var E;return[t("span",{title:c(l,f)},[v?i(p).filter((e=>null!=e)).map(((e,o)=>[o+1,".",e,";",t("br",null,null)])):f])]},renderEdit:a.createRenderEdit((({fieldItem:e,emitFormClick:l,row:i,column:r,$rowIndex:d,$table:u})=>{const c=o(s),a=g(c,r.field,i,u);return[t(f,n({queryOptions:e.queryOptions},e.componentProps,{options:a,column:r,row:i,"row-index":d,value:i[r.field],"onUpdate:value":e=>i[r.field]=e,onClick:l}),null)]}))})},apply(e){async function o(e,o={}){var t,n,l;const i=null==(t=e.editRender)?void 0:t.props;if(!i)return[];let r=E(i.options)||E(null==(n=i.componentProps)?void 0:n.options)||[];if(i.queryOptions)try{const t={column:e,isFullData:!0,...o};r=await(null==(l=i.queryOptions)?void 0:l.call(i,t))}catch(e){console.log(`获取${i.field}_options错误`)}return r}d(e).bindAutoFocusConfig(y,r.SELECT,".n-base-selection-input"),e.fieldHooks.fieldList.tap(y,((e,{uuid:t})=>{if(t){C.get(t)||C.set(t,{}),x.set(t,h(e));const n=C.get(t);e.forEach((async t=>{var l;const i=null==(l=t.editRender)?void 0:l.props;t.field&&i&&"SELECT"===p.getCellType(i)&&(n[t.field]||v(e,t.field)||(n[t.field]=[],n[t.field]=await o(t)))}))}return e})),e.dataHooks.data.tap(y,((e,{uuid:t},n)=>{if(!t)return;const l=x.get(t);if(!l||!l.length)return;const i=C.get(t);l.forEach((async t=>{var n;const r=null==(n=t.editRender)?void 0:n.props;if(t.field&&r&&"SELECT"===p.getCellType(r)&&(null==r?void 0:r.connectField)){const n=r.connectField.split(","),s=e[r.columnName];n.forEach((async n=>{const d=null==l?void 0:l.find((e=>e.field===n));if(!d)return;const u=s?`${n}__${r.columnName}-${s}`:n;i[u]||(i[u]=[],i[u]=await o(d,{row:e,connectColumn:t}))}))}}))})),e.setupHooks.setup.tap(y,(e=>{l((()=>{var o;const t=null==(o=e.value)?void 0:o.uuid;t&&(C.delete(t),x.delete(t))}))})),e.eventHooks.onCellDblclick.tap(y,(({$table:e},o,{emits:t})=>{var n;const{column:l,row:i}=e.reactData.editStore.actived;if(!l||!i)return;const s=null==(n=l.editRender)?void 0:n.props,{cellDblclickSelectable:d=!1,multiple:u=!1,valueField:c="value"}=s.componentProps||{};if(!d||!function(e){return e&&p.getCellType(e)===r.SELECT}(s))return;const a=o.uuid&&g(o.uuid,l.field,i,e);if(1!==(null==a?void 0:a.length))return;const f=u?[a[0][c]]:a[0][c],m=i[l.field];e.clearEdit(),b(f,m)||(i[l.field]=f,t("formChange",{column:l,row:i,oldValue:m,value:f,index:e.getRowIndex(i),$table:e,option:a[0]}))}))}})}export{y as selectRendererPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{reactive as e,inject as t,createVNode as a,toRaw as
|
|
1
|
+
import{reactive as e,inject as t,createVNode as a,toRaw as r,h as o,onBeforeUnmount as n}from"vue";import{traverse as i,arrayed as u}from"../../../../../../../shared/utils/index.js";import{isFunction as l,isObject as s,isArray as d,compact as p,range as c,uniq as f,flatten as _}from"lodash-es";import{NInput as m}from"naive-ui";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as E,InjectionIhoTableUUID as A,InjectionIhoTableHandler as h}from"../../../../constants/index.js";import{useAutoFocus as v}from"../hooks/useAutoFocus.js";import{createIhoTableClearActivedInterceptor as R,getLowCodeFieldFromField as g,IhoTableRenderHelper as T,getRowHeight as D,getColumnRenderWidth as w,parseMergeField as b}from"../../../../utils/index.js";import P from"./editSeparate.vue.js";import{contentSeparate as $,getLengthDiffArray as x,getColumnInfoMaxLength as C,generateSeparateRowData as S,isSeparateColumn as k}from"./separateUtils.js";import{getSeparateInfo as H,setSeparateInfo as j,deleteSeparateInfo as M}from"../../../../utils/separateMap.js";import{defineTablePlugin as O}from"../../../../hooks/useTablePlugin.js";function F(){const F="separateRendererPlugins",I=e(new Map);return O({name:F,vxe(e){e.interceptor.add("event.clearActived",R(E.SEPARATE,(e=>e.classList.contains("v-binder-follower-content")))),e.renderer.add(E.SEPARATE,{renderCell(e,{column:r,row:o}){var n,i;const u=t(A),l=null!=(i=null==(n=H(u,o))?void 0:n.separateData)?i:{},s=g(r),d=(null==s?void 0:s.separateFormatter)?s.separateFormatter(l[r.field]):l[r.field];return a("section",{class:"iho-table__ellipsis",title:d},[d])},renderEdit:T.createRenderEdit((({fieldItem:e,column:n,row:i,emitFormClick:u})=>{var d,p;const c=t(A),f=H(c,i),_=D(),E={};let v=null!=(p=null==(d=e.componentProps)?void 0:d.separateSlot)?p:e.separateSlot;return v&&(v=r(v),E.menu=l(v)?v:s(v)?e=>o(v,e):void 0),e.separateRowEdit?function(){if(!f)return[];if(f.ihoTableHandler=t(h),f.separateData["__"+n.field]=f.separateData["__"+n.field]||f.separateData[n.field],E.menu){const e=E.menu;return a(e,{column:n,col:n,row:i,value:f.separateData["__"+n.field],"onUpdate:value":e=>f.separateData["__"+n.field]=e},null)}return a(m,{value:f.separateData["__"+n.field],"onUpdate:value":e=>f.separateData["__"+n.field]=e},null)}():function(){var t;const r=null==(t=null==f?void 0:f.separateData)?void 0:t[n.field],o=l(e.separateFormatter)?e.separateFormatter(r):r;return[a(P,{value:i[n.field],"onUpdate:value":e=>i[n.field]=e,"row-index":null==f?void 0:f.index,height:_,column:n,row:i,"display-content":o,onClick:u},E)]}()}))})},apply(e){function t(e){return(...t)=>{var a;return!(null==(a=t[0].row)?void 0:a.$__SEPARATE)&&(!l(e)||e(...t))}}v(e).bindAutoFocusConfig(F,E.SEPARATE,".iho-table__separateText"),e.eventHooks.onEditClosed.tap(F,(({row:e,column:t,$table:a},r,{emits:o})=>{if(!e.$__uuid)return;const n=g(t);if(!n||!n.separateRowEdit)return;const i=H(e.$__uuid,e);if(!i)return;const{separateData:u,originalData:l,ihoTableHandler:s,index:p}=i,{field:c}=t;if(u["__"+c]&&u["__"+c]!==u[c]&&d(l.$__SEPARATE_DATA)){const e=l.$__SEPARATE_DATA.map((e=>{var t;return null!=(t=e["__"+c])?t:e[c]})),r=l[c];l[c]=d(l[c])?e:e.join(""),o("formChange",{value:l[c],oldValue:r,row:l,column:t,index:p,$table:a}),null==s||s.updateTableDataRef()}})),e.fieldHooks.fieldList.tap(F,((e,{uuid:t})=>(t&&I.set(t,e.reduce(((e,t)=>(i(t,(t=>{k(t)&&(e.push(r(t)),t.showOverflow="ellipsis")})),e)),[])),e))),e.dataHooks.data.tapPromise(F,(async(e,t,{insertAfter:a,index:r,$table:o})=>{var n;if(!t.uuid)return;const i=I.get(t.uuid);if(!i||!i.length)return;const l=[];for(const t of i){if(!t.field)continue;const a=await w(t,e,r,o),i={field:t.field,column:t,data:$(b(e,t),t,a,null==(n=g(t))?void 0:n.separateDeep)};l.push(i)}function s(e){return l.find((t=>t.field===e))}l.forEach((e=>{const{column:t}=e,a=g(t);if(!a)return;if(!a.separateDeep||!a.separateBinder)return;const r=p(u(a.separateBinder).map(s));if(!r.length)return;const o=r.concat(e),n=Math.max(...o.map((e=>e.data.length)));c(n).forEach((e=>{const t=o.map((t=>({item:t.data[e],data:t.data}))),a=t.map((({item:e})=>n(e)));if(1===f(a).length)return;const r=Math.max(...a);function n(e){return d(e)?e.length:1}t.forEach((({item:t,data:a})=>{const o=n(t);o!==r&&(d(t)?t.push(...x(r,o)):a[e]=c(r).map(((e,a)=>0===a?t:"")))}))}))})),l.forEach((e=>{e.data=_(e.data)})),c(C(l)).forEach(((o,n,i)=>{var u;const s=S(l,n),d={index:r,originalData:e,separateData:s,separateIndex:n,separateLength:i.length,isOriginRow:0===n,isLastRow:n===i.length-1};if(0===n)return e.$__SEPARATE_DATA=[s],e.$__SEPARATE_ROW_CACHE=e.$__SEPARATE_ROW_CACHE||[],e.$__uuid=t.uuid,void j(t.uuid,e,d);const p=null!=(u=e.$__SEPARATE_ROW_CACHE[n-1])?u:e.$__SEPARATE_ROW_CACHE[n-1]={$__SEPARATE:!0,$__uuid:t.uuid,$__SEPARATE_INDEX:n};p.$__ORIGIN_INDEX=r,j(t.uuid,p,d),e.$__SEPARATE_DATA.push(s),a(p)}))})),e.eventHooks.onResizableChange.tap(F,(async({column:e},t,a)=>{k(e)&&a.updateTableDataRef()})),e.configHooks.editConfig.tap(F,((e={},t)=>{const a=e.beforeEditMethod;return e.beforeEditMethod=(...e)=>{var r;if(!t.uuid)return c();const o=I.get(t.uuid);if(!o||!o.length)return c();const{row:n,column:i}=e[0],u=H(t.uuid,n);if(!u)return c();const s=null==(r=i.editRender)?void 0:r.props;if(!s||s.separateRowEdit)return c();const{isOriginRow:d,isLastRow:p}=u;return("bottom"===s.separatePlacement?p:d)&&c();function c(){return!l(a)||a(...e)}},e})),e.configHooks.checkboxConfig.tap(F,((e={},a)=>(e.checkMethod=t(e.checkMethod),e.visibleMethod=t(e.visibleMethod),e))),e.setupHooks.setup.tap(F,(e=>{n((()=>{e.value.uuid&&(I.delete(e.value.uuid),M(e.value.uuid))}))}))}})}export{F as separateRendererPlugins};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{reactive as e,inject as t,unref as n,toRaw as r,createVNode as o}from"vue";import{jsonParse as i,arrayed as u,findAncestor as l}from"../../../../shared/utils/index.js";import{promiseTimeout as a}from"@vueuse/shared";import{
|
|
1
|
+
import{reactive as e,inject as t,unref as n,toRaw as r,createVNode as o}from"vue";import{jsonParse as i,arrayed as u,findAncestor as l}from"../../../../shared/utils/index.js";import{promiseTimeout as a}from"@vueuse/shared";import{isNumber as c,isFunction as s,isString as d,isObject as f,isArray as p}from"lodash-es";import{InjectionIhoTableConfig as m,InjectionIhoTableEmits as v,IHO_TABLE_STRING_STATUS as I,IHO_TABLE_NUMBER_STATUS as g,IHO_TABLE_TREE_TYPE as h,InjectionIhoTableUUID as E}from"../constants/index.js";import{getSeparateInfo as T}from"./separateMap.js";export{deleteSeparateInfo,getSeparateInfo,setSeparateInfo}from"./separateMap.js";function w(e){return console.warn(`[IhoTable]: ${e}`)}const C=Object.freeze({getCellType(e){var t;return((null==(t=e.settingObj)?void 0:t.attr)||e.formType||"DEFAULT").toUpperCase()}});function R(){var e,n,r;const o=t(m);return o||w("this function(getRowHeight) only can be used in setup environment"),null!=(r=null==(n=null==(e=null==o?void 0:o.value)?void 0:e.rowConfig)?void 0:n.height)?r:32}function S(e){const t=e.slice(2);return`${t[0].toLowerCase()}${t.slice(1)}`}function O(e){return`on${e[0].toUpperCase()}${e.slice(1)}`}function P(t,n=!0){const r=n?e(new Map):new Map;return{getItemFromUUID:function(e){return r.set(e,r.get(e)||t()).get(e)},setItemFromUUID:function(e,t){r.set(e,t)},removeItemFromUUID:function(e){r.delete(e)}}}async function F(e,t,r,o){const i=u();return c(i)||await a(0),u()||function(){const t=+e.colWidth;return c(t)?t:64}();function u(){var i;const u=null==(i=n(o))?void 0:i.getColumnByField(e.field);if(!u)return;const l=$(u);return l?s(l.separateWidth)?l.separateWidth({column:u,row:t,rowIndex:r,$table:n(o)}):c(l.separateWidth)?l.separateWidth:u.renderWidth:u.renderWidth}}function A(e){const o=t(v);function i(){var t;const r=n(e);return{$table:r.$table,value:r.row[r.column.field],row:r.row,column:{...r.column,...null==(t=r.column.editRender)?void 0:t.props},index:r.rowIndex>-1?r.rowIndex:r.$rowIndex}}function u(e={}){o("formChange",{...i(),...r(e)})}function l(e={}){o("formClick",{...i(),...r(e)})}return{emitFormChange:function(){u()},emitFormClick:function(){l()},emitFormChangeWithParams:u,emitFormClickWithParams:l}}function $(e){var t;return null==(t=e.editRender)?void 0:t.props}const b=Object.freeze({createDefaultRenderCell:function(){return function({props:e},{row:n,column:r}){if("bottom"!==(null==e?void 0:e.separatePlacement))return c(n[r.field]);const i=t(E),u=T(i,n);if(!u)return c(n[r.field]);const{originalData:l=n,isLastRow:a}=u;return c(a?l[r.field]:null);function c(e){return[o("span",{title:_(r,e)},[e])]}}},createRenderEdit:function(e){return function({props:t},n){return e({...n,fieldItem:t||{},...A(n)})}},isEditableColumn(e,t){var n;return!1!==(null==(n=e.editConfig)?void 0:n.showIcon)&&t.editRender&&!1!==t.editRender.enabled},hasFilter(e){if(y(e))return!0;let t=e.fieldSetting;return d(t)&&(t=i(t||"")),f(t)&&((n=t).notParticipatingSearch!==I.POSITIVE&&"manual"===(null==(r=n.mapping)?void 0:r.type));var n,r},hasDateFiler(e){var t;return null==(t=null==e?void 0:e.filterSetting)?void 0:t.daterange}}),x=Object.freeze({isPositive:e=>e===g.POSITIVE||e===I.POSITIVE,isNegative:e=>e===g.NEGATIVE||e===I.NEGATIVE,notPositive:e=>e!==g.POSITIVE&&e!==I.POSITIVE,notNegative:e=>e!==g.NEGATIVE&&e!==I.NEGATIVE}),N=(e,t)=>({$event:n,column:r})=>{var o;if(!u(e).includes(null==(o=r.editRender)?void 0:o.name))return!0;const i=null==n?void 0:n.target;return!f(i)||!l(i,t)};function V(e){return[h.TRANSFORM_WITH_SPAN_METHOD,h.TRANSFORM_TREE_TYPE].includes(`${e.isTree}`)}function W(e){return d(e)&&!!e.match(/^###\{[^{}]+}$/)}function D(e){try{return JSON.parse(e.replace(/^###/,""))}catch(e){return{}}}function U(e,t){if(e.$__SEPARATE||!t.editRender||!t.editRender.props)return e[t.field];const{fieldSetting:n}=t.editRender.props;if(!d(n))return e[t.field];const{mergedFeildExpression:r}=i(n);return r&&d(r)?r.replace(/#{(.+?)}/g,(function(t,n){let r=n?e[n.trim()]:null;W(r)&&(r=D(r).change_text);return r||(null==r?"--":r)})):e[t.field]}const j=["SEARCH","SELECT","RADIO","CHECKBOX"];function y(e){return e.notParticipatingSearch===g.NEGATIVE&&j.includes(C.getCellType(e))&&p(e.options)&&e.options.length}function _(e,t=""){return"tooltip"===e.showOverflow?"":t}export{b as IhoTableRenderHelper,x as IhoTableStatusHelper,C as IhoTableUtils,w as IhoTableWarn,N as createIhoTableClearActivedInterceptor,S as eventListener2EventName,O as eventName2EventListener,F as getColumnRenderWidth,$ as getLowCodeFieldFromField,R as getRowHeight,_ as getTitle,y as isCompatibleColumn,W as isRichContent,V as isTransformTreeType,U as parseMergeField,D as parseRichContent,A as useIhoTableFormEvent,P as useUUIDMap};
|