cnhis-design-vue 3.1.42-beta.65 → 3.1.42-beta.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/form-render/src/components/renderer/searchCascade.d.ts +9 -0
- package/es/components/form-render/src/components/renderer/searchCascade.js +1 -1
- package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue.d.ts +44 -0
- package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue.js +1 -0
- package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/index.d.ts +1 -0
- package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/index.js +1 -0
- package/es/components/iho-table/src/plugins/index.js +1 -1
- package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/varialbleHeightPlugin/index.js +1 -1
- package/es/components/iho-table/src/types/index.d.ts +4 -0
- package/es/components/iho-table/src/utils/index.d.ts +1 -0
- package/es/components/iho-table/src/utils/index.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
|
@@ -12,6 +12,10 @@ export declare const SEARCH_CASCADER: import("vue").DefineComponent<{
|
|
|
12
12
|
urlConfig: {
|
|
13
13
|
type: PropType<UrlConfig>;
|
|
14
14
|
};
|
|
15
|
+
lazyRequest: {
|
|
16
|
+
type: BooleanConstructor;
|
|
17
|
+
default: boolean;
|
|
18
|
+
};
|
|
15
19
|
requestCache: {
|
|
16
20
|
type: BooleanConstructor;
|
|
17
21
|
default: boolean;
|
|
@@ -48,6 +52,10 @@ export declare const SEARCH_CASCADER: import("vue").DefineComponent<{
|
|
|
48
52
|
urlConfig: {
|
|
49
53
|
type: PropType<UrlConfig>;
|
|
50
54
|
};
|
|
55
|
+
lazyRequest: {
|
|
56
|
+
type: BooleanConstructor;
|
|
57
|
+
default: boolean;
|
|
58
|
+
};
|
|
51
59
|
requestCache: {
|
|
52
60
|
type: BooleanConstructor;
|
|
53
61
|
default: boolean;
|
|
@@ -79,6 +87,7 @@ export declare const SEARCH_CASCADER: import("vue").DefineComponent<{
|
|
|
79
87
|
options: AnyObject[];
|
|
80
88
|
labelField: string;
|
|
81
89
|
valueField: string;
|
|
90
|
+
lazyRequest: boolean;
|
|
82
91
|
requestCache: boolean;
|
|
83
92
|
filterable: boolean;
|
|
84
93
|
checkStrategy: string;
|
|
@@ -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 u,isArray as i,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
|
|
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 u,isArray as i,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 k,traverseDependKey as j}from"../../utils/schema.js";const g=f(e({name:"FormCascader",props:{options:{type:Array,default:()=>[]},depth:{type:[Number,String]},urlConfig:{type:Object},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},onFocus:{type:Function},filterable:{type:Boolean,default:!1},checkStrategy:{type:String,default:"child"},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},onChange:{},value:{}},emits:["update:value"],setup(e,{slots:f,emit:y}){const k=t(),{field:g,title:b}=m(),S=t(1),C=t(!0);const w=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"})),A=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 H(e,t,a){y("update:value",i(a)?a.map((function(e){return{...e,label:e[w.value],children:void 0,parent:void 0,mergeItemValue:void 0}})):null)}const x=l(p);async function q(t){e.filterable?await async function(){if(!e.urlConfig||k.value&&e.requestCache)return;const t=await x.addAsync({...e.urlConfig,params:{lvlnr:"1"},key:b.value,cache:e.requestCache});function a(e,t,r){const o=[...r,...l(e)],n={[w.value]:e[w.value],[F.value]:e[F.value],depth:t+1,isLeaf:!0,keyword:e.keyword,mergeItemValue:o};return i(e.children)&&(n.children=e.children.map((e=>a(e,t+1,o))),n.isLeaf=!e.children.length),S.value=Math.max(S.value,t+1),n}function l(e){let t=[];if(s(e[w.value])&&(t=[...t,e[w.value]]),s(e.keyword)&&e.keyword.length>0){const a=e.keyword.split(",");t=[...t,...a]}return t}k.value=t.map((e=>a(e,0,[])))}():await async function(t){if(r(e,t))return;const a=await x.addAsync(o(s(t),i(e),b.value,t));if(!a.length&&t)return t.isLeaf=!0,H(0,0,n(t)),void(O.value=!1);const l=a.map((e=>u(e,s(t))));function r(e,t){return!i(e)||!t&&k.value&&e.requestCache||s(t)>=s(e)-1}function o(t,a,l,r){const o={lvlnr:t+1+""};return r&&a.dependKey&&j(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 u(a,l){return{[w.value]:a[w.value],[F.value]:a[F.value],depth:l+1,parent:t,isLeaf:l+2>=s(e)}}function i(e){return e.urlConfig}function s(e){var t;return null!=(t=null==e?void 0:e.depth)?t:-1}t?t.children=l:k.value=l}(t),await B()}const V=`form-render__cascade--menu-${l(d)}`;async function B(){await n();const e=document.querySelector(`.${V} .v-vl`);e&&e.dispatchEvent(new CustomEvent("scroll"))}function L(t,a){if(!t||!a)return!1;const{mergeItemValue:l}=a;if(e.checkStrategy.includes("child")&&a.depth<S.value)return!1;return l.length>0&&l.some((e=>e.includes(t.trim())))}const{injectValueValidate:K,injectValueWatchFromEmpty:I,injectValueBindKey:E}=c();I((()=>e.value),q),K((()=>e.value)),r((()=>e.urlConfig),(async(t,a)=>{u(t,a)||(k.value=null,C.value?e.lazyRequest||(q(),C.value=!C.value):await q())}),{immediate:!0});const O=t(!1);function R(e){O.value=!!e,e&&q()}const W=a((()=>k.value||e.options||[])),z=a((()=>!e.filterable)),N=E(A);return()=>o(v,{key:N.value,remote:z.value,filterable:e.filterable,"menu-props":{class:V,onClick:B},"check-strategy":e.checkStrategy,show:!!O.value,"onUpdate:show":R,value:A.value,filter:L,"onUpdate:value":H,labelField:w.value,valueField:F.value,options:W.value,onLoad:q,onFocus:h(g)},f)}}),y({dataSource:"options"},k));export{g as SEARCH_CASCADER};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { VxeColumnPropTypes } from 'vxe-table';
|
|
3
|
+
declare const _default: import("vue").DefineComponent<{
|
|
4
|
+
payload: {
|
|
5
|
+
type: PropType<VxeColumnPropTypes.FilterSlotParams>;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
}, {
|
|
9
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
10
|
+
payload: {
|
|
11
|
+
type: PropType<VxeColumnPropTypes.FilterSlotParams>;
|
|
12
|
+
required: true;
|
|
13
|
+
};
|
|
14
|
+
}>> & {}>>;
|
|
15
|
+
optionRef: {
|
|
16
|
+
label: string | number;
|
|
17
|
+
value: any;
|
|
18
|
+
data: any;
|
|
19
|
+
resetValue: any;
|
|
20
|
+
checked: boolean;
|
|
21
|
+
_checked: boolean;
|
|
22
|
+
};
|
|
23
|
+
onConfirm: (value: [number, number], formattedValue: [string, string] | null) => void;
|
|
24
|
+
CDatePicker: import("../../../../../shared/types").SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
25
|
+
attrs: {
|
|
26
|
+
[x: string]: unknown;
|
|
27
|
+
};
|
|
28
|
+
datePickerRef: import("vue").Ref<import("../../../../../shared/types").AnyObject | null>;
|
|
29
|
+
panelInstRef: import("vue").Ref<null>;
|
|
30
|
+
isDateTime: import("vue").ComputedRef<boolean>;
|
|
31
|
+
formatRef: import("vue").ComputedRef<string>;
|
|
32
|
+
panelFormatRef: import("vue").ComputedRef<string | [string, string]>;
|
|
33
|
+
focus: () => any;
|
|
34
|
+
blur: () => any;
|
|
35
|
+
onUpdateShow: (show: boolean) => void;
|
|
36
|
+
NDatePicker: any;
|
|
37
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
|
|
38
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
39
|
+
payload: {
|
|
40
|
+
type: PropType<VxeColumnPropTypes.FilterSlotParams>;
|
|
41
|
+
required: true;
|
|
42
|
+
};
|
|
43
|
+
}>>, {}>;
|
|
44
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineComponent as e,reactive as a,openBlock as l,createBlock as t,unref as o}from"vue";import r from"../../../../date-picker/index.js";import n from"../../../../../_virtual/plugin-vue_export-helper.js";var i=n(e({__name:"filter",props:{payload:{type:Object,required:!0}},setup(e){var n,i,p;const d=e,u=a((null==(p=null==(i=null==(n=d.payload)?void 0:n.column)?void 0:i.filters)?void 0:p[0])||{data:void 0});function v(e,a){var l;u.value=a,(null==(l=d.payload)?void 0:l.$panel)&&(d.payload.$panel.changeOption(null,!!a,u),d.payload.$panel.confirmFilter(new CustomEvent("click")))}return(e,a)=>(l(),t(o(r),{type:"datetimerange",panel:"",clearable:"","formatted-value":u.data,"onUpdate:formatted-value":a[0]||(a[0]=e=>u.data=e),onConfirm:v},null,8,["formatted-value"]))}}),[["__file","filter.vue"]]);export{i as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function filterDaterangeRenderPlugin(): import("../../../../../../es/components/iho-table").TablePlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createVNode as e}from"vue";import"../../../index.js";import t from"./filter.vue.js";import{isValid as i}from"date-fns";import{isObject as r,isArray as n}from"@vue/shared";import{defineTablePlugin as o}from"../../hooks/useTablePlugin.js";function l(){const l="filterDaterangeRenderPlugin";return o({name:l,vxe(i){i.renderer.mixin({filterDaterangeRenderPlugin:{showFilterFooter:!1,renderFilter:(i,r)=>e(t,{payload:r,key:r.column.field},null)}})},apply(e){e.fieldHooks.field.tap(l,((e,t,o,{$table:l})=>{var a,f,d,s;const u=null==(a=e.editRender)?void 0:a.props;if(!r(u))return e;if(!(null==(f=null==u?void 0:u.filterSetting)?void 0:f.daterange))return e;e.filterRender={name:"filterDaterangeRenderPlugin"};const m=null==(d=l.value)?void 0:d.getColumnByField(e.field),c={};return m&&n(m.filters)&&Object.assign(c,{...(null==(s=m.filters)?void 0:s[0])||{}}),e.filters=[{data:void 0,...c}],e.filterMethod||(e.filterMethod=function({option:e,row:t,column:r}){const{data:n}=e,o=t[r.field];if(!i(new Date(o)))return!1;const l=new Date(o).getTime(),a=new Date(n[0]).getTime(),f=new Date(n[1]).getTime();return l>=a&&l<=f}),e.sortable?e.headerClassName=({$table:e,column:t})=>{const i=["iho-table__hideSortIcon"];return e.isSort(t)&&i.push("is--filter-active"),i}:e.headerClassName="iho-table__hideSortIcon",o.filterConfig={iconMatch:"iho-table--iconfont iho-table-icon-filter",iconNone:"iho-table--iconfont iho-table-icon-filter",...o.filterConfig},e}))}})}export{l as filterDaterangeRenderPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"./anchorPlugin/index.js";import*as r from"./defaultConfigPlugin/index.js";import*as i from"./
|
|
1
|
+
import*as e from"./anchorPlugin/index.js";import*as r from"./defaultConfigPlugin/index.js";import*as i from"./filterDaterangeRenderPlugin/index.js";import*as n from"./filterRenderPlugin/index.js";import*as d from"./highLightSetPlugin.js";import*as s from"./keyboardEventPlugin/index.js";import*as t from"./lowCodeFieldAdaptorPlugin/index.js";import*as l from"./maxCheckSizePlugin.js";import*as g from"./rendererPlugins/editableWidgets/dateRendererPlugin/index.js";import*as u from"./rendererPlugins/editableWidgets/inputRendererPlugin.js";import*as o from"./rendererPlugins/editableWidgets/numberRendererPlugin.js";import*as a from"./rendererPlugins/editableWidgets/selectRendererPlugin/index.js";import*as P from"./rendererPlugins/editableWidgets/separateRendererPlugin/index.js";import*as m from"./rendererPlugins/editableWidgets/timeRendererPlugin/index.js";import*as x from"./rendererPlugins/widgets/checkRendererPlugin.js";import*as f from"./rendererPlugins/widgets/colorRendererPlugin.js";import*as p from"./rendererPlugins/widgets/defaultRendererPlugin.js";import*as R from"./rendererPlugins/widgets/labelRendererPlugin.js";import*as j from"./rendererPlugins/widgets/pictureRendererPlugin.js";import*as b from"./rendererPlugins/widgets/seqRendererPlugin.js";import*as w from"./rowClickPlugin/index.js";import*as c from"./rowDragPlugin/index.js";import*as h from"./rowGroupSettingPlugin/index.js";import*as W from"./varialbleHeightPlugin/index.js";import*as k from"./virtualTreePlugin/index.js";import{separateMetaModule as C}from"../../../../shared/utils/index.js";var v=C(Object.assign({"./anchorPlugin/index.tsx":e,"./defaultConfigPlugin/index.ts":r,"./filterDaterangeRenderPlugin/index.tsx":i,"./filterRenderPlugin/index.tsx":n,"./highLightSetPlugin.tsx":d,"./keyboardEventPlugin/index.ts":s,"./lowCodeFieldAdaptorPlugin/index.tsx":t,"./maxCheckSizePlugin.ts":l,"./rendererPlugins/editableWidgets/dateRendererPlugin/index.tsx":g,"./rendererPlugins/editableWidgets/inputRendererPlugin.tsx":u,"./rendererPlugins/editableWidgets/numberRendererPlugin.tsx":o,"./rendererPlugins/editableWidgets/selectRendererPlugin/index.tsx":a,"./rendererPlugins/editableWidgets/separateRendererPlugin/index.tsx":P,"./rendererPlugins/editableWidgets/timeRendererPlugin/index.tsx":m,"./rendererPlugins/widgets/checkRendererPlugin.tsx":x,"./rendererPlugins/widgets/colorRendererPlugin.tsx":f,"./rendererPlugins/widgets/defaultRendererPlugin.tsx":p,"./rendererPlugins/widgets/labelRendererPlugin.tsx":R,"./rendererPlugins/widgets/pictureRendererPlugin.tsx":j,"./rendererPlugins/widgets/seqRendererPlugin.tsx":b,"./rowClickPlugin/index.ts":w,"./rowDragPlugin/index.ts":c,"./rowGroupSettingPlugin/index.ts":h,"./varialbleHeightPlugin/index.tsx":W,"./virtualTreePlugin/index.ts":k}));export{v as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{toRaw as e,h as t,inject as l,createVNode as i}from"vue";import{arrayed as o,widthAppend as s}from"../../../../../shared/utils/index.js";import{isObject as n,isFunction as d,cloneDeep as a,isString as r}from"lodash-es";import{NEllipsis as u}from"naive-ui";import f from"../../../../annotation-edit/index.js";import{HIGHEST_PRIORITY as m,IHO_TABLE_FIXED_STATUS as c,LOWEST_PRIORITY as p,WIDGET_TYPE as h,InjectionIhoTableAnnotation as v,InjectionIhoTableConfig as b}from"../../constants/index.js";import{defineTablePlugin as g}from"../../hooks/useTablePlugin.js";import{IhoTableStatusHelper as R,IhoTableUtils as j,IhoTableRenderHelper as x}from"../../utils/index.js";import{getDefaultValue as P}from"../rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.js";function F(){const F="lowCodeFieldAdaptorPlugin";return g({name:F,apply(g){g.fieldHooks.field.tap({name:F,stage:m},((m,p,g)=>{const F=m,S={className:F.bold?"iho-table__boldCell":"",field:F.columnName,showOverflow:"tooltip",visible:R.notNegative(F.isShow),minWidth:F.colWidth,sortable:R.isPositive(F.isSort),fixed:c[F.isFixed],...F,title:F.alias||F.title};return function(e,a){const m={default:a.slotFn,header:a.headerSlotFn,edit:a.editSlotFn,footer:a.footerSlotFn,...a.slots};if(d(a.checkEditStatus)){const{default:e}=m;d(e)&&(m.default=l=>a.checkEditStatus(l)?e(l):[t("span",null,P(l.row,l.column.editRender.props))])}const c=m.header;m.header=e=>function(e,t,a){const m=l(v),c=l(b),p=e.column||{},h=n(null==m?void 0:m.value)&&!1!==t.annotation,g=x.isEditableColumn(c.value,p),R=p.sortable||x.hasFilter(t),j=r(a)?a:d(a)?a(e):null;let P=!1;if(c.value){const e=c.value.editRules&&c.value.editRules[p.field];e&&(P=o(e).some((e=>e.required)))}return i("section",{class:"iho-table__headerWrapper"},[i("section",{style:{width:s(Math.max(0,p.renderWidth-20-(P?14:0)-(h?18:0)-(R?23:0)-(g?22:0)))}},[null!=j?j:i(u,{style:{maxWidth:"100%"}},{default:()=>p.title})]),h?i(f,{modelValue:m.value[p.field],"onUpdate:modelValue":e=>m.value[p.field]=e},null):null])}(e,a,c),e.slots=m}(S,F),function(t,l,i){var o,s;const r=a(e(l));r.componentProps={size:"mini"===i.size?"small":i.size,...r.componentProps},t.editRender={autofocus:"input",name:j.getCellType(l),props:r},t.editRender.enabled=!Reflect.get(h,t.editRender.name),d(null==(o=t.slots)?void 0:o.default)&&(t.editRender.enabled=t.editRender.enabled&&d(null==(s=t.slots)?void 0:s.edit));if(!n(l.settingObj))return;Reflect.has(l.settingObj,"isHide")&&(t.visible=t.visible&&R.notPositive(l.settingObj.isHide))}(S,F,g),S})),g.fieldHooks.field.tap({name:F+"After",stage:p},(e=>(n(e.slots)&&Object.entries(e.slots).forEach((([t,l])=>{null==l&&Reflect.deleteProperty(e.slots,t)})),e)))}})}export{F as lowCodeFieldAdaptorPlugin};
|
|
1
|
+
import{toRaw as e,h as t,inject as l,createVNode as i}from"vue";import{arrayed as o,widthAppend as s}from"../../../../../shared/utils/index.js";import{isObject as n,isFunction as d,cloneDeep as a,isString as r}from"lodash-es";import{NEllipsis as u}from"naive-ui";import f from"../../../../annotation-edit/index.js";import{HIGHEST_PRIORITY as m,IHO_TABLE_FIXED_STATUS as c,LOWEST_PRIORITY as p,WIDGET_TYPE as h,InjectionIhoTableAnnotation as v,InjectionIhoTableConfig as b}from"../../constants/index.js";import{defineTablePlugin as g}from"../../hooks/useTablePlugin.js";import{IhoTableStatusHelper as R,IhoTableUtils as j,IhoTableRenderHelper as x}from"../../utils/index.js";import{getDefaultValue as P}from"../rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.js";function F(){const F="lowCodeFieldAdaptorPlugin";return g({name:F,apply(g){g.fieldHooks.field.tap({name:F,stage:m},((m,p,g)=>{const F=m,S={className:F.bold?"iho-table__boldCell":"",field:F.columnName,showOverflow:"tooltip",visible:R.notNegative(F.isShow),minWidth:F.colWidth,sortable:R.isPositive(F.isSort),fixed:c[F.isFixed],...F,title:F.alias||F.title};return function(e,a){const m={default:a.slotFn,header:a.headerSlotFn,edit:a.editSlotFn,footer:a.footerSlotFn,...a.slots};if(d(a.checkEditStatus)){const{default:e}=m;d(e)&&(m.default=l=>a.checkEditStatus(l)?e(l):[t("span",null,P(l.row,l.column.editRender.props))])}const c=m.header;m.header=e=>function(e,t,a){const m=l(v),c=l(b),p=e.column||{},h=n(null==m?void 0:m.value)&&!1!==t.annotation,g=x.isEditableColumn(c.value,p),R=p.sortable||x.hasFilter(t)||x.hasDateFiler(t),j=r(a)?a:d(a)?a(e):null;let P=!1;if(c.value){const e=c.value.editRules&&c.value.editRules[p.field];e&&(P=o(e).some((e=>e.required)))}return i("section",{class:"iho-table__headerWrapper"},[i("section",{style:{width:s(Math.max(0,p.renderWidth-20-(P?14:0)-(h?18:0)-(R?23:0)-(g?22:0)))}},[null!=j?j:i(u,{style:{maxWidth:"100%"}},{default:()=>p.title})]),h?i(f,{modelValue:m.value[p.field],"onUpdate:modelValue":e=>m.value[p.field]=e},null):null])}(e,a,c),e.slots=m}(S,F),function(t,l,i){var o,s;const r=a(e(l));r.componentProps={size:"mini"===i.size?"small":i.size,...r.componentProps},t.editRender={autofocus:"input",name:j.getCellType(l),props:r},t.editRender.enabled=!Reflect.get(h,t.editRender.name),d(null==(o=t.slots)?void 0:o.default)&&(t.editRender.enabled=t.editRender.enabled&&d(null==(s=t.slots)?void 0:s.edit));if(!n(l.settingObj))return;Reflect.has(l.settingObj,"isHide")&&(t.visible=t.visible&&R.notPositive(l.settingObj.isHide))}(S,F,g),S})),g.fieldHooks.field.tap({name:F+"After",stage:p},(e=>(n(e.slots)&&Object.entries(e.slots).forEach((([t,l])=>{null==l&&Reflect.deleteProperty(e.slots,t)})),e)))}})}export{F as lowCodeFieldAdaptorPlugin};
|
|
@@ -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
|
|
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",width:"calc(100% - 2px)",overflow:"hidden"}},[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};
|
|
@@ -51,6 +51,9 @@ export declare namespace IhoTableLowCodeField {
|
|
|
51
51
|
}>;
|
|
52
52
|
};
|
|
53
53
|
}>;
|
|
54
|
+
type FilterSetting = Partial<{
|
|
55
|
+
daterange: boolean;
|
|
56
|
+
}>;
|
|
54
57
|
type ColorAndIconItem = {
|
|
55
58
|
condition?: {
|
|
56
59
|
con: LOW_CODE_VALUE_RELATION;
|
|
@@ -111,6 +114,7 @@ export declare type LowCodeTableFieldItem = {
|
|
|
111
114
|
checkEditStatus: (payload: VxeTableDefines.CellRenderBodyParams) => boolean | void;
|
|
112
115
|
colorAndIcon: IhoTableLowCodeField.ColorAndIconItem[];
|
|
113
116
|
variableHeight: boolean;
|
|
117
|
+
filterSetting: IhoTableLowCodeField.FilterSetting;
|
|
114
118
|
}> & Partial<VxeTableDefines.ColumnInfo>;
|
|
115
119
|
export declare type IhoTableFormChangePayload = {
|
|
116
120
|
column: IhoTableFieldItem;
|
|
@@ -36,6 +36,7 @@ export declare const IhoTableRenderHelper: Readonly<{
|
|
|
36
36
|
createRenderEdit: typeof createRenderEdit;
|
|
37
37
|
isEditableColumn(config: IhoTableConfig, column: IhoTableFieldItem): boolean | undefined;
|
|
38
38
|
hasFilter(lowCodeField: LowCodeTableFieldItem): boolean;
|
|
39
|
+
hasDateFiler(lowCodeField: LowCodeTableFieldItem): boolean | undefined;
|
|
39
40
|
}>;
|
|
40
41
|
export declare const IhoTableStatusHelper: Readonly<{
|
|
41
42
|
isPositive(value: string | number | undefined | null): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{reactive as e,inject as n,unref as t,toRaw as r,createVNode as i}from"vue";import{jsonParse as o,arrayed as u,findAncestor as l}from"../../../../shared/utils/index.js";import{promiseTimeout as c}from"@vueuse/shared";import{isNumber as
|
|
1
|
+
import{reactive as e,inject as n,unref as t,toRaw as r,createVNode as i}from"vue";import{jsonParse as o,arrayed as u,findAncestor as l}from"../../../../shared/utils/index.js";import{promiseTimeout as c}from"@vueuse/shared";import{isNumber as a,cloneDeep as d,isString as s,isObject as f,isArray as m}from"lodash-es";import{InjectionIhoTableEmits as p,InjectionIhoTableConfig as v,IHO_TABLE_STRING_STATUS as g,IHO_TABLE_NUMBER_STATUS as E,IHO_TABLE_TREE_TYPE as I}from"../constants/index.js";function h(e){return console.warn(`[IhoTable]: ${e}`)}const T=Object.freeze({getCellType(e){var n;return((null==(n=e.settingObj)?void 0:n.attr)||e.formType||"DEFAULT").toUpperCase()}});function C(){var e,t,r;const i=n(v);return i||h("this function(getRowHeight) only can be used in setup environment"),null!=(r=null==(t=null==(e=null==i?void 0:i.value)?void 0:e.rowConfig)?void 0:t.height)?r:32}function R(e){const n=e.slice(2);return`${n[0].toLowerCase()}${n.slice(1)}`}function S(e){return`on${e[0].toUpperCase()}${e.slice(1)}`}function w(n,t=!0){const r=t?e(new Map):new Map;return{getItemFromUUID:function(e){return r.set(e,r.get(e)||n()).get(e)},setItemFromUUID:function(e,n){r.set(e,n)},removeItemFromUUID:function(e){r.delete(e)}}}async function O(e,n){return r()||await c(0),r()||function(){const n=+e.colWidth;return a(n)?n:64}();function r(){var r,i;return null==(i=null==(r=t(n))?void 0:r.getColumnByField(e.field))?void 0:i.renderWidth}}function F(e){const t=n(p);function i(){var n;return{value:e.row[e.column.field],row:e.row,column:{...e.column,...null==(n=e.column.editRender)?void 0:n.props},index:e.rowIndex>-1?e.rowIndex:e.$rowIndex}}function o(e={}){t("formChange",{...i(),...d(r(e))})}function u(e={}){t("formClick",{...i(),...d(r(e))})}return{emitFormChange:function(){o()},emitFormClick:function(){u()},emitFormChangeWithParams:o,emitFormClickWithParams:u}}const P=Object.freeze({createDefaultRenderCell:function(){return function(e,{row:n,column:t}){return[i("span",null,[n[t.field]])]}},createRenderEdit:function(e){return function({props:n},t){return e({...t,fieldItem:n||{},...F(t)})}},isEditableColumn(e,n){var t;return!1!==(null==(t=e.editConfig)?void 0:t.showIcon)&&n.editRender&&!1!==n.editRender.enabled},hasFilter(e){if(y(e))return!0;let n=e.fieldSetting;return s(n)&&(n=o(n||"")),f(n)&&((t=n).notParticipatingSearch!==g.POSITIVE&&"manual"===(null==(r=t.mapping)?void 0:r.type));var t,r},hasDateFiler(e){var n;return null==(n=null==e?void 0:e.filterSetting)?void 0:n.daterange}}),A=Object.freeze({isPositive:e=>e===E.POSITIVE||e===g.POSITIVE,isNegative:e=>e===E.NEGATIVE||e===g.NEGATIVE,notPositive:e=>e!==E.POSITIVE&&e!==g.POSITIVE,notNegative:e=>e!==E.NEGATIVE&&e!==g.NEGATIVE}),N=(e,n)=>({$event:t,column:r})=>{var i;if(!u(e).includes(null==(i=r.editRender)?void 0:i.name))return!0;const o=null==t?void 0:t.target;return!f(o)||!l(o,n)};function V(e){return[I.TRANSFORM_WITH_SPAN_METHOD,I.TRANSFORM_TREE_TYPE].includes(`${e.isTree}`)}function $(e){return s(e)&&!!e.match(/^###\{[^{}]+}$/)}function x(e){try{return JSON.parse(e.replace(/^###/,""))}catch(e){return{}}}function U(e,n){if(e.$__SEPARATE||!n.editRender||!n.editRender.props)return e[n.field];const{fieldSetting:t}=n.editRender.props;if(!s(t))return e[n.field];const{mergedFeildExpression:r}=o(t);return r&&s(r)?r.replace(/#{(.+?)}/g,(function(n,t){let r=t?e[t.trim()]:null;$(r)&&(r=x(r).change_text);return r||(null==r?"--":r)})):e[n.field]}const b=["SEARCH","SELECT","RADIO","CHECKBOX"];function y(e){return e.notParticipatingSearch===E.NEGATIVE&&b.includes(T.getCellType(e))&&m(e.options)&&e.options.length}export{P as IhoTableRenderHelper,A as IhoTableStatusHelper,T as IhoTableUtils,h as IhoTableWarn,N as createIhoTableClearActivedInterceptor,R as eventListener2EventName,S as eventName2EventListener,O as getColumnRenderWidth,C as getRowHeight,y as isCompatibleColumn,$ as isRichContent,V as isTransformTreeType,U as parseMergeField,x as parseRichContent,F as useIhoTableFormEvent,w as useUUIDMap};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e="@cnhis-design-vue/shared",i="3.1.42-beta.
|
|
1
|
+
var e="@cnhis-design-vue/shared",i="3.1.42-beta.67",s="index.ts",n={"naive-ui":"^2.30.0",vue:"^3.2.0"},a={"@vicons/ionicons5":"^0.12.0","lodash-es":"^4.17.21",moment:"^2.29.1","video.js":"^7.19.2","videojs-contrib-hls":"^5.15.0",viewerjs:"^1.10.5","xe-utils":"^3.5.4"},d={name:e,version:"3.1.42-beta.67",private:!0,main:"index.ts",peerDependencies:n,dependencies:a};export{d as default,a as dependencies,s as main,e as name,n as peerDependencies,i as version};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cnhis-design-vue",
|
|
3
|
-
"version": "3.1.42-beta.
|
|
3
|
+
"version": "3.1.42-beta.67",
|
|
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": "
|
|
64
|
+
"gitHead": "a8f7d7cdca3113620c2a7b0dbaf062673dfc51cc"
|
|
65
65
|
}
|