cnhis-design-vue 3.1.57-release.3 → 3.2.1-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (200) hide show
  1. package/README.md +87 -87
  2. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  3. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
  4. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
  5. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
  6. package/es/components/button-print/index.d.ts +1 -0
  7. package/es/components/button-print/src/ButtonPrint.vue.d.ts +1 -0
  8. package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
  9. package/es/components/button-print/src/utils/print.d.ts +15 -3
  10. package/es/components/button-print/src/utils/print.js +1 -1
  11. package/es/components/calendar/index.d.ts +24 -13
  12. package/es/components/calendar/src/Calendar.vue.d.ts +24 -13
  13. package/es/components/calendar/src/Calendar.vue2.js +1 -1
  14. package/es/components/callback/src/components/render/popupMaps.d.ts +294 -2
  15. package/es/components/classification/src/components/table-modal/index.vue.d.ts +0 -3
  16. package/es/components/classification/src/index.vue.d.ts +3 -3
  17. package/es/components/drag-scroll/index.d.ts +2 -0
  18. package/es/components/drag-scroll/index.js +1 -0
  19. package/es/components/drag-scroll/src/index.d.ts +4 -0
  20. package/es/components/drag-scroll/src/index.js +1 -0
  21. package/es/components/drag-scroll/src/types.d.ts +24 -0
  22. package/es/components/drag-scroll/src/types.js +1 -0
  23. package/es/components/expand-field/src/components/form.vue2.js +1 -1
  24. package/es/components/fabric-chart/src/constants/index.d.ts +2 -1
  25. package/es/components/fabric-chart/src/constants/index.js +1 -1
  26. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
  27. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogram.js +1 -1
  28. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +1 -1
  29. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
  30. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.js +1 -1
  31. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
  32. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
  33. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  34. package/es/components/fabric-chart/src/interface.d.ts +1 -1
  35. package/es/components/fabric-chart/src/utils/index.js +1 -1
  36. package/es/components/field-set/index.d.ts +1 -1
  37. package/es/components/field-set/src/FieldColor.vue.d.ts +2 -1
  38. package/es/components/field-set/src/FieldSet.vue.d.ts +2 -1
  39. package/es/components/field-set/src/Index.vue.d.ts +1 -1
  40. package/es/components/field-set/src/Index.vue2.js +1 -1
  41. package/es/components/field-set/src/TableStyle.vue.d.ts +71 -0
  42. package/es/components/field-set/src/TableStyle.vue.js +1 -0
  43. package/es/components/field-set/src/TableStyle.vue2.js +1 -0
  44. package/es/components/field-set/src/components/Row.vue.d.ts +2 -1
  45. package/es/components/field-set/src/components/Row.vue2.js +1 -1
  46. package/es/components/field-set/src/types/index.d.ts +1 -1
  47. package/es/components/field-set/style/index.css +1 -1
  48. package/es/components/form-config/index.d.ts +45 -4
  49. package/es/components/form-config/src/FormConfig.vue.d.ts +45 -4
  50. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +16 -2
  51. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +22 -2
  52. package/es/components/form-render/index.d.ts +16 -2
  53. package/es/components/form-render/index.js +1 -1
  54. package/es/components/form-render/src/FormRender.vue.d.ts +15 -1
  55. package/es/components/form-render/src/FormRender.vue2.js +1 -1
  56. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +16 -2
  57. package/es/components/form-render/src/FormRenderWrapper.vue2.js +1 -1
  58. package/es/components/form-render/src/components/renderer/formItem.js +1 -1
  59. package/es/components/form-render/src/components/renderer/index.js +1 -1
  60. package/es/components/form-render/src/components/renderer/select.d.ts +2 -0
  61. package/es/components/form-render/src/components/renderer/select.js +1 -1
  62. package/es/components/form-render/src/components/renderer/simpleComponent.js +1 -1
  63. package/es/components/form-render/src/components/renderer/time.d.ts +7 -0
  64. package/es/components/form-render/src/components/renderer/time.js +1 -0
  65. package/es/components/form-render/src/hooks/index.d.ts +1 -0
  66. package/es/components/form-render/src/hooks/index.js +1 -1
  67. package/es/components/form-render/src/hooks/useAutoHidden.d.ts +1 -1
  68. package/es/components/form-render/src/hooks/useAutoHidden.js +1 -1
  69. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
  70. package/es/components/form-render/src/hooks/useFieldNormalize.d.ts +6 -4
  71. package/es/components/form-render/src/hooks/useFieldNormalize.js +1 -1
  72. package/es/components/form-render/src/hooks/useFormEvent.js +1 -1
  73. package/es/components/form-render/src/hooks/useFormRenderOptions.js +1 -1
  74. package/es/components/form-render/src/hooks/useSelectedSetting.d.ts +5 -0
  75. package/es/components/form-render/src/hooks/useSelectedSetting.js +1 -0
  76. package/es/components/form-render/src/types/fieldItem.d.ts +1 -0
  77. package/es/components/form-render/src/types/index.d.ts +2 -0
  78. package/es/components/form-render/src/utils/business.d.ts +1 -1
  79. package/es/components/form-render/src/utils/business.js +1 -1
  80. package/es/components/form-render/src/utils/index.d.ts +1 -0
  81. package/es/components/form-render/src/utils/index.js +1 -1
  82. package/es/components/iho-table/index.d.ts +278 -0
  83. package/es/components/iho-table/src/IhoTable.vue.d.ts +278 -0
  84. package/es/components/iho-table/src/IhoTable.vue2.js +1 -1
  85. package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +1 -5
  86. package/es/components/iho-table/src/hooks/tapHooks/index.js +1 -1
  87. package/es/components/iho-table/src/hooks/tapHooks/useDataHooks.d.ts +2 -1
  88. package/es/components/iho-table/src/hooks/tapHooks/useDataHooks.js +1 -1
  89. package/es/components/iho-table/src/plugins/{bindEventSettingPlugin/index.d.ts → bindEventSettingPlugin.d.ts} +1 -1
  90. package/es/components/iho-table/src/plugins/bindEventSettingPlugin.js +1 -0
  91. package/es/components/iho-table/src/plugins/{defaultConfigPlugin/index.d.ts → defaultConfigPlugin.d.ts} +1 -1
  92. package/es/components/iho-table/src/plugins/defaultConfigPlugin.js +1 -0
  93. package/es/components/iho-table/src/plugins/dragScrollPlugin.d.ts +1 -0
  94. package/es/components/iho-table/src/plugins/dragScrollPlugin.js +1 -0
  95. package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue.d.ts +1 -1
  96. package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue2.js +1 -1
  97. package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -1
  98. package/es/components/iho-table/src/plugins/headerPlugin.js +1 -1
  99. package/es/components/iho-table/src/plugins/index.js +1 -1
  100. package/es/components/iho-table/src/plugins/{keyboardEventPlugin/index.d.ts → keyboardEventPlugin.d.ts} +1 -1
  101. package/es/components/iho-table/src/plugins/keyboardEventPlugin.js +1 -0
  102. package/es/components/iho-table/src/plugins/{lowCodeFieldAdaptorPlugin/index.d.ts → lowCodeFieldAdaptorPlugin.d.ts} +1 -1
  103. package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin.js +1 -0
  104. package/es/components/iho-table/src/plugins/{operationalFormPlugin/index.d.ts → operationalFormPlugin.d.ts} +1 -1
  105. package/es/components/iho-table/src/plugins/operationalFormPlugin.js +1 -0
  106. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +31 -1
  107. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue2.js +1 -1
  108. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/index.js +1 -1
  109. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/levelSearchCascadePlugin/index.js +1 -1
  110. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/levelSearchCascadePlugin/levelSearchCascade.vue.d.ts +1 -1
  111. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/numberRendererPlugin.js +1 -1
  112. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
  113. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -1
  114. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +1 -1
  115. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.d.ts +15 -12
  116. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue2.js +1 -1
  117. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/index.js +1 -1
  118. package/es/components/iho-table/src/plugins/rowClickPlugin.d.ts +1 -0
  119. package/es/components/iho-table/src/plugins/rowClickPlugin.js +1 -0
  120. package/es/components/iho-table/src/plugins/rowDragPlugin.d.ts +1 -0
  121. package/es/components/iho-table/src/plugins/rowDragPlugin.js +1 -0
  122. package/es/components/iho-table/src/plugins/{varialbleHeightPlugin/index.d.ts → varialbleHeightPlugin.d.ts} +1 -1
  123. package/es/components/iho-table/src/plugins/varialbleHeightPlugin.js +1 -0
  124. package/es/components/iho-table/src/plugins/verticalTablePlugin/constants.d.ts +1 -0
  125. package/es/components/iho-table/src/plugins/verticalTablePlugin/constants.js +1 -0
  126. package/es/components/iho-table/src/plugins/verticalTablePlugin/index.d.ts +1 -0
  127. package/es/components/iho-table/src/plugins/verticalTablePlugin/index.js +1 -0
  128. package/es/components/iho-table/src/plugins/verticalTablePlugin/renderer.d.ts +6 -0
  129. package/es/components/iho-table/src/plugins/verticalTablePlugin/renderer.js +1 -0
  130. package/es/components/iho-table/src/plugins/verticalTablePlugin/types.d.ts +12 -0
  131. package/es/components/iho-table/src/plugins/verticalTablePlugin/types.js +1 -0
  132. package/es/components/iho-table/src/plugins/verticalTablePlugin/utils.d.ts +28 -0
  133. package/es/components/iho-table/src/plugins/verticalTablePlugin/utils.js +1 -0
  134. package/es/components/iho-table/src/plugins/{virtualTreePlugin/index.d.ts → virtualTreePlugin.d.ts} +1 -1
  135. package/es/components/iho-table/src/plugins/virtualTreePlugin.js +1 -0
  136. package/es/components/iho-table/src/types/index.d.ts +11 -1
  137. package/es/components/iho-table/src/types/pluginType.d.ts +3 -1
  138. package/es/components/iho-table/src/utils/index.d.ts +5 -7
  139. package/es/components/iho-table/src/utils/index.js +1 -1
  140. package/es/components/index.css +1 -1
  141. package/es/components/index.d.ts +1 -0
  142. package/es/components/index.js +1 -1
  143. package/es/components/info-header/index.d.ts +37 -4
  144. package/es/components/info-header/src/InfoHeader.vue.d.ts +37 -4
  145. package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +1 -0
  146. package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +1 -0
  147. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +17 -2
  148. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +16 -2
  149. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  150. package/es/components/search-cascader/index.d.ts +1 -1
  151. package/es/components/search-cascader/src/SearchCascader.vue.d.ts +1 -1
  152. package/es/components/search-cascader/src/components/SearchMenu.d.ts +1 -1
  153. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
  154. package/es/components/select-person/src/SearchMultiple.vue.d.ts +0 -6
  155. package/es/components/shortcut-setter/index.d.ts +17 -2
  156. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +17 -2
  157. package/es/components/steps-wheel/src/StepsWheel.vue2.js +1 -1
  158. package/es/components/table-export-field/src/components/ExportModal.vue2.js +1 -1
  159. package/es/components/table-export-field/style/index.css +1 -1
  160. package/es/components/table-export-field/style/table-export-field-iconfont.ttf +0 -0
  161. package/es/env.d.ts +25 -25
  162. package/es/shared/assets/img/failure.png.js +1 -1
  163. package/es/shared/assets/img/no-permission.png.js +1 -1
  164. package/es/shared/assets/img/nodata.png.js +1 -1
  165. package/es/shared/assets/img/notfound.png.js +1 -1
  166. package/es/shared/assets/img/qr.png.js +1 -1
  167. package/es/shared/assets/img/success.png.js +1 -1
  168. package/es/shared/assets/img/table_style_1.png.js +1 -0
  169. package/es/shared/assets/img/table_style_2.png.js +1 -0
  170. package/es/shared/assets/img/table_style_3.png.js +1 -0
  171. package/es/shared/assets/img/table_style_4.png.js +1 -0
  172. package/es/shared/assets/img/video.png.js +1 -1
  173. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  174. package/es/shared/assets/img/xb_big.png.js +1 -1
  175. package/es/shared/assets/img/xb_small.png.js +1 -1
  176. package/es/shared/components/InputNumberSlash/InputNumberSlash.js +1 -1
  177. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +86 -0
  178. package/es/shared/hooks/selectHooks/useOptionFiltered.d.ts +3 -1
  179. package/es/shared/hooks/selectHooks/useOptionFiltered.js +1 -1
  180. package/es/shared/hooks/selectHooks/useSearchContent.d.ts +1 -1
  181. package/es/shared/hooks/selectHooks/useSearchContent.js +1 -1
  182. package/es/shared/package.json.js +1 -1
  183. package/es/shared/types/business.d.ts +15 -6
  184. package/es/shared/utils/business.d.ts +1 -1
  185. package/es/shared/utils/fabricjs/index.d.ts +6823 -0
  186. package/es/shared/utils/index.d.ts +2 -1
  187. package/es/shared/utils/index.js +1 -1
  188. package/es/shared/utils/tapable/index.d.ts +139 -0
  189. package/package.json +16 -15
  190. package/es/components/iho-table/src/plugins/bindEventSettingPlugin/index.js +0 -1
  191. package/es/components/iho-table/src/plugins/defaultConfigPlugin/index.js +0 -1
  192. package/es/components/iho-table/src/plugins/keyboardEventPlugin/index.js +0 -1
  193. package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index.js +0 -1
  194. package/es/components/iho-table/src/plugins/operationalFormPlugin/index.js +0 -1
  195. package/es/components/iho-table/src/plugins/rowClickPlugin/index.d.ts +0 -1
  196. package/es/components/iho-table/src/plugins/rowClickPlugin/index.js +0 -1
  197. package/es/components/iho-table/src/plugins/rowDragPlugin/index.d.ts +0 -1
  198. package/es/components/iho-table/src/plugins/rowDragPlugin/index.js +0 -1
  199. package/es/components/iho-table/src/plugins/varialbleHeightPlugin/index.js +0 -1
  200. package/es/components/iho-table/src/plugins/virtualTreePlugin/index.js +0 -1
