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.
Files changed (192) hide show
  1. package/README.md +87 -87
  2. package/es/components/biunique-chat/index.d.ts +750 -562
  3. package/es/components/biunique-chat/index.js +1 -1
  4. package/es/components/biunique-chat/src/Index.vue.d.ts +1213 -0
  5. package/es/components/biunique-chat/src/Index.vue.js +1 -0
  6. package/es/components/biunique-chat/src/Index.vue2.js +1 -0
  7. package/es/components/biunique-chat/src/api/index.d.ts +2 -5
  8. package/es/components/biunique-chat/src/api/index.js +1 -1
  9. package/es/components/biunique-chat/src/components/ChatFile.vue.d.ts +241 -0
  10. package/es/components/biunique-chat/src/components/ChatFile.vue.js +1 -0
  11. package/es/components/biunique-chat/src/components/ChatFile.vue2.js +1 -0
  12. package/es/components/biunique-chat/src/components/ChatFooter.vue.d.ts +3 -5
  13. package/es/components/biunique-chat/src/components/ChatFooter.vue2.js +1 -1
  14. package/es/components/biunique-chat/src/components/ChatHeader.vue.d.ts +639 -0
  15. package/es/components/biunique-chat/src/components/ChatHeader.vue2.js +1 -1
  16. package/es/components/biunique-chat/src/components/ChatMain.vue.d.ts +61 -5
  17. package/es/components/biunique-chat/src/components/ChatMain.vue2.js +1 -1
  18. package/es/components/biunique-chat/src/components/ChatRecord.vue.d.ts +101 -0
  19. package/es/components/biunique-chat/src/components/ChatRecord.vue.js +1 -0
  20. package/es/components/biunique-chat/src/components/ChatRecord.vue2.js +1 -0
  21. package/es/components/biunique-chat/src/components/ChatSet.vue.d.ts +246 -0
  22. package/es/components/biunique-chat/src/components/ChatSet.vue.js +1 -0
  23. package/es/components/biunique-chat/src/components/ChatSet.vue2.js +1 -0
  24. package/es/components/biunique-chat/src/components/PersonProfile.vue.d.ts +59 -0
  25. package/es/components/biunique-chat/src/components/PersonProfile.vue.js +1 -0
  26. package/es/components/biunique-chat/src/components/PersonProfile.vue2.js +1 -0
  27. package/es/components/biunique-chat/src/components/SiderList.vue.d.ts +18 -28
  28. package/es/components/biunique-chat/src/components/SiderList.vue2.js +1 -1
  29. package/es/components/biunique-chat/src/hooks/useState.d.ts +7 -0
  30. package/es/components/biunique-chat/src/hooks/useState.js +1 -0
  31. package/es/components/biunique-chat/src/types/index.d.ts +10 -0
  32. package/es/components/biunique-chat/src/utils/index.d.ts +6 -0
  33. package/es/components/biunique-chat/src/utils/index.js +1 -0
  34. package/es/components/biunique-chat/style/iconfont.ttf +0 -0
  35. package/es/components/biunique-chat/style/index.css +1 -1
  36. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  37. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
  38. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
  39. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
  40. package/es/components/button-print/src/utils/print.d.ts +2 -1
  41. package/es/components/button-print/src/utils/print.js +1 -1
  42. package/es/components/callback/src/components/render/popupMaps.d.ts +74 -70
  43. package/es/components/classification/src/components/table-modal/index.vue.d.ts +0 -3
  44. package/es/components/classification/src/index.vue.d.ts +3 -3
  45. package/es/components/default-page/index.d.ts +71 -0
  46. package/es/components/default-page/index.js +1 -0
  47. package/es/components/default-page/src/constants/index.d.ts +19 -0
  48. package/es/components/default-page/src/constants/index.js +1 -0
  49. package/es/components/default-page/src/index.vue.d.ts +72 -0
  50. package/es/components/default-page/src/index.vue.js +1 -0
  51. package/es/components/default-page/src/index.vue2.js +1 -0
  52. package/es/components/default-page/style/index.css +1 -0
  53. package/es/components/expand-field/src/components/form.vue2.js +1 -1
  54. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
  55. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
  56. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
  57. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.js +1 -1
  58. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
  59. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
  60. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
  61. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  62. package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
  63. package/es/components/fabric-chart/src/hooks/temperature/useOther.js +1 -1
  64. package/es/components/fabric-chart/src/hooks/useCommon.d.ts +1 -0
  65. package/es/components/fabric-chart/src/hooks/useCommon.js +1 -1
  66. package/es/components/fabric-chart/src/hooks/useCumputedPoint.js +1 -1
  67. package/es/components/field-set/src/FieldColor.vue.d.ts +1 -1
  68. package/es/components/field-set/src/FieldSet.vue.d.ts +1 -1
  69. package/es/components/field-set/src/components/Row.vue.d.ts +1 -1
  70. package/es/components/form-config/src/hooks/useSortalbeConfig.js +1 -1
  71. package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue2.js +1 -1
  72. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
  73. package/es/components/form-render/src/hooks/useFormEvent.js +1 -1
  74. package/es/components/form-render/src/hooks/useSelectedSetting.d.ts +3 -4
  75. package/es/components/form-render/src/hooks/useSelectedSetting.js +1 -1
  76. package/es/components/iho-table/index.d.ts +74 -70
  77. package/es/components/iho-table/src/IhoTable.vue.d.ts +74 -70
  78. package/es/components/iho-table/src/IhoTable.vue2.js +1 -1
  79. package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +3 -1
  80. package/es/components/iho-table/src/hooks/tapHooks/index.js +1 -1
  81. package/es/components/iho-table/src/hooks/tapHooks/useConfigHooks.d.ts +1 -0
  82. package/es/components/iho-table/src/hooks/tapHooks/useEventHooks.d.ts +2 -1
  83. package/es/components/iho-table/src/hooks/tapHooks/useEventHooks.js +1 -1
  84. package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue.d.ts +1 -0
  85. package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue2.js +1 -1
  86. package/es/components/iho-table/src/plugins/headerPlugin.js +1 -1
  87. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/checkRendererPlugin.js +1 -1
  88. package/es/components/iho-table/src/plugins/verticalTablePlugin/index.js +1 -1
  89. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/index.d.ts +117 -0
  90. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/index.js +1 -0
  91. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useColumn2Data.d.ts +2 -0
  92. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useColumn2Data.js +1 -0
  93. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useCurrentColumn.d.ts +2 -0
  94. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useCurrentColumn.js +1 -0
  95. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useData2Column.d.ts +2 -0
  96. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useData2Column.js +1 -0
  97. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useEditCell.d.ts +2 -0
  98. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useEditCell.js +1 -0
  99. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useEventConvert.d.ts +2 -0
  100. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useEventConvert.js +1 -0
  101. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useExpose.d.ts +2 -0
  102. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useExpose.js +1 -0
  103. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useHeaderCSS.d.ts +2 -0
  104. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useHeaderCSS.js +1 -0
  105. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useHoverColumn.d.ts +2 -0
  106. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useHoverColumn.js +1 -0
  107. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useTriggerRow.d.ts +2 -0
  108. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useTriggerRow.js +1 -0
  109. package/es/components/iho-table/src/plugins/verticalTablePlugin/{renderer.d.ts → src/renderer.d.ts} +2 -1
  110. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/renderer.js +1 -0
  111. package/es/components/iho-table/src/plugins/verticalTablePlugin/{types.d.ts → src/types.d.ts} +4 -3
  112. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/types.js +1 -0
  113. package/es/components/iho-table/src/plugins/verticalTablePlugin/{utils.d.ts → src/utils.d.ts} +8 -6
  114. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/utils.js +1 -0
  115. package/es/components/iho-table/src/types/index.d.ts +34 -4
  116. package/es/components/iho-table/src/types/pluginType.d.ts +1 -0
  117. package/es/components/iho-table/src/utils/index.d.ts +1 -1
  118. package/es/components/iho-table/src/utils/index.js +1 -1
  119. package/es/components/iho-table/style/index.css +1 -1
  120. package/es/components/index.css +1 -1
  121. package/es/components/index.d.ts +4 -1
  122. package/es/components/index.js +1 -1
  123. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  124. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
  125. package/es/components/select-person/src/SearchMultiple.vue.d.ts +0 -6
  126. package/es/components/step-notice/index.d.ts +310 -0
  127. package/es/components/step-notice/index.js +1 -0
  128. package/es/components/step-notice/src/StepNotice.vue.d.ts +288 -0
  129. package/es/components/step-notice/src/StepNotice.vue.js +1 -0
  130. package/es/components/step-notice/src/StepNotice.vue2.js +1 -0
  131. package/es/components/step-notice/src/components/NoticeConnection.vue.d.ts +39 -0
  132. package/es/components/step-notice/src/components/NoticeConnection.vue.js +1 -0
  133. package/es/components/step-notice/src/components/NoticeConnection.vue2.js +1 -0
  134. package/es/components/step-notice/src/components/NoticeItem.vue.d.ts +151 -0
  135. package/es/components/step-notice/src/components/NoticeItem.vue.js +1 -0
  136. package/es/components/step-notice/src/components/NoticeItem.vue2.js +1 -0
  137. package/es/components/step-notice/src/components/NoticeItemAside.vue.d.ts +35 -0
  138. package/es/components/step-notice/src/components/NoticeItemAside.vue.js +1 -0
  139. package/es/components/step-notice/src/components/NoticeItemAside.vue2.js +1 -0
  140. package/es/components/step-notice/src/components/NoticeOperationList.vue.d.ts +49 -0
  141. package/es/components/step-notice/src/components/NoticeOperationList.vue.js +1 -0
  142. package/es/components/step-notice/src/components/NoticeOperationList.vue2.js +1 -0
  143. package/es/components/step-notice/src/hooks/useTheme.d.ts +1 -0
  144. package/es/components/step-notice/src/hooks/useTheme.js +1 -0
  145. package/es/components/step-notice/src/types.d.ts +33 -0
  146. package/es/components/step-notice/src/types.js +1 -0
  147. package/es/components/step-notice/src/utils.d.ts +3 -0
  148. package/es/components/step-notice/src/utils.js +1 -0
  149. package/es/components/step-notice/style/index.css +1 -0
  150. package/es/env.d.ts +25 -25
  151. package/es/shared/assets/img/defaultCover/10reload.jpg.js +1 -0
  152. package/es/shared/assets/img/defaultCover/1tab.jpg.js +1 -0
  153. package/es/shared/assets/img/defaultCover/2menu.jpg.js +1 -0
  154. package/es/shared/assets/img/defaultCover/3view.jpg.js +1 -0
  155. package/es/shared/assets/img/defaultCover/4system.jpg.js +1 -0
  156. package/es/shared/assets/img/defaultCover/5location.jpg.js +1 -0
  157. package/es/shared/assets/img/defaultCover/6notfound.jpg.js +1 -0
  158. package/es/shared/assets/img/defaultCover/7loading.jpg.js +1 -0
  159. package/es/shared/assets/img/defaultCover/8nopermission.jpg.js +1 -0
  160. package/es/shared/assets/img/defaultCover/9nodata.jpg.js +1 -0
  161. package/es/shared/assets/img/failure.png.js +1 -1
  162. package/es/shared/assets/img/no-permission.png.js +1 -1
  163. package/es/shared/assets/img/nodata.png.js +1 -1
  164. package/es/shared/assets/img/notfound.png.js +1 -1
  165. package/es/shared/assets/img/qr.png.js +1 -1
  166. package/es/shared/assets/img/success.png.js +1 -1
  167. package/es/shared/assets/img/table_style_2.png.js +1 -1
  168. package/es/shared/assets/img/video.png.js +1 -1
  169. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  170. package/es/shared/assets/img/xb_big.png.js +1 -1
  171. package/es/shared/assets/img/xb_small.png.js +1 -1
  172. package/es/shared/components/JSONTree/JSONTree.vue.d.ts +26 -0
  173. package/es/shared/components/JSONTree/JSONTree.vue.js +1 -0
  174. package/es/shared/components/JSONTree/JSONTree.vue2.js +1 -0
  175. package/es/shared/components/JSONTree/index.d.ts +2 -0
  176. package/es/shared/components/JSONTree/index.js +1 -0
  177. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +86 -0
  178. package/es/shared/hooks/index.js +1 -1
  179. package/es/shared/hooks/useTheme.d.ts +1 -0
  180. package/es/shared/hooks/useTheme.js +1 -1
  181. package/es/shared/package.json.js +1 -1
  182. package/es/shared/utils/fabricjs/index.d.ts +6823 -0
  183. package/es/shared/utils/tapable/index.d.ts +139 -0
  184. package/package.json +2 -2
  185. package/es/components/biunique-chat/src/BiuniqueChat.vue.d.ts +0 -1005
  186. package/es/components/biunique-chat/src/BiuniqueChat.vue.js +0 -1
  187. package/es/components/biunique-chat/src/BiuniqueChat.vue2.js +0 -1
  188. package/es/components/iho-table/src/plugins/verticalTablePlugin/renderer.js +0 -1
  189. package/es/components/iho-table/src/plugins/verticalTablePlugin/utils.js +0 -1
  190. /package/es/components/{iho-table/src/plugins/verticalTablePlugin/types.js → biunique-chat/src/types/index.js} +0 -0
  191. /package/es/components/iho-table/src/plugins/verticalTablePlugin/{constants.d.ts → src/constants.d.ts} +0 -0
  192. /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 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 _}from"@vueuse/shared";import{widthAppend as T,uuidGenerator as A}from"../../../shared/utils/index.js";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{NConfigProvider as L}from"naive-ui";import{useVersion as P}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:T(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=A();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}),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 _(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()},...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(P)()),[(r(),d(f(c(qe)))),m("section",{style:p(c(ne))},[v(c(L),{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
+ 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 f}from"./useDataHooks.js";import{useDomInsertHooks as l}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:f().create(),setupHooks:m().create(),domInsertHooks:l().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,f)=>{const l=[],c=[];let u=!1;return a=t.fieldHooks.field.call(a,{index:f,remove(){u=!0},insertAfter(e){c.push(...o(e))},insertBefore(e){l.push(...o(e))}},n,i),s.push(...l),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 h({hooks:o,config:e,$table:r,emits:s,context:a}){return n.reduce(((n,f)=>(n[f]=n=>function(n,f){var l;const c=i(n);s(c,f),null==(l=o.eventHooks[n])||l.promise(f,t(e),{$table:t(r),emits:s,...a})}(f,n),n)),{})}function g(e,r,s){return async n=>{e.dataHooks.dataStart.promise(t(r));let i=await n.reduce((async(n,i,a)=>{const f=[],l=[];let c=!1;await e.dataHooks.data.promise(i,t(r),{index:a,$table:s,insertBefore(e){f.push(...o(e))},insertAfter(e){l.push(...o(e))},remove(){c=!0}});const u=await n;return u.push(...f),!c&&u.push(i),u.push(...l),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,g as createDataTransfer,C as createDomInsertComponent,h as createTableEventHandlers,p as createTableHooks};
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 e 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 n,onMounted as t,onBeforeUnmount as o,provide as i}from"vue";import{InjectionIhoTableEventListener as c}from"../../constants/index.js";import{AbstractEventHooks as s}from"../../types/pluginType.js";class l extends s{constructor(){super(...arguments),this.onKeydownStart=new e(["event","context","config"]),this.onKeydown=new e(["event","context","config"]),this.onKeydownEnd=new e(["event","context","config"]),this.onPaste=new e(["event","context","config"]),this.onCopy=new e(["event","context","config"]),this.onCut=new e(["event","context","config"]),this.onCurrentChange=new e(["event","context","config"]),this.onRadioChange=new e(["event","context","config"]),this.onCheckboxChange=new e(["event","context","config"]),this.onCheckboxAll=new e(["event","context","config"]),this.onCheckboxRangeStart=new e(["event","context","config"]),this.onCheckboxRangeChange=new e(["event","context","config"]),this.onCheckboxRangeEnd=new e(["event","context","config"]),this.onCellClick=new e(["event","context","config"]),this.onCellDblclick=new e(["event","context","config"]),this.onCellMenu=new e(["event","context","config"]),this.onCellMouseenter=new e(["event","context","config"]),this.onCellMouseleave=new e(["event","context","config"]),this.onHeaderCellClick=new e(["event","context","config"]),this.onHeaderCellDblclick=new e(["event","context","config"]),this.onHeaderCellMenu=new e(["event","context","config"]),this.onFooterCellClick=new e(["event","context","config"]),this.onFooterCellDblclick=new e(["event","context","config"]),this.onFooterCellMenu=new e(["event","context","config"]),this.onSortChange=new e(["event","context","config"]),this.onFilterChange=new e(["event","context","config"]),this.onFilterVisible=new e(["event","context","config"]),this.onResizableChange=new e(["event","context","config"]),this.onToggleRowExpand=new e(["event","context","config"]),this.onToggleTreeExpand=new e(["event","context","config"]),this.onMenuClick=new e(["event","context","config"]),this.onEditClosed=new e(["event","context","config"]),this.onEditActived=new e(["event","context","config"]),this.onEditDisabled=new e(["event","context","config"]),this.onValidError=new e(["event","context","config"]),this.onScroll=new e(["event","context","config"]),this.onCustom=new e(["event","context","config"]),this.onOpenFnr=new e(["event","context","config"]),this.onFnrChange=new e(["event","context","config"]),this.onFnrFind=new e(["event","context","config"]),this.onFnrFindAll=new e(["event","context","config"]),this.onFnrReplace=new e(["event","context","config"]),this.onFnrReplaceAll=new e(["event","context","config"]),this.onCellAreaCopy=new e(["event","context","config"]),this.onCellAreaCut=new e(["event","context","config"]),this.onCellAreaPaste=new e(["event","context","config"]),this.onCellAreaMerge=new e(["event","context","config"]),this.onClearCellAreaMerge=new e(["event","context","config"]),this.onHeaderCellAreaSelection=new e(["event","context","config"]),this.onCellAreaSelectionStart=new e(["event","context","config"]),this.onCellAreaSelectionDrag=new e(["event","context","config"]),this.onCellAreaSelectionEnd=new e(["event","context","config"]),this.onCellAreaExtensionStart=new e(["event","context","config"]),this.onCellAreaExtensionDrag=new e(["event","context","config"]),this.onCellAreaExtensionEnd=new e(["event","context","config"]),this.onCellAreaArrowsStart=new e(["event","context","config"]),this.onCellAreaArrowsEnd=new e(["event","context","config"]),this.onActiveCellChangeStart=new e(["event","context","config"]),this.onActiveCellChangeEnd=new e(["event","context","config"]),this.onCellAreaSelectionAllStart=new e(["event","context","config"]),this.onCellAreaSelectionAllEnd=new e(["event","context","config"]),this.onPageChange=new e(["event","context","config"])}}function r(){return{create:function(){return new l}}}class a{constructor(){this.eventMap=new Map}addEventListener(e,i){if(!n())throw new Error("addEventListener can only used in setup environment!");const c=this.eventMap.get(e)||new Set;this.eventMap.set(e,c),t((()=>c.add(i))),o((()=>c.delete(i)))}trigger(e,...n){var t;null==(t=this.eventMap.get(e))||t.forEach((e=>{e(...n)}))}}function h(){if(!n())throw new Error("provideIhoTableEventListener can only used in setup environment!");const e=new a;return i(c,e),e}export{a as IhoTableEventListener,h as provideIhoTableEventListener,r as useEventHooks};
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 o,openBlock as r,createElementBlock as n,unref as v,createBlock as c,createCommentVNode as s,createElementVNode as d,createVNode as p,isRef as f,withCtx as h,mergeProps as m,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 I,widthAppend as D}from"../../../../../shared/utils/index.js";import{useVirtualList as S}from"@vueuse/core";import{isNumber as U,isString as j,isFunction as x,isEqual as F}from"lodash-es";import{NInput as R,NCheckbox as W,NSpin as E,NCheckboxGroup as $,NRadioGroup as O,NButtonGroup as P,NButton as V}from"naive-ui";import{isVariableHeightTable as Y}from"../../utils/index.js";const q={class:"iho-table__filterWrapper"},z={key:1,class:"iho-table__filterCheckAllWrapper"},A={class:"iho-table__filterListItem"},H={class:"iho-table__filterListItem"},M=["title"],B=["title"],G={class:"iho-table__filterListItemContent"},J={class:"iho-table__filterFooter"};var K=e({__name:"filter",props:{payload:{type:Object,required:!0}},setup(e){const K=e,N=l("$xetable"),Q=a((()=>{var e;return!!(null==(e=K.payload)?void 0:e.column.filterMultiple)})),T=a((()=>{var e,l,a;return null!=(a=null==(l=null==(e=K.payload)?void 0:e.column)?void 0:l.filters)?a:[]})),X=a({get:()=>T.value.reduce(((e,l)=>(l.checked&&e.push(l.value),e)),[]),async set(e){if(!K.payload||!N)return;const l=N.reactData.filterStore.options||[];if(Q.value?(l.forEach((l=>l._checked=e.includes(l.value))),N.checkFilterOptions()):l.forEach((l=>l._checked=l.value===e[0])),!Y(N))return a();function a(){K.payload.$panel.confirmFilter(new CustomEvent("click"))}N.reactData.scrollYLoad=!0,a(),N.reactData.scrollYLoad=!1}}),Z=t([...X.value]),ee=t("");async function le(){N&&(N.reactData.filterStore.visible=!1)}u(le);const ae=a((()=>{var e,l;if(!K.payload||!K.payload.column)return 10;const{filterCapacity:a}=null!=(l=null==(e=K.payload.column.editRender)?void 0:e.props)?l:{};return U(a)&&a>0?a:10})),te=a((()=>ee.value?T.value.filter((e=>!!`${e.label}`.includes(ee.value)||(j(e.data)?I(ee.value,e.data):void 0))):T.value)),{list:ue,containerProps:ie,wrapperProps:oe}=S(te,{itemHeight:32,overscan:3}),re=a({get:()=>te.value.every((e=>Z.value.includes(e.value))),set(e){Z.value=e?[...new Set([...Z.value,...te.value.map((e=>e.value))])]:Z.value.filter((e=>te.value.every((l=>l.value!==e))))}}),ne=a((()=>te.value.some((e=>Z.value.includes(e.value)))&&!re.value)),ve=a({get:()=>Z.value.length===T.value.length&&0!==T.value.length,set:e=>{Z.value=e?T.value.map((e=>e.value)):[]}}),ce=a((()=>!!Z.value.length&&!ve.value)),se=a((()=>({height:D(32*ae.value)})));function de(){X.value=Q.value?Z.value:F(Z.value[0],null)?[]:[Z.value[0]],le()}function pe(){Z.value=Q.value?[]:[null]}const fe=t(!1);return i((async()=>{var e;if(!N)return;const l=null==(e=K.payload.column.editRender.props)?void 0:e.onFilterShow;if(x(l))try{fe.value=!0,await l(K.payload);const{filterStore:e}=N.reactData;o(e.options)!==o(T.value)&&(e.options=T.value)}finally{fe.value=!1}})),(e,l)=>(r(),n("section",q,[v(T).length>5?(r(),c(v(R),{key:0,value:ee.value,"onUpdate:value":l[0]||(l[0]=e=>ee.value=e)},null,8,["value"])):s("v-if",!0),v(Q)?(r(),n("div",z,[d("div",A,[p(v(W),{label:"全选当前",checked:v(re),"onUpdate:checked":l[1]||(l[1]=e=>f(re)?re.value=e:null),indeterminate:v(ne)},null,8,["checked","indeterminate"])]),d("div",H,[p(v(W),{label:"全选所有",checked:v(ve),"onUpdate:checked":l[2]||(l[2]=e=>f(ve)?ve.value=e:null),indeterminate:v(ce)},null,8,["checked","indeterminate"])])])):s("v-if",!0),p(v(E),{show:fe.value},{default:h((()=>[v(Q)?(r(),c(v($),{key:0,value:Z.value,"onUpdate:value":l[3]||(l[3]=e=>Z.value=e)},{default:h((()=>[d("section",m(v(ie),{style:v(se),class:"iho-table__filterListWrapper"}),[d("section",_(y(v(oe))),[(r(!0),n(b,null,k(v(ue),(e=>(r(),n("div",{class:"iho-table__filterListItem",key:e.data.value},[p(v(W),{value:e.data.value},{default:h((()=>[d("div",{class:"iho-table__filterListItemContent",title:e.data.label},g(e.data.label),9,M)])),_:2},1032,["value"])])))),128))],16)],16)])),_:1},8,["value"])):(r(),c(v(O),{key:1,value:Z.value[0],"onUpdate:value":l[5]||(l[5]=e=>Z.value[0]=e)},{default:h((()=>[d("section",m(v(ie),{style:v(se),class:"iho-table__filterListWrapper"}),[d("section",_(y(v(oe))),[(r(!0),n(b,null,k(v(ue),(e=>(r(),n("div",{class:"iho-table__filterListItem",key:e.data.value,title:e.data.label},[p(v(w),{value:e.data.value,currentValue:Z.value[0],cancelable:"",onCancel:l[4]||(l[4]=e=>Z.value=[null])},{default:h((()=>[d("div",G,g(e.data.label),1)])),_:2},1032,["value","currentValue"])],8,B)))),128))],16)],16)])),_:1},8,["value"]))])),_:1},8,["show"]),d("footer",J,[d("section",null,[v(Q)?(r(),n(b,{key:0},[C(" 已选择 "),d("span",{style:L({color:"var(--c-primary-color)"})},g(Z.value.length),5),C(" 项 ")],64)):s("v-if",!0)]),p(v(P),{size:"small"},{default:h((()=>[p(v(V),{onClick:pe},{default:h((()=>[C("清空")])),_:1}),p(v(V),{onClick:le},{default:h((()=>[C("取消")])),_:1}),p(v(V),{type:"primary",onClick:de},{default:h((()=>[C("确定")])),_:1})])),_:1})])]))}});export{K as default};
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 h,IhoTableRenderHelper as c}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,h){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=c.isEditableColumn(f.value,b),w=c.hasFilter(t)||c.hasDateFiler(t),W=c.hasTitlePrefix(t),k=i(h)?h:s(h)?h(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,h(e),p)},e}))}})}export{f as default};
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 a}from"vue";import"../../../../index.js";import{NCheckbox as n}from"naive-ui";import{isNumber as t}from"lodash-es";import{defineTablePlugin as s}from"../../../hooks/useTablePlugin.js";function r(){const o="checkRendererPlugin";return s({name:o,apply(a){a.fieldHooks.field.tap(o,((a,{index:n,insertBefore:s},r)=>{if(0===n&&r.selectType&&["checkbox","radio"].includes(r.selectType)){const{radioConfig:a,checkboxConfig:n={}}=r,i={width:45,align:"center",fixed:"left",..."radio"===r.selectType?a:n,field:o,type:r.selectType,annotation:!1};n.disableHeader&&(i.slots={header:()=>e("span",{class:"checkbox-cell--disable"},null),...i.slots}),n.useNCheckbox&&(i.slots={...t(n.maxCheckSize)?{}:{header:o=>[e(l,{params:o},null)]},checkbox:o=>[e(l,{params:o},null)],...i.slots}),s(i)}return a}))}})}const l=o({name:"Checkbox",props:{params:{type:Object,default:()=>({})}},setup(o){const t=a("$xetable");function s(e,a){var n;a.stopPropagation(),"header"===(null==(n=o.params)?void 0:n.type)?null==t||t.triggerCheckAllEvent(new MouseEvent("mouse-down"),e):null==t||t.triggerCheckRowEvent(new MouseEvent("mouse-down"),o.params,e)}return()=>e(n,{checked:o.params.checked,"onUpdate:checked":e=>o.params.checked=e,indeterminate:o.params.indeterminate,disabled:o.params.disabled,onUpdateChecked:s},null)}});export{r as checkRendererPlugin};
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{getArrDepth as e}from"../../../../../shared/utils/index.js";import{useThrottleFn as t}from"@vueuse/core";import{promiseTimeout as o}from"@vueuse/shared";import{pick as n,isEmpty as r,isArray as i}from"lodash-es";import{inject as l,onBeforeUnmount as a,unref as d}from"vue";import"../../../index.js";import{InjectionIhoTableUUID as c,LOWEST_PRIORITY as u,WIDGET_TYPE as s}from"../../constants/index.js";import{useUUIDMap as f}from"../../utils/index.js";import{VERTICAL_CELL_TYPE as g}from"./constants.js";import{createCellRender as m}from"./renderer.js";import{isVerticalTable as p,isVerticalHeader as h,getSpanInfo as w,getVerticalInfoFromEvent as x,createVerticalFieldList as v,bindHeaderInfoAndFlatten as C,findFixedLeftFields as b,createDataProxy as D,createVerticalStateHandler as k,getOriginFieldFromRowData as y}from"./utils.js";import{defineTablePlugin as R}from"../../hooks/useTablePlugin.js";const I=["RADIO","SWITCH"];function j(){const j="verticalTablePlugin",{getItemFromUUID:T,removeItemFromUUID:H}=f((()=>({})));return R({name:j,vxe(e){e.renderer.add(g,{renderCell:m(e,T,"default"),renderEdit:m(e,T,"edit"),renderHeader(t,o){var n,r,i;const a=l(c),d=T(a),u=null==(n=d.fixedLeftVerticalData)?void 0:n[o.$rowIndex];if(!u)return null;const s=(null==(r=d.editCell)?void 0:r.rowIndex)===o.$rowIndex&&(null==(i=d.editCell)?void 0:i.column)===o.column;return m(e,T,s?"edit":"default")(null,{...o,row:u,rowIndex:o.$rowIndex,rowid:o.$rowIndex+"",fixed:o.column.fixed,isHidden:!o.column.visible,type:o.column.type})}})},apply(l){l.configHooks.config.tap({name:j,stage:u},(e=>{if(!e.uuid||!p(e))return e;const{uuid:i}=e,l=T(i);l.originalTableConfig=e,Reflect.set(window,"__state",l);const a=k(l);function d({column:e,type:t,$rowIndex:o}){if(h(e.field))return void(l.editCell=null);const n=a.getOriginDataByColumn(e);if(n){if(l.editCell="body"===t?null:{rowIndex:o,column:e},l.currentRow=a.getTableConfig("rowConfig.clickToCancel")&&l.currentRow===n?null:n,"row"===a.getTableConfig("checkboxConfig.trigger")){const e=a.getTableConfig("checkboxConfig.checkField")||"checked";n[e]=!n[e]}"row"===a.getTableConfig("radioConfig.trigger")&&(l.currentRow=n)}}function c({column:e,row:t}){const o={};if(t&&w(t,e).colspan>1&&Object.assign(o,{textAlign:"center"}),!h(e.field)){const n=a.getOriginDataByColumn(e);n===l.hoveringRow&&Object.assign(o,{backgroundColor:"var(--c-hover-color)"}),n===l.currentRow&&Object.assign(o,{backgroundColor:"var(--c-primary-color-opacity2)"}),t&&["checkbox","radio","seq"].includes(y(t).type||"")&&Object.assign(o,{textAlign:"center"})}return o}function u({column:e}){const t=h(e.field);return{"vxe-header--column":t,"vxe-table--header":t,[e.field]:!0}}return a.initClickEvent(i),{uuid:i,showHeader:!1,...n(e,["border","height","verticalConfig","showSeq","size","rowGroupSetting","keyboardConfig","selectType","columnConfig"]),cellClassName:u,headerRowStyle({$rowIndex:e}){const t={background:"white"};return r(l.fixedLeftVerticalData)||l.fixedLeftVerticalData.length!==e||(t.display="none"),t},headerCellStyle({column:e,$rowIndex:t}){const{fixedLeftVerticalData:o=[]}=l,n=c({column:e,row:o[t]});return e.colSpan>1&&(n.textAlign="center"),{textShadow:h(e.field)?"0 0 1px":"none",...n}},headerCellClassName:u,cellStyle:c,spanMethod:({row:e,column:t})=>w(e,t),editConfig:{...e.editConfig,showIcon:!1,beforeEditMethod({row:e,column:t}){var o;const{originalField:n={}}=e;if(h(t.field))return!1;const{editRender:{name:r=s.DEFAULT}={}}=n;return!Object.values(s).concat(I).includes(r)&&(!(null==(o=n.slots)?void 0:o.default)||!!n.slots.edit)}},onHeaderCellClick:d,onCellClick:d,onMousemove:t((e=>{var t,o;const n=x(e);if(!n||"body"!==n.type)return l.hoveringRow=null;l.hoveringRow=null!=(o=null==(t=l.originalData)?void 0:t[n.sequence])?o:null}),100),async onMouseleave(){await o(101),l.hoveringRow=null},async onScroll(){await o(101),l.hoveringRow=null}}})),l.fieldHooks.fieldList.tap({name:j,stage:u},((t,o,{globProps:n})=>{const{uuid:r}=o;if(!r||!p(o))return t;const l=T(r);if(!l)return t;if(l.originalFieldList=t,!i(n.tableData))return[];let a=v(n.tableData,l.headerDepth=e(t),l);l.fullVerticalOriginData=C(t,l.headerDepth);const d=b(t);return d.length&&(o.showHeader=!0,d.forEach((e=>{let t=[];a=a.reduce(((o,n)=>{if(h(n.field)){if(0===e[n.field.replaceAll("_parent","")+"_colspan"])return t.push(n),o}return o.push({field:n.field+"_parent",fixed:n.fixed,editRender:n.editRender,children:[...t,n]}),t=[],o}),[])}))),l.verticalFieldList=a})),l.dataHooks.dataList.tap({name:j,stage:u},((e,t)=>{const{uuid:o}=t;if(!o||!p(t))return e;const n=T(o);if(!n)return e;n.originalData=e;const{fullVerticalOriginData:r=[]}=n;return n.fixedLeftVerticalData=r.filter((e=>"left"===e.fixed)).map((e=>D(e,(()=>n.originalData||[])))),n.verticalData=r.filter((e=>"left"!==e.fixed)).map((e=>D(e,(()=>n.originalData||[]))))})),l.setupHooks.setup.tap(j,(e=>{a((()=>{const{uuid:t}=d(e)||{};t&&(k(T(t)).removeClickEvent(),H(t))}))})),l.exposeHooks.expose.tap(j,((e,t,o)=>Object.assign(e,{verticalTable:{update(){t.value.uuid&&(o.updateConfigRef(),o.updateFieldListRef(),o.updateTableDataRef())}}})))}})}export{j as verticalTablePlugin};
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,2 @@
1
+ import { VerticalTablePlugin } from '../../../../../../../components/iho-table/src/plugins/verticalTablePlugin/src/hooks/index';
2
+ export declare const useColumn2Data: VerticalTablePlugin;
@@ -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,2 @@
1
+ import { VerticalTablePlugin } from '../../../../../../../components/iho-table/src/plugins/verticalTablePlugin/src/hooks/index';
2
+ export declare const useCurrentColumn: VerticalTablePlugin;
@@ -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,2 @@
1
+ import { VerticalTablePlugin } from '../../../../../../../components/iho-table/src/plugins/verticalTablePlugin/src/hooks/index';
2
+ export declare const useData2Column: VerticalTablePlugin;
@@ -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,2 @@
1
+ import { VerticalTablePlugin } from '../../../../../../../components/iho-table/src/plugins/verticalTablePlugin/src/hooks/index';
2
+ export declare const useEditCell: VerticalTablePlugin;
@@ -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,2 @@
1
+ import { VerticalTablePlugin } from '../../../../../../../components/iho-table/src/plugins/verticalTablePlugin/src/hooks/index';
2
+ export declare const useEventConvert: VerticalTablePlugin;
@@ -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,2 @@
1
+ import { VerticalTablePlugin } from '../../../../../../../components/iho-table/src/plugins/verticalTablePlugin/src/hooks/index';
2
+ export declare const useExpose: VerticalTablePlugin;
@@ -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,2 @@
1
+ import { VerticalTablePlugin } from './index';
2
+ export declare const useHeaderCSS: VerticalTablePlugin;
@@ -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,2 @@
1
+ import { VerticalTablePlugin } from './index';
2
+ export declare const useHoverColumn: VerticalTablePlugin;
@@ -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,2 @@
1
+ import { VerticalTablePlugin } from '../../../../../../../components/iho-table/src/plugins/verticalTablePlugin/src/hooks/index';
2
+ export declare const useTriggerRow: VerticalTablePlugin;
@@ -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};
@@ -1,5 +1,6 @@
1
1
  import { VxeGlobalRendererHandles } from 'vxe-table/types/v-x-e-table/renderer';
2
- import { IhoTableInstance } from '../../../../../components/iho-table';
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};
@@ -1,5 +1,5 @@
1
- import { AnyObject } from '../../../../../shared/types';
2
- import { IhoTableConfig, IhoTableFieldItem } from '../../../../../components/iho-table';
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
- rowIndex: number;
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
  }>;
@@ -1,18 +1,22 @@
1
- import { AnyObject } from '../../../../../shared/types';
1
+ import { AnyObject } from '../../../../../../shared/types';
2
2
  import { VxeTableDefines } from 'vxe-table';
3
- import { IhoTableConfig, IhoTableFieldItem } from '../../../../../components/iho-table';
4
- import { IhoTableVerticalState } from '../../../../../components/iho-table/src/plugins/verticalTablePlugin/types';
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: AnyObject, column: VxeTableDefines.ColumnInfo): {
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};