cnhis-design-vue 3.2.1-release.2 → 3.2.2-beta.10
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/biunique-chat/index.d.ts +750 -562
- package/es/components/biunique-chat/index.js +1 -1
- package/es/components/biunique-chat/src/Index.vue.d.ts +1213 -0
- package/es/components/biunique-chat/src/Index.vue.js +1 -0
- package/es/components/biunique-chat/src/Index.vue2.js +1 -0
- package/es/components/biunique-chat/src/api/index.d.ts +2 -5
- package/es/components/biunique-chat/src/api/index.js +1 -1
- package/es/components/biunique-chat/src/components/ChatFile.vue.d.ts +241 -0
- package/es/components/biunique-chat/src/components/ChatFile.vue.js +1 -0
- package/es/components/biunique-chat/src/components/ChatFile.vue2.js +1 -0
- package/es/components/biunique-chat/src/components/ChatFooter.vue.d.ts +3 -5
- package/es/components/biunique-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/biunique-chat/src/components/ChatHeader.vue.d.ts +639 -0
- package/es/components/biunique-chat/src/components/ChatHeader.vue2.js +1 -1
- package/es/components/biunique-chat/src/components/ChatMain.vue.d.ts +61 -5
- package/es/components/biunique-chat/src/components/ChatMain.vue2.js +1 -1
- package/es/components/biunique-chat/src/components/ChatRecord.vue.d.ts +101 -0
- package/es/components/biunique-chat/src/components/ChatRecord.vue.js +1 -0
- package/es/components/biunique-chat/src/components/ChatRecord.vue2.js +1 -0
- package/es/components/biunique-chat/src/components/ChatSet.vue.d.ts +246 -0
- package/es/components/biunique-chat/src/components/ChatSet.vue.js +1 -0
- package/es/components/biunique-chat/src/components/ChatSet.vue2.js +1 -0
- package/es/components/biunique-chat/src/components/PersonProfile.vue.d.ts +59 -0
- package/es/components/biunique-chat/src/components/PersonProfile.vue.js +1 -0
- package/es/components/biunique-chat/src/components/PersonProfile.vue2.js +1 -0
- package/es/components/biunique-chat/src/components/SiderList.vue.d.ts +18 -28
- package/es/components/biunique-chat/src/components/SiderList.vue2.js +1 -1
- package/es/components/biunique-chat/src/hooks/useState.d.ts +7 -0
- package/es/components/biunique-chat/src/hooks/useState.js +1 -0
- package/es/components/biunique-chat/src/types/index.d.ts +10 -0
- package/es/components/biunique-chat/src/utils/index.d.ts +6 -0
- package/es/components/biunique-chat/src/utils/index.js +1 -0
- package/es/components/biunique-chat/style/iconfont.ttf +0 -0
- package/es/components/biunique-chat/style/index.css +1 -1
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
- package/es/components/button-print/src/utils/print.d.ts +2 -1
- package/es/components/button-print/src/utils/print.js +1 -1
- package/es/components/callback/src/components/render/popupMaps.d.ts +74 -70
- package/es/components/classification/src/components/table-modal/index.vue.d.ts +0 -3
- package/es/components/classification/src/index.vue.d.ts +3 -3
- package/es/components/default-page/index.d.ts +71 -0
- package/es/components/default-page/index.js +1 -0
- package/es/components/default-page/src/constants/index.d.ts +19 -0
- package/es/components/default-page/src/constants/index.js +1 -0
- package/es/components/default-page/src/index.vue.d.ts +72 -0
- package/es/components/default-page/src/index.vue.js +1 -0
- package/es/components/default-page/src/index.vue2.js +1 -0
- package/es/components/default-page/style/index.css +1 -0
- package/es/components/expand-field/src/components/form.vue2.js +1 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useOther.js +1 -1
- package/es/components/fabric-chart/src/hooks/useCommon.d.ts +1 -0
- package/es/components/fabric-chart/src/hooks/useCommon.js +1 -1
- package/es/components/fabric-chart/src/hooks/useCumputedPoint.js +1 -1
- package/es/components/field-set/src/FieldColor.vue.d.ts +1 -1
- package/es/components/field-set/src/FieldSet.vue.d.ts +1 -1
- package/es/components/field-set/src/components/Row.vue.d.ts +1 -1
- package/es/components/form-config/src/hooks/useSortalbeConfig.js +1 -1
- package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue2.js +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/form-render/src/hooks/useFormEvent.js +1 -1
- package/es/components/form-render/src/hooks/useSelectedSetting.d.ts +3 -4
- package/es/components/form-render/src/hooks/useSelectedSetting.js +1 -1
- package/es/components/iho-table/index.d.ts +74 -70
- package/es/components/iho-table/src/IhoTable.vue.d.ts +74 -70
- package/es/components/iho-table/src/IhoTable.vue2.js +1 -1
- package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +3 -1
- package/es/components/iho-table/src/hooks/tapHooks/index.js +1 -1
- package/es/components/iho-table/src/hooks/tapHooks/useConfigHooks.d.ts +1 -0
- package/es/components/iho-table/src/hooks/tapHooks/useEventHooks.d.ts +2 -1
- package/es/components/iho-table/src/hooks/tapHooks/useEventHooks.js +1 -1
- package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue.d.ts +1 -0
- package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/headerPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/checkRendererPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/verticalTablePlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/index.d.ts +117 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/index.js +1 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useColumn2Data.d.ts +2 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useColumn2Data.js +1 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useCurrentColumn.d.ts +2 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useCurrentColumn.js +1 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useData2Column.d.ts +2 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useData2Column.js +1 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useEditCell.d.ts +2 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useEditCell.js +1 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useEventConvert.d.ts +2 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useEventConvert.js +1 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useExpose.d.ts +2 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useExpose.js +1 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useHeaderCSS.d.ts +2 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useHeaderCSS.js +1 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useHoverColumn.d.ts +2 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useHoverColumn.js +1 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useTriggerRow.d.ts +2 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useTriggerRow.js +1 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/{renderer.d.ts → src/renderer.d.ts} +2 -1
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/renderer.js +1 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/{types.d.ts → src/types.d.ts} +4 -3
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/types.js +1 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/{utils.d.ts → src/utils.d.ts} +8 -6
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/utils.js +1 -0
- package/es/components/iho-table/src/types/index.d.ts +34 -4
- package/es/components/iho-table/src/types/pluginType.d.ts +1 -0
- package/es/components/iho-table/src/utils/index.d.ts +1 -1
- package/es/components/iho-table/src/utils/index.js +1 -1
- package/es/components/iho-table/style/index.css +1 -1
- package/es/components/index.css +1 -1
- package/es/components/index.d.ts +4 -1
- package/es/components/index.js +1 -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 +0 -6
- package/es/components/step-notice/index.d.ts +310 -0
- package/es/components/step-notice/index.js +1 -0
- package/es/components/step-notice/src/StepNotice.vue.d.ts +288 -0
- package/es/components/step-notice/src/StepNotice.vue.js +1 -0
- package/es/components/step-notice/src/StepNotice.vue2.js +1 -0
- package/es/components/step-notice/src/components/NoticeConnection.vue.d.ts +39 -0
- package/es/components/step-notice/src/components/NoticeConnection.vue.js +1 -0
- package/es/components/step-notice/src/components/NoticeConnection.vue2.js +1 -0
- package/es/components/step-notice/src/components/NoticeItem.vue.d.ts +151 -0
- package/es/components/step-notice/src/components/NoticeItem.vue.js +1 -0
- package/es/components/step-notice/src/components/NoticeItem.vue2.js +1 -0
- package/es/components/step-notice/src/components/NoticeItemAside.vue.d.ts +35 -0
- package/es/components/step-notice/src/components/NoticeItemAside.vue.js +1 -0
- package/es/components/step-notice/src/components/NoticeItemAside.vue2.js +1 -0
- package/es/components/step-notice/src/components/NoticeOperationList.vue.d.ts +49 -0
- package/es/components/step-notice/src/components/NoticeOperationList.vue.js +1 -0
- package/es/components/step-notice/src/components/NoticeOperationList.vue2.js +1 -0
- package/es/components/step-notice/src/hooks/useTheme.d.ts +1 -0
- package/es/components/step-notice/src/hooks/useTheme.js +1 -0
- package/es/components/step-notice/src/types.d.ts +33 -0
- package/es/components/step-notice/src/types.js +1 -0
- package/es/components/step-notice/src/utils.d.ts +3 -0
- package/es/components/step-notice/src/utils.js +1 -0
- package/es/components/step-notice/style/index.css +1 -0
- package/es/env.d.ts +25 -25
- package/es/shared/assets/img/defaultCover/10reload.jpg.js +1 -0
- package/es/shared/assets/img/defaultCover/1tab.jpg.js +1 -0
- package/es/shared/assets/img/defaultCover/2menu.jpg.js +1 -0
- package/es/shared/assets/img/defaultCover/3view.jpg.js +1 -0
- package/es/shared/assets/img/defaultCover/4system.jpg.js +1 -0
- package/es/shared/assets/img/defaultCover/5location.jpg.js +1 -0
- package/es/shared/assets/img/defaultCover/6notfound.jpg.js +1 -0
- package/es/shared/assets/img/defaultCover/7loading.jpg.js +1 -0
- package/es/shared/assets/img/defaultCover/8nopermission.jpg.js +1 -0
- package/es/shared/assets/img/defaultCover/9nodata.jpg.js +1 -0
- 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/table_style_2.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/components/JSONTree/JSONTree.vue.d.ts +26 -0
- package/es/shared/components/JSONTree/JSONTree.vue.js +1 -0
- package/es/shared/components/JSONTree/JSONTree.vue2.js +1 -0
- package/es/shared/components/JSONTree/index.d.ts +2 -0
- package/es/shared/components/JSONTree/index.js +1 -0
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +86 -0
- package/es/shared/hooks/index.js +1 -1
- package/es/shared/hooks/useTheme.d.ts +1 -0
- package/es/shared/hooks/useTheme.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/es/shared/utils/fabricjs/index.d.ts +6823 -0
- package/es/shared/utils/tapable/index.d.ts +139 -0
- package/package.json +2 -2
- package/es/components/biunique-chat/src/BiuniqueChat.vue.d.ts +0 -1005
- package/es/components/biunique-chat/src/BiuniqueChat.vue.js +0 -1
- package/es/components/biunique-chat/src/BiuniqueChat.vue2.js +0 -1
- package/es/components/iho-table/src/plugins/verticalTablePlugin/renderer.js +0 -1
- package/es/components/iho-table/src/plugins/verticalTablePlugin/utils.js +0 -1
- /package/es/components/{iho-table/src/plugins/verticalTablePlugin/types.js → biunique-chat/src/types/index.js} +0 -0
- /package/es/components/iho-table/src/plugins/verticalTablePlugin/{constants.d.ts → src/constants.d.ts} +0 -0
- /package/es/components/iho-table/src/plugins/verticalTablePlugin/{constants.js → src/constants.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as t,provide as o,ref as a,toRaw as l,watch as
|
|
1
|
+
import{defineComponent as e,computed as t,provide as o,ref as a,toRaw as l,watch as r,resolveComponent as n,openBlock as s,createElementBlock as i,mergeProps as u,unref as c,createBlock as d,resolveDynamicComponent as f,createElementVNode as m,normalizeStyle as p,createVNode as v,withCtx as b,createSlots as h,renderList as g,createCommentVNode as x,renderSlot as y,normalizeProps as k,guardReactiveProps as C}from"vue";import{useTheme as D,createOpacityColor as j}from"../../../shared/hooks/useTheme.js";import{useDebounceFn as $}from"@vueuse/core";import"date-fns";import{isString as I,isEqualWith as w,isFunction as q,pick as R}from"lodash-es";import{useFormAsyncQueue as H,presetRequestHandler as T}from"../../../shared/hooks/useFormRequest/index.js";import{promiseTimeout as _}from"@vueuse/shared";import{hex2rgba as P,widthAppend as A,uuidGenerator as L}from"../../../shared/utils/index.js";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{NConfigProvider as S}from"naive-ui";import{useVersion as F}from"../../../shared/hooks/useVersion.js";import{VxeTableEventNameList as O,InjectionIhoTableEmits as B,InjectionTableAsyncQueue as E,InjectionIhoTableAnnotation as N,InjectionIhoTableUUID as V,InjectionIhoTableInstance as W,InjectionIhoTableConfig as z,InjectionIhoTableFieldList as G,InjectionIhoTableHandler as J}from"./constants/index.js";import{createTableHooks as K,applyTableConfigHooks as M,applyTableFieldHooks as Q,createTableEventHandlers as U,createDomInsertComponent as X,createDataTransfer as Y}from"./hooks/tapHooks/index.js";import{provideIhoTableEventListener as Z}from"./hooks/tapHooks/useEventHooks.js";import{eventName2EventListener as ee}from"./utils/index.js";const te=["id"];var oe=e({__name:"IhoTable",props:{tableConfig:{type:Object,default:()=>({})},fieldList:{type:Array,default:()=>[]},tableData:{type:Array,default:()=>[]},annotation:{type:Object},requestInstance:{type:Object},uniqueCacheData:{type:Boolean,default:!1},parallelism:{type:Number,default:3}},emits:["formChange","settingClick","formClick","keyboard","rowDrag",...O],setup(e,{expose:O,emit:oe}){var ae,le;const re=e,ne=t((()=>{const e=D({"--c-border-color":"#d0d0d0","--c-head-bg-color":"#f2f2f2","--c-hover-color":"#e6e6e6","--c-stripe-color":"#f6f6f6"}).value;return e["--c-primary-color-opacity3"]=j(...P(e["--c-primary-color"]),.3),e})),se=t((()=>{var e,t;const o=null!=(t=null==(e=re.tableConfig)?void 0:e.height)?t:"100%";return{height:"auto"===o?"100%":I(o)&&(o.includes("calc")||o.endsWith("%"))?o:A(o)}})),ie=Z(),ue=function(e,...t){oe(e,...t);const o=c(pe)[ee(e)];q(o)&&o(...t),ie.trigger(e,...t)};o(B,ue);const ce=H(t((()=>re.requestInstance)),t((()=>!!re.uniqueCacheData))).create(re.parallelism,{beforeRequest:(e,t)=>t,afterRequest:(e,t)=>T(t)});o(E,ce);const de=K();o(N,t((()=>re.annotation)));const fe=L();o(V,fe);const me=a();o(W,me);const pe=a({uuid:null!=(le=null==(ae=re.tableConfig)?void 0:ae.uuid)?le:fe});o(z,pe);const ve=$(be,10);function be(){var e,t;pe.value=M(de,{...re.tableConfig,uuid:null!=(t=null==(e=re.tableConfig)?void 0:e.uuid)?t:fe},{$table:me,emits:ue,globProps:re})}const he=a([]);o(G,he);const ge=$(xe,10);function xe(){const e=Q(de,re.fieldList,pe.value,{$table:me,emits:ue,globProps:re});w(e,l(he.value),((e,t)=>{if(q(e)&&q(t))return e.toString()===t.toString()}))||(he.value=e)}const ye=Y(de,pe,me),ke=a([]);async function Ce(){var e,t;const o=await ye(re.tableData),a=null==(e=me.value)?void 0:e.getTableData().fullData;if(a){let e=0;if(!(a.some((t=>{var a;if(!(null==(a=me.value)?void 0:a.isInsertByRow(t))){if(t!==o[e])return!0;e++}}))||e!==o.length))return}ke.value=o,null==(t=me.value)||t.recalculate(!0)}const De={updateTableDataRef:$(Ce,10),updateConfigRef:ve,updateFieldListRef:ge};o(J,De);const je=U({hooks:de,config:pe,$table:me,context:De,emits:ue,globProps:re}),$e=t((()=>({...pe.value,...je})));let Ie=!1,we=!1,qe=!1;const Re=$((()=>{Ie&&be(),we&&xe(),qe&&Ce(),Ie=!1,we=!1,qe=!1}),10);r((()=>re.tableConfig),(()=>{Ie=!0,we=!0,qe=!0,Re()}),{deep:!0}),r((()=>re.fieldList),(()=>{we=!0,qe=!0,Re()}),{deep:!0}),r([()=>[...re.tableData],()=>{var e;return null==(e=re.tableData)?void 0:e.length}],(()=>{qe=!0,Re()})),r([()=>re.tableData,()=>{var e;return null==(e=re.tableData)?void 0:e.length}],(async()=>{var e,t;(null==(e=pe.value.treeConfig)?void 0:e.expandAll)&&(await _(11),null==(t=me.value)||t.setAllTreeExpand(!0))})),be(),xe(),Ce();const{header:He,footer:Te}=X(de);function _e(e){return R(e,["row","rowIndex","$rowIndex","column","columnIndex","$columnIndex","_columnIndex","checked","disabled","indeterminate"])}return O({$table:me,async loadData(e){var t;null==(t=me.value)||t.loadData(await ye(e))},setSort:(e,t)=>({field:e,value:t}),setFilter:(e,t)=>({field:e,value:t}),reload(){var e,t;null==(e=me.value)||e.loadColumn([]),null==(t=me.value)||t.loadData([]),be(),xe(),Ce()},verticalTable:{update:()=>{}},...de.exposeHooks.expose.call({},pe,{$table:me,emits:ue,globProps:re,...De})}),de.setupHooks.setup.call(pe,he,{$table:me,emits:ue,globProps:re}),(e,t)=>{const o=n("vxe-grid");return s(),i("section",u({class:"iho-table",id:c(fe),style:c(ne)},c(F)()),[(s(),d(f(c(He)))),m("section",{style:p(c(se))},[v(c(S),{abstract:"",namespace:"vxe-table--ignore-clear"},{default:b((()=>[v(o,u({ref_key:"$table",ref:me},c($e),{columns:he.value,data:ke.value}),h({_:2},[g(e.$slots,((t,o)=>({name:o,fn:b((t=>[x(" 实际上所有的vxe-grid插槽都支持 "),y(e.$slots,o,k(C(_e(t))))]))})))]),1040,["columns","data"])])),_:3})],4),(s(),d(f(c(Te))))],16,te)}}});export{oe as default};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AnyObject, Nullable } from '../../../../../shared/types';
|
|
2
2
|
import { MaybeRef } from '@vueuse/core';
|
|
3
|
+
import { IhoTableProps } from 'cnhis-design-vue';
|
|
3
4
|
import { VxeTableInstance } from 'vxe-table';
|
|
4
5
|
import { IhoTableHandlerContext, IhoTableConfig, IhoTableEmits, IhoTableFieldItem, IhoTableHandler, TableHooks } from '../../../../../components/iho-table/src/types';
|
|
5
6
|
export declare const createTableHooks: () => Readonly<{
|
|
@@ -13,12 +14,13 @@ export declare const createTableHooks: () => Readonly<{
|
|
|
13
14
|
}>;
|
|
14
15
|
export declare function applyTableConfigHooks(hooks: TableHooks, config: IhoTableConfig, context: IhoTableHandlerContext): IhoTableConfig;
|
|
15
16
|
export declare function applyTableFieldHooks(hooks: TableHooks, fieldList: IhoTableFieldItem[], config: IhoTableConfig, context: IhoTableHandlerContext): IhoTableFieldItem[];
|
|
16
|
-
export declare function createTableEventHandlers({ hooks, config, $table, emits, context }: {
|
|
17
|
+
export declare function createTableEventHandlers({ hooks, config, $table, emits, context, globProps }: {
|
|
17
18
|
hooks: TableHooks;
|
|
18
19
|
config: MaybeRef<IhoTableConfig>;
|
|
19
20
|
$table: MaybeRef<Nullable<VxeTableInstance>>;
|
|
20
21
|
emits: IhoTableEmits;
|
|
21
22
|
context: IhoTableHandler;
|
|
23
|
+
globProps: IhoTableProps;
|
|
22
24
|
}): {
|
|
23
25
|
onCopy: import("vxe-table").VxeTableEvents.Copy | undefined;
|
|
24
26
|
onCut: import("vxe-table").VxeTableEvents.Cut | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{arrayed as o}from"../../../../../shared/utils/index.js";import{cloneDeep as e,isArray as r}from"lodash-es";import{unref as t,defineComponent as s}from"vue";import{VxeEventListenerNameList as n}from"../../constants/index.js";import{eventListener2EventName as i}from"../../utils/index.js";import{useConfigHooks as a}from"./useConfigHooks.js";import{useDataHooks as
|
|
1
|
+
import{arrayed as o}from"../../../../../shared/utils/index.js";import{cloneDeep as e,isArray as r}from"lodash-es";import{unref as t,defineComponent as s}from"vue";import{VxeEventListenerNameList as n}from"../../constants/index.js";import{eventListener2EventName as i}from"../../utils/index.js";import{useConfigHooks as a}from"./useConfigHooks.js";import{useDataHooks as l}from"./useDataHooks.js";import{useDomInsertHooks as f}from"./useDomInsertHooks.js";import{useEventHooks as c}from"./useEventHooks.js";import{useExposeHooks as u}from"./useExposeHooks.js";import{useFieldHooks as d}from"./useFieldHooks.js";import{useSetupHooks as m}from"./useSetupHooks.js";const p=(()=>{let o=null;return()=>o||(o=Object.freeze({configHooks:a().create(),fieldHooks:d().create(),eventHooks:c().create(),dataHooks:l().create(),setupHooks:m().create(),domInsertHooks:f().create(),exposeHooks:u().create()}))})();function k(o,r,t){const s=o.configHooks.config.call(e(r),t);return["rowConfig","editConfig","columnConfig","resizableConfig","seqConfig","sortConfig","filterConfig","radioConfig","checkboxConfig","expandConfig","treeConfig","mouseConfig","menuConfig","keyboardConfig","scrollY","scrollX","editRules"].forEach((e=>{s[e]=o.configHooks[e].call(s[e],s,t)})),s}function H(t,s,n,i){t.fieldHooks.fieldStart.promise(n,i);let a=function e(s){return s.reduce(((s,a,l)=>{const f=[],c=[];let u=!1;return a=t.fieldHooks.field.call(a,{index:l,remove(){u=!0},insertAfter(e){c.push(...o(e))},insertBefore(e){f.push(...o(e))}},n,i),s.push(...f),u||(s.push(a),r(a.children)&&(a.children=e(a.children))),s.push(...c),s}),[])}(e(s));return a=t.fieldHooks.fieldList.call(a,n,i),t.fieldHooks.fieldEnd.promise(n,i),a}function g({hooks:o,config:e,$table:r,emits:s,context:a,globProps:l}){return n.reduce(((n,f)=>(n[f]=n=>function(n,f){var c;const u=i(n);f=o.eventHooks.beforeEvent.call(f,t(e),{$table:t(r),emits:s,globProps:l,...a},u),s(u,f),null==(c=o.eventHooks[n])||c.promise(f,t(e),{$table:t(r),globProps:l,emits:s,...a})}(f,n),n)),{})}function h(e,r,s){return async n=>{e.dataHooks.dataStart.promise(t(r));let i=await n.reduce((async(n,i,a)=>{const l=[],f=[];let c=!1;await e.dataHooks.data.promise(i,t(r),{index:a,$table:s,insertBefore(e){l.push(...o(e))},insertAfter(e){f.push(...o(e))},remove(){c=!0}});const u=await n;return u.push(...l),!c&&u.push(i),u.push(...f),u}),Promise.resolve([]));return i=e.dataHooks.dataList.call(i,t(r)),e.dataHooks.dataEnd.promise(t(r)),i}}function C(o){return{header:s({name:"IhoTableHeader",render:()=>o.domInsertHooks.header.call([])}),footer:s({name:"IhoTableFooter",render:()=>o.domInsertHooks.footer.call([])})}}export{k as applyTableConfigHooks,H as applyTableFieldHooks,h as createDataTransfer,C as createDomInsertComponent,g as createTableEventHandlers,p as createTableHooks};
|
|
@@ -23,6 +23,7 @@ declare class ConfigHooks extends AbstractConfigHooks {
|
|
|
23
23
|
maxCheckSize: number;
|
|
24
24
|
disableHeader: boolean;
|
|
25
25
|
useNCheckbox: boolean;
|
|
26
|
+
indeterminateField: string;
|
|
26
27
|
}>) | undefined, IhoTableConfig, IhoTableHandlerContext<true>], import("../../../../../shared/utils/tapable").UnsetAdditionalOptions>;
|
|
27
28
|
readonly expandConfig: SyncWaterfallHook<[import("vxe-table").VxeTablePropTypes.ExpandConfig | undefined, IhoTableConfig, IhoTableHandlerContext<true>], import("../../../../../shared/utils/tapable").UnsetAdditionalOptions>;
|
|
28
29
|
readonly treeConfig: SyncWaterfallHook<[import("vxe-table").VxeTablePropTypes.TreeConfig | undefined, IhoTableConfig, IhoTableHandlerContext<true>], import("../../../../../shared/utils/tapable").UnsetAdditionalOptions>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { AnyFn } from '../../../../../shared/types';
|
|
2
|
-
import { AsyncParallelHook } from '../../../../../shared/utils/tapable';
|
|
2
|
+
import { AsyncParallelHook, SyncWaterfallHook } from '../../../../../shared/utils/tapable';
|
|
3
3
|
import { AbstractEventHooks, IhoTableEmitPayload, IhoTableEventNameUnion } from '../../../../../components/iho-table/src/types';
|
|
4
4
|
declare class EventHooks extends AbstractEventHooks {
|
|
5
|
+
readonly beforeEvent: SyncWaterfallHook<[any, import("../../../../../components/iho-table/src/types").IhoTableConfig, import("../../../../../components/iho-table/src/types").IhoTableHandler & import("../../../../../components/iho-table/src/types").IhoTableHandlerContext<false>, string], import("../../../../../shared/utils/tapable").UnsetAdditionalOptions>;
|
|
5
6
|
readonly onKeydownStart: AsyncParallelHook<[import("vxe-table/types/table").VxeTableDefines.KeydownStartEventParams, import("../../../../../components/iho-table/src/types").IhoTableConfig, import("../../../../../components/iho-table/src/types").IhoTableHandler & import("../../../../../components/iho-table/src/types").IhoTableHandlerContext<false>], import("../../../../../shared/utils/tapable").UnsetAdditionalOptions>;
|
|
6
7
|
readonly onKeydown: AsyncParallelHook<[import("vxe-table/types/table").VxeTableDefines.KeydownEventParams, import("../../../../../components/iho-table/src/types").IhoTableConfig, import("../../../../../components/iho-table/src/types").IhoTableHandler & import("../../../../../components/iho-table/src/types").IhoTableHandlerContext<false>], import("../../../../../shared/utils/tapable").UnsetAdditionalOptions>;
|
|
7
8
|
readonly onKeydownEnd: AsyncParallelHook<[import("vxe-table/types/table").VxeTableDefines.KeydownEndEventParams, import("../../../../../components/iho-table/src/types").IhoTableConfig, import("../../../../../components/iho-table/src/types").IhoTableHandler & import("../../../../../components/iho-table/src/types").IhoTableHandlerContext<false>], import("../../../../../shared/utils/tapable").UnsetAdditionalOptions>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import
|
|
1
|
+
import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import e from"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import n from"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{getCurrentInstance as t,onMounted as o,onBeforeUnmount as i,provide as c}from"vue";import{InjectionIhoTableEventListener as s}from"../../constants/index.js";import{AbstractEventHooks as l}from"../../types/pluginType.js";class r extends l{constructor(){super(...arguments),this.beforeEvent=new e(["payload","config","context","eventName"]),this.onKeydownStart=new n(["event","config","context"]),this.onKeydown=new n(["event","config","context"]),this.onKeydownEnd=new n(["event","config","context"]),this.onPaste=new n(["event","config","context"]),this.onCopy=new n(["event","config","context"]),this.onCut=new n(["event","config","context"]),this.onCurrentChange=new n(["event","config","context"]),this.onRadioChange=new n(["event","config","context"]),this.onCheckboxChange=new n(["event","config","context"]),this.onCheckboxAll=new n(["event","config","context"]),this.onCheckboxRangeStart=new n(["event","config","context"]),this.onCheckboxRangeChange=new n(["event","config","context"]),this.onCheckboxRangeEnd=new n(["event","config","context"]),this.onCellClick=new n(["event","config","context"]),this.onCellDblclick=new n(["event","config","context"]),this.onCellMenu=new n(["event","config","context"]),this.onCellMouseenter=new n(["event","config","context"]),this.onCellMouseleave=new n(["event","config","context"]),this.onHeaderCellClick=new n(["event","config","context"]),this.onHeaderCellDblclick=new n(["event","config","context"]),this.onHeaderCellMenu=new n(["event","config","context"]),this.onFooterCellClick=new n(["event","config","context"]),this.onFooterCellDblclick=new n(["event","config","context"]),this.onFooterCellMenu=new n(["event","config","context"]),this.onSortChange=new n(["event","config","context"]),this.onFilterChange=new n(["event","config","context"]),this.onFilterVisible=new n(["event","config","context"]),this.onResizableChange=new n(["event","config","context"]),this.onToggleRowExpand=new n(["event","config","context"]),this.onToggleTreeExpand=new n(["event","config","context"]),this.onMenuClick=new n(["event","config","context"]),this.onEditClosed=new n(["event","config","context"]),this.onEditActived=new n(["event","config","context"]),this.onEditDisabled=new n(["event","config","context"]),this.onValidError=new n(["event","config","context"]),this.onScroll=new n(["event","config","context"]),this.onCustom=new n(["event","config","context"]),this.onOpenFnr=new n(["event","config","context"]),this.onFnrChange=new n(["event","config","context"]),this.onFnrFind=new n(["event","config","context"]),this.onFnrFindAll=new n(["event","config","context"]),this.onFnrReplace=new n(["event","config","context"]),this.onFnrReplaceAll=new n(["event","config","context"]),this.onCellAreaCopy=new n(["event","config","context"]),this.onCellAreaCut=new n(["event","config","context"]),this.onCellAreaPaste=new n(["event","config","context"]),this.onCellAreaMerge=new n(["event","config","context"]),this.onClearCellAreaMerge=new n(["event","config","context"]),this.onHeaderCellAreaSelection=new n(["event","config","context"]),this.onCellAreaSelectionStart=new n(["event","config","context"]),this.onCellAreaSelectionDrag=new n(["event","config","context"]),this.onCellAreaSelectionEnd=new n(["event","config","context"]),this.onCellAreaExtensionStart=new n(["event","config","context"]),this.onCellAreaExtensionDrag=new n(["event","config","context"]),this.onCellAreaExtensionEnd=new n(["event","config","context"]),this.onCellAreaArrowsStart=new n(["event","config","context"]),this.onCellAreaArrowsEnd=new n(["event","config","context"]),this.onActiveCellChangeStart=new n(["event","config","context"]),this.onActiveCellChangeEnd=new n(["event","config","context"]),this.onCellAreaSelectionAllStart=new n(["event","config","context"]),this.onCellAreaSelectionAllEnd=new n(["event","config","context"]),this.onPageChange=new n(["event","config","context"])}}function a(){return{create:function(){return new r}}}class h{constructor(){this.eventMap=new Map}addEventListener(e,n){if(!t())throw new Error("addEventListener can only used in setup environment!");const c=this.eventMap.get(e)||new Set;this.eventMap.set(e,c),o((()=>c.add(n))),i((()=>c.delete(n)))}trigger(e,...n){var t;null==(t=this.eventMap.get(e))||t.forEach((e=>{e(...n)}))}}function g(){if(!t())throw new Error("provideIhoTableEventListener can only used in setup environment!");const e=new h;return c(s,e),e}export{h as IhoTableEventListener,g as provideIhoTableEventListener,a as useEventHooks};
|
|
@@ -13,6 +13,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
13
13
|
};
|
|
14
14
|
}>> & {}>>;
|
|
15
15
|
$table: (VxeTableConstructor & VxeTablePrivateMethods & VxeTableMethods) | undefined;
|
|
16
|
+
tableConfig: import("vue").Ref<import("../../../../../components/iho-table").IhoTableConfig>;
|
|
16
17
|
multipleRef: import("vue").ComputedRef<boolean>;
|
|
17
18
|
optionsRef: import("vue").ComputedRef<import("vxe-table").VxeTableDefines.FilterOption[] & VxeColumnPropTypes.Filter[]>;
|
|
18
19
|
checkedRef: import("vue").WritableComputedRef<string[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,inject as l,computed as a,ref as t,onDeactivated as u,onMounted as i,toRaw as
|
|
1
|
+
import{defineComponent as e,inject as l,computed as a,ref as t,onDeactivated as u,onMounted as i,toRaw as n,openBlock as o,createElementBlock as r,unref as v,createBlock as s,createCommentVNode as c,createElementVNode as d,createVNode as p,isRef as f,withCtx as m,mergeProps as h,normalizeProps as _,guardReactiveProps as y,Fragment as b,renderList as k,toDisplayString as g,createTextVNode as C,normalizeStyle as L}from"vue";import w from"../../../../../shared/components/CancelRadio/CancelRadio.js";import{keywordMatcher as D,widthAppend as I}from"../../../../../shared/utils/index.js";import{useVirtualList as j}from"@vueuse/core";import{isNumber as x,isString as F,isFunction as S,isEqual as U}from"lodash-es";import{NInput as R,NCheckbox as W,NSpin as E,NCheckboxGroup as Y,NRadioGroup as $,NButtonGroup as O,NButton as P}from"naive-ui";import{InjectionIhoTableConfig as V}from"../../constants/index.js";import{isVariableHeightTable as q}from"../../utils/index.js";const z={class:"iho-table__filterWrapper"},A={key:1,class:"iho-table__filterCheckAllWrapper"},H={class:"iho-table__filterListItem"},M={class:"iho-table__filterListItem"},B=["title"],G=["title"],J={class:"iho-table__filterListItemContent"},K={class:"iho-table__filterFooter"};var N=e({__name:"filter",props:{payload:{type:Object,required:!0}},setup(e){const N=e,Q=l("$xetable"),T=l(V),X=a((()=>{var e;return!!(null==(e=N.payload)?void 0:e.column.filterMultiple)})),Z=a((()=>{var e,l,a;return null!=(a=null==(l=null==(e=N.payload)?void 0:e.column)?void 0:l.filters)?a:[]})),ee=a({get:()=>Z.value.reduce(((e,l)=>(l.checked&&e.push(l.value),e)),[]),async set(e){var l,a,t,u;if(!N.payload||!Q)return;const i=Q.reactData.filterStore.options||[];if(X.value?(i.forEach((l=>l._checked=e.includes(l.value))),Q.checkFilterOptions()):i.forEach((l=>l._checked=l.value===e[0])),!q(Q))return n();function n(){N.payload.$panel.confirmFilter(new CustomEvent("click"))}(null!=(a=null==(l=Q.internalData.afterFullData)?void 0:l.length)?a:0)>(null!=(u=null==(t=T.value.scrollY)?void 0:t.gt)?u:100)&&(Q.reactData.scrollYLoad=!0),n(),Q.reactData.scrollYLoad=!1}}),le=t([...ee.value]),ae=t("");async function te(){Q&&(Q.reactData.filterStore.visible=!1)}u(te);const ue=a((()=>{var e,l;if(!N.payload||!N.payload.column)return 10;const{filterCapacity:a}=null!=(l=null==(e=N.payload.column.editRender)?void 0:e.props)?l:{};return x(a)&&a>0?a:10})),ie=a((()=>ae.value?Z.value.filter((e=>!!`${e.label}`.includes(ae.value)||(F(e.data)?D(ae.value,e.data):void 0))):Z.value)),{list:ne,containerProps:oe,wrapperProps:re}=j(ie,{itemHeight:32,overscan:3}),ve=a({get:()=>ie.value.every((e=>le.value.includes(e.value))),set(e){le.value=e?[...new Set([...le.value,...ie.value.map((e=>e.value))])]:le.value.filter((e=>ie.value.every((l=>l.value!==e))))}}),se=a((()=>ie.value.some((e=>le.value.includes(e.value)))&&!ve.value)),ce=a({get:()=>le.value.length===Z.value.length&&0!==Z.value.length,set:e=>{le.value=e?Z.value.map((e=>e.value)):[]}}),de=a((()=>!!le.value.length&&!ce.value)),pe=a((()=>({height:I(32*ue.value)})));function fe(){ee.value=X.value?le.value:U(le.value[0],null)?[]:[le.value[0]],te()}function me(){le.value=X.value?[]:[null]}const he=t(!1);return i((async()=>{var e;if(!Q)return;const l=null==(e=N.payload.column.editRender.props)?void 0:e.onFilterShow;if(S(l))try{he.value=!0,await l(N.payload);const{filterStore:e}=Q.reactData;n(e.options)!==n(Z.value)&&(e.options=Z.value)}finally{he.value=!1}})),(e,l)=>(o(),r("section",z,[v(Z).length>5?(o(),s(v(R),{key:0,value:ae.value,"onUpdate:value":l[0]||(l[0]=e=>ae.value=e)},null,8,["value"])):c("v-if",!0),v(X)?(o(),r("div",A,[d("div",H,[p(v(W),{label:"全选当前",checked:v(ve),"onUpdate:checked":l[1]||(l[1]=e=>f(ve)?ve.value=e:null),indeterminate:v(se)},null,8,["checked","indeterminate"])]),d("div",M,[p(v(W),{label:"全选所有",checked:v(ce),"onUpdate:checked":l[2]||(l[2]=e=>f(ce)?ce.value=e:null),indeterminate:v(de)},null,8,["checked","indeterminate"])])])):c("v-if",!0),p(v(E),{show:he.value},{default:m((()=>[v(X)?(o(),s(v(Y),{key:0,value:le.value,"onUpdate:value":l[3]||(l[3]=e=>le.value=e)},{default:m((()=>[d("section",h(v(oe),{style:v(pe),class:"iho-table__filterListWrapper"}),[d("section",_(y(v(re))),[(o(!0),r(b,null,k(v(ne),(e=>(o(),r("div",{class:"iho-table__filterListItem",key:e.data.value},[p(v(W),{value:e.data.value},{default:m((()=>[d("div",{class:"iho-table__filterListItemContent",title:e.data.label},g(e.data.label),9,B)])),_:2},1032,["value"])])))),128))],16)],16)])),_:1},8,["value"])):(o(),s(v($),{key:1,value:le.value[0],"onUpdate:value":l[5]||(l[5]=e=>le.value[0]=e)},{default:m((()=>[d("section",h(v(oe),{style:v(pe),class:"iho-table__filterListWrapper"}),[d("section",_(y(v(re))),[(o(!0),r(b,null,k(v(ne),(e=>(o(),r("div",{class:"iho-table__filterListItem",key:e.data.value,title:e.data.label},[p(v(w),{value:e.data.value,currentValue:le.value[0],cancelable:"",onCancel:l[4]||(l[4]=e=>le.value=[null])},{default:m((()=>[d("div",J,g(e.data.label),1)])),_:2},1032,["value","currentValue"])],8,G)))),128))],16)],16)])),_:1},8,["value"]))])),_:1},8,["show"]),d("footer",K,[d("section",null,[v(X)?(o(),r(b,{key:0},[C(" 已选择 "),d("span",{style:L({color:"var(--c-primary-color)"})},g(le.value.length),5),C(" 项 ")],64)):c("v-if",!0)]),p(v(O),{size:"small"},{default:m((()=>[p(v(P),{onClick:me},{default:m((()=>[C("清空")])),_:1}),p(v(P),{onClick:te},{default:m((()=>[C("取消")])),_:1}),p(v(P),{type:"primary",onClick:fe},{default:m((()=>[C("确定")])),_:1})])),_:1})])]))}});export{N as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useAttrs as e,onBeforeUnmount as t,inject as l,createVNode as o}from"vue";import{arrayed as n,widthAppend as a}from"../../../../shared/utils/index.js";import{isObject as r,isString as i,isFunction as s}from"lodash-es";import u from"../../../annotation-edit/index.js";import"../../index.js";import{InjectionIhoTableAnnotation as d,InjectionIhoTableConfig as m}from"../constants/index.js";import{getLowCodeFieldFromField as
|
|
1
|
+
import{useAttrs as e,onBeforeUnmount as t,inject as l,createVNode as o}from"vue";import{arrayed as n,widthAppend as a}from"../../../../shared/utils/index.js";import{isObject as r,isString as i,isFunction as s}from"lodash-es";import u from"../../../annotation-edit/index.js";import"../../index.js";import{InjectionIhoTableAnnotation as d,InjectionIhoTableConfig as m}from"../constants/index.js";import{getLowCodeFieldFromField as c,IhoTableRenderHelper as h}from"../utils/index.js";import{defineTablePlugin as p}from"../hooks/useTablePlugin.js";function f(){const f="headerPlugin";return p({name:f,apply(p){let v=null;p.setupHooks.setup.tap(f,(()=>{v=e(),t((()=>{v=null}))})),p.fieldHooks.field.tap(f,(e=>{var t;const p=null==(t=e.slots)?void 0:t.header;return e.slots={...e.slots,header:t=>function(e,t,c){const p=l(d),f=l(m),x=l("$xetable"),b=e.column||{},j=r(null==p?void 0:p.value)&&!1!==t.annotation,g=h.isEditableColumn(f.value,b),w=h.hasFilter(t)||h.hasDateFiler(t),W=h.hasTitlePrefix(e.column),k=i(c)?c:s(c)?c(e):null;let y=!1;if(f.value){const e=f.value.editRules&&f.value.editRules[b.field];e&&(y=n(e).some((e=>e.required)))}const D=f.value.border?Math.max(2,Math.ceil(x.reactData.scrollbarWidth/x.reactData.tableColumn.length)):1,M=a(Math.max(0,b.renderWidth-20-D-(y?14:0)-(j?18:0)-(w?23:0)-(g?22:0)-(W?20:0)-(b.sortable?23:0)));return o("section",{class:"iho-table__headerWrapper"},[o("section",{style:{width:M}},[null!=k?k:o("div",{style:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},[function(){const e=b.title,t=/\\n|\n|\r/g;if(!t.test(e))return e;const l=e.replace(t,"<br>").split("<br>");return l.map(((e,t)=>[e,t===l.length-1?null:o("br",null,null)]))}()])]),j?o(u,{modelValue:p.value[b.field],"onUpdate:modelValue":e=>p.value[b.field]=e,shortcuts:v&&(v["annotation-shortcuts"]||v.annotationShortcuts)||[]},null):null])}(t,c(e),p)},e}))}})}export{f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createVNode as e,defineComponent as o,inject as
|
|
1
|
+
import{createVNode as e,defineComponent as o,inject as n,computed as l}from"vue";import{isNumber as t,constant as a,isString as i}from"lodash-es";import"../../../../index.js";import{NCheckbox as d}from"naive-ui";import{defineTablePlugin as c}from"../../../hooks/useTablePlugin.js";function r(){const o="checkRendererPlugin";return c({name:o,apply(n){n.fieldHooks.field.tap(o,((n,{index:l,insertBefore:i},d)=>{if(0===l&&d.selectType&&["checkbox","radio"].includes(d.selectType)){const{radioConfig:n,checkboxConfig:l={}}=d,c={width:45,align:"center",fixed:"left",..."radio"===d.selectType?n:l,field:o,type:d.selectType,annotation:!1};l.disableHeader&&(c.slots={header:()=>e("span",{class:"checkbox-cell--disable"},null),...c.slots}),l.useNCheckbox&&(c.slots={checkbox:e=>s(e,l),header:t(l.maxCheckSize)?a([]):e=>s(e,l),...c.slots}),i(c)}return n}))}})}function s(o,n){return[e(p,{payload:o,checkboxConfig:n},null)]}const p=o({name:"IhoTableNCheckbox",props:{payload:{type:Object,default:()=>({})},checkboxConfig:{type:Object,default:()=>({})}},setup(o){const t=n("$xetable");function a(e,n){var l;n.stopPropagation(),"header"===(null==(l=o.payload)?void 0:l.type)?null==t||t.triggerCheckAllEvent(new MouseEvent("mouse-down"),e):null==t||t.triggerCheckRowEvent(new MouseEvent("mouse-down"),o.payload,e)}const c=l((()=>{var e,n;return i(null==(e=o.checkboxConfig)?void 0:e.indeterminateField)?null==(n=o.payload.row)?void 0:n[o.checkboxConfig.indeterminateField]:o.payload.indeterminate}));return()=>o.payload.visible?e(d,{checked:o.payload.checked,"onUpdate:checked":e=>o.payload.checked=e,indeterminate:c.value,disabled:o.payload.disabled,onUpdateChecked:a},null):null}});export{r as checkRendererPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{pick as e}from"lodash-es";import{onBeforeUnmount as r,unref as o}from"vue";import"../../../index.js";import{LOWEST_PRIORITY as l}from"../../constants/index.js";import{createVerticalTableHooks as t,usePresetVerticalPlugins as n}from"./src/hooks/index.js";import{useUUIDMap as i}from"../../utils/index.js";import{VERTICAL_CELL_TYPE as s}from"./src/constants.js";import{createCellRender as a,createHeaderCellRender as c}from"./src/renderer.js";import{isVerticalTable as d,getSpanInfo as u}from"./src/utils.js";import{defineTablePlugin as m}from"../../hooks/useTablePlugin.js";function f(){const f="verticalTablePlugin",{getItemFromUUID:p,removeItemFromUUID:C}=i((()=>({})));return m({name:f,vxe(e){e.renderer.add(s,{renderCell:a(e,p,"default"),renderEdit:a(e,p,"edit"),renderHeader:c(e,p)})},apply(i){const s=t();n(s,i,p),i.configHooks.config.tap({name:f,stage:l},(r=>{if(!r.uuid||!d(r))return r;const o=p(r.uuid);function l(e){s.onCellClick.call(e,o)}function t(e){var r;return e.row||null==e.$rowIndex||(e.row=null==(r=o.fixedLeftVerticalData)?void 0:r[e.$rowIndex]),s.cellStyle.call({},e,o)}function n(e){return s.cellClassName.call({},e,o)}o.originalTableConfig=r;const i={...e(r,["uuid","border","height","verticalConfig","showSeq","size","rowGroupSetting","keyboardConfig","selectType","editConfig"]),cellClassName:n,headerCellClassName:n,cellStyle:t,headerCellStyle:t,headerRowStyle:e=>s.headerRowStyle.call({background:"white"},e,o),spanMethod:u,onCellClick:l,onHeaderCellClick:l};return s.config.call(i,o)})),i.setupHooks.setup.tap(f,(e=>{r((()=>C(o(e).uuid)))}))}})}export{f as verticalTablePlugin};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { AnyObject } from '../../../../../../../shared/types';
|
|
2
|
+
import { SyncHook, SyncWaterfallHook } from '../../../../../../../shared/utils/tapable';
|
|
3
|
+
import { CSSProperties } from 'vue';
|
|
4
|
+
import { VxeTableDefines } from 'vxe-table';
|
|
5
|
+
import { VxeColumnPropTypes } from 'vxe-table/types/column';
|
|
6
|
+
import { VxeTableConstructor, VxeTablePrivateMethods } from 'vxe-table/types/table';
|
|
7
|
+
import { IhoTableConfig, TableHooks } from '../../../../../../../components/iho-table';
|
|
8
|
+
import { IhoTableVerticalState } from '../types';
|
|
9
|
+
export declare const createVerticalTableHooks: () => {
|
|
10
|
+
onCellClick: SyncHook<[{
|
|
11
|
+
$rowIndex: number;
|
|
12
|
+
row?: AnyObject | undefined;
|
|
13
|
+
$columnIndex: number;
|
|
14
|
+
column: VxeTableDefines.ColumnInfo;
|
|
15
|
+
}, Partial<{
|
|
16
|
+
originalTableConfig: IhoTableConfig;
|
|
17
|
+
originalFieldList: import("../../../../../../../components/iho-table").IhoTableFieldItem[];
|
|
18
|
+
originalData: AnyObject[];
|
|
19
|
+
verticalFieldList: import("../../../../../../../components/iho-table").IhoTableFieldItem[];
|
|
20
|
+
fullVerticalOriginData: AnyObject[];
|
|
21
|
+
verticalData: AnyObject[];
|
|
22
|
+
fixedLeftVerticalData: AnyObject[];
|
|
23
|
+
headerDepth: number;
|
|
24
|
+
currentRow: AnyObject | null;
|
|
25
|
+
editCell: {
|
|
26
|
+
row: AnyObject;
|
|
27
|
+
column: import("../../../../../../../components/iho-table").IhoTableFieldItem;
|
|
28
|
+
} | null;
|
|
29
|
+
editStateEvent: (event: MouseEvent) => void;
|
|
30
|
+
hoveringRow: AnyObject | null;
|
|
31
|
+
hoveringFieldKey: string | null;
|
|
32
|
+
}>], void, import("../../../../../../../shared/utils/tapable").UnsetAdditionalOptions>;
|
|
33
|
+
cellStyle: SyncWaterfallHook<[CSSProperties, {
|
|
34
|
+
column: VxeTableDefines.ColumnInfo;
|
|
35
|
+
row?: AnyObject | undefined;
|
|
36
|
+
}, Partial<{
|
|
37
|
+
originalTableConfig: IhoTableConfig;
|
|
38
|
+
originalFieldList: import("../../../../../../../components/iho-table").IhoTableFieldItem[];
|
|
39
|
+
originalData: AnyObject[];
|
|
40
|
+
verticalFieldList: import("../../../../../../../components/iho-table").IhoTableFieldItem[];
|
|
41
|
+
fullVerticalOriginData: AnyObject[];
|
|
42
|
+
verticalData: AnyObject[];
|
|
43
|
+
fixedLeftVerticalData: AnyObject[];
|
|
44
|
+
headerDepth: number;
|
|
45
|
+
currentRow: AnyObject | null;
|
|
46
|
+
editCell: {
|
|
47
|
+
row: AnyObject;
|
|
48
|
+
column: import("../../../../../../../components/iho-table").IhoTableFieldItem;
|
|
49
|
+
} | null;
|
|
50
|
+
editStateEvent: (event: MouseEvent) => void;
|
|
51
|
+
hoveringRow: AnyObject | null;
|
|
52
|
+
hoveringFieldKey: string | null;
|
|
53
|
+
}>], import("../../../../../../../shared/utils/tapable").UnsetAdditionalOptions>;
|
|
54
|
+
cellClassName: SyncWaterfallHook<[Record<string, boolean>, {
|
|
55
|
+
column: VxeTableDefines.ColumnInfo;
|
|
56
|
+
}, Partial<{
|
|
57
|
+
originalTableConfig: IhoTableConfig;
|
|
58
|
+
originalFieldList: import("../../../../../../../components/iho-table").IhoTableFieldItem[];
|
|
59
|
+
originalData: AnyObject[];
|
|
60
|
+
verticalFieldList: import("../../../../../../../components/iho-table").IhoTableFieldItem[];
|
|
61
|
+
fullVerticalOriginData: AnyObject[];
|
|
62
|
+
verticalData: AnyObject[];
|
|
63
|
+
fixedLeftVerticalData: AnyObject[];
|
|
64
|
+
headerDepth: number;
|
|
65
|
+
currentRow: AnyObject | null;
|
|
66
|
+
editCell: {
|
|
67
|
+
row: AnyObject;
|
|
68
|
+
column: import("../../../../../../../components/iho-table").IhoTableFieldItem;
|
|
69
|
+
} | null;
|
|
70
|
+
editStateEvent: (event: MouseEvent) => void;
|
|
71
|
+
hoveringRow: AnyObject | null;
|
|
72
|
+
hoveringFieldKey: string | null;
|
|
73
|
+
}>], import("../../../../../../../shared/utils/tapable").UnsetAdditionalOptions>;
|
|
74
|
+
config: SyncWaterfallHook<[IhoTableConfig, Partial<{
|
|
75
|
+
originalTableConfig: IhoTableConfig;
|
|
76
|
+
originalFieldList: import("../../../../../../../components/iho-table").IhoTableFieldItem[];
|
|
77
|
+
originalData: AnyObject[];
|
|
78
|
+
verticalFieldList: import("../../../../../../../components/iho-table").IhoTableFieldItem[];
|
|
79
|
+
fullVerticalOriginData: AnyObject[];
|
|
80
|
+
verticalData: AnyObject[];
|
|
81
|
+
fixedLeftVerticalData: AnyObject[];
|
|
82
|
+
headerDepth: number;
|
|
83
|
+
currentRow: AnyObject | null;
|
|
84
|
+
editCell: {
|
|
85
|
+
row: AnyObject;
|
|
86
|
+
column: import("../../../../../../../components/iho-table").IhoTableFieldItem;
|
|
87
|
+
} | null;
|
|
88
|
+
editStateEvent: (event: MouseEvent) => void;
|
|
89
|
+
hoveringRow: AnyObject | null;
|
|
90
|
+
hoveringFieldKey: string | null;
|
|
91
|
+
}>], import("../../../../../../../shared/utils/tapable").UnsetAdditionalOptions>;
|
|
92
|
+
headerRowStyle: SyncWaterfallHook<[CSSProperties, {
|
|
93
|
+
$table: VxeTableConstructor & VxeTablePrivateMethods;
|
|
94
|
+
$rowIndex: number;
|
|
95
|
+
fixed: VxeColumnPropTypes.Fixed;
|
|
96
|
+
type: string;
|
|
97
|
+
}, Partial<{
|
|
98
|
+
originalTableConfig: IhoTableConfig;
|
|
99
|
+
originalFieldList: import("../../../../../../../components/iho-table").IhoTableFieldItem[];
|
|
100
|
+
originalData: AnyObject[];
|
|
101
|
+
verticalFieldList: import("../../../../../../../components/iho-table").IhoTableFieldItem[];
|
|
102
|
+
fullVerticalOriginData: AnyObject[];
|
|
103
|
+
verticalData: AnyObject[];
|
|
104
|
+
fixedLeftVerticalData: AnyObject[];
|
|
105
|
+
headerDepth: number;
|
|
106
|
+
currentRow: AnyObject | null;
|
|
107
|
+
editCell: {
|
|
108
|
+
row: AnyObject;
|
|
109
|
+
column: import("../../../../../../../components/iho-table").IhoTableFieldItem;
|
|
110
|
+
} | null;
|
|
111
|
+
editStateEvent: (event: MouseEvent) => void;
|
|
112
|
+
hoveringRow: AnyObject | null;
|
|
113
|
+
hoveringFieldKey: string | null;
|
|
114
|
+
}>], import("../../../../../../../shared/utils/tapable").UnsetAdditionalOptions>;
|
|
115
|
+
};
|
|
116
|
+
export declare const usePresetVerticalPlugins: VerticalTablePlugin;
|
|
117
|
+
export declare type VerticalTablePlugin = (verticalTableHooks: ReturnType<typeof createVerticalTableHooks>, tableHooks: TableHooks, getVerticalState: (uuid: string) => IhoTableVerticalState) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"../../../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../../../shared/utils/tapable/SyncBailHook.js";import o from"../../../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{useExpose as s}from"./useExpose.js";import{useColumn2Data as a}from"./useColumn2Data.js";import{useCurrentColumn as t}from"./useCurrentColumn.js";import{useData2Column as r}from"./useData2Column.js";import{useEditCell as l}from"./useEditCell.js";import{useEventConvert as i}from"./useEventConvert.js";import{useHeaderCSS as p}from"./useHeaderCSS.js";import{useHoverColumn as m}from"./useHoverColumn.js";import{useTriggerRow as n}from"./useTriggerRow.js";const u=()=>({onCellClick:new e(["payload","verticalState"]),cellStyle:new o(["styles","payload","verticalState"]),cellClassName:new o(["classes","payload","verticalState"]),config:new o(["config","verticalState"]),headerRowStyle:new o(["styles","payload","verticalState"])}),c=(e,o,u)=>{t(e,o,u),l(e,o,u),m(e,o,u),p(e),n(e),i(e,o,u),r(e,o,u),a(e,o,u),s(e,o)};export{u as createVerticalTableHooks,c as usePresetVerticalPlugins};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isEmpty as t}from"lodash-es";import{LOWEST_PRIORITY as a}from"../../../../constants/index.js";import{isVerticalTable as e,createDataProxy as i}from"../utils.js";const r=(r,o,l)=>{r.headerRowStyle.tap("useData2Column",((a,e,i)=>(t(i.fixedLeftVerticalData)||i.fixedLeftVerticalData.length!==e.$rowIndex||(a.display="none"),a))),o.dataHooks.dataList.tap({name:"Vertical--useData2Column",stage:a},((t,a)=>{const{uuid:r}=a;if(!r||!e(a))return t;const o=l(r);if(!o)return t;o.originalData=t;const{fullVerticalOriginData:n=[]}=o;return o.fixedLeftVerticalData=n.filter((t=>"left"===t.fixed)).map((t=>i(t,(()=>o.originalData||[])))),o.verticalData=n.filter((t=>"left"!==t.fixed)).map((t=>i(t,(()=>o.originalData||[]))))}))};export{r as useColumn2Data};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{unref as r}from"vue";import{isVerticalHeader as e,createVerticalStateHandler as o}from"../utils.js";const n=(n,t,l)=>{n.onCellClick.tap("useCurrentColumn",(({row:r},e)=>{if(!r)return;const n=o(e);n.getTableConfig("rowConfig.isCurrent")&&(e.currentRow=!1!==n.getTableConfig("rowConfig.clickToCancel")&&e.currentRow===r?null:r)})),n.cellStyle.tap("useCurrentColumn",((r,{column:n},t)=>{if(e(n.field))return r;const l=o(t);if(!l.getTableConfig("rowConfig.isCurrent"))return r;return l.getOriginDataByColumn(n)!==t.currentRow?r:Object.assign(r,{backgroundColor:"var(--c-primary-color-opacity2)"})})),t.exposeHooks.expose.tap("VerticalTable-useCurrentColumn",((e,o)=>Object.assign(e,{verticalTable:{...e.verticalTable,getCurrentRow:()=>{var e;const n=null==(e=r(o))?void 0:e.uuid;return n?l(n).currentRow:null}}})))};export{n as useCurrentColumn};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getArrDepth as e}from"../../../../../../../shared/utils/index.js";import{isArray as t}from"lodash-es";import{LOWEST_PRIORITY as r}from"../../../../constants/index.js";import{isVerticalTable as i,createVerticalFieldList as l,bindHeaderInfoAndFlatten as a,findFixedLeftFields as n,isVerticalHeader as s}from"../utils.js";const d=(d,o,f)=>{o.fieldHooks.fieldList.tap({name:"Vertical--useColumn2Data",stage:r},((r,d,{globProps:o})=>{const{uuid:u}=d;if(!u||!i(d))return r;const p=f(u);if(!p)return r;if(p.originalFieldList=r,!t(o.tableData))return[];let c=l(o.tableData,p.headerDepth=e(r),p);p.fullVerticalOriginData=a(r,p.headerDepth);const h=n(r);return d.showHeader=!!h.length,h.length&&h.forEach((e=>{let t=[];c=c.reduce(((r,i)=>{if(s(i.field)){if(0===e[i.field.replaceAll("_parent","")+"_colspan"])return t.push(i),r}return r.push({field:i.field+"_parent",fixed:i.fixed,editRender:i.editRender,children:[...t,i]}),t=[],r}),[])})),p.verticalFieldList=c}))};export{d as useData2Column};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{findAncestor as t}from"../../../../../../../shared/utils/index.js";import{onBeforeUnmount as e,unref as i}from"vue";import{WIDGET_TYPE as n}from"../../../../constants/index.js";import{isVerticalHeader as l}from"../utils.js";const o=["RADIO","SWITCH"],d=(d,r,u)=>{d.onCellClick.tap("useEditCell",(({column:t,row:e,$columnIndex:i},n)=>{var l,o;n.editCell=e&&i<=(null!=(o=null==(l=n.fixedLeftVerticalData)?void 0:l.length)?o:0)?{row:e,column:t}:null})),d.config.tap("useEditCell",((e,i)=>(e.uuid&&(i.editStateEvent&&window.removeEventListener("click",i.editStateEvent,{capture:!0}),i.editStateEvent=n=>{t(n.target,(t=>t.getAttribute("uuid")===e.uuid||t.classList.contains("vxe-table--ignore-clear")))||(i.editCell=null)},window.addEventListener("click",i.editStateEvent,{capture:!0})),e.editConfig={...e.editConfig,showIcon:!1,beforeEditMethod({row:t,column:e}){var i;const{originalField:d={}}=t;if(l(e.field))return!1;const{editRender:{name:r=n.DEFAULT}={}}=d;return!Object.values(n).concat(o).includes(r)&&(!(null==(i=d.slots)?void 0:i.default)||!!d.slots.edit)}},e))),r.setupHooks.setup.tap("Vertical-UseEditCell",(t=>{e((()=>{const{uuid:e}=i(t)||{};if(!e)return;const n=u(e);n.editStateEvent&&window.removeEventListener("click",n.editStateEvent,{capture:!0})}))}))};export{d as useEditCell};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isObject as e}from"lodash-es";import{unref as o}from"vue";import{isVerticalTable as n,isVerticalHeader as r,getHeaderDepthByField as t,getOriginFieldFromRowData as d,getOriginRowFromRowData as l}from"../utils.js";const u=(u,c,m)=>{c.eventHooks.beforeEvent.tap("Vertical--useEventConvert",((u,c)=>{var i;if(!e(u))return u;const x=null==(i=o(c))?void 0:i.uuid;if(!x||!n(c))return u;const I=u,{$table:a,$event:s,cell:v}=I;let{$columnIndex:f,$rowIndex:p,column:w,columnIndex:$,row:h,rowIndex:b,type:_,_rowIndex:y,_columnIndex:E}=I;if(w&&(_=r(w.field)?"header":"body",h)){const e=t(w.field);w=d(h),h="header"===_?void 0:l(h,e),E=$=f=(m(x).headerDepth||0)+(y||0),y=b=p="header"===_?-1:e}return{$table:a,$event:s,cell:v,type:_,row:h,column:w,rowIndex:b,columnIndex:$,$rowIndex:p,$columnIndex:f,_rowIndex:y,_columnIndex:E}}))};export{u as useEventConvert};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=(e,a)=>{a.exposeHooks.expose.tap("Vertical--useExpose",((e,a,t)=>Object.assign(e,{verticalTable:{...e.verticalTable,update(){a.value.uuid&&(t.updateConfigRef(),t.updateFieldListRef(),t.updateTableDataRef())}}})))};export{e as useExpose};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isVerticalHeader as e,getOriginFieldFromRowData as t,getSpanInfo as l}from"../utils.js";const n=n=>{n.cellStyle.tap("useHeaderCSS",((n,{column:c,row:s})=>(e(c.field)||(s&&["checkbox","radio","seq"].includes(t(s).type||"")&&Object.assign(n,{textAlign:"center"}),Object.assign(n,{textShadow:"none"})),s&&l({row:s,column:c}).colspan>1&&Object.assign(n,{textAlign:"center"}),c.colSpan>1&&Object.assign(n,{textAlign:"center"}),n))),n.cellClassName.tap("useHeaderCSS",((t,{column:l})=>{const n=e(l.field);return Object.assign(t,{"vxe-header--column":n,"vxe-table--header":n,[l.field.replaceAll("_parent","")]:!0})}))};export{n as useHeaderCSS};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useThrottleFn as o}from"@vueuse/core";import{promiseTimeout as e}from"@vueuse/shared";import{unref as r}from"vue";import{createVerticalStateHandler as n,getVerticalInfoFromEvent as l}from"../utils.js";const u=(u,i,t)=>{u.config.tap("useHoverColumn",((r,u)=>{if(!n(u).getTableConfig("rowConfig.isHover"))return r;function i(o){var e,n;if(o){const r=l(o);if(i(),!r||"body"!==r.type)return;u.hoveringRow=null!=(n=null==(e=u.originalData)?void 0:e[r.sequence])?n:null,u.hoveringFieldKey=r.fieldKey,t(r.fieldKey).forEach((o=>{o.style.backgroundColor||(o.style.backgroundColor="var(--c-hover-color)")}))}else i();function i(){u.hoveringRow=null;const o=u.hoveringFieldKey;o&&(t(o).forEach((o=>{"var(--c-hover-color)"===o.style.backgroundColor&&(o.style.backgroundColor="")})),u.hoveringFieldKey=null)}function t(o){const e=r.uuid;if(!e)return[];const n=document.querySelector(`[uuid="${e}"]`);return n?Array.from(n.querySelectorAll(`.${o}`)):[]}}return Object.assign(r,{onMousemove:o(i,100),async onMouseleave(){await e(101),i()},async onScroll(){i()}})})),i.exposeHooks.expose.tap("VerticalTable-useHoverColumn",((o,e)=>Object.assign(o,{verticalTable:{...o.verticalTable,getHoveringRow:()=>{var o;const n=null==(o=r(e))?void 0:o.uuid;return n?t(n).hoveringRow:null}}})))};export{u as useHoverColumn};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createVerticalStateHandler as o}from"../utils.js";const e=e=>{e.onCellClick.tap("useTriggerRow",(({row:e},r)=>{if(!e)return;const i=o(r);if("row"===i.getTableConfig("checkboxConfig.trigger")){const o=i.getTableConfig("checkboxConfig.checkField")||"checked";e[o]=!e[o]}"row"===i.getTableConfig("radioConfig.trigger")&&(r.currentRow=e)}))};export{e as useTriggerRow};
|
package/es/components/iho-table/src/plugins/verticalTablePlugin/{renderer.d.ts → src/renderer.d.ts}
RENAMED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { VxeGlobalRendererHandles } from 'vxe-table/types/v-x-e-table/renderer';
|
|
2
|
-
import { IhoTableInstance } from '
|
|
2
|
+
import { IhoTableInstance } from '../../../../../../components/iho-table';
|
|
3
3
|
import { IhoTableVerticalState } from './types';
|
|
4
4
|
export declare const VerticalRenderMap: Record<string, (payload: VxeGlobalRendererHandles.RenderCellParams, verticalState: IhoTableVerticalState) => any>;
|
|
5
5
|
export declare function createCellRender(instance: IhoTableInstance, verticalStateGetter: (uuid: string) => IhoTableVerticalState, type: 'edit' | 'default'): (_: unknown, payload: VxeGlobalRendererHandles.RenderCellParams) => any;
|
|
6
|
+
export declare function createHeaderCellRender(instance: IhoTableInstance, verticalStateGetter: (uuid: string) => IhoTableVerticalState): (_: unknown, payload: VxeGlobalRendererHandles.RenderHeaderParams) => any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{inject as e,createVNode as l,toRaw as n,computed as r,withModifiers as i}from"vue";import{property as o,isFunction as t,isEmpty as d,identity as u}from"lodash-es";import{NPopover as c,NCheckbox as a,NRadio as s}from"naive-ui";import{InjectionIhoTableUUID as f,WIDGET_TYPE as v}from"../../../constants/index.js";import{IhoTableRenderHelper as x}from"../../../utils/index.js";import{isVerticalHeader as m,getHeaderDepthByField as p,getOriginBasePayload as h,getOriginRowFromRowData as w}from"./utils.js";const k={seq:e=>e.rowIndex+1,checkbox:e=>l(a,{checked:e.row.checked,"onUpdate:checked":l=>e.row.checked=l,onClick:i(u,["stop"])},null),radio(e,n){const o=r({get:()=>e.row===n.currentRow,set(){n.currentRow=e.row}});return l(s,{checked:o.value,"onUpdate:checked":e=>o.value=e,onClick:i(u,["stop"])},null)}};function g(n,i,u){return(s,w)=>{var g,b;const I=e(f),C=i(I),{row:D,column:H}=w;if(m(H.field)){const e=o("originalField")(D);if("checkbox"===e.type)return function(e){var n,i;const o=r({get(){var l,n;return!d(e.originalData)&&null!=(n=null==(l=e.originalData)?void 0:l.every((e=>e.checked)))&&n},set(l){var n;null==(n=e.originalData)||n.forEach((e=>e.checked=l))}}),t=r((()=>{var l,n;return null!=(n=null==(l=e.originalData)?void 0:l.some((e=>e.checked)))&&n}));return l(a,{checked:o.value,"onUpdate:checked":e=>o.value=e,indeterminate:!o.value&&t.value,disabled:null==(i=null==(n=e.originalTableConfig)?void 0:n.checkboxConfig)?void 0:i.disableHeader},null)}(C);const n=D[H.field.replaceAll("_parent","")];return x.hasTitlePrefix(e)&&p(H.field)===C.headerDepth?[l(c,null,{trigger:()=>l("i",{class:"vxe-cell-help-icon vxe-icon-question-circle-fill"},null),default:()=>e.titlePrefix.useHTML?l("div",{innerHTML:e.titlePrefix.useHTML},null):l("div",null,[e.titlePrefix.content])}),n]:n}const y={$table:w.$table,columnIndex:w.rowIndex,$columnIndex:w.rowIndex,isHidden:w.isHidden,rowid:w.rowid,...h(D,H)};if(!y.row)return null;const{originalField:{editRender:T={},slots:$={}}={}}=D;if(t($[u]))return $[u](y);if($.default&&!$.edit)return $.default(y);if(k[y.type])return k[y.type](y,C);const L=T.name||v.DEFAULT,F=n.renderer.get(L);return F?"default"===u?null==(g=F.renderCell)?void 0:g.call(F,T,y):null==(b=F.renderEdit)?void 0:b.call(F,T,y):{}}}function b(l,r){return(i,t)=>{var d,u,c;const a=e(f),s=r(a),v=null==(d=s.fixedLeftVerticalData)?void 0:d[t.$rowIndex];if(!v)return null;const x=o("originalField")(v),m=w(v,p(t.column.field)),h=n(null==(u=s.editCell)?void 0:u.row)===n(m)&&n(null==(c=s.editCell)?void 0:c.column)===n(x);return g(l,r,h?"edit":"default")(null,{...t,row:v,rowIndex:t.$rowIndex,rowid:t.$rowIndex+"",fixed:t.column.fixed,isHidden:!t.column.visible,type:t.column.type})}}export{k as VerticalRenderMap,g as createCellRender,b as createHeaderCellRender};
|
package/es/components/iho-table/src/plugins/verticalTablePlugin/{types.d.ts → src/types.d.ts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AnyObject } from '
|
|
2
|
-
import { IhoTableConfig, IhoTableFieldItem } from '
|
|
1
|
+
import { AnyObject } from '../../../../../../shared/types';
|
|
2
|
+
import { IhoTableConfig, IhoTableFieldItem } from '../../../../../../components/iho-table';
|
|
3
3
|
export declare type IhoTableVerticalState = Partial<{
|
|
4
4
|
originalTableConfig: IhoTableConfig;
|
|
5
5
|
originalFieldList: IhoTableFieldItem[];
|
|
@@ -11,9 +11,10 @@ export declare type IhoTableVerticalState = Partial<{
|
|
|
11
11
|
headerDepth: number;
|
|
12
12
|
currentRow: AnyObject | null;
|
|
13
13
|
editCell: {
|
|
14
|
-
|
|
14
|
+
row: AnyObject;
|
|
15
15
|
column: IhoTableFieldItem;
|
|
16
16
|
} | null;
|
|
17
17
|
editStateEvent: (event: MouseEvent) => void;
|
|
18
18
|
hoveringRow: AnyObject | null;
|
|
19
|
+
hoveringFieldKey: string | null;
|
|
19
20
|
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/es/components/iho-table/src/plugins/verticalTablePlugin/{utils.d.ts → src/utils.d.ts}
RENAMED
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
import { AnyObject } from '
|
|
1
|
+
import { AnyObject } from '../../../../../../shared/types';
|
|
2
2
|
import { VxeTableDefines } from 'vxe-table';
|
|
3
|
-
import { IhoTableConfig, IhoTableFieldItem } from '
|
|
4
|
-
import { IhoTableVerticalState } from '
|
|
3
|
+
import { IhoTableConfig, IhoTableFieldItem } from '../../../../../../components/iho-table';
|
|
4
|
+
import { IhoTableVerticalState } from './types';
|
|
5
5
|
export declare function isVerticalTable(tableConfig: IhoTableConfig): boolean;
|
|
6
6
|
export declare function isVerticalHeader(field?: string): boolean;
|
|
7
7
|
export declare function isVerticalBody(field?: string): boolean;
|
|
8
8
|
export declare function getHeaderDepthByField(field?: string): number;
|
|
9
9
|
export declare function bindHeaderInfoAndFlatten(fieldList: IhoTableFieldItem[], depth: number): IhoTableFieldItem[];
|
|
10
|
-
export declare function getSpanInfo(row
|
|
10
|
+
export declare function getSpanInfo({ row, column }: {
|
|
11
|
+
row: AnyObject;
|
|
12
|
+
column: VxeTableDefines.ColumnInfo;
|
|
13
|
+
}): {
|
|
11
14
|
rowspan: any;
|
|
12
15
|
colspan: any;
|
|
13
16
|
};
|
|
14
17
|
export declare function createVerticalFieldList(tableData: AnyObject[], headerDepth: number, verticalState: IhoTableVerticalState): IhoTableFieldItem[];
|
|
15
18
|
export declare function getVerticalInfoFromEvent(event: MouseEvent): {
|
|
19
|
+
fieldKey: string;
|
|
16
20
|
type: string;
|
|
17
21
|
sequence: number;
|
|
18
22
|
} | undefined;
|
|
@@ -30,7 +34,5 @@ export declare function findFixedLeftFields(fieldList: IhoTableFieldItem[]): Iho
|
|
|
30
34
|
export declare function createVerticalStateHandler(verticalState: IhoTableVerticalState): {
|
|
31
35
|
readonly getOriginDataByColumn: (column: VxeTableDefines.ColumnInfo) => AnyObject;
|
|
32
36
|
readonly getTableConfig: (path: string) => any;
|
|
33
|
-
readonly initClickEvent: (uuid: string) => void;
|
|
34
|
-
readonly removeClickEvent: () => void;
|
|
35
37
|
};
|
|
36
38
|
export declare function createDataProxy(originalField: IhoTableFieldItem, dataList: AnyObject[] | (() => AnyObject[])): {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{traverse as e,findAncestor as n,getStringWidth as t}from"../../../../../../shared/utils/index.js";import{isString as r,isNumber as i,constant as o,isFunction as a,range as l,property as u}from"lodash-es";import{IhoTableRenderHelper as c}from"../../../utils/index.js";import{VERTICAL_CELL_TYPE as f}from"./constants.js";function d(e){var n;return!!(null==(n=e.verticalConfig)?void 0:n.enable)}function s(e){return!!r(e)&&e.startsWith("header_")}function p(e){return!!r(e)&&e.startsWith("body_")}function h(e){var n;return r(e)?+(null!=(n=e.split("_")[1])?n:-1):-1}function _(n,t){const r=[];return e(n,((e,n,o)=>{e.parent=o,e.children||(!function(e,n){let t=e,r=n;if(!e.parent)return e[`header_${n}`]=e.title,void l(n+1).forEach((t=>{e[`header_${t}_colspan`]=t===n?n+1:0,e[`header_${t}_rowspan`]=t===n?1:0}));for(;t;)e[`header_${r}`]=t.title,e[`header_${r}_rowspan`]=i(t),e[`header_${r}_colspan`]=1,r--,t=t.parent}(e,t),r.push(e))})),r.forEach(((e,n)=>{const t=r[n-1];t&&Object.entries(e).forEach((([n,r])=>{n.match(/^header_(\d+)$/)&&r===t[n]&&r&&(e[`${n}_colspan`]=0,e[`${n}_rowspan`]=0)}))})),r;function i(n){if(!n.children)return 1;let t=0;return e(n.children,(e=>{e.children||t++})),t}}function g({row:e,column:n}){var t,r;return s(n.field)?{rowspan:null!=(t=e[n.field+"_rowspan"])?t:1,colspan:null!=(r=e[n.field+"_colspan"])?r:1}:{colspan:1,rowspan:1}}const m=({cell:e}={})=>{const n=e&&e.querySelector("input,.n-input__input-el");return n&&n.click(),n};function $(n,r){let i=120;return e(r,((e,r,o,a)=>{a===n&&(i=Math.max(i,t(e.title||"")+20+(c.hasTitlePrefix(e)?20:0)))})),Math.ceil(i)}function b(e,n,t){const r=T(t);let u=r.getTableConfig("verticalConfig.headerWidth");u="auto"===u?$:i(u)?o(u):a(u)?u:$;let c=r.getTableConfig("verticalConfig.bodyWidth");return c=i(c)?o(c):a(c)?c:o(120),[...l(n+1).map((e=>({field:`header_${e}`,title:`header_${e}`,width:u(e,t.originalFieldList),fixed:"left",editRender:{name:f,props:{},enable:!1}}))),...e.map(((e,n)=>({field:`body_${n}`,title:`body_${n}`,minWidth:c(n),editRender:{name:f,props:{},enable:!0,autofocus:m}})))]}function y(e){const t=n(e.target,(e=>"TD"===e.tagName||"TH"===e.tagName));if(!t)return;const r=t.className.match(/(body|header)_(\d+)/);if(!r)return;const[i,o,a]=r;return{fieldKey:i,type:o,sequence:+a}}function w(e){return u("originalField")(e)}function x(e,n){return u(`originalData.${n}`)(e)}function v(e,n){const t=h(n.field),r=w(e);return{row:x(e,t),rowIndex:t,$rowIndex:t,column:r,fixed:r.fixed,type:r.type}}function C(n){const t=[];return e(n,(e=>{"left"===e.fixed&&t.push(e)})),t}function T(e){return{getOriginDataByColumn(n){const{originalData:t=[]}=e;return t[h(n.field)]},getTableConfig:n=>u(n)(e.originalTableConfig)}}function D(e,n){return new Proxy({},{get(t,r){var i;if("originalField"===r)return e;if("originalData"===r)return a(n)?n():n;if(s(r))return e[r];if(p(r)){const t=h(r);return"seq"===e.type?t+1:null==(i=n[t])?void 0:i[e.field]}},set(t,r,i){if(!s(r)){const t=h(r);t>=0&&n[t]&&(n[t][e.field]=i)}return!0}})}m.toString=()=>"input,.n-input__input-el";export{_ as bindHeaderInfoAndFlatten,D as createDataProxy,b as createVerticalFieldList,T as createVerticalStateHandler,C as findFixedLeftFields,h as getHeaderDepthByField,v as getOriginBasePayload,w as getOriginFieldFromRowData,x as getOriginRowFromRowData,g as getSpanInfo,y as getVerticalInfoFromEvent,p as isVerticalBody,s as isVerticalHeader,d as isVerticalTable};
|