cnhis-design-vue 3.1.42-beta.52 → 3.1.42-beta.54

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.
@@ -69,10 +69,10 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
69
69
  default: boolean;
70
70
  };
71
71
  externalOptionConfig: {
72
- type: import("vue").PropType<{
73
- options?: import("../../../es/shared/types").AnyObject[] | undefined;
74
- onSelect?: ((key: string | number, option: import("../../../es/shared/types").AnyObject) => void) | undefined;
75
- }>;
72
+ type: import("vue").PropType<Partial<{
73
+ options: import("../../../es/shared/types").AnyObject[];
74
+ onSelect: (key: string | number, option: import("../../../es/shared/types").AnyObject) => void;
75
+ }>>;
76
76
  default: () => {};
77
77
  };
78
78
  }, {
@@ -146,10 +146,10 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
146
146
  default: boolean;
147
147
  };
148
148
  externalOptionConfig: {
149
- type: import("vue").PropType<{
150
- options?: import("../../../es/shared/types").AnyObject[] | undefined;
151
- onSelect?: ((key: string | number, option: import("../../../es/shared/types").AnyObject) => void) | undefined;
152
- }>;
149
+ type: import("vue").PropType<Partial<{
150
+ options: import("../../../es/shared/types").AnyObject[];
151
+ onSelect: (key: string | number, option: import("../../../es/shared/types").AnyObject) => void;
152
+ }>>;
153
153
  default: () => {};
154
154
  };
155
155
  }>> & {
@@ -1908,10 +1908,10 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
1908
1908
  default: boolean;
1909
1909
  };
1910
1910
  externalOptionConfig: {
1911
- type: import("vue").PropType<{
1912
- options?: import("../../../es/shared/types").AnyObject[] | undefined;
1913
- onSelect?: ((key: string | number, option: import("../../../es/shared/types").AnyObject) => void) | undefined;
1914
- }>;
1911
+ type: import("vue").PropType<Partial<{
1912
+ options: import("../../../es/shared/types").AnyObject[];
1913
+ onSelect: (key: string | number, option: import("../../../es/shared/types").AnyObject) => void;
1914
+ }>>;
1915
1915
  default: () => {};
1916
1916
  };
1917
1917
  }>> & {
@@ -1934,9 +1934,9 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
1934
1934
  printdlgshow: string;
1935
1935
  btnprint: string;
1936
1936
  directPrint: boolean;
1937
- externalOptionConfig: {
1938
- options?: import("../../../es/shared/types").AnyObject[] | undefined;
1939
- onSelect?: ((key: string | number, option: import("../../../es/shared/types").AnyObject) => void) | undefined;
1940
- };
1937
+ externalOptionConfig: Partial<{
1938
+ options: import("../../../es/shared/types").AnyObject[];
1939
+ onSelect: (key: string | number, option: import("../../../es/shared/types").AnyObject) => void;
1940
+ }>;
1941
1941
  }>>;
1942
1942
  export default ButtonPrint;
@@ -2,10 +2,6 @@
2
2
  import { AnyObject } from '../../../../es/shared/types';
3
3
  import { PropType } from 'vue';
4
4
  import { Print } from './utils';