@@ -14,8 +14,9 @@ export declare function findAncestor(ele: HTMLElement | null, finder: (ele: HTML
14
14
  export declare function widthAppend(value: string | number, append?: string): string;
15
15
  export declare function targetStringIncludes(arr: string[], target: string): boolean;
16
16
  export declare const jsonParse: import("@vueuse/core").UseMemoizedFn<any, [value: string]>;
17
- export declare function shallowOmit<T, K extends Array<keyof T>>(target: T, keys: K): Omit<T, K[number]>;
17
+ export declare function shallowOmit<T extends object, K extends Array<keyof T>>(target: T, keys: K): Omit<T, K[number]>;
18
18
  export declare function checkInSetupEnv(message?: string): void;
19
19
  export declare function hex2rgba(hex: string, defaultAlpha?: number): readonly [number, number, number, number];
20
20
  export declare function createProviderWrapper(instance?: ComponentInternalInstance): import("vue").DefineComponent<{}, () => JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
21
21
  export declare const keywordMatcher: import("@vueuse/core").UseMemoizedFn<boolean, [text: unknown, keyword: unknown]>;
22
+ export declare function isHTMLElement(target: unknown): target is HTMLElement;
@@ -1 +1 @@
1
- import{getCurrentInstance as t,defineComponent as e,provide as n,createVNode as r}from"vue";import{useMemoize as o}from"@vueuse/core";import{isString as i,isObject as s,isNumber as u,isArray as c,isFunction as a}from"lodash-es";import f from"../package.json.js";export{getBindEventSettingTrigger,getDateOperationalFormHandler,getOperationalFormHandler,isConditionsMatchSqlExpression,isMatchLowCodeCondition,isMatchLowCodeConditionsWithSqlExpression,isMatchNewLowCodeConditionsWithSqlExpression}from"./business.js";function l(t,e,n="children",r){let o=!1;function i(){o=!0}!function t(e,n,r="children",s){r=x(r),e=x(e);for(let u=0;u<e.length;u++){if(n(e[u],i,s),o)return;for(let i=0;i<r.length;i++){const s=e[u][r[i]];if(Array.isArray(s)&&t(s,n,r,e[u]),o)return}}}(t,e,n,r)}function d(t,e,n=e.name,r){if(!n)throw new Error(`[CUI]: invalid component name for ${e}`);const{components:o={}}=t._context;o[n]||(!Reflect.get(t,"__cnhis_version")&&s(f)&&Reflect.set(t,"__cnhis_version",f.version),r?r():t.component(n,e))}function p(t){if(!i(t))return;const e=t.match(/[Hms:]+/);return e?e[0]:void 0}function x(t){return Array.isArray(t)?t:[t]}function h(){return`key${"xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){const e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}))}`}const m=o((function(t){if(!t)return 0;let e="";return[...t].reduce(((t,n)=>{const r=e;return e=n,/[a-z]/.test(n)?t+8.05:/[A-Z]/.test(n)?t+9.13:/\d/.test(n)?t+8.9:/[.,]/.test(n)?t+4.03:/[)(]/.test(n)?t+5.17:/[\u4e00-\u9fa5():,。]/.test(n)?t+13.95:/[-+]/.test(n)?t+7.51:/[/\\]/.test(n)?t+4.11:/%/.test(n)?t+12.68:/‰/.test(n)?t+17.75:" "===n?" "===r?t:t+4:t+6}),0)})),g=Object.seal(Object.create(null));function v(t,e){return function t(e,n){return s(e)?c(e)?e.map((e=>t(e,n))):Object.entries(e).reduce(((e,[r,o])=>(n.includes(r)||(s(o)&&!a(o)?e[r]=t(o,n):e[r]=o),e)),{}):e}(t,e)}function y(t){return Object.values(t).reduce(((t,e)=>Object.assign(t,e)),{})}function w(t,e){if(!t)return t;if(e(t))return t;let n=t.parentElement;for(;n&&!e(n);)n=n.parentElement;return n}function O(t,e="px"){if(u(t))return`${t}${e}`;if(i(t))return t.endsWith(e)?t:`${t}${e}`;throw new Error(`invalid width value ${t}, it need to be a string or number!`)}const b=o((t=>{try{return JSON.parse(t)}catch(t){return{}}}),{getKey:t=>t});function j(t,e){if(!s(t))return t;const n={...t};for(let t=0;t<e.length;t++)Reflect.deleteProperty(n,e[t]);return n}function E(e){if(!t())throw new Error(e||"can't use this hook out of setup environment")}function C(t,e=1){const[n,r,o,i,s]=t.match(/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i)||[];if(!n)return[255,255,255,e];const c=s&&parseInt(s,16)/255;return[parseInt(r,16),parseInt(o,16),parseInt(i,16),+(u(c)?c.toFixed(2):e)]}function S(t){return e({setup(e,{slots:o}){let i=(null==t?void 0:t.parent)&&Reflect.get(t.parent,"provides");const s=[];for(;i;)Object.entries(i).forEach((([t,e])=>{s.includes(t)||(s.push(t),n(t,e))})),i=Object.getPrototypeOf(i);return()=>{var t;return r("div",null,[null==(t=o.default)?void 0:t.call(o)])}}})}const $=o((function(t,e){return!(!i(e)||!i(t))&&e.split(",").some((e=>e.trim().includes(t)))}),{getKey:(...t)=>t.reduce(((t,e)=>String(t)+"_"+String(e)),"")});export{g as DMZ,x as arrayed,E as checkInSetupEnv,S as createProviderWrapper,v as deepOmit,w as findAncestor,p as generateTimeFormat,m as getStringWidth,C as hex2rgba,b as jsonParse,$ as keywordMatcher,d as safeComponentRegister,y as separateMetaModule,j as shallowOmit,l as traverse,h as uuidGenerator,O as widthAppend};
1
+ import{getCurrentInstance as t,defineComponent as e,provide as n,createVNode as r}from"vue";import{isObject as o}from"@vue/shared";import{useMemoize as i}from"@vueuse/core";import{isString as u,isNumber as c,isArray as s,isFunction as f}from"lodash-es";import a from"../package.json.js";export{getBindEventSettingTrigger,getDateOperationalFormHandler,getOperationalFormHandler,isConditionsMatchSqlExpression,isMatchLowCodeCondition,isMatchLowCodeConditionsWithSqlExpression,isMatchNewLowCodeConditionsWithSqlExpression}from"./business.js";function l(t,e,n="children",r){let o=!1;function i(){o=!0}!function t(e,n,r="children",u){r=x(r),e=x(e);for(let c=0;c<e.length;c++){if(n(e[c],i,u),o)return;for(let i=0;i<r.length;i++){const u=e[c][r[i]];if(Array.isArray(u)&&t(u,n,r,e[c]),o)return}}}(t,e,n,r)}function d(t,e,n=e.name,r){if(!n)throw new Error(`[CUI]: invalid component name for ${e}`);const{components:i={}}=t._context;i[n]||(!Reflect.get(t,"__cnhis_version")&&o(a)&&Reflect.set(t,"__cnhis_version",a.version),r?r():t.component(n,e))}function p(t){if(!u(t))return;const e=t.match(/[Hms:]+/);return e?e[0]:void 0}function x(t){return Array.isArray(t)?t:[t]}function m(){return`key${"xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){const e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}))}`}const h={a:7.7,b:8.6,c:7.7,d:8.6,e:7.7,f:5,g:8.6,h:8.2,i:3.3,j:3.3,k:7.6,l:3.5,m:12.1,n:8.2,o:8.2,p:8.6,q:8.6,r:5.4,s:7.1,t:5,u:8.2,v:7.6,w:10.9,x:7.3,y:7.6,z:7.6,A:9.43,B:9.33,C:9.93,D:10,E:8.27,F:8.1,G:10.4,H:10.4,I:3.7,J:7.5,K:9.2,L:7.9,M:12.4,N:10.4,O:10.8,P:8.9,Q:10.8,R:9.1,S:8.8,T:8.9,U:10.4,V:9.4,W:13.5,X:9.4,Y:9.1,Z:9.1,".":4.03,",":4.03,"(":5.17,")":5.17,"-":7.51,"+":7.51,"/":4.11,"\\":4.11,"%":12.68,"‰":17.75},g=/\d/,v=/[\u4e00-\u9fa5():,。]/;const y=i((function(t){if(!t)return 0;let e="";return[...t].reduce(((t,n)=>{const r=e;return e=n," "===n?" "===r?t:t+4:t+(function(t){return h[t]?h[t]:g.test(t)?8.9:v.test(t)?13.95:void 0}(n)||6)}),0)})),w=Object.seal(Object.create(null));function E(t,e){return function t(e,n){return o(e)?s(e)?e.map((e=>t(e,n))):Object.entries(e).reduce(((e,[r,i])=>(n.includes(r)||(o(i)&&!f(i)?e[r]=t(i,n):e[r]=i),e)),{}):e}(t,e)}function O(t){return Object.values(t).reduce(((t,e)=>Object.assign(t,e)),{})}function b(t,e){if(!t)return t;if(e(t))return t;let n=t.parentElement;for(;n&&!e(n);)n=n.parentElement;return n}function j(t,e="px"){if(c(t))return`${t}${e}`;if(u(t))return t.endsWith(e)?t:`${t}${e}`;throw new Error(`invalid width value ${t}, it need to be a string or number!`)}const C=i((t=>{try{return JSON.parse(t)}catch(t){return{}}}),{getKey:t=>t});function S(t,e){if(!o(t))return t;const n={...t};for(let t=0;t<e.length;t++)Reflect.deleteProperty(n,e[t]);return n}function $(e){if(!t())throw new Error(e||"can't use this hook out of setup environment")}function _(t,e=1){const[n,r,o,i,u]=t.match(/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i)||[];if(!n)return[255,255,255,e];const s=u&&parseInt(u,16)/255;return[parseInt(r,16),parseInt(o,16),parseInt(i,16),+(c(s)?s.toFixed(2):e)]}function M(t){return e({setup(e,{slots:o}){let i=(null==t?void 0:t.parent)&&Reflect.get(t.parent,"provides");const u=[];for(;i;)Object.entries(i).forEach((([t,e])=>{u.includes(t)||(u.push(t),n(t,e))})),i=Object.getPrototypeOf(i);return()=>{var t;return r("div",null,[null==(t=o.default)?void 0:t.call(o)])}}})}const I=i((function(t,e){return!(!u(e)||!u(t))&&e.split(",").some((e=>e.trim().includes(t)))}),{getKey:(...t)=>t.reduce(((t,e)=>String(t)+"_"+String(e)),"")});function A(t){try{return t instanceof HTMLElement}catch(e){return o(t)&&1===t.nodeType&&o(t.style)&&o(t.ownerDocument)}}export{w as DMZ,x as arrayed,$ as checkInSetupEnv,M as createProviderWrapper,E as deepOmit,b as findAncestor,p as generateTimeFormat,y as getStringWidth,_ as hex2rgba,A as isHTMLElement,C as jsonParse,I as keywordMatcher,d as safeComponentRegister,O as separateMetaModule,S as shallowOmit,l as traverse,m as uuidGenerator,j as widthAppend};
@@ -0,0 +1,139 @@
1
+ type FixedSizeArray<T extends number, U> = T extends 0
2
+ ? void[]
3
+ : ReadonlyArray<U> & {
4
+ 0: U;
5
+ length: T;
6
+ };
7
+ type Measure<T extends number> = T extends 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 ? T : never;
8
+ type Append<T extends any[], U> = {
9
+ 0: [U];
10
+ 1: [T[0], U];
11
+ 2: [T[0], T[1], U];
12
+ 3: [T[0], T[1], T[2], U];
13
+ 4: [T[0], T[1], T[2], T[3], U];
14
+ 5: [T[0], T[1], T[2], T[3], T[4], U];
15
+ 6: [T[0], T[1], T[2], T[3], T[4], T[5], U];
16
+ 7: [T[0], T[1], T[2], T[3], T[4], T[5], T[6], U];
17
+ 8: [T[0], T[1], T[2], T[3], T[4], T[5], T[6], T[7], U];
18
+ }[Measure<T['length']>];
19
+ type AsArray<T> = T extends any[] ? T : [T];
20
+
21
+ declare class UnsetAdditionalOptions {
22
+ _UnsetAdditionalOptions: true;
23
+ }
24
+ type IfSet<X> = X extends UnsetAdditionalOptions ? {} : X;
25
+
26
+ type Callback<E, T> = (error: E | null, result?: T) => void;
27
+ type InnerCallback<E, T> = (error?: E | null | false, result?: T) => void;
28
+
29
+ type FullTap = Tap & {
30
+ type: 'sync' | 'async' | 'promise';
31
+ fn: Function;
32
+ };
33
+
34
+ type Tap = TapOptions & {
35
+ name: string;
36
+ };
37
+
38
+ type TapOptions = {
39
+ before?: string;
40
+ stage?: number;
41
+ };
42
+
43
+ interface HookInterceptor<T, R, AdditionalOptions = UnsetAdditionalOptions> {
44
+ name?: string;
45
+ tap?: (tap: FullTap & IfSet<AdditionalOptions>) => void;
46
+ call?: (...args: any[]) => void;
47
+ loop?: (...args: any[]) => void;
48
+ error?: (err: Error) => void;
49
+ result?: (result: R) => void;
50
+ done?: () => void;
51
+ register?: (tap: FullTap & IfSet<AdditionalOptions>) => FullTap & IfSet<AdditionalOptions>;
52
+ }
53
+
54
+ type ArgumentNames<T extends any[]> = FixedSizeArray<T['length'], string>;
55
+
56
+ declare class Hook<T, R, AdditionalOptions = UnsetAdditionalOptions> {
57
+ constructor(args?: ArgumentNames<AsArray<T>>, name?: string);
58
+ name: string | undefined;
59
+ taps: FullTap[];
60
+ intercept(interceptor: HookInterceptor<T, R, AdditionalOptions>): void;
61
+ isUsed(): boolean;
62
+ callAsync(...args: Append<AsArray<T>, Callback<Error, R>>): void;
63
+ promise(...args: AsArray<T>): Promise<R>;
64
+ tap(options: string | (Tap & IfSet<AdditionalOptions>), fn: (...args: AsArray<T>) => R): void;
65
+ withOptions(options: TapOptions & IfSet<AdditionalOptions>): Omit<this, 'call' | 'callAsync' | 'promise'>;
66
+ }
67
+
68
+ export class SyncHook<T, R = void, AdditionalOptions = UnsetAdditionalOptions> extends Hook<T, R, AdditionalOptions> {
69
+ call(...args: AsArray<T>): R;
70
+ }
71
+
72
+ export class SyncBailHook<T, R, AdditionalOptions = UnsetAdditionalOptions> extends SyncHook<T, R, AdditionalOptions> {}
73
+ export class SyncLoopHook<T, AdditionalOptions = UnsetAdditionalOptions> extends SyncHook<T, void, AdditionalOptions> {}
74
+ export class SyncWaterfallHook<T, AdditionalOptions = UnsetAdditionalOptions> extends SyncHook<
75
+ T,
76
+ AsArray<T>[0],
77
+ AdditionalOptions
78
+ > {}
79
+
80
+ declare class AsyncHook<T, R, AdditionalOptions = UnsetAdditionalOptions> extends Hook<T, R, AdditionalOptions> {
81
+ tapAsync(
82
+ options: string | (Tap & IfSet<AdditionalOptions>),
83
+ fn: (...args: Append<AsArray<T>, InnerCallback<Error, R>>) => void
84
+ ): void;
85
+ tapPromise(options: string | (Tap & IfSet<AdditionalOptions>), fn: (...args: AsArray<T>) => Promise<R>): void;
86
+ }
87
+
88
+ export class AsyncParallelHook<T, AdditionalOptions = UnsetAdditionalOptions> extends AsyncHook<
89
+ T,
90
+ void,
91
+ AdditionalOptions
92
+ > {}
93
+ export class AsyncParallelBailHook<T, R, AdditionalOptions = UnsetAdditionalOptions> extends AsyncHook<
94
+ T,
95
+ R,
96
+ AdditionalOptions
97
+ > {}
98
+ export class AsyncSeriesHook<T, AdditionalOptions = UnsetAdditionalOptions> extends AsyncHook<
99
+ T,
100
+ void,
101
+ AdditionalOptions
102
+ > {}
103
+ export class AsyncSeriesBailHook<T, R, AdditionalOptions = UnsetAdditionalOptions> extends AsyncHook<
104
+ T,
105
+ R,
106
+ AdditionalOptions
107
+ > {}
108
+ export class AsyncSeriesLoopHook<T, AdditionalOptions = UnsetAdditionalOptions> extends AsyncHook<
109
+ T,
110
+ void,
111
+ AdditionalOptions
112
+ > {}
113
+ export class AsyncSeriesWaterfallHook<T, AdditionalOptions = UnsetAdditionalOptions> extends AsyncHook<
114
+ T,
115
+ AsArray<T>[0],
116
+ AdditionalOptions
117
+ > {}
118
+
119
+ type HookFactory<H> = (key: any, hook?: H) => H;
120
+
121
+ interface HookMapInterceptor<H> {
122
+ factory?: HookFactory<H>;
123
+ }
124
+
125
+ export class HookMap<H> {
126
+ constructor(factory: HookFactory<H>, name?: string);
127
+ name: string | undefined;
128
+ get(key: any): H | undefined;
129
+ for(key: any): H;
130
+ intercept(interceptor: HookMapInterceptor<H>): void;
131
+ }
132
+
133
+ export class MultiHook<H> {
134
+ constructor(hooks: H[], name?: string);
135
+ name: string | undefined;
136
+ tap(options: string | Tap, fn?: Function): void;
137
+ tapAsync(options: string | Tap, fn?: Function): void;
138
+ tapPromise(options: string | Tap, fn?: Function): void;
139
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "3.1.57-release.3",
3
+ "version": "3.2.1-alpha.0",
4
4
  "license": "ISC",
5
5
  "module": "./es/components/index.js",
6
6
  "main": "./es/components/index.js",
@@ -16,20 +16,26 @@
16
16
  "peerDependencies": {
17
17
  "naive-ui": "^2.30.0",
18
18
  "vue": "^3.2.0",
19
- "vxe-table": "^4.2.5"
20
- },
21
- "dependencies": {
22
- "@formily/core": "2.1.9",
23
- "@formily/path": "2.1.9",
24
- "@formily/reactive": "2.1.9",
25
- "@formily/vue": "2.1.9",
26
19
  "@fullcalendar/core": "^6.1.10",
27
20
  "@fullcalendar/interaction": "^6.1.10",
28
21
  "@fullcalendar/resource": "^6.1.10",
29
22
  "@fullcalendar/resource-timegrid": "^6.1.10",
30
23
  "@fullcalendar/scrollgrid": "^6.1.10",
31
24
  "@fullcalendar/vue3": "^6.1.10",
25
+ "vxe-table": "^4.2.5"
26
+ },
27
+ "dependencies": {
32
28
  "@vicons/ionicons5": "^0.12.0",
29
+ "lodash-es": "^4.17.21",
30
+ "moment": "^2.29.1",
31
+ "video.js": "^7.19.2",
32
+ "videojs-contrib-hls": "^5.15.0",
33
+ "viewerjs": "^1.10.5",
34
+ "xe-utils": "^3.5.4",
35
+ "@formily/core": "2.1.9",
36
+ "@formily/path": "2.1.9",
37
+ "@formily/reactive": "2.1.9",
38
+ "@formily/vue": "2.1.9",
33
39
  "@vueuse/core": "^8.6.0",
34
40
  "@vueuse/shared": "^8.6.0",
35
41
  "@wangeditor/editor": "^5.1.1",
@@ -42,25 +48,20 @@
42
48
  "ids": "^1.0.0",
43
49
  "inherits": "^2.0.4",
44
50
  "lodash": "^4.17.21",
45
- "lodash-es": "^4.17.21",
46
51
  "lodash-unified": "^1.0.2",
47
52
  "min-dash": "^3.8.1",
48
53
  "min-dom": "^3.2.1",
49
- "moment": "^2.29.1",
50
54
  "naive-ui": "^2.30.0",
51
55
  "recorder-core": "^1.2.23070100",
56
+ "socket.io-client": "^4.7.3",
52
57
  "sockjs-client": "^1.6.1",
53
58
  "sortablejs": "^1.15.0",
54
59
  "spark-md5": "^3.0.2",
55
60
  "stompjs": "^2.3.3",
56
61
  "tiny-svg": "^2.2.4",
57
62
  "v-viewer": "^3.0.10",
58
- "video.js": "^7.19.2",
59
- "videojs-contrib-hls": "^5.15.0",
60
- "viewerjs": "^1.10.5",
61
63
  "vue": "^3.2.0",
62
- "vue-simple-uploader": "^1.0.0-beta.5",
63
- "xe-utils": "^3.5.4"
64
+ "vue-simple-uploader": "^1.0.0-beta.5"
64
65
  },
65
66
  "browserslist": [
66
67
  "defaults",
@@ -1 +0,0 @@
1
- import"../../../../../shared/utils/index.js";import"../../../index.js";import{isFunction as n}from"lodash-es";import{getBindEventSettingTrigger as t}from"../../../../../shared/utils/business.js";import{defineTablePlugin as o}from"../../hooks/useTablePlugin.js";function e(){const e="bindEventSettingPlugin";return o({name:e,apply(o){o.configHooks.config.tap(e,(o=>{const e=o.onFormChange;return o.onFormChange=function(o){var i;const{column:r,row:s}=o,u=null==(i=r.editRender)?void 0:i.props;if(u&&(null==u?void 0:u.bindEventSetting)){u.bindEventSetting.forEach((n=>{t(n.event_type)(n,{getter:n=>s[n],setter:(n,t)=>s[n]=t})}))}n(e)&&e(o)},o}))}})}export{e as bindEventSettingPlugin};
@@ -1 +0,0 @@
1
- import{mergeWith as e,isObject as o}from"lodash-es";import{HIGHEST_PRIORITY as i}from"../../constants/index.js";import{defineTablePlugin as t}from"../../hooks/useTablePlugin.js";import{IhoTableStatusHelper as s}from"../../utils/index.js";function n(){const n="defaultTablePlugin";return t({name:n,vxe(e){e.setup({zIndex:3e3})},apply(t){t.configHooks.config.tap({name:n,stage:i},(o=>{const i=e({border:!0,showSeq:!0,columnConfig:{resizable:!0},rowConfig:{height:36,useKey:!0,isHover:!0,isCurrent:!0,keyField:"theUniqueKey"},showOverflow:"title",showHeaderOverflow:"title",editConfig:{trigger:"click",mode:"cell"}},o,{height:o.height?"auto":void 0});return i.selectType=o.selectType||(s.isPositive(o.isBatchSelect)?"checkbox":s.isPositive(o.isSingleSelect)?"radio":void 0),i})),t.configHooks.mouseConfig.tap({name:n,stage:i},((e,i)=>o(i.keyboardConfig)?Object.assign({selected:!!i.keyboardConfig.isEdit},e):e))}})}export{n as defaultConfigPlugin};
@@ -1 +0,0 @@
1
- import{promiseTimeout as e}from"@vueuse/shared";import"../../../index.js";import{defineTablePlugin as o}from"../../hooks/useTablePlugin.js";function t(){const t="keyboardEventPlugin";return o({name:t,apply(o){o.eventHooks.onKeydown.tap(t,(async({$event:o,$table:t},n,{emits:r})=>{await e(0);const{row:a,column:i}=t.getSelectedCell()||t.getEditRecord()||{};if(!a||!i)return;r("keyboard",{$table:t,key:o.key,index:t.getRowIndex(a),value:a[i.field],row:a,column:i})}))}})}export{t as keyboardEventPlugin};
@@ -1 +0,0 @@
1
- import{isObject as e,isFunction as t,cloneDeep as i}from"lodash-es";import{toRaw as o,h as l}from"vue";import{HIGHEST_PRIORITY as s,IHO_TABLE_FIXED_STATUS as n,LOWEST_PRIORITY as d,WIDGET_TYPE as r}from"../../constants/index.js";import{defineTablePlugin as a}from"../../hooks/useTablePlugin.js";import{IhoTableStatusHelper as f,IhoTableUtils as c}from"../../utils/index.js";import{getDefaultValue as m}from"../rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.js";function p(){const p="lowCodeFieldAdaptorPlugin";return a({name:p,apply(a){a.fieldHooks.field.tap({name:p,stage:s},((s,d,a)=>{const p=s,u={className:p.bold?"iho-table__boldCell":"",field:p.columnName,showOverflow:"ellipsis",visible:f.notNegative(p.isShow),minWidth:p.colWidth,sortable:f.isPositive(p.isSort),fixed:n[p.isFixed],...p,title:p.alias||p.title};return function(e,i){const o={default:i.slotFn,header:i.headerSlotFn,edit:i.editSlotFn,footer:i.footerSlotFn,...i.slots};if(t(i.checkEditStatus)){const{default:e}=o;t(e)&&(o.default=t=>i.checkEditStatus(t)?e(t):[l("span",null,m(t.row,t.column.editRender.props))])}e.slots=o}(u,p),function(l,s,n){var d,a;const m=i(o(s));m.componentProps={size:"mini"===n.size?"small":n.size,...m.componentProps},n.forceClearable&&(m.componentProps.clearable=!0);l.editRender={name:c.getCellType(s),...l.editRender,props:m},l.editRender.enabled=!Reflect.get(r,l.editRender.name),!l.editRender.enabled&&t(null==(d=l.slots)?void 0:d.default)&&(l.editRender.enabled=t(null==(a=l.slots)?void 0:a.edit));if(!e(s.settingObj))return;Reflect.has(s.settingObj,"isHide")&&(l.visible=l.visible&&f.notPositive(s.settingObj.isHide))}(u,p,a),u})),a.fieldHooks.field.tap({name:p+"After",stage:d},(t=>(e(t.slots)&&Object.entries(t.slots).forEach((([e,i])=>{null==i&&Reflect.deleteProperty(t.slots,e)})),t)))}})}export{p as lowCodeFieldAdaptorPlugin};
@@ -1 +0,0 @@
1
- import"../../../../../shared/utils/index.js";import{format as o}from"date-fns";import"../../../index.js";import{isFunction as n,isNumber as t,isDate as e}from"lodash-es";import{EDITABLE_WIDGET_TYPE as r}from"../../constants/index.js";import{getLowCodeFieldFromField as i,IhoTableUtils as s}from"../../utils/index.js";import{getOperationalFormHandler as a,getDateOperationalFormHandler as m}from"../../../../../shared/utils/business.js";import{defineTablePlugin as l}from"../../hooks/useTablePlugin.js";function u(){const u="operationalFormPlugin";return l({name:u,apply(l){l.configHooks.config.tap(u,(l=>{const u=l.onFormChange;return l.onFormChange=function(d){const{column:p,row:f,$table:c}=d;!function(n,u){const{operationalFormHandler:d}=a(l.operationalForm||l.operationForm,(o=>n[o]),((o,t)=>{u.getColumns().some((n=>n.field===o))&&(n[o]=t)})),{dateOperationalFormHandler:p}=m(l.dateOperationalForm,(o=>n[o]),((a,m)=>{const l=u.getColumns().find((o=>o.field===a));if(!l)return;const d=i(l);d&&[r.DATE,r.TIME].includes(s.getCellType(d))&&(m=t(m)||e(m)?o(new Date(m),d.valueFormat||"yyyy-MM-dd HH:mm:ss"):null),n[a]=m}));return function(o){d(o),p(o)}}(f,c)(p.field),n(u)&&u(d)},l}))}})}export{u as operationalFormPlugin};
@@ -1 +0,0 @@
1
- export declare function rowClickPlugin(): import("../../../../../components/iho-table").TablePlugin;
@@ -1 +0,0 @@
1
- import{onBeforeUnmount as e}from"vue";import"../../../index.js";import{defineTablePlugin as o}from"../../hooks/useTablePlugin.js";function n(){const n="rowClickPlugin",u=new Map;return o({name:n,apply(o){o.eventHooks.onCurrentChange.tap(n,((e,{uuid:o,rowConfig:n})=>{o&&!1!==(null==n?void 0:n.clickToCancel)&&u.set(o,!0)})),o.eventHooks.onCellClick.tap(n,(async({$table:e},{uuid:o,rowConfig:n})=>{o&&!1!==(null==n?void 0:n.clickToCancel)&&(u.get(o)?u.set(o,!1):e.clearCurrentRow())})),o.setupHooks.setup.tap(n,(o=>{e((()=>{o.value.uuid&&u.delete(o.value.uuid)}))}))}})}export{n as rowClickPlugin};
@@ -1 +0,0 @@
1
- export declare function rowDragPlugin(): import("../../../../../components/iho-table").TablePlugin;
@@ -1 +0,0 @@
1
- import{promiseTimeout as e}from"@vueuse/shared";import{isFunction as l,cloneDeep as n}from"lodash-es";import{nextTick as o,onBeforeUnmount as t}from"vue";import"../../../index.js";import i from"sortablejs";import d from"xe-utils";import{defineTablePlugin as r}from"../../hooks/useTablePlugin.js";function a(){const n="rowDragPlugin",d=new Map;return r({name:n,apply(r){r.fieldHooks.fieldEnd.tapPromise(n,(async(n,{$table:t,emits:r})=>{const{uuid:a}=n,s=n.sortableConfig||{};a&&s.enable&&!d.get(a)&&(await o(),async function n(o=0){if(o>2)return;const c=function(){var e,l,n,o,i,d,r,a,u,s;const c=null==(o=null==(n=null==(l=null==(e=t.value)?void 0:e.$el)?void 0:l.querySelector)?void 0:n.call(l,".vxe-table--body"))?void 0:o.scrollWidth,v=(null==(r=null==(d=null==(i=t.value)?void 0:i.$el)?void 0:d.querySelector)?void 0:r.call(d,".vxe-table.is--scroll-x"))?".fixed-left--wrapper>.vxe-table--body tbody":".body--wrapper>.vxe-table--body tbody";return c?null==(s=null==(u=null==(a=t.value)?void 0:a.$el)?void 0:u.querySelector)?void 0:s.call(u,v):null}();if(c){const e=i.create(c,{handle:".col--seq",...s,onEnd:e=>{var n,o,i,d,a,c,v;const{oldIndex:f=0,newIndex:x=0}=e,p={oldIndex:f,newIndex:x},{virtualY:b}=(null==(n=t.value)?void 0:n.getScroll())||{};if(b){const e=(null==(d=null==(i=null==(o=t.value)?void 0:o.getTableData())?void 0:i.tableData)?void 0:d[f])||{},l=null!=(v=null!=(c=e.__currentIndex)?c:null==(a=t.value)?void 0:a.getVTRowIndex(e))?v:0,n=l+(x-f);e.__currentIndex=n,p.oldIndex=l,p.newIndex=n}const y={...e,...p,...u(e,p,t.value)};r("rowDrag",y),l(s.onEnd)&&s.onEnd(y)}});return d.set(a,e)}await e(100),n(++o)}())})),r.setupHooks.setup.tap(n,(e=>{t((()=>{var l,n;const o=null==(l=e.value)?void 0:l.uuid;o&&d.has(o)&&(null==(n=d.get(o))||n.destroy(),d.delete(o))}))}))}})}function u(e,l,o){var t;const i=null==(t=null==o?void 0:o.getTableData())?void 0:t.fullData,r=o.treeConfig&&o.treeConfig.transform?function(e,l){var o,t,i,r,a;const{oldIndex:u=0,newIndex:s=0}=e,c={children:"childrenList"},{fullData:v,tableData:f}=l.getTableData(),x=null==f?void 0:f[u],p=null==f?void 0:f[s-1],b=n(v),y=d.findTree(b,(e=>e.__id===x.__id),c);if(p){const e=null==(t=null==(o=l.$el)?void 0:o.querySelector)?void 0:t.call(o,".body--wrapper>.vxe-table--body tbody"),n=null==(r=null==(i=l.$el)?void 0:i.querySelector)?void 0:r.call(i,".fixed-left--wrapper>.vxe-table--body tbody"),v=d.findTree(b,(e=>e.__id===p.__id),c);if(d.findTree(x[c.children],(e=>e.__id===p.__id),c)){const l=e.children[u],o=e.children[s];return e.insertBefore(o,l),null==(a=null==n?void 0:n.insertBefore)||a.call(n,n.children[s],n.children[u]),console.log("不允许自己给自己拖动"),b}const f=y.items.splice(y.index,1)[0];l.isTreeExpandByRow(p)?p[c.children].splice(0,0,f):v.items.splice(v.index+(y.index<v.index?0:1),0,f)}else{const e=y.items.splice(y.index,1)[0];b.unshift(e)}return b}(e,o):function(e,l){var o;const{oldIndex:t=0,newIndex:i=0}=e,d=n((null==(o=null==l?void 0:l.getTableData())?void 0:o.fullData)||[]),r=d.splice(t,1)[0];return d.splice(i,0,r),d}(l,o);return{oldData:i,newData:r}}export{a as rowDragPlugin};
@@ -1 +0,0 @@
1
- import{unref as e,onBeforeUnmount as t,shallowReactive as o,createVNode as l,defineComponent as n,inject as r,ref as a,computed as s,provide as i,watch as u,onMounted as d,h as c}from"vue";import{traverse as p,widthAppend as f}from"../../../../../shared/utils/index.js";import{doAnimation as m}from"../../../../../shared/utils/anime.js";import{useThrottleFn as h}from"@vueuse/core";import{promiseTimeout as g}from"@vueuse/shared";import{last as v,isFunction as x,isNumber as y}from"lodash-es";import"../../../index.js";import{EDITABLE_WIDGET_TYPE as b,InjectionIhoTableUUID as I}from"../../constants/index.js";import{useUUIDMap as T,IhoTableUtils as w}from"../../utils/index.js";import{defineTablePlugin as R}from"../../hooks/useTablePlugin.js";class D{constructor(){this.records={},this.maxRecords=o(new Map)}set(e,t,o){if(this.records[e]||(this.records[e]={}),this.records[e][t]===o)return;this.records[e][t]=o;const l=Math.max(...Object.values(this.records[e]),0);this.maxRecords.get(e)!==l&&this.maxRecords.set(e,l)}getMax(e){return this.maxRecords.get(e)||0}}const{getItemFromUUID:H,removeItemFromUUID:M}=T((()=>new D),!0),{getItemFromUUID:S,removeItemFromUUID:C,setItemFromUUID:U}=T((()=>null)),{getItemFromUUID:$,removeItemFromUUID:k,setItemFromUUID:F}=T((()=>{}));let j={};function E(t,o,{scrollTop:l=0}){var n,r;const{uuid:a,rowConfig:s={}}=o;if(!a)return;const i=H(a),{oSize:u=0,gt:d=100}=null!=(n=$(a))?n:{},{internalData:c,reactData:p}=t,{scrollYStore:f,elemStore:m,afterFullData:h,fullDataRowIdData:g}=c;if(d>h.length)return;const y=null!=(r=s.height)?r:36,b=m["main-body-wrapper"],I=b?e(b):null;let T=I?Math.max(8,Math.ceil(I.clientHeight/y)+2+u):8;const w=[0];let R=0;if(l&&h.find(((e,o)=>{const n=t.getRowSeq(e),r=(v(w)||0)+Math.max(y,i.getMax(n));if(w.push(r),r>l)return R=Math.max(0,o-u),T+=Math.min(R,u),!0})),R>0&&x(o.spanMethod)){const{spanMethod:e}=o,l={rowspan:1,colspan:1};for(;R>0;){if(!t.getColumns().some(((t,o)=>{const{rowspan:n,colspan:r}=e({column:t,columnIndex:o,$columnIndex:o,row:h[R],rowIndex:R,$rowIndex:R,_rowIndex:R,isHidden:!t.visible,fixed:t.fixed,type:t.type,visibleData:h})||l;if(0===n&&0===r)return R--,!0})))break}}const D=`${w[R]}px`,M=`${h.reduce(((e,o)=>{const l=t.getRowSeq(o);return e+Math.max(y,i.getMax(l))}),0)}px`;["main","left","right"].forEach((t=>{const o=m[`${t}-body-table`],n=o?e(o):null;n&&(n.style.marginTop=D,n.scrollTop=l),["header","body","footer"].forEach((o=>{const l=m[`${t}-${o}-ySpace`],n=l?e(l):null;n&&(n.style.height=M)}))}));const S=Math.min(h.length,R+T);if(f.startIndex===R&&f.endIndex===S)return;f.startIndex=R,f.endIndex=S;const C=h.slice(f.startIndex,f.endIndex);C.forEach(((e,o)=>{const l=t.getRowid(e),n=g[l];n&&(n.$index=o)})),p.tableData.length=0,p.tableData.push(...C)}const Y=h(E,300);function q(e){var t,o;return(!0===e.variableHeight||"1"===e.variableHeight)&&(null!=(o=null==(t=e.editRender)?void 0:t.name)?o:w.getCellType(e))!==b.SEPARATE}function L(){const o="variableHeightRendererPlugin";return R({name:o,vxe(e){j=n({props:{payload:{type:Object,required:!0}},setup(t){const o=r(I),n=r("$xetable"),p=a(),m=H(o),h=s((()=>t.payload.row[t.payload.column.field]));function v(){const{row:e,column:o}=t.payload,l=n.getRowSeq(e);if(!m||null==l||!p.value)return;const r=p.value.clientHeight;m.set(l,o.field,r)}i("updateCellHeight",v),u([()=>t.payload.rowIndex,()=>t.payload.column.field,h,()=>t.payload.column.renderWidth],(async()=>{await g(0),v()})),d((()=>{n&&!S(o)&&U(o,n),v()}));const b=s((()=>{var o,l,n,r,a;const s=null!=(l=null==(o=t.payload.column.editRender)?void 0:o.props)?l:{},i=null!=(r=null==(n=s.slots)?void 0:n.default)?r:s.slotFn;if(x(i))return i;const u=null==(a=t.payload.column.editRender)?void 0:a.name;if(u){const o=e.renderer.get(u);if(null==o?void 0:o.renderCell)return()=>o.renderCell(t.payload.column.editRender,t.payload)}return()=>h.value})),T=s((()=>{if(t.payload.column.treeNode)return"";const e=t.payload.column.renderWidth;return y(e)&&e>0?f(e-20-2):""}));return()=>l("div",{ref:p,style:{padding:"7px 0",width:T.value,overflow:"hidden"}},[c(b.value,t.payload)])}})},apply(n){function r(t){const o=S(t.uuid);if(!o)return;t.scrollY={enabled:!1},o.reactData.scrollYLoad=!1;const l=function(t){const o=t.internalData.elemStore["main-body-wrapper"];return o?e(o):null}(o);l&&E(o,t,{scrollTop:l.scrollTop})}function a(e){if(!e.uuid)return;const t=$(e.uuid);t&&(e.scrollY=t),setTimeout((()=>r(e)),300)}function s(e){return l(j,{payload:e},null)}n.dataHooks.dataStart.tap(o,a),n.eventHooks.onFilterChange.tap(o,((e,t)=>a(t))),n.eventHooks.onSortChange.tap(o,((e,t)=>a(t))),n.eventHooks.onToggleTreeExpand.tap(o,((e,t)=>a(t))),n.eventHooks.onResizableChange.tap(o,(async({column:e},t)=>{e.editRender&&e.editRender.props&&q(e.editRender.props)&&a(t)})),n.eventHooks.onScroll.tap(o,h(((e,t)=>{if(e.isX)return;const{uuid:o}=t;if(!o)return;const l=S(o);l&&E(l,t,e)}),100,!0,!0)),n.fieldHooks.field.tap(o,(e=>{if(q(e)){e.slots={...e.slots,default:s};const t=e.className,o="variable-height";e.className=t?function(e){return x(t)?[t(e),o]:[t,o]}:o}return e})),n.fieldHooks.fieldList.tap(o,((t,o,{$table:l})=>(o.uuid&&p(t,((t,n)=>{var a,s;if(q(t)){const t=null!=(s=null==(a=o.rowConfig)?void 0:a.height)?s:36,i=H(o.uuid),u=o.cellStyle;if(o.cellStyle=function(e){const o={};if(l.value){const n=Math.max(t,i.getMax(l.value.getRowSeq(e.row)));o.height=`${n}px`}return Object.assign(o,u?x(u)?u(e):u:null)},o.sortableConfig&&o.sortableConfig.enable){const t=o.sortableConfig.onEnd;o.sortableConfig.onEnd=function(l){const n=S(o.uuid);if(n){const{internalData:{elemStore:t}}=n,l=t["main-table-body"];l&&e(l)&&E(n,o,{scrollTop:e(l).scrollTop})}x(t)&&t(l)}}o.scrollY={...o.scrollY,mode:"default"},o.onWheel=function(t){let o=null,l=0,n=!0;return function(r){if(!t.uuid)return;const a=S(t.uuid);if(!a)return;const{internalData:s}=a,{isHover:i}=t.rowConfig||{},{deltaX:u,deltaY:d}=r,{refTableLeftBody:c,refTableRightBody:p,refTableBody:f}=a.getRefMaps(),h=d,g=u,v=h<0,x=e(f),y=x?x.$el:null;if(!y)return;if(v?y.scrollTop<=0:y.scrollTop>=y.scrollHeight-y.clientHeight)return;const b=y.scrollTop+h,I=y.scrollLeft+g;if(b===s.lastScrollTop)return;r.preventDefault(),s.lastScrollTop=b,s.lastScrollLeft=I,s.lastScrollTime=Date.now(),i&&a.clearHoverRow();const T=c.value,w=p.value,R=T?T.$el:null,D=w?w.$el:null,H=Math.min(100,Math.abs(Math.floor(h/2)));n&&(l=y.scrollTop,n=!1),l+=H*(v?-1:1),o&&o(),o=m(y.scrollTop,l,400,(e=>{y.scrollTop=e,R&&(R.scrollTop=e),D&&(D.scrollTop=e)}),"easeOutCubic",(()=>{l=y.scrollTop,n=!0})),Y(a,t,y)}}(o),setTimeout((()=>{F(o.uuid,o.scrollY),r(o)}),300),n()}})),t))),n.setupHooks.setup.tap(o,(e=>{t((()=>{e.value.uuid&&(M(e.value.uuid),C(e.value.uuid),k(e.value.uuid))}))}))}})}export{L as variableHeightRendererPlugin};
@@ -1 +0,0 @@
1
- import{traverse as e,uuidGenerator as t,DMZ as r}from"../../../../../shared/utils/index.js";import{isArray as i,sortBy as n,isFunction as o,isEmpty as s}from"lodash-es";import{onBeforeUnmount as d}from"vue";import"../../../index.js";import{HIGHEST_PRIORITY as a,IHO_TABLE_TREE_TYPE as f}from"../../constants/index.js";import{isTransformTreeType as l}from"../../utils/index.js";import{defineTablePlugin as u}from"../../hooks/useTablePlugin.js";function p(){const p="virtualTreePlugin",c=new Map;return u({name:p,apply(u){u.configHooks.treeConfig.tap({name:p,stage:a},((e,t)=>l(t)?Object.assign({transform:!0,expandAll:!0,reserve:!0,children:"childrenList",rowField:"__id"},e):e)),u.dataHooks.data.tap(p,((r,n,o)=>{if(!n.treeConfig)return;const{transform:s,rowField:d="__id",parentField:a="parentId",children:f="childrenList"}=n.treeConfig;function u(e){e[d]=e[d]||e.theUniqueKey||t()}l(n)&&s&&(u(r),i(r[f])&&e(r[f],((e,t,r)=>{r&&(e[a]=r[d]),o.insertAfter(e),u(e)}),f,r))})),u.fieldHooks.fieldList.tap(p,((e,t)=>{if(!t.treeConfig)return e;const{transform:i}=t.treeConfig||r;if(!l(t)||!i||!t.uuid)return e;const o=e.filter((e=>!1!==e.visible));let s=o.findIndex((e=>e.treeNode));if(~s&&o[s].fixed){const e=n(o,(e=>"left"===e.fixed?-1:"right"===e.fixed?1:0));s=e.findIndex((e=>e.treeNode))}~s||o.some(((e,t)=>{if(!e.type)return s=t,e.treeNode=!0}));const d=o.length-s-o.filter((e=>"right"===e.fixed)).length;return c.set(t.uuid,{index:s,colspan:d}),e})),u.configHooks.treeConfig.tap(p,((e,t)=>{if(!e)return e;const{transform:r,parentField:i="parentId",hasChild:n="hasChild",children:d="childrenList"}=e;if(o(t.spanMethod)||!r||`${t.isTree}`!==f.TRANSFORM_WITH_SPAN_METHOD)return e;const a=Object.freeze({rowspan:0,colspan:0});return t.spanMethod=({row:e,column:r,$columnIndex:o})=>{const f=c.get(t.uuid);if(f&&(Reflect.has(e,n)?e[n]:!e[i])&&!s(e[d]))return r.treeNode?{rowspan:1,colspan:f.colspan}:"right"!==r.fixed&&o>=f.index?a:void 0},e})),u.setupHooks.setup.tap(p,(e=>{d((()=>{var t;(null==(t=e.value)?void 0:t.uuid)&&c.delete(e.value.uuid)}))}))}})}export{p as virtualTreePlugin};