cnhis-design-vue 3.1.57-release.3 → 3.1.57

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 (73) 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/callback/src/components/render/popupMaps.d.ts +2 -0
  7. package/es/components/classification/src/components/table-modal/index.vue.d.ts +0 -3
  8. package/es/components/classification/src/index.vue.d.ts +3 -3
  9. package/es/components/expand-field/src/components/form.vue2.js +1 -1
  10. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
  11. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
  12. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  13. package/es/components/field-set/src/FieldColor.vue.d.ts +1 -1
  14. package/es/components/field-set/src/components/edit-dialog.vue.d.ts +1 -1
  15. package/es/components/iho-table/index.d.ts +2 -0
  16. package/es/components/iho-table/src/IhoTable.vue.d.ts +2 -0
  17. package/es/components/iho-table/src/IhoTable.vue2.js +1 -1
  18. package/es/components/iho-table/src/plugins/{bindEventSettingPlugin/index.d.ts → bindEventSettingPlugin.d.ts} +1 -1
  19. package/es/components/iho-table/src/plugins/bindEventSettingPlugin.js +1 -0
  20. package/es/components/iho-table/src/plugins/{defaultConfigPlugin/index.d.ts → defaultConfigPlugin.d.ts} +1 -1
  21. package/es/components/iho-table/src/plugins/defaultConfigPlugin.js +1 -0
  22. package/es/components/iho-table/src/plugins/dragScrollPlugin.d.ts +1 -0
  23. package/es/components/iho-table/src/plugins/dragScrollPlugin.js +1 -0
  24. package/es/components/iho-table/src/plugins/headerPlugin.js +1 -1
  25. package/es/components/iho-table/src/plugins/index.js +1 -1
  26. package/es/components/iho-table/src/plugins/{keyboardEventPlugin/index.d.ts → keyboardEventPlugin.d.ts} +1 -1
  27. package/es/components/iho-table/src/plugins/keyboardEventPlugin.js +1 -0
  28. package/es/components/iho-table/src/plugins/{lowCodeFieldAdaptorPlugin/index.d.ts → lowCodeFieldAdaptorPlugin.d.ts} +1 -1
  29. package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin.js +1 -0
  30. package/es/components/iho-table/src/plugins/{operationalFormPlugin/index.d.ts → operationalFormPlugin.d.ts} +1 -1
  31. package/es/components/iho-table/src/plugins/operationalFormPlugin.js +1 -0
  32. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +31 -1
  33. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue2.js +1 -1
  34. package/es/components/iho-table/src/plugins/rowClickPlugin.d.ts +1 -0
  35. package/es/components/iho-table/src/plugins/rowClickPlugin.js +1 -0
  36. package/es/components/iho-table/src/plugins/rowDragPlugin.d.ts +1 -0
  37. package/es/components/iho-table/src/plugins/rowDragPlugin.js +1 -0
  38. package/es/components/iho-table/src/plugins/{varialbleHeightPlugin/index.d.ts → varialbleHeightPlugin.d.ts} +1 -1
  39. package/es/components/iho-table/src/plugins/varialbleHeightPlugin.js +1 -0
  40. package/es/components/iho-table/src/plugins/{virtualTreePlugin/index.d.ts → virtualTreePlugin.d.ts} +1 -1
  41. package/es/components/iho-table/src/plugins/virtualTreePlugin.js +1 -0
  42. package/es/components/iho-table/src/types/index.d.ts +1 -0
  43. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  44. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
  45. package/es/components/select-person/src/SearchMultiple.vue.d.ts +0 -6
  46. package/es/components/table-export-field/src/components/ExportModal.vue.d.ts +3 -0
  47. package/es/env.d.ts +25 -25
  48. package/es/shared/assets/img/failure.png.js +1 -1
  49. package/es/shared/assets/img/no-permission.png.js +1 -1
  50. package/es/shared/assets/img/nodata.png.js +1 -1
  51. package/es/shared/assets/img/notfound.png.js +1 -1
  52. package/es/shared/assets/img/qr.png.js +1 -1
  53. package/es/shared/assets/img/success.png.js +1 -1
  54. package/es/shared/assets/img/video.png.js +1 -1
  55. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  56. package/es/shared/assets/img/xb_big.png.js +1 -1
  57. package/es/shared/assets/img/xb_small.png.js +1 -1
  58. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +86 -0
  59. package/es/shared/package.json.js +1 -1
  60. package/es/shared/utils/fabricjs/index.d.ts +6823 -0
  61. package/es/shared/utils/tapable/index.d.ts +139 -0
  62. package/package.json +1 -1
  63. package/es/components/iho-table/src/plugins/bindEventSettingPlugin/index.js +0 -1
  64. package/es/components/iho-table/src/plugins/defaultConfigPlugin/index.js +0 -1
  65. package/es/components/iho-table/src/plugins/keyboardEventPlugin/index.js +0 -1
  66. package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index.js +0 -1
  67. package/es/components/iho-table/src/plugins/operationalFormPlugin/index.js +0 -1
  68. package/es/components/iho-table/src/plugins/rowClickPlugin/index.d.ts +0 -1
  69. package/es/components/iho-table/src/plugins/rowClickPlugin/index.js +0 -1
  70. package/es/components/iho-table/src/plugins/rowDragPlugin/index.d.ts +0 -1
  71. package/es/components/iho-table/src/plugins/rowDragPlugin/index.js +0 -1
  72. package/es/components/iho-table/src/plugins/varialbleHeightPlugin/index.js +0 -1
  73. package/es/components/iho-table/src/plugins/virtualTreePlugin/index.js +0 -1
@@ -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.1.57",
4
4
  "license": "ISC",
5
5
  "module": "./es/components/index.js",
6
6
  "main": "./es/components/index.js",
@@ -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};