5
- declare type IExternalOptionConfig = {
6
- options?: AnyObject[];
7
- onSelect?: (key: string | number, option: AnyObject) => void;
8
- };
9
5
  declare const _default: import("vue").DefineComponent<{
10
6
  printParams: {
11
7
  type: PropType<AnyObject[]>;
@@ -77,7 +73,10 @@ declare const _default: import("vue").DefineComponent<{
77
73
  default: boolean;
78
74
  };
79
75
  externalOptionConfig: {
80
- type: PropType<IExternalOptionConfig>;
76
+ type: PropType<Partial<{
77
+ options: AnyObject[];
78
+ onSelect: (key: string | number, option: AnyObject) => void;
79
+ }>>;
81
80
  default: () => {};
82
81
  };
83
82
  }, {
@@ -154,7 +153,10 @@ declare const _default: import("vue").DefineComponent<{
154
153
  default: boolean;
155
154
  };
156
155
  externalOptionConfig: {
157
- type: PropType<IExternalOptionConfig>;
156
+ type: PropType<Partial<{
157
+ options: AnyObject[];
158
+ onSelect: (key: string | number, option: AnyObject) => void;
159
+ }>>;
158
160
  default: () => {};
159
161
  };
160
162
  }>> & {
@@ -1916,7 +1918,10 @@ declare const _default: import("vue").DefineComponent<{
1916
1918
  default: boolean;
1917
1919
  };
1918
1920
  externalOptionConfig: {
1919
- type: PropType<IExternalOptionConfig>;
1921
+ type: PropType<Partial<{
1922
+ options: AnyObject[];
1923
+ onSelect: (key: string | number, option: AnyObject) => void;
1924
+ }>>;
1920
1925
  default: () => {};
1921
1926
  };
1922
1927
  }>> & {
@@ -1939,6 +1944,9 @@ declare const _default: import("vue").DefineComponent<{
1939
1944
  printdlgshow: string;
1940
1945
  btnprint: string;
1941
1946
  directPrint: boolean;
1942
- externalOptionConfig: IExternalOptionConfig;
1947
+ externalOptionConfig: Partial<{
1948
+ options: AnyObject[];
1949
+ onSelect: (key: string | number, option: AnyObject) => void;
1950
+ }>;
1943
1951
  }>;
1944
1952
  export default _default;
@@ -116,6 +116,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
116
116
  children?: any[] | undefined;
117
117
  childrenFields?: any[] | undefined;
118
118
  }[] | undefined;
119
+ multi_select?: import("..").FormCommonState | undefined;
119
120
  multi_select_value?: string | number | undefined;
120
121
  wordbook?: {
121
122
  level_num?: number | undefined;
@@ -1810,6 +1811,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
1810
1811
  children?: any[] | undefined;
1811
1812
  childrenFields?: any[] | undefined;
1812
1813
  }[] | undefined;
1814
+ multi_select?: import("..").FormCommonState | undefined;
1813
1815
  multi_select_value?: string | number | undefined;
1814
1816
  wordbook?: {
1815
1817
  level_num?: number | undefined;
@@ -4448,6 +4450,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
4448
4450
  children?: any[] | undefined;
4449
4451
  childrenFields?: any[] | undefined;
4450
4452
  }[] | undefined;
4453
+ multi_select?: import("..").FormCommonState | undefined;
4451
4454
  multi_select_value?: string | number | undefined;
4452
4455
  wordbook?: {
4453
4456
  level_num?: number | undefined;
@@ -6154,6 +6157,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
6154
6157
  children?: any[] | undefined;
6155
6158
  childrenFields?: any[] | undefined;
6156
6159
  }[] | undefined;
6160
+ multi_select?: import("..").FormCommonState | undefined;
6157
6161
  multi_select_value?: string | number | undefined;
6158
6162
  wordbook?: {
6159
6163
  level_num?: number | undefined;
@@ -7832,6 +7836,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
7832
7836
  children?: any[] | undefined;
7833
7837
  childrenFields?: any[] | undefined;
7834
7838
  }[] | undefined;
7839
+ multi_select?: import("..").FormCommonState | undefined;
7835
7840
  multi_select_value?: string | number | undefined;
7836
7841
  wordbook?: {
7837
7842
  level_num?: number | undefined;
@@ -118,6 +118,7 @@ declare const _default: import("vue").DefineComponent<{
118
118
  children?: any[] | undefined;
119
119
  childrenFields?: any[] | undefined;
120
120
  }[] | undefined;
121
+ multi_select?: import("../../../../es/components/form-render").FormCommonState | undefined;
121
122
  multi_select_value?: string | number | undefined;
122
123
  wordbook?: {
123
124
  level_num?: number | undefined;
@@ -1812,6 +1813,7 @@ declare const _default: import("vue").DefineComponent<{
1812
1813
  children?: any[] | undefined;
1813
1814
  childrenFields?: any[] | undefined;
1814
1815
  }[] | undefined;
1816
+ multi_select?: import("../../../../es/components/form-render").FormCommonState | undefined;
1815
1817
  multi_select_value?: string | number | undefined;
1816
1818
  wordbook?: {
1817
1819
  level_num?: number | undefined;
@@ -4450,6 +4452,7 @@ declare const _default: import("vue").DefineComponent<{
4450
4452
  children?: any[] | undefined;
4451
4453
  childrenFields?: any[] | undefined;
4452
4454
  }[] | undefined;
4455
+ multi_select?: import("../../../../es/components/form-render").FormCommonState | undefined;
4453
4456
  multi_select_value?: string | number | undefined;
4454
4457
  wordbook?: {
4455
4458
  level_num?: number | undefined;
@@ -6156,6 +6159,7 @@ declare const _default: import("vue").DefineComponent<{
6156
6159
  children?: any[] | undefined;
6157
6160
  childrenFields?: any[] | undefined;
6158
6161
  }[] | undefined;
6162
+ multi_select?: import("../../../../es/components/form-render").FormCommonState | undefined;
6159
6163
  multi_select_value?: string | number | undefined;
6160
6164
  wordbook?: {
6161
6165
  level_num?: number | undefined;
@@ -7834,6 +7838,7 @@ declare const _default: import("vue").DefineComponent<{
7834
7838
  children?: any[] | undefined;
7835
7839
  childrenFields?: any[] | undefined;
7836
7840
  }[] | undefined;
7841
+ multi_select?: import("../../../../es/components/form-render").FormCommonState | undefined;
7837
7842
  multi_select_value?: string | number | undefined;
7838
7843
  wordbook?: {
7839
7844
  level_num?: number | undefined;
@@ -81,6 +81,7 @@ declare const _default: import("vue").DefineComponent<{
81
81
  children?: any[] | undefined;
82
82
  childrenFields?: any[] | undefined;
83
83
  }[] | undefined;
84
+ multi_select?: import("../../../../../es/components/form-render").FormCommonState | undefined;
84
85
  multi_select_value?: string | number | undefined;
85
86
  wordbook?: {
86
87
  level_num?: number | undefined;
@@ -1787,6 +1788,7 @@ declare const _default: import("vue").DefineComponent<{
1787
1788
  children?: any[] | undefined;
1788
1789
  childrenFields?: any[] | undefined;
1789
1790
  }[] | undefined;
1791
+ multi_select?: import("../../../../../es/components/form-render").FormCommonState | undefined;
1790
1792
  multi_select_value?: string | number | undefined;
1791
1793
  wordbook?: {
1792
1794
  level_num?: number | undefined;
@@ -3465,6 +3467,7 @@ declare const _default: import("vue").DefineComponent<{
3465
3467
  children?: any[] | undefined;
3466
3468
  childrenFields?: any[] | undefined;
3467
3469
  }[] | undefined;
3470
+ multi_select?: import("../../../../../es/components/form-render").FormCommonState | undefined;
3468
3471
  multi_select_value?: string | number | undefined;
3469
3472
  wordbook?: {
3470
3473
  level_num?: number | undefined;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,computed as a,inject as l,watch as r,createVNode as o,nextTick as n}from"vue";import{isEqual as i,isArray as u,isString as s}from"lodash-es";import"../../../index.js";import{useCommonInjection as c}from"../../hooks/useCommonInjection.js";import{InjectionAsyncQueue as p,InjectionFormUUID as d}from"../../constants/index.js";import"../../../../../shared/utils/index.js";import"../../utils/index.js";import{useFormField as m}from"../../hooks/useFormField.js";import{NCascader as v}from"naive-ui";import"@vueuse/core";import"date-fns";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"../../../../../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"../../hooks/useFormValidator.js";import"@formily/core";import"@formily/reactive";import{connect as f,mapProps as y}from"@formily/vue";import"@vue/shared";import"./index.js";import"../../hooks/useFormRenderOptions.js";import{createVisitedSetter as h,assignUpdateValue as j,traverseDependKey as k}from"../../utils/schema.js";const b=f(e({name:"FormCascader",props:{options:{type:Array,default:()=>[]},depth:{type:[Number,String]},urlConfig:{type:Object},requestCache:{type:Boolean,default:!0},onFocus:{type:Function},filterable:{type:Boolean,default:!1},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},onChange:{},value:{}},emits:["update:value"],setup(e,{slots:f,emit:y}){const j=t(),{field:b,title:C}=m(),g=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.nameKey)?a:e.labelField)?l:"text"})),F=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.valueKey)?a:e.valueField)?l:"value"})),S=a((()=>{try{const t=Array.isArray(e.value)?e.value:JSON.parse(e.value||"");return Array.isArray(t)&&t.length?t.map((e=>e[g.value])).join(" / "):null}catch(e){return null}}));function w(e,t,a){y("update:value",u(a)?a.map((function(e){return{...e,label:e[g.value],children:void 0,parent:void 0}})):null)}const A=l(p);async function H(t){e.filterable?await async function(){if(!e.urlConfig||j.value&&e.requestCache)return;const t=await A.addAsync({...e.urlConfig,params:{lvlnr:"1"},key:C.value,cache:e.requestCache});function a(e,t){const l={[g.value]:e[g.value],[F.value]:e[F.value],depth:t+1,isLeaf:!0,keyword:e.keyword};return u(e.children)&&(l.children=e.children.map((e=>a(e,t+1))),l.isLeaf=!e.children.length),l}j.value=t.map((e=>a(e,0)))}():await async function(t){if(r(e,t))return;const a=await A.addAsync(o(s(t),u(e),C.value,t));if(!a.length&&t)return t.isLeaf=!0,w(0,0,n(t)),void(E.value=!1);const l=a.map((e=>i(e,s(t))));function r(e,t){return!u(e)||!t&&j.value&&e.requestCache||s(t)>=s(e)-1}function o(t,a,l,r){const o={lvlnr:t+1+""};return r&&a.dependKey&&k(a.dependKey,((e,t)=>{o[t]=r[e]})),{params:o,...a,key:l,cache:e.requestCache}}function n(e){let t=e;const a=[e];for(;t.parent;)a.unshift(t.parent),t=t.parent;return a}function i(a,l){return{[g.value]:a[g.value],[F.value]:a[F.value],depth:l+1,parent:t,isLeaf:l+2>=s(e)}}function u(e){return e.urlConfig}function s(e){var t;return null!=(t=null==e?void 0:e.depth)?t:-1}t?t.children=l:j.value=l}(t),await L()}const x=`form-render__cascade--menu-${l(d)}`;async function L(){await n();const e=document.querySelector(`.${x} .v-vl`);e&&e.dispatchEvent(new CustomEvent("scroll"))}function q(e,t){if(!e||!t)return!1;const{keyword:a,[g.value]:l}=t;return s(a)?a.split(",").some((t=>t.includes(e))):!!s(l)&&l.includes(e)}const{injectValueValidate:B,injectValueWatchFromEmpty:K,injectValueBindKey:V}=c();K((()=>e.value),H),B((()=>e.value)),r((()=>e.urlConfig),(async(e,t)=>{i(e,t)||(j.value=null,await H())}));const E=t(!1);function O(e){E.value=!!e,e&&H()}const W=a((()=>j.value||e.options||[])),N=a((()=>!e.filterable)),P=V(S);return()=>o(v,{key:P.value,remote:N.value,filterable:e.filterable,"menu-props":{class:x,onClick:L},checkStrategy:"child",show:!!E.value,"onUpdate:show":O,value:S.value,filter:q,"onUpdate:value":w,labelField:g.value,valueField:F.value,options:W.value,onLoad:H,onFocus:h(b)},f)}}),y({dataSource:"options"},j));export{b as SEARCH_CASCADER};
1
+ import{defineComponent as e,ref as t,computed as a,inject as l,watch as r,createVNode as o,nextTick as n}from"vue";import{isEqual as i,isArray as u,isString as s}from"lodash-es";import"../../../index.js";import{useCommonInjection as c}from"../../hooks/useCommonInjection.js";import{InjectionAsyncQueue as p,InjectionFormUUID as d}from"../../constants/index.js";import"../../../../../shared/utils/index.js";import"../../utils/index.js";import{useFormField as m}from"../../hooks/useFormField.js";import{NCascader as v}from"naive-ui";import"@vueuse/core";import"date-fns";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"../../../../../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"../../hooks/useFormValidator.js";import"@formily/core";import"@formily/reactive";import{connect as f,mapProps as y}from"@formily/vue";import"@vue/shared";import"./index.js";import"../../hooks/useFormRenderOptions.js";import{createVisitedSetter as h,assignUpdateValue as j,traverseDependKey as k}from"../../utils/schema.js";const b=f(e({name:"FormCascader",props:{options:{type:Array,default:()=>[]},depth:{type:[Number,String]},urlConfig:{type:Object},requestCache:{type:Boolean,default:!0},onFocus:{type:Function},filterable:{type:Boolean,default:!1},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},onChange:{},value:{}},emits:["update:value"],setup(e,{slots:f,emit:y}){const j=t(),{field:b,title:C}=m(),g=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.nameKey)?a:e.labelField)?l:"text"})),F=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.valueKey)?a:e.valueField)?l:"value"})),S=a((()=>{try{const t=Array.isArray(e.value)?e.value:JSON.parse(e.value||"");return Array.isArray(t)&&t.length?t.map((e=>e[F.value])).slice(-1).join(""):null}catch(e){return null}}));function w(e,t,a){y("update:value",u(a)?a.map((function(e){return{...e,label:e[g.value],children:void 0,parent:void 0}})):null)}const A=l(p);async function H(t){e.filterable?await async function(){if(!e.urlConfig||j.value&&e.requestCache)return;const t=await A.addAsync({...e.urlConfig,params:{lvlnr:"1"},key:C.value,cache:e.requestCache});function a(e,t){const l={[g.value]:e[g.value],[F.value]:e[F.value],depth:t+1,isLeaf:!0,keyword:e.keyword};return u(e.children)&&(l.children=e.children.map((e=>a(e,t+1))),l.isLeaf=!e.children.length),l}j.value=t.map((e=>a(e,0)))}():await async function(t){if(r(e,t))return;const a=await A.addAsync(o(s(t),u(e),C.value,t));if(!a.length&&t)return t.isLeaf=!0,w(0,0,n(t)),void(E.value=!1);const l=a.map((e=>i(e,s(t))));function r(e,t){return!u(e)||!t&&j.value&&e.requestCache||s(t)>=s(e)-1}function o(t,a,l,r){const o={lvlnr:t+1+""};return r&&a.dependKey&&k(a.dependKey,((e,t)=>{o[t]=r[e]})),{params:o,...a,key:l,cache:e.requestCache}}function n(e){let t=e;const a=[e];for(;t.parent;)a.unshift(t.parent),t=t.parent;return a}function i(a,l){return{[g.value]:a[g.value],[F.value]:a[F.value],depth:l+1,parent:t,isLeaf:l+2>=s(e)}}function u(e){return e.urlConfig}function s(e){var t;return null!=(t=null==e?void 0:e.depth)?t:-1}t?t.children=l:j.value=l}(t),await L()}const x=`form-render__cascade--menu-${l(d)}`;async function L(){await n();const e=document.querySelector(`.${x} .v-vl`);e&&e.dispatchEvent(new CustomEvent("scroll"))}function q(e,t){if(!e||!t)return!1;const{keyword:a,[g.value]:l}=t;return s(a)?a.split(",").some((t=>t.includes(e))):!!s(l)&&l.includes(e)}const{injectValueValidate:B,injectValueWatchFromEmpty:K,injectValueBindKey:V}=c();K((()=>e.value),H),B((()=>e.value)),r((()=>e.urlConfig),(async(e,t)=>{i(e,t)||(j.value=null,await H())}));const E=t(!1);function O(e){E.value=!!e,e&&H()}const W=a((()=>j.value||e.options||[])),N=a((()=>!e.filterable)),P=V(S);return()=>o(v,{key:P.value,remote:N.value,filterable:e.filterable,"menu-props":{class:x,onClick:L},checkStrategy:"child",show:!!E.value,"onUpdate:show":O,value:S.value,filter:q,"onUpdate:value":w,labelField:g.value,valueField:F.value,options:W.value,onLoad:H,onFocus:h(b)},f)}}),y({dataSource:"options"},j));export{b as SEARCH_CASCADER};
@@ -1 +1 @@
1
- import{arrayed as t}from"../../../../shared/utils/index.js";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"../../../../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{FIELD_BUSINESS_TYPE as a}from"../constants/index.js";function l(){const l=new e(["fieldItem"]);l.tap("__block",(t=>(["CHECKBOX_BLOCK","RADIO_BLOCK"].includes(t.html_type)&&(t.__vertical=!0),t))),l.tap("__age",(e=>("AGE"===e.html_type&&(e.html_type="INPUT_NUMBER",e.reactions=e.reactions?t(e.reactions):[],e.reactions.push({target:e.val_key_unit,fulfill:{state:{disabled:"{{$self.disabled}}"}}}),e.suffixConfig=[{validate:{obj_type:a.AGE_UNIT},val_key:e.val_key_unit,html_type:"SELECT",option:e.option,urlConfig:e.urlConfig}]),e))),l.tap("__search_more",(t=>("SEARCH_MORE"===t.html_type&&(t.__multiple=!0),t)));const o=[[["SEARCH","PHONE_TYPE","IDCARD_TYPE","SEARCH_MORE"],"SELECT"],["DIGITAL","INPUT_NUMBER"],["CHECKBOX_BLOCK","CHECKBOX"],["RADIO_BLOCK","RADIO"],[["DATE-INPUT","DATETIME-INPUT"],"DATE"],["SWITCH_COMPONENT","SWITCH"],["SLIDER_COMPONENT","SLIDER"],["LEVEL_SEARCH_CASCADE","LEVEL_SEARCH_CASCADER"],["SEARCH_CASCADE","SEARCH_CASCADER"]];return l.tap("__normalize",(t=>(o.some((([e,a])=>(Array.isArray(e)?e.includes(t.html_type):e===t.html_type)&&(t.html_type=a))),t))),{FieldNormalizeWaterfallHook:l}}export{l as useFieldNormalize};
1
+ import{arrayed as t}from"../../../../shared/utils/index.js";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"../../../../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{FIELD_BUSINESS_TYPE as l}from"../constants/index.js";function a(){const a=new e(["fieldItem"]);a.tap("__block",(t=>(["CHECKBOX_BLOCK","RADIO_BLOCK"].includes(t.html_type)&&(t.__vertical=!0),t))),a.tap("__age",(e=>("AGE"===e.html_type&&(e.html_type="INPUT_NUMBER",e.reactions=e.reactions?t(e.reactions):[],e.reactions.push({target:e.val_key_unit,fulfill:{state:{disabled:"{{$self.disabled}}"}}}),e.suffixConfig=[{validate:{obj_type:l.AGE_UNIT},val_key:e.val_key_unit,html_type:"SELECT",option:e.option,urlConfig:e.urlConfig}]),e))),a.tap("__multiple_select",(t=>{const{html_type:e,multi_select:l,__multiple:a}=t;return t.__multiple="SEARCH"!==e&&("SEARCH_MORE"===e||("SELECT"===e?"0"===l:a)),t}));const s=[[["SEARCH","PHONE_TYPE","IDCARD_TYPE","SEARCH_MORE"],"SELECT"],["DIGITAL","INPUT_NUMBER"],["CHECKBOX_BLOCK","CHECKBOX"],["RADIO_BLOCK","RADIO"],[["DATE-INPUT","DATETIME-INPUT"],"DATE"],["SWITCH_COMPONENT","SWITCH"],["SLIDER_COMPONENT","SLIDER"],["LEVEL_SEARCH_CASCADE","LEVEL_SEARCH_CASCADER"],["SEARCH_CASCADE","SEARCH_CASCADER"]];return a.tap("__normalize",(t=>(s.some((([e,l])=>(Array.isArray(e)?e.includes(t.html_type):e===t.html_type)&&(t.html_type=l))),t))),{FieldNormalizeWaterfallHook:a}}export{a as useFieldNormalize};
@@ -145,6 +145,11 @@ export declare type FieldItem = {
145
145
  placeholder: string;
146
146
  validate: ValidateItem;
147
147
  option: FormOptionItem[];
148
+ /**
149
+ * 是否开启多选('0'表示开启, 值是反的)
150
+ * 仅在html_type为SELECT时生效
151
+ */
152
+ multi_select: FormCommonState;
148
153
  /**
149
154
  * 多选时最大选择数量
150
155
  */
@@ -1 +1 @@
1
- import{cloneDeep as e,isString as t,isFunction as i,pick as n,isArray as a}from"lodash-es";import{isObject as o}from"@vue/shared";const r=Symbol("remove property");function l(){return{formConfigLikeAdaptor:function(l){const s={};return o(l)?{fieldList:function(l){const p=new Map([["NONE",0],["LEFT",1],["RIGHT",2]]),m=new Map([["0",!0],["1",!1]]),u=new Map([["0",0],["1",1]]),d=new Map([...["RADIO","RADIO_BLOCK","CHECKBOX","CHECKBOX_BLOCK","SELECT","SWITCH_COMPONENT"].map((e=>[e,"select"])),...["DATE"].map((e=>[e,"date"])),...["INPUT"].map((e=>[e,"input"])),...["DIGITAL"].map((e=>[e,"number"]))]),c=(e,t)=>{if(!o(e))return;const i={label:e.describe,...e};t.options=a(t.options)?[...t.options,i]:[i]},f=new Map([["multi_select_value",{property:"multiple",valueMap:m}],["is_null",(e,t,i,n)=>{"1"!==e&&"0"===e&&(n[i.val_key]=[{required:!0,message:"必填"}])}],["validate",(e,t)=>{if(!o(e))return;t.componentProps=Object.assign({},t.comonentProps,Object.entries({maxlength:"max_length",minlength:"min_length",max:"max_value",min:"min_value",precision:"decimal_length"}).reduce(((t,[i,n])=>(t[i]=e[n],t)),{}))}],["dateValidate",(e,t)=>{o(e)&&(t.isDateDisabled=(t,i)=>{if(!o(i))return;const{startDate:n,endDate:a}=e;let r=!1;return n&&(r=new Date(i[n]).getTime()>t),a&&(r=r||new Date(i[a]).getTime()<t),r})}],["date_format","valueFormat"],...["open","close"].map((e=>[e,c])),["is_edit",{property:"isEdit",valueMap:u}],["html_type",(e,i,n)=>{var a;t(e)&&(i.formType="DATE"!==e?null!=(a=d.get(e))?a:e:t(n.date_format)&&n.date_format.startsWith("HH:mm")?"time":"date")}],["option",{property:"options",fieldMap:new Map([["text","label"]])}],["alias",(e,t,i)=>{t.title=`${e}${i.suffix?`(${i.suffix})`:""}`}]]),v=new Map([["sum","isSum"],["show","isShow"],["elementId","columnName"],["columnWidth","colWidth"],["fixedWayEnum",{property:"isFixed",valueMap:p}],["multi_select_value",{property:"multiple",valueMap:m}],["setting",{fieldMap:f,assign:!0}]]);return l.map((e=>_(e,s,v)));function _(l,s,p){if(!p)return e(l);const m={};return Object.entries(l).forEach((([e,n])=>{const a=p.get(e);return a?a!==r?t(a)?m[a]=n:i(a)?a(n,m,l,s):void(o(a)&&(a.assign?Object.assign(m,u(n,a)):m[a.property||e]=u(n,a))):void 0:m[e]=n})),m.componentProps=Object.assign({},m.componentProps,n(m,["options","multiple","isDateDisabled"])),m;function u(e,t){var n,r;return!o(t)||i(t)?e:a(e)?e.map((e=>u(e,t))):o(e)?_(e,s,t.fieldMap):null!=(r=null==(n=t.valueMap)?void 0:n.get(e))?r:e}}}(l.fieldList),editRules:s}:{fieldList:[],editRules:s}}}}export{l as useColumnConfigAdaptor};
1
+ import{cloneDeep as e,isString as t,isFunction as n,pick as o,isArray as i,isNumber as a}from"lodash-es";import{isObject as r}from"@vue/shared";const s=Symbol("remove property");function l(){return{formConfigLikeAdaptor:function(l){const p={};return r(l)?{fieldList:function(l){const m=new Map([["NONE",0],["LEFT",1],["RIGHT",2]]),u=new Map([["0",0],["1",1]]),c=new Map([...["RADIO","RADIO_BLOCK","CHECKBOX","CHECKBOX_BLOCK","SELECT","SEARCH","SEARCH_MORE","SWITCH_COMPONENT"].map((e=>[e,"select"])),...["DATE"].map((e=>[e,"date"])),...["INPUT"].map((e=>[e,"input"])),...["DIGITAL"].map((e=>[e,"number"]))]),d=(e,t)=>{if(!r(e))return;const n={label:e.describe,...e};t.options=i(t.options)?[...t.options,n]:[n]},f=(e,n)=>{0!==e&&"0"!==e&&(t(e)||a(e))&&(n.componentProps={maxTagCount:+e,...n.componentProps})},_=new Map([["multi_select_value",f],["is_null",(e,t,n,o)=>{"1"!==e&&"0"===e&&(o[n.val_key]=[{required:!0,message:"必填"}])}],["validate",(e,t)=>{if(!r(e))return;t.componentProps=Object.assign({},t.comonentProps,Object.entries({maxlength:"max_length",minlength:"min_length",max:"max_value",min:"min_value",precision:"decimal_length"}).reduce(((t,[n,o])=>(t[n]=e[o],t)),{}))}],["dateValidate",(e,t)=>{r(e)&&(t.isDateDisabled=(t,n)=>{if(!r(n))return;const{startDate:o,endDate:i}=e;let a=!1;return o&&(a=new Date(n[o]).getTime()>t),i&&(a=a||new Date(n[i]).getTime()<t),a})}],["date_format","valueFormat"],...["open","close"].map((e=>[e,d])),["is_edit",{property:"isEdit",valueMap:u}],["html_type",(e,n,o)=>{var i;if(!t(e))return;if("DATE"===e)return void(n.formType=t(o.date_format)&&o.date_format.startsWith("HH:mm")?"time":"date");n.formType=null!=(i=c.get(e))?i:e;const a="SEARCH"!==e&&("SEARCH_MORE"===e||("SELECT"===e?"0"===o.multi_select:null));a&&(n.componentProps={multiple:a,...n.componentProps})}],["option",{property:"options",fieldMap:new Map([["text","label"]])}],["alias",(e,t,n)=>{t.title=`${e}${n.suffix?`(${n.suffix})`:""}`}]]),g=new Map([["sum","isSum"],["show","isShow"],["elementId","columnName"],["columnWidth","colWidth"],["fixedWayEnum",{property:"isFixed",valueMap:m}],["multi_select_value",f],["setting",{fieldMap:_,assign:!0}]]);return l.map((e=>E(e,p,g)));function E(a,l,p){if(!p)return e(a);const m={};return Object.entries(a).forEach((([e,o])=>{const i=p.get(e);return i?i!==s?t(i)?m[i]=o:n(i)?i(o,m,a,l):void(r(i)&&(i.assign?Object.assign(m,u(o,i)):m[i.property||e]=u(o,i))):void 0:m[e]=o})),m.componentProps=Object.assign({},m.componentProps,o(m,["options","maxTagCount","isDateDisabled"])),m;function u(e,t){var o,a;return!r(t)||n(t)?e:i(e)?e.map((e=>u(e,t))):r(e)?E(e,l,t.fieldMap):null!=(a=null==(o=t.valueMap)?void 0:o.get(e))?a:e}}}(l.fieldList),editRules:p}:{fieldList:[],editRules:p}}}}export{l as useColumnConfigAdaptor};
@@ -1 +1 @@
1
- import{reactive as e,onBeforeUnmount as i,inject as t,createVNode as o,mergeProps as n}from"vue";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as l,InjectionIhoTableUUID as r}from"../../../../constants/index.js";import{createIhoTableClearActivedInterceptor as d,IhoTableUtils as s,IhoTableRenderHelper as u}from"../../../../utils/index.js";import p from"./editSelect.js";import{getDefaultValue as a}from"./selectUtils.js";import{defineTablePlugin as c}from"../../../../hooks/useTablePlugin.js";function f(){const f="selectRendererPlugin",m=e(new Map),E=e(new Map);function v(e={}){return{renderCell({props:e},{row:i,column:n}){var l;const d=t(r),s=(null==(l=m.get(d).find((e=>e.field===n.field)))?void 0:l.options)||[],u=a(i,e,s);return[o("span",null,[u])]},renderEdit:u.createRenderEdit((({fieldItem:i,emitFormClick:l,row:d,column:s,$rowIndex:u})=>{var a;const c=t(r),f=(null==(a=m.get(c).find((e=>e.field===s.field)))?void 0:a.options)||[];return[o(p,n({queryOptions:i.queryOptions,options:f},e,i.componentProps,{column:s,row:d,"row-index":u,value:d[s.field],"onUpdate:value":e=>d[s.field]=e,onClick:l}),null)]}))}}return c({name:f,vxe(e){e.interceptor.add("event.clearActived",d([l.SELECT,l.SELECT_MORE],(e=>e.classList.contains("iho-table__selectMenu")))),e.renderer.add(l.SELECT,v()),e.renderer.add(l.SELECT_MORE,v({multiple:!0}))},apply(e){e.fieldHooks.fieldList.tap(f,((e,{uuid:i})=>(i&&(E.set(i,e),m.set(i,[])),e))),e.fieldHooks.fieldEnd.tapPromise(f,(async({uuid:e},{$table:i})=>{if(!e)return;const t=E.get(e),o=m.get(e);t.forEach((async i=>{var t,n;if(i.field&&(null==(t=i.editRender)?void 0:t.props)&&["SELECT","SELECT_MORE"].includes(s.getCellType(i.editRender.props))){if(o.findIndex((e=>e.field===i.field))>-1)return;let t=i.options||[];if(i.queryOptions)try{const e={keyword:"",column:i,isFullData:!0};t=await(null==(n=i.queryOptions)?void 0:n.call(i,e))}catch(e){console.log(`获取${i.field}_options错误`)}o.push({field:i.field,options:t}),m.set(e,o)}}))})),e.setupHooks.setup.tap(f,(e=>{i((()=>{e.value.uuid&&(E.delete(e.value.uuid),m.delete(e.value.uuid))}))}))}})}export{f as selectRendererPlugin};
1
+ import{reactive as e,inject as t,createVNode as o,mergeProps as i,onBeforeUnmount as n}from"vue";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as l,InjectionIhoTableUUID as r}from"../../../../constants/index.js";import{createIhoTableClearActivedInterceptor as s,IhoTableRenderHelper as d,IhoTableUtils as u}from"../../../../utils/index.js";import p from"./editSelect.js";import{getDefaultValue as a}from"./selectUtils.js";import{defineTablePlugin as c}from"../../../../hooks/useTablePlugin.js";function f(){const f="selectRendererPlugin",m=e(new Map),v=e(new Map);return c({name:f,vxe(e){e.interceptor.add("event.clearActived",s(l.SELECT,(e=>e.classList.contains("iho-table__selectMenu")))),e.renderer.add(l.SELECT,{renderCell({props:e},{row:i,column:n}){const l=t(r),s=m.get(l)[n.field]||[];return[o("span",null,[a(i,e,s)])]},renderEdit:d.createRenderEdit((({fieldItem:e,emitFormClick:n,row:l,column:s,$rowIndex:d})=>{const u=t(r),a=m.get(u)[s.field]||[];return[o(p,i({queryOptions:e.queryOptions,options:a},e.componentProps,{column:s,row:l,"row-index":d,value:l[s.field],"onUpdate:value":e=>l[s.field]=e,onClick:n}),null)]}))})},apply(e){e.fieldHooks.fieldList.tap(f,((e,{uuid:t})=>(t&&(v.set(t,e),m.set(t,{})),e))),e.fieldHooks.fieldEnd.tapPromise(f,(async({uuid:e})=>{if(!e)return;const t=v.get(e),o=m.get(e);t.forEach((async e=>{var t,i;const n=null==(t=e.editRender)?void 0:t.props;if(e.field&&n&&"SELECT"===u.getCellType(n)){if(o[e.field])return;let t=n.options||[];if(n.queryOptions)try{const o={column:e,isFullData:!0};t=await(null==(i=n.queryOptions)?void 0:i.call(n,o))}catch(e){console.log(`获取${n.field}_options错误`)}o[e.field]=t}}))})),e.setupHooks.setup.tap(f,(e=>{n((()=>{e.value.uuid&&(v.delete(e.value.uuid),m.delete(e.value.uuid))}))}))}})}export{f as selectRendererPlugin};
@@ -1,2 +1,3 @@
1
+ import { AnyObject } from '../../../../../../../../es/shared/types';
1
2
  import { LowCodeTableFieldItem } from '../../../../../../../../es/components/iho-table/src/types';
2
- export declare function getDefaultValue(row: any, item: LowCodeTableFieldItem | any, options?: never[]): any;
3
+ export declare function getDefaultValue(row: any, item: LowCodeTableFieldItem | any, options?: AnyObject[]): any;
@@ -1 +1 @@
1
- import{defineComponent as e,inject as t,ref as o,computed as l,provide as n,watch as r,onMounted as a,createVNode as s,h as i,unref as u,onBeforeUnmount as c,shallowReactive as d}from"vue";import{traverse as p}from"../../../../../shared/utils/index.js";import{doAnimation as f}from"../../../../../shared/utils/anime.js";import{useThrottleFn as m}from"@vueuse/core";import{promiseTimeout as h}from"@vueuse/shared";import{isFunction as g,last as v,omit as x}from"lodash-es";import"../../../index.js";import{InjectionIhoTableUUID as I,WIDGET_TYPE as b}from"../../constants/index.js";import{useUUIDMap as w}from"../../utils/index.js";import{defineTablePlugin as y}from"../../hooks/useTablePlugin.js";class T{constructor(){this.records={},this.maxRecords=d(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:R,removeItemFromUUID:H}=w((()=>new T),!0),{getItemFromUUID:D,removeItemFromUUID:M,setItemFromUUID:S}=w((()=>null)),{getItemFromUUID:U,removeItemFromUUID:C,setItemFromUUID:$}=w((()=>{})),E=e({props:{payload:{type:Object,required:!0}},setup(e){const u=t(I),c=t("$xetable"),d=o(),p=R(u),f=l((()=>e.payload.row[e.payload.column.field]));function m(){const{row:t,column:o}=e.payload,l=c.getRowSeq(t);if(!p||null==l||!d.value)return;const n=d.value.clientHeight;p.set(l,o.field,n)}n("updateCellHeight",m),r([()=>e.payload.rowIndex,()=>e.payload.column.field,f,()=>e.payload.column.renderWidth],(async()=>{await h(0),m()})),a((()=>{c&&!D(u)&&S(u,c),m()}));const v=l((()=>{var t,o,l,n;const r=null!=(o=null==(t=e.payload.column.editRender)?void 0:t.props)?o:{},a=null!=(n=null==(l=r.slots)?void 0:l.default)?n:r.slotFn;return g(a)?a:()=>f.value}));return()=>s("div",{ref:d,style:"padding:7px 0"},[i(v.value,e.payload)])}});function k(e,t,{scrollTop:o=0}){var l,n;const{uuid:r,rowConfig:a={}}=t;if(!r)return;const s=R(r),{oSize:i=0,gt:c=100}=null!=(l=U(r))?l:{},{internalData:d,reactData:p}=e,{scrollYStore:f,elemStore:m,afterFullData:h,fullDataRowIdData:x}=d;if(c>h.length)return;const I=null!=(n=a.height)?n:36,b=m["main-body-wrapper"],w=b?u(b):null;let y=w?Math.max(8,Math.ceil(w.clientHeight/I)+2+i):8;const T=[0];let H=0;if(o&&h.find(((t,l)=>{const n=e.getRowSeq(t),r=(v(T)||0)+Math.max(I,s.getMax(n));if(T.push(r),r>o)return H=Math.max(0,l-i),y+=Math.min(H,i),!0})),H>0&&g(t.spanMethod)){const{spanMethod:o}=t,l={rowspan:1,colspan:1};for(;H>0;){if(!e.getColumns().some(((e,t)=>{const{rowspan:n,colspan:r}=o({column:e,columnIndex:t,$columnIndex:t,row:h[H],rowIndex:H,$rowIndex:H,_rowIndex:H,isHidden:!e.visible,fixed:e.fixed,type:e.type,visibleData:h})||l;if(0===n&&0===r)return H--,!0})))break}}const D=`${T[H]}px`,M=`${h.reduce(((t,o)=>{const l=e.getRowSeq(o);return t+Math.max(I,s.getMax(l))}),0)}px`;["main","left","right"].forEach((e=>{const t=m[`${e}-body-table`],l=t?u(t):null;l&&(l.style.marginTop=D,l.scrollTop=o),["header","body","footer"].forEach((t=>{const o=m[`${e}-${t}-ySpace`],l=o?u(o):null;l&&(l.style.height=M)}))}));const S=Math.min(h.length,H+y);if(f.startIndex===H&&f.endIndex===S)return;f.startIndex=H,f.endIndex=S;const C=h.slice(f.startIndex,f.endIndex);C.forEach(((t,o)=>{const l=e.getRowid(t),n=x[l];n&&(n.$index=o)})),p.tableData.length=0,p.tableData.push(...C)}const F=m(k,300);function j(){const e="variableHeightRendererPlugin";return y({name:e,vxe(e){e.renderer.add(b.VARIABLE_HEIGHT,{renderCell:(e,t)=>s(E,{payload:t},null)})},apply(t){function o(e){const t=D(e.uuid);if(!t)return;e.scrollY={enabled:!1},t.reactData.scrollYLoad=!1;const o=function(e){const t=e.internalData.elemStore["main-body-wrapper"];return t?u(t):null}(t);o&&k(t,e,{scrollTop:o.scrollTop})}function l(e){if(!e.uuid)return;const t=U(e.uuid);t&&(e.scrollY=t),setTimeout((()=>o(e)),300)}t.dataHooks.dataStart.tap(e,l),t.eventHooks.onFilterChange.tap(e,((e,t)=>l(t))),t.eventHooks.onSortChange.tap(e,((e,t)=>l(t))),t.eventHooks.onToggleTreeExpand.tap(e,((e,t)=>l(t))),t.eventHooks.onResizableChange.tap(e,(async({column:e},t)=>{if(!e.editRender||!e.editRender.props)return;e.editRender.props.variableHeight&&l(t)})),t.eventHooks.onScroll.tap(e,m(((e,t)=>{if(e.isX)return;const{uuid:o}=t;if(!o)return;const l=D(o);l&&k(l,t,e)}),100,!0,!0)),t.fieldHooks.field.tap(e,(e=>{if(Reflect.get(e,"variableHeight")){const t=e.slots;e.slots=x(t,["default"]),e.editRender={...e.editRender,name:b.VARIABLE_HEIGHT};const o=e.className,l="variable-height";e.className=o?function(e){return g(o)?[o(e),l]:[o,l]}:l}return e})),t.fieldHooks.fieldList.tap(e,((e,t,{$table:l})=>(t.uuid&&p(e,((n,r)=>{var a,s,i;if((null==(a=n.editRender)?void 0:a.name)===b.VARIABLE_HEIGHT){const n=null!=(i=null==(s=t.rowConfig)?void 0:s.height)?i:36,a=R(t.uuid),c=t.cellStyle;if(t.cellStyle=function(e){const t={};if(e.column.fixed&&Reflect.get(e,"fixed")&&l.value){const o=Math.max(n,a.getMax(l.value.getRowSeq(e.row)));t.height=`${o}px`}return Object.assign(t,c?g(c)?c(e):c:null)},t.sortableConfig&&t.sortableConfig.enable){const e=t.sortableConfig.onEnd;t.sortableConfig.onEnd=function(o){const l=D(t.uuid);if(l){const{internalData:{elemStore:e}}=l,o=e["main-table-body"];o&&u(o)&&k(l,t,{scrollTop:u(o).scrollTop})}g(e)&&e(o)}}t.showOverflow="tooltip",p(e,(e=>{e.showOverflow="tooltip"})),t.scrollY={...t.scrollY,mode:"default"},t.onWheel=function(e){let t=null,o=0,l=!0;return function(n){if(!e.uuid)return;const r=D(e.uuid);if(!r)return;const{internalData:a}=r,{isHover:s}=e.rowConfig||{},{deltaX:i,deltaY:c}=n,{refTableLeftBody:d,refTableRightBody:p,refTableBody:m}=r.getRefMaps(),h=c,g=i,v=h<0,x=u(m),I=x?x.$el:null;if(!I)return;if(v?I.scrollTop<=0:I.scrollTop>=I.scrollHeight-I.clientHeight)return;const b=I.scrollTop+h,w=I.scrollLeft+g;if(b===a.lastScrollTop)return;n.preventDefault(),a.lastScrollTop=b,a.lastScrollLeft=w,a.lastScrollTime=Date.now(),s&&r.clearHoverRow();const y=d.value,T=p.value,R=y?y.$el:null,H=T?T.$el:null,M=Math.min(100,Math.abs(Math.floor(h/2)));l&&(o=I.scrollTop,l=!1),o+=M*(v?-1:1),t&&t(),t=f(I.scrollTop,o,400,(e=>{I.scrollTop=e,R&&(R.scrollTop=e),H&&(H.scrollTop=e)}),"easeOutCubic",(()=>{o=I.scrollTop,l=!0})),F(r,e,I)}}(t),setTimeout((()=>{$(t.uuid,t.scrollY),o(t)}),300),r()}})),e))),t.setupHooks.setup.tap(e,(e=>{c((()=>{e.value.uuid&&(H(e.value.uuid),M(e.value.uuid),C(e.value.uuid))}))}))}})}export{j as variableHeightRendererPlugin};
1
+ import{defineComponent as e,inject as t,ref as o,computed as l,provide as n,watch as r,onMounted as a,createVNode as s,h as i,unref as u,onBeforeUnmount as c,shallowReactive as d}from"vue";import{widthAppend as p,traverse 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{isFunction as v,isNumber as x,last as I,omit as b}from"lodash-es";import"../../../index.js";import{InjectionIhoTableUUID as w,WIDGET_TYPE as y}from"../../constants/index.js";import{useUUIDMap as T}from"../../utils/index.js";import{defineTablePlugin as R}from"../../hooks/useTablePlugin.js";class H{constructor(){this.records={},this.maxRecords=d(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:D,removeItemFromUUID:M}=T((()=>new H),!0),{getItemFromUUID:S,removeItemFromUUID:U,setItemFromUUID:C}=T((()=>null)),{getItemFromUUID:$,removeItemFromUUID:E,setItemFromUUID:k}=T((()=>{})),F=e({props:{payload:{type:Object,required:!0}},setup(e){const u=t(w),c=t("$xetable"),d=o(),f=D(u),m=l((()=>e.payload.row[e.payload.column.field]));function h(){const{row:t,column:o}=e.payload,l=c.getRowSeq(t);if(!f||null==l||!d.value)return;const n=d.value.clientHeight;f.set(l,o.field,n)}n("updateCellHeight",h),r([()=>e.payload.rowIndex,()=>e.payload.column.field,m,()=>e.payload.column.renderWidth],(async()=>{await g(0),h()})),a((()=>{c&&!S(u)&&C(u,c),h()}));const I=l((()=>{var t,o,l,n;const r=null!=(o=null==(t=e.payload.column.editRender)?void 0:t.props)?o:{},a=null!=(n=null==(l=r.slots)?void 0:l.default)?n:r.slotFn;return v(a)?a:()=>m.value})),b=l((()=>{const t=e.payload.column.renderWidth;return x(t)&&t>0?p(t-20-2):""}));return()=>s("div",{ref:d,style:{padding:"7px 0",width:b.value}},[i(I.value,e.payload)])}});function j(e,t,{scrollTop:o=0}){var l,n;const{uuid:r,rowConfig:a={}}=t;if(!r)return;const s=D(r),{oSize:i=0,gt:c=100}=null!=(l=$(r))?l:{},{internalData:d,reactData:p}=e,{scrollYStore:f,elemStore:m,afterFullData:h,fullDataRowIdData:g}=d;if(c>h.length)return;const x=null!=(n=a.height)?n:36,b=m["main-body-wrapper"],w=b?u(b):null;let y=w?Math.max(8,Math.ceil(w.clientHeight/x)+2+i):8;const T=[0];let R=0;if(o&&h.find(((t,l)=>{const n=e.getRowSeq(t),r=(I(T)||0)+Math.max(x,s.getMax(n));if(T.push(r),r>o)return R=Math.max(0,l-i),y+=Math.min(R,i),!0})),R>0&&v(t.spanMethod)){const{spanMethod:o}=t,l={rowspan:1,colspan:1};for(;R>0;){if(!e.getColumns().some(((e,t)=>{const{rowspan:n,colspan:r}=o({column:e,columnIndex:t,$columnIndex:t,row:h[R],rowIndex:R,$rowIndex:R,_rowIndex:R,isHidden:!e.visible,fixed:e.fixed,type:e.type,visibleData:h})||l;if(0===n&&0===r)return R--,!0})))break}}const H=`${T[R]}px`,M=`${h.reduce(((t,o)=>{const l=e.getRowSeq(o);return t+Math.max(x,s.getMax(l))}),0)}px`;["main","left","right"].forEach((e=>{const t=m[`${e}-body-table`],l=t?u(t):null;l&&(l.style.marginTop=H,l.scrollTop=o),["header","body","footer"].forEach((t=>{const o=m[`${e}-${t}-ySpace`],l=o?u(o):null;l&&(l.style.height=M)}))}));const S=Math.min(h.length,R+y);if(f.startIndex===R&&f.endIndex===S)return;f.startIndex=R,f.endIndex=S;const U=h.slice(f.startIndex,f.endIndex);U.forEach(((t,o)=>{const l=e.getRowid(t),n=g[l];n&&(n.$index=o)})),p.tableData.length=0,p.tableData.push(...U)}const L=h(j,300);function Y(){const e="variableHeightRendererPlugin";return R({name:e,vxe(e){e.renderer.add(y.VARIABLE_HEIGHT,{renderCell:(e,t)=>s(F,{payload:t},null)})},apply(t){function o(e){const t=S(e.uuid);if(!t)return;e.scrollY={enabled:!1},t.reactData.scrollYLoad=!1;const o=function(e){const t=e.internalData.elemStore["main-body-wrapper"];return t?u(t):null}(t);o&&j(t,e,{scrollTop:o.scrollTop})}function l(e){if(!e.uuid)return;const t=$(e.uuid);t&&(e.scrollY=t),setTimeout((()=>o(e)),300)}t.dataHooks.dataStart.tap(e,l),t.eventHooks.onFilterChange.tap(e,((e,t)=>l(t))),t.eventHooks.onSortChange.tap(e,((e,t)=>l(t))),t.eventHooks.onToggleTreeExpand.tap(e,((e,t)=>l(t))),t.eventHooks.onResizableChange.tap(e,(async({column:e},t)=>{if(!e.editRender||!e.editRender.props)return;e.editRender.props.variableHeight&&l(t)})),t.eventHooks.onScroll.tap(e,h(((e,t)=>{if(e.isX)return;const{uuid:o}=t;if(!o)return;const l=S(o);l&&j(l,t,e)}),100,!0,!0)),t.fieldHooks.field.tap(e,(e=>{if(Reflect.get(e,"variableHeight")){const t=e.slots;e.slots=b(t,["default"]),e.editRender={...e.editRender,name:y.VARIABLE_HEIGHT};const o=e.className,l="variable-height";e.className=o?function(e){return v(o)?[o(e),l]:[o,l]}:l}return e})),t.fieldHooks.fieldList.tap(e,((e,t,{$table:l})=>(t.uuid&&f(e,((n,r)=>{var a,s,i;if((null==(a=n.editRender)?void 0:a.name)===y.VARIABLE_HEIGHT){const n=null!=(i=null==(s=t.rowConfig)?void 0:s.height)?i:36,a=D(t.uuid),c=t.cellStyle;if(t.cellStyle=function(e){const t={};if(e.column.fixed&&Reflect.get(e,"fixed")&&l.value){const o=Math.max(n,a.getMax(l.value.getRowSeq(e.row)));t.height=`${o}px`}return Object.assign(t,c?v(c)?c(e):c:null)},t.sortableConfig&&t.sortableConfig.enable){const e=t.sortableConfig.onEnd;t.sortableConfig.onEnd=function(o){const l=S(t.uuid);if(l){const{internalData:{elemStore:e}}=l,o=e["main-table-body"];o&&u(o)&&j(l,t,{scrollTop:u(o).scrollTop})}v(e)&&e(o)}}t.showOverflow="tooltip",f(e,(e=>{e.showOverflow="tooltip"})),t.scrollY={...t.scrollY,mode:"default"},t.onWheel=function(e){let t=null,o=0,l=!0;return function(n){if(!e.uuid)return;const r=S(e.uuid);if(!r)return;const{internalData:a}=r,{isHover:s}=e.rowConfig||{},{deltaX:i,deltaY:c}=n,{refTableLeftBody:d,refTableRightBody:p,refTableBody:f}=r.getRefMaps(),h=c,g=i,v=h<0,x=u(f),I=x?x.$el:null;if(!I)return;if(v?I.scrollTop<=0:I.scrollTop>=I.scrollHeight-I.clientHeight)return;const b=I.scrollTop+h,w=I.scrollLeft+g;if(b===a.lastScrollTop)return;n.preventDefault(),a.lastScrollTop=b,a.lastScrollLeft=w,a.lastScrollTime=Date.now(),s&&r.clearHoverRow();const y=d.value,T=p.value,R=y?y.$el:null,H=T?T.$el:null,D=Math.min(100,Math.abs(Math.floor(h/2)));l&&(o=I.scrollTop,l=!1),o+=D*(v?-1:1),t&&t(),t=m(I.scrollTop,o,400,(e=>{I.scrollTop=e,R&&(R.scrollTop=e),H&&(H.scrollTop=e)}),"easeOutCubic",(()=>{o=I.scrollTop,l=!0})),L(r,e,I)}}(t),setTimeout((()=>{k(t.uuid,t.scrollY),o(t)}),300),r()}})),e))),t.setupHooks.setup.tap(e,(e=>{c((()=>{e.value.uuid&&(M(e.value.uuid),U(e.value.uuid),E(e.value.uuid))}))}))}})}export{Y as variableHeightRendererPlugin};
@@ -67,10 +67,11 @@ export declare namespace IhoTableLowCodeField {
67
67
  [K: string]: unknown;
68
68
  }>;
69
69
  type QueryOptions = (payload: {
70
- keyword: string;
71
- row: AnyObject;
70
+ keyword?: string;
71
+ row?: AnyObject;
72
72
  column: VxeTableDefines.ColumnInfo;
73
- rowIndex: number;
73
+ rowIndex?: number;
74
+ isFullData?: boolean;
74
75
  }) => Promise<AnyObject[]>;
75
76
  }
76
77
  export declare type LowCodeTableFieldItem = {
@@ -94,6 +94,7 @@ declare const ShortcutSetter: SFCWithInstall<import("vue").DefineComponent<{
94
94
  children?: any[] | undefined;
95
95
  childrenFields?: any[] | undefined;
96
96
  }[] | undefined;
97
+ multi_select?: import("..").FormCommonState | undefined;
97
98
  multi_select_value?: string | number | undefined;
98
99
  wordbook?: {
99
100
  level_num?: number | undefined;
@@ -96,6 +96,7 @@ declare const _default: import("vue").DefineComponent<{
96
96
  children?: any[] | undefined;
97
97
  childrenFields?: any[] | undefined;
98
98
  }[] | undefined;
99
+ multi_select?: import("../../../../es/components/form-render").FormCommonState | undefined;
99
100
  multi_select_value?: string | number | undefined;
100
101
  wordbook?: {
101
102
  level_num?: number | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "3.1.42-beta.52",
3
+ "version": "3.1.42-beta.54",
4
4
  "license": "ISC",
5
5
  "module": "./es/components/index.js",
6
6
  "main": "./es/components/index.js",
@@ -61,5 +61,5 @@
61
61
  "iOS 7",
62
62
  "last 3 iOS versions"
63
63
  ],
64
- "gitHead": "c1417496e99e3d7ac593f6faca450a25332446ae"
64
+ "gitHead": "c378ea5cf60376824f2d3cd989a101cca75b7c84"
65
65
  }