cnhis-design-vue 3.2.1-release.1 → 3.2.2-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -87
- package/es/components/button-print/src/utils/print.d.ts +1 -1
- package/es/components/button-print/src/utils/print.js +1 -1
- package/es/components/calendar/index.d.ts +1 -11
- package/es/components/calendar/src/Calendar.vue.d.ts +1 -11
- package/es/components/callback/src/components/render/popupMaps.d.ts +1982 -170
- package/es/components/classification/src/index.vue.d.ts +0 -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/surgicalAnesthesia/useOther.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.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/TableStyle.vue2.js +1 -1
- package/es/components/field-set/src/components/Row.vue.d.ts +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/iho-table/index.d.ts +1982 -170
- package/es/components/iho-table/src/IhoTable.vue.d.ts +1982 -170
- 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 +4 -2
- 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/hooks/tapHooks/useExposeHooks.d.ts +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/checkRendererPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/seqRendererPlugin.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 +112 -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/src/renderer.d.ts +6 -0
- 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} +9 -2
- package/es/components/iho-table/src/plugins/verticalTablePlugin/{utils.d.ts → src/utils.d.ts} +17 -8
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/utils.js +1 -0
- package/es/components/iho-table/src/types/index.d.ts +40 -4
- package/es/components/iho-table/src/types/pluginType.d.ts +2 -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 +6 -0
- package/es/components/step-notice/index.d.ts +301 -0
- package/es/components/step-notice/index.js +1 -0
- package/es/components/step-notice/src/StepNotice.vue.d.ts +279 -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 +148 -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 +32 -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/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/package.json.js +1 -1
- package/es/shared/utils/index.d.ts +4 -1
- package/es/shared/utils/index.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/components/iho-table/src/plugins/verticalTablePlugin/renderer.d.ts +0 -6
- 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/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
- /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
- /package/es/components/iho-table/src/plugins/verticalTablePlugin/{types.js → src/types.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as t,provide as o,ref as a,toRaw as l,watch as n,resolveComponent as s,openBlock as r,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 k,normalizeProps as y,guardReactiveProps as C}from"vue";import{useTheme as D}from"../../../shared/hooks/useTheme.js";import{useDebounceFn as j}from"@vueuse/core";import"date-fns";import{isString as $,isEqualWith as I,isFunction as w,pick as q}from"lodash-es";import{useFormAsyncQueue as R,presetRequestHandler as H}from"../../../shared/hooks/useFormRequest/index.js";import{promiseTimeout as
|
|
1
|
+
import{defineComponent as e,computed as t,provide as o,ref as a,toRaw as l,watch as n,resolveComponent as s,openBlock as r,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 k,normalizeProps as y,guardReactiveProps as C}from"vue";import{useTheme as D}from"../../../shared/hooks/useTheme.js";import{useDebounceFn as j}from"@vueuse/core";import"date-fns";import{isString as $,isEqualWith as I,isFunction as w,pick as q}from"lodash-es";import{useFormAsyncQueue as R,presetRequestHandler as H}from"../../../shared/hooks/useFormRequest/index.js";import{promiseTimeout as T}from"@vueuse/shared";import{widthAppend as _,uuidGenerator as P}from"../../../shared/utils/index.js";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{NConfigProvider as A}from"naive-ui";import{useVersion as L}from"../../../shared/hooks/useVersion.js";import{VxeTableEventNameList as S,InjectionIhoTableEmits as F,InjectionTableAsyncQueue as O,InjectionIhoTableAnnotation as B,InjectionIhoTableUUID as E,InjectionIhoTableInstance as N,InjectionIhoTableConfig as V,InjectionIhoTableFieldList as W,InjectionIhoTableHandler as z}from"./constants/index.js";import{createTableHooks as G,applyTableConfigHooks as J,applyTableFieldHooks as K,createTableEventHandlers as M,createDomInsertComponent as Q,createDataTransfer as U}from"./hooks/tapHooks/index.js";import{provideIhoTableEventListener as X}from"./hooks/tapHooks/useEventHooks.js";import{eventName2EventListener as Y}from"./utils/index.js";const Z=["id"];var ee=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",...S],setup(e,{expose:S,emit:ee}){var te,oe;const ae=e,le=D({"--c-border-color":"#d0d0d0","--c-head-bg-color":"#f2f2f2","--c-hover-color":"#e6e6e6","--c-stripe-color":"#f6f6f6"}),ne=t((()=>{var e,t;const o=null!=(t=null==(e=ae.tableConfig)?void 0:e.height)?t:"100%";return{height:"auto"===o?"100%":$(o)&&(o.includes("calc")||o.endsWith("%"))?o:_(o)}})),se=X(),re=function(e,...t){ee(e,...t);const o=c(fe)[Y(e)];w(o)&&o(...t),se.trigger(e,...t)};o(F,re);const ie=R(t((()=>ae.requestInstance)),t((()=>!!ae.uniqueCacheData))).create(ae.parallelism,{beforeRequest:(e,t)=>t,afterRequest:(e,t)=>H(t)});o(O,ie);const ue=G();o(B,t((()=>ae.annotation)));const ce=P();o(E,ce);const de=a();o(N,de);const fe=a({uuid:null!=(oe=null==(te=ae.tableConfig)?void 0:te.uuid)?oe:ce});o(V,fe);const me=j(pe,10);function pe(){var e,t;fe.value=J(ue,{...ae.tableConfig,uuid:null!=(t=null==(e=ae.tableConfig)?void 0:e.uuid)?t:ce},{$table:de,emits:re,globProps:ae})}const ve=a([]);o(W,ve);const be=j(he,10);function he(){const e=K(ue,ae.fieldList,fe.value,{$table:de,emits:re,globProps:ae});I(e,l(ve.value),((e,t)=>{if(w(e)&&w(t))return e.toString()===t.toString()}))||(ve.value=e)}const ge=U(ue,fe,de),xe=a([]);async function ke(){var e,t;const o=await ge(ae.tableData),a=null==(e=de.value)?void 0:e.getTableData().fullData;if(a){let e=0;if(!(a.some((t=>{var a;if(!(null==(a=de.value)?void 0:a.isInsertByRow(t))){if(t!==o[e])return!0;e++}}))||e!==o.length))return}xe.value=o,null==(t=de.value)||t.recalculate(!0)}const ye={updateTableDataRef:j(ke,10),updateConfigRef:me,updateFieldListRef:be};o(z,ye);const Ce=M({hooks:ue,config:fe,$table:de,context:ye,emits:re,globProps:ae}),De=t((()=>({...fe.value,...Ce})));let je=!1,$e=!1,Ie=!1;const we=j((()=>{je&&pe(),$e&&he(),Ie&&ke(),je=!1,$e=!1,Ie=!1}),10);n((()=>ae.tableConfig),(()=>{je=!0,$e=!0,Ie=!0,we()}),{deep:!0}),n((()=>ae.fieldList),(()=>{$e=!0,Ie=!0,we()}),{deep:!0}),n([()=>[...ae.tableData],()=>{var e;return null==(e=ae.tableData)?void 0:e.length}],(()=>{Ie=!0,we()})),n([()=>ae.tableData,()=>{var e;return null==(e=ae.tableData)?void 0:e.length}],(async()=>{var e,t;(null==(e=fe.value.treeConfig)?void 0:e.expandAll)&&(await T(11),null==(t=de.value)||t.setAllTreeExpand(!0))})),pe(),he(),ke();const{header:qe,footer:Re}=Q(ue);function He(e){return q(e,["row","rowIndex","$rowIndex","column","columnIndex","$columnIndex","_columnIndex","checked","disabled","indeterminate"])}return S({$table:de,async loadData(e){var t;null==(t=de.value)||t.loadData(await ge(e))},setSort:(e,t)=>({field:e,value:t}),setFilter:(e,t)=>({field:e,value:t}),reload(){var e,t;null==(e=de.value)||e.loadColumn([]),null==(t=de.value)||t.loadData([]),pe(),he(),ke()},verticalTable:{update:()=>{}},...ue.exposeHooks.expose.call({},fe,{$table:de,emits:re,globProps:ae,...ye})}),ue.setupHooks.setup.call(fe,ve,{$table:de,emits:re,globProps:ae}),(e,t)=>{const o=s("vxe-grid");return r(),i("section",u({class:"iho-table",id:c(ce),style:c(le)},c(L)()),[(r(),d(f(c(qe)))),m("section",{style:p(c(ne))},[v(c(A),{abstract:"",namespace:"vxe-table--ignore-clear"},{default:b((()=>[v(o,u({ref_key:"$table",ref:de},c(De),{columns:ve.value,data:xe.value}),h({_:2},[g(e.$slots,((t,o)=>({name:o,fn:b((t=>[x(" 实际上所有的vxe-grid插槽都支持 "),k(e.$slots,o,y(C(He(t))))]))})))]),1040,["columns","data"])])),_:3})],4),(r(),d(f(c(Re))))],16,Z)}}});export{ee 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};
|
|
@@ -7,9 +7,10 @@ declare class ConfigHooks extends AbstractConfigHooks {
|
|
|
7
7
|
clickToCancel: boolean;
|
|
8
8
|
}>) | undefined, IhoTableConfig, IhoTableHandlerContext<true>], import("../../../../../shared/utils/tapable").UnsetAdditionalOptions>;
|
|
9
9
|
readonly editConfig: SyncWaterfallHook<[import("vxe-table").VxeTablePropTypes.EditConfig | undefined, IhoTableConfig, IhoTableHandlerContext<true>], import("../../../../../shared/utils/tapable").UnsetAdditionalOptions>;
|
|
10
|
-
readonly columnConfig: SyncWaterfallHook<[(import("vxe-table").VxeTablePropTypes.ColumnConfig & {
|
|
10
|
+
readonly columnConfig: SyncWaterfallHook<[(import("vxe-table").VxeTablePropTypes.ColumnConfig & Partial<{
|
|
11
11
|
seqSlotFn: string | ((params: import("vxe-table").VxeColumnPropTypes.DefaultSlotParams) => import("vxe-table").SlotVNodeType | import("vxe-table").SlotVNodeType[]) | null | undefined;
|
|
12
|
-
|
|
12
|
+
seqConfig: Partial<import("../../../../../components/iho-table/src/types").IhoTableFieldItem>;
|
|
13
|
+
}>) | undefined, IhoTableConfig, IhoTableHandlerContext<true>], import("../../../../../shared/utils/tapable").UnsetAdditionalOptions>;
|
|
13
14
|
readonly resizableConfig: SyncWaterfallHook<[import("vxe-table").VxeTablePropTypes.ResizableConfig | undefined, IhoTableConfig, IhoTableHandlerContext<true>], import("../../../../../shared/utils/tapable").UnsetAdditionalOptions>;
|
|
14
15
|
readonly seqConfig: SyncWaterfallHook<[import("vxe-table").VxeTablePropTypes.SeqConfig | undefined, IhoTableConfig, IhoTableHandlerContext<true>], import("../../../../../shared/utils/tapable").UnsetAdditionalOptions>;
|
|
15
16
|
readonly sortConfig: SyncWaterfallHook<[import("vxe-table").VxeTablePropTypes.SortConfig | undefined, IhoTableConfig, IhoTableHandlerContext<true>], import("../../../../../shared/utils/tapable").UnsetAdditionalOptions>;
|
|
@@ -22,6 +23,7 @@ declare class ConfigHooks extends AbstractConfigHooks {
|
|
|
22
23
|
maxCheckSize: number;
|
|
23
24
|
disableHeader: boolean;
|
|
24
25
|
useNCheckbox: boolean;
|
|
26
|
+
indeterminateField: string;
|
|
25
27
|
}>) | undefined, IhoTableConfig, IhoTableHandlerContext<true>], import("../../../../../shared/utils/tapable").UnsetAdditionalOptions>;
|
|
26
28
|
readonly expandConfig: SyncWaterfallHook<[import("vxe-table").VxeTablePropTypes.ExpandConfig | undefined, IhoTableConfig, IhoTableHandlerContext<true>], import("../../../../../shared/utils/tapable").UnsetAdditionalOptions>;
|
|
27
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};
|
|
@@ -2,7 +2,7 @@ import { AnyFn } from '../../../../../shared/types';
|
|
|
2
2
|
import { SyncWaterfallHook } from '../../../../../shared/utils/tapable';
|
|
3
3
|
import { AbstractExposeHooks } from '../../../../../components/iho-table/src/types';
|
|
4
4
|
declare class ExposeHooks extends AbstractExposeHooks {
|
|
5
|
-
readonly expose: SyncWaterfallHook<[Record<string, AnyFn<any[], any>>, import("vue").Ref<import("../../../../../components/iho-table/src/types").IhoTableConfig>, import("../../../../../components/iho-table/src/types").IhoTableHandlerContext<true>], import("../../../../../shared/utils/tapable").UnsetAdditionalOptions>;
|
|
5
|
+
readonly expose: SyncWaterfallHook<[Record<string, AnyFn<any[], any>>, import("vue").Ref<import("../../../../../components/iho-table/src/types").IhoTableConfig>, import("../../../../../components/iho-table/src/types").IhoTableHandler & import("../../../../../components/iho-table/src/types").IhoTableHandlerContext<true>], import("../../../../../shared/utils/tapable").UnsetAdditionalOptions>;
|
|
6
6
|
}
|
|
7
7
|
export declare function useExposeHooks(): {
|
|
8
8
|
create: () => ExposeHooks;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{reactive as e,inject as t,createVNode as a,toRaw as o,h as r,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 f,uniq as c,flatten as _}from"lodash-es";import{NInput as m}from"naive-ui";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as E,InjectionIhoTableUUID as h,InjectionIhoTableHandler as A}from"../../../../constants/index.js";import{useAutoFocus as v}from"../hooks/useAutoFocus.js";import{getLowCodeFieldFromField as R,IhoTableRenderHelper as g,getRowHeight as D,getColumnRenderWidth as T,parseMergeField as w}from"../../../../utils/index.js";import b from"./editSeparate.vue.js";import{contentSeparate as $,getLengthDiffArray as P,getColumnInfoMaxLength as x,generateSeparateRowData as C,isSeparateColumn as S}from"./separateUtils.js";import{getSeparateInfo as k,setSeparateInfo as H,deleteSeparateInfo as j}from"../../../../utils/separateMap.js";import{defineTablePlugin as M}from"../../../../hooks/useTablePlugin.js";function O(){const O="separateRendererPlugins",F=e(new Map);return M({name:O,vxe(e){e.renderer.add(E.SEPARATE,{renderCell(e,{column:o,row:r}){var n,i;const u=t(h),l=null!=(i=null==(n=k(u,r))?void 0:n.separateData)?i:{},s=R(o),d=(null==s?void 0:s.separateFormatter)?s.separateFormatter(l[o.field]):l[o.field];return a("section",{class:"iho-table__ellipsis iho-table__colorAndIcon",title:d},[d])},renderEdit:g.createRenderEdit((({fieldItem:e,column:n,row:i,emitFormClick:u})=>{var d,p;const f=t(h),c=k(f,i),_=D(),E={};let v=null!=(p=null==(d=e.componentProps)?void 0:d.separateSlot)?p:e.separateSlot;return v&&(v=o(v),E.menu=l(v)?v:s(v)?e=>r(v,e):void 0),e.separateRowEdit?function(){if(!c)return[];if(c.ihoTableHandler=t(A),c.separateData["__"+n.field]=c.separateData["__"+n.field]
|
|
1
|
+
import{reactive as e,inject as t,createVNode as a,toRaw as o,h as r,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 f,uniq as c,flatten as _}from"lodash-es";import{NInput as m}from"naive-ui";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as E,InjectionIhoTableUUID as h,InjectionIhoTableHandler as A}from"../../../../constants/index.js";import{useAutoFocus as v}from"../hooks/useAutoFocus.js";import{getLowCodeFieldFromField as R,IhoTableRenderHelper as g,getRowHeight as D,getColumnRenderWidth as T,parseMergeField as w}from"../../../../utils/index.js";import b from"./editSeparate.vue.js";import{contentSeparate as $,getLengthDiffArray as P,getColumnInfoMaxLength as x,generateSeparateRowData as C,isSeparateColumn as S}from"./separateUtils.js";import{getSeparateInfo as k,setSeparateInfo as H,deleteSeparateInfo as j}from"../../../../utils/separateMap.js";import{defineTablePlugin as M}from"../../../../hooks/useTablePlugin.js";function O(){const O="separateRendererPlugins",F=e(new Map);return M({name:O,vxe(e){e.renderer.add(E.SEPARATE,{renderCell(e,{column:o,row:r}){var n,i;const u=t(h),l=null!=(i=null==(n=k(u,r))?void 0:n.separateData)?i:{},s=R(o),d=(null==s?void 0:s.separateFormatter)?s.separateFormatter(l[o.field]):l[o.field];return a("section",{class:"iho-table__ellipsis iho-table__colorAndIcon",title:d},[d])},renderEdit:g.createRenderEdit((({fieldItem:e,column:n,row:i,emitFormClick:u})=>{var d,p;const f=t(h),c=k(f,i),_=D(),E={};let v=null!=(p=null==(d=e.componentProps)?void 0:d.separateSlot)?p:e.separateSlot;return v&&(v=o(v),E.menu=l(v)?v:s(v)?e=>r(v,e):void 0),e.separateRowEdit?function(){var e;if(!c)return[];if(c.ihoTableHandler=t(A),c.separateData["__"+n.field]=null!=(e=c.separateData["__"+n.field])?e:c.separateData[n.field],E.menu){const e=E.menu;return a(e,{column:n,col:n,row:i,value:c.separateData["__"+n.field],"onUpdate:value":e=>c.separateData["__"+n.field]=e},null)}return a(m,{value:c.separateData["__"+n.field],"onUpdate:value":e=>c.separateData["__"+n.field]=e},null)}():function(){var t;const o=null==(t=null==c?void 0:c.separateData)?void 0:t[n.field],r=l(e.separateFormatter)?e.separateFormatter(o):o;return[a(b,{value:i[n.field],"onUpdate:value":e=>i[n.field]=e,"row-index":null==c?void 0:c.index,height:_,column:n,row:i,"display-content":r,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(O,E.SEPARATE,".iho-table__separateText"),e.eventHooks.onEditClosed.tap(O,(({row:e,column:t,$table:a},o,{emits:r})=>{if(!e.$__uuid)return;const n=R(t);if(!n||!n.separateRowEdit)return;const i=k(e.$__uuid,e);if(!i)return;const{separateData:u,originalData:l,ihoTableHandler:s,index:p}=i,{field:f}=t;if(null!==u["__"+f]&&u["__"+f]!==u[f]&&d(l.$__SEPARATE_DATA)){const e=l.$__SEPARATE_DATA.map((e=>{var t;return null!=(t=e["__"+f])?t:e[f]})),o=l[f];l[f]=d(l[f])?e:e.join(""),r("formChange",{value:l[f],oldValue:o,row:l,column:t,index:p,$table:a}),null==s||s.updateTableDataRef()}})),e.fieldHooks.fieldList.tap(O,((e,{uuid:t})=>(t&&F.set(t,e.reduce(((e,t)=>(i(t,(t=>{S(t)&&(e.push(o(t)),t.showOverflow="ellipsis")})),e)),[])),e))),e.dataHooks.data.tapPromise(O,(async(e,t,{insertAfter:a,index:o,$table:r})=>{var n;if(!t.uuid)return;const i=F.get(t.uuid);if(!i||!i.length)return;const l=[];for(const t of i){if(!t.field)continue;const a=await T(t,e,o,r),i={field:t.field,column:t,data:$(w(e,t),t,a,null==(n=R(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=R(t);if(!a)return;if(!a.separateDeep||!a.separateBinder)return;const o=p(u(a.separateBinder).map(s));if(!o.length)return;const r=o.concat(e),n=Math.max(...r.map((e=>e.data.length)));f(n).forEach((e=>{const t=r.map((t=>({item:t.data[e],data:t.data}))),a=t.map((({item:e})=>n(e)));if(1===c(a).length)return;const o=Math.max(...a);function n(e){return d(e)?e.length:1}t.forEach((({item:t,data:a})=>{const r=n(t);r!==o&&(d(t)?t.push(...P(o,r)):a[e]=f(o).map(((e,a)=>0===a?t:"")))}))}))})),l.forEach((e=>{e.data=_(e.data)})),f(x(l)).forEach(((r,n,i)=>{var u;const s=C(l,n),d={index:o,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 H(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=o,H(t.uuid,p,d),e.$__SEPARATE_DATA.push(s),a(p)}))})),e.eventHooks.onResizableChange.tap(O,(async(e,t,a)=>{a.updateTableDataRef()})),e.configHooks.editConfig.tap(O,((e={},t)=>{const a=e.beforeEditMethod;return e.beforeEditMethod=(...e)=>{var o;if(!t.uuid)return f();const r=F.get(t.uuid);if(!r||!r.length)return f();const{row:n,column:i}=e[0],u=k(t.uuid,n);if(!u)return f();const s=null==(o=i.editRender)?void 0:o.props;if(!s||s.separateRowEdit)return f();const{isOriginRow:d,isLastRow:p}=u;return("bottom"===s.separatePlacement?p:d)&&f();function f(){return!l(a)||a(...e)}},e})),e.configHooks.checkboxConfig.tap(O,((e={},a)=>(e.checkMethod=t(e.checkMethod),e.visibleMethod=t(e.visibleMethod),e))),e.setupHooks.setup.tap(O,(e=>{n((()=>{e.value.uuid&&(F.delete(e.value.uuid),j(e.value.uuid))}))}))}})}export{O as separateRendererPlugins};
|
|
@@ -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 t}from"vue";import{isNumber as l,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:t,insertBefore:i},d)=>{if(0===t&&d.selectType&&["checkbox","radio"].includes(d.selectType)){const{radioConfig:n,checkboxConfig:t={}}=d,c={width:45,align:"center",fixed:"left",..."radio"===d.selectType?n:t,field:o,type:d.selectType,annotation:!1};t.disableHeader&&(c.slots={header:()=>e("span",{class:"checkbox-cell--disable"},null),...c.slots}),t.useNCheckbox&&(c.slots={checkbox:e=>s(e,t),header:l(t.maxCheckSize)?a([]):e=>s(e,t),...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 l=n("$xetable");function a(e,n){var t;n.stopPropagation(),"header"===(null==(t=o.payload)?void 0:t.type)?null==l||l.triggerCheckAllEvent(new MouseEvent("mouse-down"),e):null==l||l.triggerCheckRowEvent(new MouseEvent("mouse-down"),o.payload,e)}const c=t((()=>{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()=>e(d,{checked:o.payload.checked,"onUpdate:checked":e=>o.payload.checked=e,indeterminate:c.value,disabled:o.payload.disabled,onUpdateChecked:a},null)}});export{r as checkRendererPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{inject as o,createVNode as
|
|
1
|
+
import{inject as o,createVNode as n}from"vue";import{SettingsSharp as e}from"@vicons/ionicons5";import{isFunction as i}from"lodash-es";import{NIcon as t}from"naive-ui";import"../../../../index.js";import{InjectionIhoTableEmits as l}from"../../../constants/index.js";import{IhoTableStatusHelper as s}from"../../../utils/index.js";import{defineTablePlugin as r}from"../../../hooks/useTablePlugin.js";function f(){const f="seqRendererPlugin";return r({name:f,apply(r){r.fieldHooks.field.tap({name:f,before:"checkRendererPlugin"},((r,{index:u,insertBefore:m},c)=>{var d,a,p,g,v;if(0===u&&c.showSeq){const r={align:"center",fixed:"left",width:50,type:"seq",field:f,annotation:!1,...null==(d=c.columnConfig)?void 0:d.seqConfig,slots:{header(){if(s.isPositive(c.hideSettingBtn))return[];const i=o(l);return[n(t,{style:{cursor:"pointer"},size:"14",color:"#777",component:e,onClick:function(){i&&i("settingClick")}},null)]},...null==(p=null==(a=c.columnConfig)?void 0:a.seqConfig)?void 0:p.slots}};i(null==(g=c.columnConfig)?void 0:g.seqSlotFn)&&(r.slots||(r.slots={}),r.slots.default=c.columnConfig.seqSlotFn),(null==(v=c.sortableConfig)?void 0:v.enable)&&(r.className="col--drag"),m(r)}return r}))}})}export{f as seqRendererPlugin};
|
|
@@ -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,112 @@
|
|
|
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
|
+
}>], void, import("../../../../../../../shared/utils/tapable").UnsetAdditionalOptions>;
|
|
32
|
+
cellStyle: SyncWaterfallHook<[CSSProperties, {
|
|
33
|
+
column: VxeTableDefines.ColumnInfo;
|
|
34
|
+
row?: AnyObject | undefined;
|
|
35
|
+
}, Partial<{
|
|
36
|
+
originalTableConfig: IhoTableConfig;
|
|
37
|
+
originalFieldList: import("../../../../../../../components/iho-table").IhoTableFieldItem[];
|
|
38
|
+
originalData: AnyObject[];
|
|
39
|
+
verticalFieldList: import("../../../../../../../components/iho-table").IhoTableFieldItem[];
|
|
40
|
+
fullVerticalOriginData: AnyObject[];
|
|
41
|
+
verticalData: AnyObject[];
|
|
42
|
+
fixedLeftVerticalData: AnyObject[];
|
|
43
|
+
headerDepth: number;
|
|
44
|
+
currentRow: AnyObject | null;
|
|
45
|
+
editCell: {
|
|
46
|
+
row: AnyObject;
|
|
47
|
+
column: import("../../../../../../../components/iho-table").IhoTableFieldItem;
|
|
48
|
+
} | null;
|
|
49
|
+
editStateEvent: (event: MouseEvent) => void;
|
|
50
|
+
hoveringRow: AnyObject | null;
|
|
51
|
+
}>], import("../../../../../../../shared/utils/tapable").UnsetAdditionalOptions>;
|
|
52
|
+
cellClassName: SyncWaterfallHook<[Record<string, boolean>, {
|
|
53
|
+
column: VxeTableDefines.ColumnInfo;
|
|
54
|
+
}, Partial<{
|
|
55
|
+
originalTableConfig: IhoTableConfig;
|
|
56
|
+
originalFieldList: import("../../../../../../../components/iho-table").IhoTableFieldItem[];
|
|
57
|
+
originalData: AnyObject[];
|
|
58
|
+
verticalFieldList: import("../../../../../../../components/iho-table").IhoTableFieldItem[];
|
|
59
|
+
fullVerticalOriginData: AnyObject[];
|
|
60
|
+
verticalData: AnyObject[];
|
|
61
|
+
fixedLeftVerticalData: AnyObject[];
|
|
62
|
+
headerDepth: number;
|
|
63
|
+
currentRow: AnyObject | null;
|
|
64
|
+
editCell: {
|
|
65
|
+
row: AnyObject;
|
|
66
|
+
column: import("../../../../../../../components/iho-table").IhoTableFieldItem;
|
|
67
|
+
} | null;
|
|
68
|
+
editStateEvent: (event: MouseEvent) => void;
|
|
69
|
+
hoveringRow: AnyObject | null;
|
|
70
|
+
}>], import("../../../../../../../shared/utils/tapable").UnsetAdditionalOptions>;
|
|
71
|
+
config: SyncWaterfallHook<[IhoTableConfig, Partial<{
|
|
72
|
+
originalTableConfig: IhoTableConfig;
|
|
73
|
+
originalFieldList: import("../../../../../../../components/iho-table").IhoTableFieldItem[];
|
|
74
|
+
originalData: AnyObject[];
|
|
75
|
+
verticalFieldList: import("../../../../../../../components/iho-table").IhoTableFieldItem[];
|
|
76
|
+
fullVerticalOriginData: AnyObject[];
|
|
77
|
+
verticalData: AnyObject[];
|
|
78
|
+
fixedLeftVerticalData: AnyObject[];
|
|
79
|
+
headerDepth: number;
|
|
80
|
+
currentRow: AnyObject | null;
|
|
81
|
+
editCell: {
|
|
82
|
+
row: AnyObject;
|
|
83
|
+
column: import("../../../../../../../components/iho-table").IhoTableFieldItem;
|
|
84
|
+
} | null;
|
|
85
|
+
editStateEvent: (event: MouseEvent) => void;
|
|
86
|
+
hoveringRow: AnyObject | null;
|
|
87
|
+
}>], import("../../../../../../../shared/utils/tapable").UnsetAdditionalOptions>;
|
|
88
|
+
headerRowStyle: SyncWaterfallHook<[CSSProperties, {
|
|
89
|
+
$table: VxeTableConstructor & VxeTablePrivateMethods;
|
|
90
|
+
$rowIndex: number;
|
|
91
|
+
fixed: VxeColumnPropTypes.Fixed;
|
|
92
|
+
type: string;
|
|
93
|
+
}, Partial<{
|
|
94
|
+
originalTableConfig: IhoTableConfig;
|
|
95
|
+
originalFieldList: import("../../../../../../../components/iho-table").IhoTableFieldItem[];
|
|
96
|
+
originalData: AnyObject[];
|
|
97
|
+
verticalFieldList: import("../../../../../../../components/iho-table").IhoTableFieldItem[];
|
|
98
|
+
fullVerticalOriginData: AnyObject[];
|
|
99
|
+
verticalData: AnyObject[];
|
|
100
|
+
fixedLeftVerticalData: AnyObject[];
|
|
101
|
+
headerDepth: number;
|
|
102
|
+
currentRow: AnyObject | null;
|
|
103
|
+
editCell: {
|
|
104
|
+
row: AnyObject;
|
|
105
|
+
column: import("../../../../../../../components/iho-table").IhoTableFieldItem;
|
|
106
|
+
} | null;
|
|
107
|
+
editStateEvent: (event: MouseEvent) => void;
|
|
108
|
+
hoveringRow: AnyObject | null;
|
|
109
|
+
}>], import("../../../../../../../shared/utils/tapable").UnsetAdditionalOptions>;
|
|
110
|
+
};
|
|
111
|
+
export declare const usePresetVerticalPlugins: VerticalTablePlugin;
|
|
112
|
+
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 n}from"../utils.js";const c=c=>{c.cellStyle.tap("useHeaderCSS",((c,{column:l,row:s})=>(e(l.field)||(s&&["checkbox","radio","seq"].includes(t(s).type||"")&&Object.assign(c,{textAlign:"center"}),Object.assign(c,{textShadow:"none"})),s&&n({row:s,column:l}).colspan>1&&Object.assign(c,{textAlign:"center"}),l.colSpan>1&&Object.assign(c,{textAlign:"center"}),c))),c.cellClassName.tap("useHeaderCSS",((t,{column:n})=>{const c=e(n.field);return Object.assign(t,{"vxe-header--column":c,"vxe-table--header":c,[n.field]:!0})}))};export{c 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{getVerticalInfoFromEvent as n,isVerticalHeader as l,createVerticalStateHandler as i}from"../utils.js";const t=(t,u,a)=>{t.config.tap("useHoverColumn",((r,l)=>i(l).getTableConfig("rowConfig.isHover")?Object.assign(r,{onMousemove:o((o=>{var e,r;const i=n(o);if(!i||"body"!==i.type)return l.hoveringRow=null;l.hoveringRow=null!=(r=null==(e=l.originalData)?void 0:e[i.sequence])?r:null}),100),async onMouseleave(){await e(101),l.hoveringRow=null},async onScroll(){await e(101),l.hoveringRow=null}}):r)),t.cellStyle.tap({name:"useHoverColumn",before:"useCurrentColumn"},((o,{column:e},r)=>{if(l(e.field))return o;const n=i(r);if(!n.getTableConfig("rowConfig.isHover"))return o;const t=n.getOriginDataByColumn(e);return r.hoveringRow!==t?o:Object.assign(o,{backgroundColor:"var(--c-hover-color)"})})),u.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?a(n).hoveringRow:null}}})))};export{t 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};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { VxeGlobalRendererHandles } from 'vxe-table/types/v-x-e-table/renderer';
|
|
2
|
+
import { IhoTableInstance } from '../../../../../../components/iho-table';
|
|
3
|
+
import { IhoTableVerticalState } from './types';
|
|
4
|
+
export declare const VerticalRenderMap: Record<string, (payload: VxeGlobalRendererHandles.RenderCellParams, verticalState: IhoTableVerticalState) => any>;
|
|
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,toRaw as n,computed as l,createVNode as r,withModifiers as o}from"vue";import{property as i,isFunction as t,isEmpty as d,identity as c}from"lodash-es";import{NCheckbox as u,NRadio as a}from"naive-ui";import{InjectionIhoTableUUID as s,WIDGET_TYPE as f}from"../../../constants/index.js";import{isVerticalHeader as v,getOriginBasePayload as m,getOriginRowFromRowData as w,getHeaderDepthByField as p}from"./utils.js";const x={seq:e=>e.rowIndex+1,checkbox:e=>r(u,{checked:e.row.checked,"onUpdate:checked":n=>e.row.checked=n,onClick:o(c,["stop"])},null),radio(e,n){const i=l({get:()=>e.row===n.currentRow,set(){n.currentRow=e.row}});return r(a,{checked:i.value,"onUpdate:checked":e=>i.value=e,onClick:o(c,["stop"])},null)}};function h(n,o,c){return(a,w)=>{var p,h;const k=e(s),g=o(k),{row:b,column:I}=w;if(v(I.field)){return"checkbox"===i("originalField")(b).type?function(e){var n,o;const i=l({get(){var n,l;return!d(e.originalData)&&null!=(l=null==(n=e.originalData)?void 0:n.every((e=>e.checked)))&&l},set(n){var l;null==(l=e.originalData)||l.forEach((e=>e.checked=n))}}),t=l((()=>{var n,l;return null!=(l=null==(n=e.originalData)?void 0:n.some((e=>e.checked)))&&l}));return r(u,{checked:i.value,"onUpdate:checked":e=>i.value=e,indeterminate:!i.value&&t.value,disabled:null==(o=null==(n=e.originalTableConfig)?void 0:n.checkboxConfig)?void 0:o.disableHeader},null)}(g):b[I.field.replaceAll("_parent","")]}const C={$table:w.$table,columnIndex:w.rowIndex,$columnIndex:w.rowIndex,isHidden:w.isHidden,rowid:w.rowid,...m(b,I)};if(!C.row)return null;const{originalField:{editRender:y={},slots:D={}}={}}=b;if(t(D[c]))return D[c](C);if(D.default&&!D.edit)return D.default(C);if(x[C.type])return x[C.type](C,g);const $=y.name||f.DEFAULT,F=n.renderer.get($);return F?"default"===c?null==(p=F.renderCell)?void 0:p.call(F,y,C):null==(h=F.renderEdit)?void 0:h.call(F,y,C):{}}}function k(l,r){return(o,t)=>{var d,c,u;const a=e(s),f=r(a),v=null==(d=f.fixedLeftVerticalData)?void 0:d[t.$rowIndex];if(!v)return null;const m=i("originalField")(v),x=w(v,p(t.column.field)),k=n(null==(c=f.editCell)?void 0:c.row)===n(x)&&n(null==(u=f.editCell)?void 0:u.column)===n(m);return h(l,r,k?"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{x as VerticalRenderMap,h as createCellRender,k as createHeaderCellRender};
|
package/es/components/iho-table/src/plugins/verticalTablePlugin/{types.d.ts → src/types.d.ts}
RENAMED
|
@@ -1,12 +1,19 @@
|
|
|
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[];
|
|
6
6
|
originalData: AnyObject[];
|
|
7
7
|
verticalFieldList: IhoTableFieldItem[];
|
|
8
|
+
fullVerticalOriginData: AnyObject[];
|
|
8
9
|
verticalData: AnyObject[];
|
|
10
|
+
fixedLeftVerticalData: AnyObject[];
|
|
9
11
|
headerDepth: number;
|
|
10
12
|
currentRow: AnyObject | null;
|
|
13
|
+
editCell: {
|
|
14
|
+
row: AnyObject;
|
|
15
|
+
column: IhoTableFieldItem;
|
|
16
|
+
} | null;
|
|
17
|
+
editStateEvent: (event: MouseEvent) => void;
|
|
11
18
|
hoveringRow: AnyObject | null;
|
|
12
19
|
}>;
|
package/es/components/iho-table/src/plugins/verticalTablePlugin/{utils.d.ts → src/utils.d.ts}
RENAMED
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import { AnyObject } from '
|
|
1
|
+
import { AnyObject } from '../../../../../../shared/types';
|
|
2
2
|
import { VxeTableDefines } from 'vxe-table';
|
|
3
|
-
import { IhoTableConfig, IhoTableFieldItem } from '
|
|
3
|
+
import { IhoTableConfig, IhoTableFieldItem } from '../../../../../../components/iho-table';
|
|
4
|
+
import { IhoTableVerticalState } from './types';
|
|
4
5
|
export declare function isVerticalTable(tableConfig: IhoTableConfig): boolean;
|
|
5
|
-
export declare function
|
|
6
|
-
export declare function
|
|
7
|
-
export declare function
|
|
8
|
-
export declare function getHeaderDepthByField(field: string): number;
|
|
6
|
+
export declare function isVerticalHeader(field?: string): boolean;
|
|
7
|
+
export declare function isVerticalBody(field?: string): boolean;
|
|
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
|
-
export declare function createVerticalFieldList(tableData: AnyObject[], headerDepth: number): IhoTableFieldItem[];
|
|
17
|
+
export declare function createVerticalFieldList(tableData: AnyObject[], headerDepth: number, verticalState: IhoTableVerticalState): IhoTableFieldItem[];
|
|
15
18
|
export declare function getVerticalInfoFromEvent(event: MouseEvent): {
|
|
16
19
|
type: string;
|
|
17
20
|
sequence: number;
|
|
@@ -26,3 +29,9 @@ export declare function getOriginBasePayload(row: AnyObject, column: VxeTableDef
|
|
|
26
29
|
fixed: import("vxe-table").VxeColumnPropTypes.Fixed;
|
|
27
30
|
type: "checkbox" | "radio" | "seq" | "expand" | "html";
|
|
28
31
|
};
|
|
32
|
+
export declare function findFixedLeftFields(fieldList: IhoTableFieldItem[]): IhoTableFieldItem[];
|
|
33
|
+
export declare function createVerticalStateHandler(verticalState: IhoTableVerticalState): {
|
|
34
|
+
readonly getOriginDataByColumn: (column: VxeTableDefines.ColumnInfo) => AnyObject;
|
|
35
|
+
readonly getTableConfig: (path: string) => any;
|
|
36
|
+
};
|
|
37
|
+
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{VERTICAL_CELL_TYPE as c}from"./constants.js";function f(e){var n;return!!(null==(n=e.verticalConfig)?void 0:n.enable)}function d(e){return!!r(e)&&e.startsWith("header_")}function s(e){return!!r(e)&&e.startsWith("body_")}function p(e){var n;return r(e)?+(null!=(n=e.split("_")[1])?n:-1):-1}function h(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 _({row:e,column:n}){var t,r;return d(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 g=({cell:e}={})=>{const n=e&&e.querySelector("input,.n-input__input-el");return n&&n.click(),n};function m(n,r){let i=120;return e(r,((e,r,o,a)=>{a===n&&(i=Math.max(i,t(e.title||"")+20))})),Math.ceil(i)}function $(e,n,t){let r=C(t).getTableConfig("verticalConfig.headerWidth");return r="auto"===r?m:i(r)?o(r):a(r)?r:m,[...l(n+1).map((e=>({field:`header_${e}`,title:`header_${e}`,width:r(e,t.originalFieldList),fixed:"left",editRender:{name:c,props:{},enable:!1}}))),...e.map(((e,n)=>({field:`body_${n}`,title:`body_${n}`,minWidth:120,editRender:{name:c,props:{},enable:!0,autofocus:g}})))]}function w(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]=r;return{type:i,sequence:+o}}function b(e){return u("originalField")(e)}function y(e,n){return u(`originalData.${n}`)(e)}function x(e,n){const t=p(n.field),r=b(e);return{row:y(e,t),rowIndex:t,$rowIndex:t,column:r,fixed:r.fixed,type:r.type}}function v(n){const t=[];return e(n,(e=>{"left"===e.fixed&&t.push(e)})),t}function C(e){return{getOriginDataByColumn(n){const{originalData:t=[]}=e;return t[p(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(d(r))return e[r];if(s(r)){const t=p(r);return"seq"===e.type?t+1:null==(i=n[t])?void 0:i[e.field]}},set(t,r,i){if(!d(r)){const t=p(r);t>=0&&n[t]&&(n[t][e.field]=i)}return!0}})}g.toString=()=>"input,.n-input__input-el";export{h as bindHeaderInfoAndFlatten,D as createDataProxy,$ as createVerticalFieldList,C as createVerticalStateHandler,v as findFixedLeftFields,p as getHeaderDepthByField,x as getOriginBasePayload,b as getOriginFieldFromRowData,y as getOriginRowFromRowData,_ as getSpanInfo,w as getVerticalInfoFromEvent,s as isVerticalBody,d as isVerticalHeader,f as isVerticalTable};
|