cnhis-design-vue 3.1.48-release.0 → 3.1.48-release.1

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.
@@ -1 +1 @@
1
- import{drawLine as t,drawPoint as e}from"../useDraw.js";import{useGrid as o}from"../useGrid.js";import{useBirthProcessCumputedPoint as n}from"../useCumputedPoint.js";import"@vueuse/core";import"../../../../../shared/utils/fabricjs/index.js";import"vue";import{getIndex as i,isEffectiveNode as l,getTime as s}from"../../utils/index.js";import{cloneDeep as r}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";function a(a,u,c,d,f){const{cumputedX:p,cumputedY:v,getXValue:m,getYValue:h}=n(u),{left:g,xCellWidth:y,yCellHeight:x,originX:L,endX:k,originY:b,endY:j,itemList:P,event:w,canvasHeight:C,scaleValues:E,xAxis:X,startTime:Y}=u,$=new Set,A=r(E);function M(o,n,l){var s;const{type:r,unit:f,dataList:p=[]}=l,v=[],g=[];null==(s=o.list)||s.forEach(((s,p)=>{!function(o,s,p,y){let x,P;const{pointAttr:C={},lineAttr:E={},title:X="",key:Y,type:H="circle"}=y,I=D(y.list[p+1],l);o&&I&&!s.breakpoint&&o[0]!==I[0]&&(P=t([...o,...I],{...E}));const S=g[p-1],z={origin:{data:s,title:X,key:Y||"",unit:f,type:r,dataIndex:n,index:p},leftLine:S,rightLine:P,...C,...u.event.hovered?u.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:u.event};S?x=e(H,{left:S.get("x2"),top:S.get("y2"),...z}):o&&(z.leftLine=null,x=e(H,{left:o[0],top:o[1],...z}));g.push(P),x&&(!function(t){w.hovered&&(t.on("mouseover",(()=>{V(t,"hover")})),t.on("mouseout",(()=>{d.show=!1})));if(t.lockMovementX&&t.lockMovementY)return;t.on("moving",(()=>{!function(t){t.setCoords();const e=t.prevPoint?t.prevPoint.left:L,o=t.nextPoint?t.nextPoint.left:k;t.top<b&&t.set("top",b),t.top>j&&t.set("top",j),t.left<e&&t.set("left",e),t.left>o&&t.set("left",o)}(t),function(t){var e,o;null==(e=t.leftLine)||e.setCoords().set({x2:t.left,y2:t.top}),null==(o=t.rightLine)||o.setCoords().set({x1:t.left,y1:t.top})}(t),w.hovered&&V(t)})),t.on("mouseup",(e=>{if(d.show=!1,1===e.button){const{key:e,type:o}=t.origin,n={...t.origin,data:{...t.origin.data,time:m(t.left),value:h(o,t.top)}};a.value.discardActiveObject(),c("change",n),function(t,e="add"){const{dataIndex:o,data:n,index:l,key:s,type:r}=t,u=A.find((t=>t.type===r)),c=u.dataList.find((t=>t.key===s));switch(e){case"remove":c.list.splice(l,1);break;case"change":c.list[l]=n;break;default:{const t=i(n.time,c.data);c.list.splice(t,0,n);break}}!function(){var t;$.size&&(null==(t=a.value)||t.remove(...function(t){const e=[];return t.forEach((t=>{t&&e.push(t),(null==t?void 0:t.leftLine)&&e.push(null==t?void 0:t.leftLine),(null==t?void 0:t.rightLine)&&e.push(null==t?void 0:t.rightLine)})),e}([...$]))),$.clear(),A.forEach((t=>{t.dataList.forEach(((e,o)=>{M(e,o,t)}))}))}()}(n,"change")}}))}(x),v.push(x),$.add(x))}(D(s,l),s,p,o)})),Promise.all(v).then((t=>{const e=g.filter((t=>t));let o=null;t=t.map((t=>(t&&o&&(o.nextPoint=t,t.prevPoint=o),o=t||o,t))),a.value.add(...e,...t)}))}function V(t,e="moving"){const{title:o,type:n,data:i,unit:l}=t.origin;d.point={x:t.left,y:t.top};const s=`${"hover"===e?i.value:h(n,t.top)}`;d.list=[`${o} ${s}${l||""}`,`时间 ${m(t.left).slice(-5)}`],d.show=!0}function D(t,e){if(l(t)&&function(t){const e=Date.parse(X.list.at(-1)),o=s(t);return o>=Y&&o<=e}(t.time)){const o=p(t.time),n=v(e.type,e.range,t.value);return[o,n<b?b:n>j?j:n]}}o(a,u),A.forEach((t=>{t.dataList.forEach(((e,o)=>{M(e,o,t)}))}))}export{a as useCenter};
1
+ import{drawLine as e,drawPoint as t}from"../useDraw.js";import{useGrid as n}from"../useGrid.js";import{useBirthProcessCumputedPoint as o}from"../useCumputedPoint.js";import"@vueuse/core";import"../../../../../shared/utils/fabricjs/index.js";import"vue";import{getIndex as i,isEffectiveNode as l,getTime as r}from"../../utils/index.js";import{cloneDeep as s}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";function a(a,f,u,p,c){const{cumputedX:d,cumputedY:v,getXValue:m,getYValue:h}=o(f),{xCellWidth:g,yCellHeight:L,originX:y,endX:x,originY:k,endY:P,event:A,scaleValues:b,xAxis:j,startTime:w,timeXCell:C}=f,X=new Set,E=new Set,Y=s(b);let M=[];function S(n,o,i){var l;const{type:r,unit:s,dataList:c=[]}=i,d=[],v=[];null==(l=n.list)||l.forEach(((l,c)=>{!function(n,l,c,L){let b,j;const{pointAttr:w={},lineAttr:Y={},title:S="",key:O,type:D="circle"}=L,I=z(L.list[c+1],i);n&&I&&!l.breakpoint&&n[0]!==I[0]&&(j=e([...n,...I],Y));const J=v[c-1],N={origin:{data:l,title:S,key:O||"",unit:s,type:r,dataIndex:o,index:c,lineAttr:Y},leftLine:J,rightLine:j,...w,...f.event.hovered?f.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:f.event};J?b=t(D,{left:J.get("x2"),top:J.get("y2"),...N}):n&&(N.leftLine=null,b=t(D,{left:n[0],top:n[1],...N}));v.push(j),b&&(b.originLeft=b.left,b.originTop=b.top,function(e){A.hovered&&(e.on("mouseover",(()=>{V(e,"hover")})),e.on("mouseout",(()=>{p.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t=6e4/C,n=e.prevPoint?e.prevPoint.left+t:y,o=e.nextPoint?e.nextPoint.left-t:x;e.top<k&&e.set("top",k),e.top>P&&e.set("top",P),e.left<n&&e.set("left",n),e.left>o&&e.set("left",o)}(e),function(e){var t,n;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(n=e.rightLine)||n.setCoords().set({x1:e.left,y1:e.top})}(e),A.hovered&&V(e),function(e){const{originLeft:t,originTop:n,left:o,top:i,origin:l}=e,r=~~((o-t)/g);if(o>t+g&&!e.nextPoint){if(0===M.length){$(e,[...e.leftLine?[e.leftLine.x1,e.leftLine.y1]:[t,n],t,n]),e.leftLine&&e.leftLine.set({stroke:"transparent"})}const o=t+g*r;if(M.every((e=>e.left!==o))){const t=m(o),n=h(l.type,i);M.push({data:{time:t,value:n},left:o,top:i}),$(e,[...e.prevPointer,o,i])}M.length<r&&function(e,t){const{originLeft:n,originTop:o,origin:i}=e;let l=1;for(;l<=t;){const t=n+g*l,r=M.some((e=>Math.abs(e.left-t)<=1));if(!r){let l=0;const r=M.find(((e,n)=>(e.left>t&&(l=n),e.left>t)));if(r){const s=JSON.parse(JSON.stringify(r)),a=M[l-1]||{left:n,top:o},f=~~((r.left-(t-g))/g),u=(r.top-a.top)/f;s.top=a.top+u,s.left=t,s.data={time:m(t),value:h(i.type,s.top)},M.splice(l,0,s),$(e,[a.left,a.top,s.left,s.top])}}l++}}(e,r)}if(M.length>0&&o<M[M.length-1].left){for(const e of E)e.left>o&&(e.leftLine&&a.value.remove(e.leftLine),a.value.remove(e));if(M=M.filter((e=>e.left<=o)),0===M.length){e.leftLine&&e.leftLine.set(e.origin.lineAttr);for(const e of E)e.leftLine&&a.value.remove(e.leftLine),a.value.remove(e)}if(M.length>0){const t=M.at(-1);e.prevPointer=[t.left,t.top]}}}(e)})),e.on("mouseup",(t=>{if(p.show=!1,1===t.button){const{key:t,type:n}=e.origin,o={...e.origin,data:{...e.origin.data,time:m(e.left),value:h(n,e.top)}};a.value.discardActiveObject(),M.length>0?(o.data=M.map((e=>e.data)),u("add",o),T(o,"add")):(u("change",o),T(o,"change"))}}))}(b),d.push(b),X.add(b))}(z(l,i),l,c,n)})),Promise.all(d).then((e=>{const t=v.filter((e=>e));let n=null;e=e.map((e=>(e&&n&&(n.nextPoint=e,e.prevPoint=n),n=e||n,e))),a.value.add(...t,...e)}))}function $(t,n){const[o,i,l,r]=n;t.clone((o=>{o.set({left:l,top:r}),t.prevPointer=[l,r];const i=e(n,t.origin.lineAttr);o.leftLine=i,E.add(o),a.value.add(i,o)}))}function T(e,t="add"){const{dataIndex:n,data:o,index:l,key:r,type:s}=e,f=Y.find((e=>e.type===s)).dataList.find((e=>e.key===r));switch(t){case"remove":f.list.splice(l,1);break;case"change":f.list[l]=o;break;default:{const e=Array.isArray(o)?o[0].time:o.time,t=i(e,f.list),n=Array.isArray(o)?o:[o];f.list.splice(t,0,...n);break}}var u,p;X.size&&(null==(u=a.value)||u.remove(...O([...X]))),E.size&&(null==(p=a.value)||p.remove(...O([...E]))),X.clear(),E.clear(),M=[],Y.forEach((e=>{e.dataList.forEach(((t,n)=>{S(t,n,e)}))}))}function O(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine)})),t}function V(e,t="moving"){const{title:n,type:o,data:i,unit:l}=e.origin;p.point={x:e.left,y:e.top};const r=`${"hover"===t?i.value:h(o,e.top)}`;p.list=[`${n} ${r}${l||""}`,`时间 ${m(e.left).slice(-5)}`],p.show=!0}function z(e,t){if(l(e)&&function(e){const t=Date.parse(j.list.at(-1)),n=r(e);return n>=w&&n<=t}(e.time)){const n=d(e.time),o=v(t.type,t.range,e.value);return[n,o<k?k:o>P?P:o]}}n(a,f),Y.forEach((e=>{e.dataList.forEach(((t,n)=>{S(t,n,e)}))}))}export{a as useCenter};
@@ -1 +1 @@
1
- import*as e from"./anchorPlugin/index.js";import*as r from"./defaultConfigPlugin/index.js";import*as i from"./fieldConnectionPlugin/index.js";import*as n from"./filterDaterangeRenderPlugin/index.js";import*as s from"./filterRenderPlugin/index.js";import*as d from"./highLightSetPlugin.js";import*as t from"./keyboardEventPlugin/index.js";import*as l from"./lowCodeFieldAdaptorPlugin/index.js";import*as g from"./maxCheckSizePlugin.js";import*as u from"./operationalFormPlugin/index.js";import*as o from"./rendererPlugins/editableWidgets/dateRendererPlugin/index.js";import*as P from"./rendererPlugins/editableWidgets/inputRendererPlugin.js";import*as a from"./rendererPlugins/editableWidgets/numberRendererPlugin.js";import*as m from"./rendererPlugins/editableWidgets/selectRendererPlugin/index.js";import*as x from"./rendererPlugins/editableWidgets/separateRendererPlugin/index.js";import*as f from"./rendererPlugins/editableWidgets/timeRendererPlugin/index.js";import*as p from"./rendererPlugins/widgets/checkRendererPlugin.js";import*as j from"./rendererPlugins/widgets/colorRendererPlugin.js";import*as R from"./rendererPlugins/widgets/defaultRendererPlugin.js";import*as w from"./rendererPlugins/widgets/htmlRendererPlugin.js";import*as b from"./rendererPlugins/widgets/labelRendererPlugin.js";import*as c from"./rendererPlugins/widgets/pictureRendererPlugin.js";import*as h from"./rendererPlugins/widgets/seqRendererPlugin.js";import*as W from"./rowClickPlugin/index.js";import*as C from"./rowDragPlugin/index.js";import*as k from"./rowGroupSettingPlugin/index.js";import*as v from"./varialbleHeightPlugin/index.js";import*as S from"./virtualTreePlugin/index.js";import{separateMetaModule as D}from"../../../../shared/utils/index.js";var F=D(Object.assign({"./anchorPlugin/index.tsx":e,"./defaultConfigPlugin/index.ts":r,"./fieldConnectionPlugin/index.ts":i,"./filterDaterangeRenderPlugin/index.tsx":n,"./filterRenderPlugin/index.tsx":s,"./highLightSetPlugin.tsx":d,"./keyboardEventPlugin/index.ts":t,"./lowCodeFieldAdaptorPlugin/index.tsx":l,"./maxCheckSizePlugin.ts":g,"./operationalFormPlugin/index.ts":u,"./rendererPlugins/editableWidgets/dateRendererPlugin/index.tsx":o,"./rendererPlugins/editableWidgets/inputRendererPlugin.tsx":P,"./rendererPlugins/editableWidgets/numberRendererPlugin.tsx":a,"./rendererPlugins/editableWidgets/selectRendererPlugin/index.tsx":m,"./rendererPlugins/editableWidgets/separateRendererPlugin/index.tsx":x,"./rendererPlugins/editableWidgets/timeRendererPlugin/index.tsx":f,"./rendererPlugins/widgets/checkRendererPlugin.tsx":p,"./rendererPlugins/widgets/colorRendererPlugin.tsx":j,"./rendererPlugins/widgets/defaultRendererPlugin.tsx":R,"./rendererPlugins/widgets/htmlRendererPlugin.tsx":w,"./rendererPlugins/widgets/labelRendererPlugin.tsx":b,"./rendererPlugins/widgets/pictureRendererPlugin.tsx":c,"./rendererPlugins/widgets/seqRendererPlugin.tsx":h,"./rowClickPlugin/index.ts":W,"./rowDragPlugin/index.ts":C,"./rowGroupSettingPlugin/index.ts":k,"./varialbleHeightPlugin/index.tsx":v,"./virtualTreePlugin/index.ts":S}));export{F as default};
1
+ import*as e from"./anchorPlugin/index.js";import*as r from"./defaultConfigPlugin/index.js";import*as i from"./fieldConnectionPlugin/index.js";import*as n from"./filterDaterangeRenderPlugin/index.js";import*as s from"./filterRenderPlugin/index.js";import*as t from"./highLightSetPlugin.js";import*as d from"./keyboardEventPlugin/index.js";import*as l from"./lowCodeFieldAdaptorPlugin/index.js";import*as g from"./maxCheckSizePlugin.js";import*as u from"./operationalFormPlugin/index.js";import*as o from"./rendererPlugins/editableWidgets/dateRendererPlugin/index.js";import*as P from"./rendererPlugins/editableWidgets/inputRendererPlugin.js";import*as a from"./rendererPlugins/editableWidgets/numberRendererPlugin.js";import*as m from"./rendererPlugins/editableWidgets/selectRendererPlugin/index.js";import*as x from"./rendererPlugins/editableWidgets/separateRendererPlugin/index.js";import*as p from"./rendererPlugins/editableWidgets/timeRendererPlugin/index.js";import*as f from"./rendererPlugins/widgets/checkRendererPlugin.js";import*as j from"./rendererPlugins/widgets/colorRendererPlugin.js";import*as R from"./rendererPlugins/widgets/defaultRendererPlugin.js";import*as w from"./rendererPlugins/widgets/htmlRendererPlugin.js";import*as b from"./rendererPlugins/widgets/labelRendererPlugin.js";import*as c from"./rendererPlugins/widgets/pictureRendererPlugin.js";import*as h from"./rendererPlugins/widgets/seqRendererPlugin.js";import*as W from"./rowClickPlugin/index.js";import*as C from"./rowDragPlugin/index.js";import*as k from"./rowGroupSettingPlugin/index.js";import*as v from"./tooltipPlugin.js";import*as S from"./varialbleHeightPlugin/index.js";import*as D from"./virtualTreePlugin/index.js";import{separateMetaModule as F}from"../../../../shared/utils/index.js";var q=F(Object.assign({"./anchorPlugin/index.tsx":e,"./defaultConfigPlugin/index.ts":r,"./fieldConnectionPlugin/index.ts":i,"./filterDaterangeRenderPlugin/index.tsx":n,"./filterRenderPlugin/index.tsx":s,"./highLightSetPlugin.tsx":t,"./keyboardEventPlugin/index.ts":d,"./lowCodeFieldAdaptorPlugin/index.tsx":l,"./maxCheckSizePlugin.ts":g,"./operationalFormPlugin/index.ts":u,"./rendererPlugins/editableWidgets/dateRendererPlugin/index.tsx":o,"./rendererPlugins/editableWidgets/inputRendererPlugin.tsx":P,"./rendererPlugins/editableWidgets/numberRendererPlugin.tsx":a,"./rendererPlugins/editableWidgets/selectRendererPlugin/index.tsx":m,"./rendererPlugins/editableWidgets/separateRendererPlugin/index.tsx":x,"./rendererPlugins/editableWidgets/timeRendererPlugin/index.tsx":p,"./rendererPlugins/widgets/checkRendererPlugin.tsx":f,"./rendererPlugins/widgets/colorRendererPlugin.tsx":j,"./rendererPlugins/widgets/defaultRendererPlugin.tsx":R,"./rendererPlugins/widgets/htmlRendererPlugin.tsx":w,"./rendererPlugins/widgets/labelRendererPlugin.tsx":b,"./rendererPlugins/widgets/pictureRendererPlugin.tsx":c,"./rendererPlugins/widgets/seqRendererPlugin.tsx":h,"./rowClickPlugin/index.ts":W,"./rowDragPlugin/index.ts":C,"./rowGroupSettingPlugin/index.ts":k,"./tooltipPlugin.ts":v,"./varialbleHeightPlugin/index.tsx":S,"./virtualTreePlugin/index.ts":D}));export{q as default};
@@ -1 +1 @@
1
- import{reactive as e,inject as t,createVNode as o,toRaw as i,h as n,onBeforeUnmount as a}from"vue";import{traverse as r}from"../../../../../../../shared/utils/index.js";import{isFunction as s,isObject as d,range as l}from"lodash-es";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as u,InjectionIhoTableUUID as c}from"../../../../constants/index.js";import{useAutoFocus as p}from"../hooks/useAutoFocus.js";import{createIhoTableClearActivedInterceptor as f,IhoTableRenderHelper as m,getRowHeight as v,getColumnRenderWidth as h,parseMergeField as A}from"../../../../utils/index.js";import{contentSeparate as E,getColumnInfoMaxLength as g,generateSeparateRowData as k,isSeparateColumn as _}from"./separateUtils.js";import b from"./editSeparate.vue.js";import{defineTablePlugin as x}from"../../../../hooks/useTablePlugin.js";function w(){const w="separateRendererPlugins",T=e(new Map);function P(e,t){var o;return null==(o=T.get(e))?void 0:o.get(t)}function R(e,t,o){const i=T.get(e)||new WeakMap;T.set(e,i),i.set(t,o)}const S=e(new Map);return x({name:w,vxe(e){e.interceptor.add("event.clearActived",f(u.SEPARATE,(e=>e.classList.contains("v-binder-follower-content")))),e.renderer.add(u.SEPARATE,{renderCell(e,{column:i,row:n}){const a=(P(t(c),n)||{separateData:{}}).separateData[i.field];return o("section",{class:"iho-table__ellipsis",title:a},[a])},renderEdit:m.createRenderEdit((({fieldItem:e,column:a,row:r,emitFormClick:l})=>{var u,p,f;const m=P(t(c),r),h=v(),A={};let E=null!=(p=null==(u=e.componentProps)?void 0:u.separateSlot)?p:e.separateSlot;return E&&(E=i(E),A.menu=s(E)?E:d(E)?e=>n(E,e):void 0),[o(b,{value:r[a.field],"onUpdate:value":e=>r[a.field]=e,"row-index":null==m?void 0:m.index,height:h,column:a,row:r,"display-content":null==(f=null==m?void 0:m.separateData)?void 0:f[a.field],onClick:l},A)]}))})},apply(e){function t(e){return(...t)=>{var o;return!(null==(o=t[0].row)?void 0:o.$__SEPARATE)&&(!s(e)||e(...t))}}p(e).bindAutoFocusConfig(w,u.SEPARATE,".iho-table__separateText"),e.fieldHooks.fieldList.tap(w,((e,{uuid:t})=>(t&&S.set(t,e.reduce(((e,t)=>(r(t,(t=>{_(t)&&e.push(i(t)),t.showOverflow="ellipsis"})),e)),[])),e))),e.dataHooks.data.tapPromise(w,(async(e,t,{insertAfter:o,index:i,$table:n})=>{if(!t.uuid)return;const a=S.get(t.uuid);if(!a||!a.length)return;const r=[];for(const t of a){if(!t.field)continue;const o=await h(t,n);r.push({field:t.field,data:E(A(e,t),t,o)})}l(g(r)).forEach(((n,a)=>{const s=k(r,a);if(0===a)return R(t.uuid,e,{index:i,separateData:s}),void(e.$__SEPARATE_DATA=[s]);const d={$__SEPARATE:!0};R(t.uuid,d,{index:i,separateData:s}),e.$__SEPARATE_DATA.push(s),o(d)}))})),e.eventHooks.onResizableChange.tap(w,(async({column:e},t,o)=>{_(e)&&o.updateTableDataRef()})),e.configHooks.editConfig.tap(w,((e={},o)=>(e.beforeEditMethod=t(e.beforeEditMethod),e))),e.configHooks.checkboxConfig.tap(w,((e={},o)=>(e.checkMethod=t(e.checkMethod),e.visibleMethod=t(e.visibleMethod),e))),e.setupHooks.setup.tap(w,(e=>{a((()=>{e.value.uuid&&(T.delete(e.value.uuid),S.delete(e.value.uuid))}))}))}})}export{w as separateRendererPlugins};
1
+ import{reactive as e,inject as t,createVNode as o,toRaw as i,h as n,onBeforeUnmount as a}from"vue";import{traverse as r}from"../../../../../../../shared/utils/index.js";import{isFunction as s,isObject as d,range as l}from"lodash-es";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as u,InjectionIhoTableUUID as c}from"../../../../constants/index.js";import{useAutoFocus as p}from"../hooks/useAutoFocus.js";import{createIhoTableClearActivedInterceptor as f,IhoTableRenderHelper as m,getRowHeight as v,getColumnRenderWidth as h,parseMergeField as A}from"../../../../utils/index.js";import{contentSeparate as E,getColumnInfoMaxLength as g,generateSeparateRowData as k,isSeparateColumn as _}from"./separateUtils.js";import b from"./editSeparate.vue.js";import{defineTablePlugin as x}from"../../../../hooks/useTablePlugin.js";function w(){const w="separateRendererPlugins",T=e(new Map);function P(e,t){var o;return null==(o=T.get(e))?void 0:o.get(t)}function R(e,t,o){const i=T.get(e)||new WeakMap;T.set(e,i),i.set(t,o)}const S=e(new Map);return x({name:w,vxe(e){e.interceptor.add("event.clearActived",f(u.SEPARATE,(e=>e.classList.contains("v-binder-follower-content")))),e.renderer.add(u.SEPARATE,{renderCell(e,{column:i,row:n}){const a=(P(t(c),n)||{separateData:{}}).separateData[i.field];return o("section",{class:"iho-table__ellipsis",title:a},[a])},renderEdit:m.createRenderEdit((({fieldItem:e,column:a,row:r,emitFormClick:l})=>{var u,p,f;const m=P(t(c),r),h=v(),A={};let E=null!=(p=null==(u=e.componentProps)?void 0:u.separateSlot)?p:e.separateSlot;return E&&(E=i(E),A.menu=s(E)?E:d(E)?e=>n(E,e):void 0),[o(b,{value:r[a.field],"onUpdate:value":e=>r[a.field]=e,"row-index":null==m?void 0:m.index,height:h,column:a,row:r,"display-content":null==(f=null==m?void 0:m.separateData)?void 0:f[a.field],onClick:l},A)]}))})},apply(e){function t(e){return(...t)=>{var o;return!(null==(o=t[0].row)?void 0:o.$__SEPARATE)&&(!s(e)||e(...t))}}p(e).bindAutoFocusConfig(w,u.SEPARATE,".iho-table__separateText"),e.fieldHooks.fieldList.tap(w,((e,{uuid:t})=>(t&&S.set(t,e.reduce(((e,t)=>(r(t,(t=>{_(t)&&(e.push(i(t)),t.showOverflow="ellipsis")})),e)),[])),e))),e.dataHooks.data.tapPromise(w,(async(e,t,{insertAfter:o,index:i,$table:n})=>{if(!t.uuid)return;const a=S.get(t.uuid);if(!a||!a.length)return;const r=[];for(const t of a){if(!t.field)continue;const o=await h(t,n);r.push({field:t.field,data:E(A(e,t),t,o)})}l(g(r)).forEach(((n,a)=>{const s=k(r,a);if(0===a)return R(t.uuid,e,{index:i,separateData:s}),void(e.$__SEPARATE_DATA=[s]);const d={$__SEPARATE:!0};R(t.uuid,d,{index:i,separateData:s}),e.$__SEPARATE_DATA.push(s),o(d)}))})),e.eventHooks.onResizableChange.tap(w,(async({column:e},t,o)=>{_(e)&&o.updateTableDataRef()})),e.configHooks.editConfig.tap(w,((e={},o)=>(e.beforeEditMethod=t(e.beforeEditMethod),e))),e.configHooks.checkboxConfig.tap(w,((e={},o)=>(e.checkMethod=t(e.checkMethod),e.visibleMethod=t(e.visibleMethod),e))),e.setupHooks.setup.tap(w,(e=>{a((()=>{e.value.uuid&&(T.delete(e.value.uuid),S.delete(e.value.uuid))}))}))}})}export{w as separateRendererPlugins};
@@ -0,0 +1 @@
1
+ export declare function tooltipPlugin(): import("../../../../../es/components/iho-table").TablePlugin;
@@ -0,0 +1 @@
1
+ import"../../index.js";import{IhoTableUtils as o,parseMergeField as e,isRichContent as t,parseRichContent as l}from"../utils/index.js";import{WIDGET_TYPE as r}from"../constants/index.js";import{isObject as i}from"@vue/shared";import{isArray as n}from"lodash-es";import{jsonParse as s}from"../../../../shared/utils/index.js";import{defineTablePlugin as p}from"../hooks/useTablePlugin.js";function a(){const a="tooltipPlugin";return p({name:a,apply(p){p.fieldHooks.field.tap(a,((p,a,d,u)=>{var f,m;const c=null==(f=p.editRender)?void 0:f.props;if(!i(c))return p;const h=o.getCellType(c);return(null==(m=d.tooltipConfig)?void 0:m.showAll)&&(h!==r.LABEL&&h!==r.DEFAULT||(p.showOverflow="tooltip")),h!==r.PICTURE&&h!==r.HEADPORTRAIT&&h!==r.HTML||(p.showOverflow="ellipsis"),d.tooltipConfig={contentMethod:i=>{var p;const{column:a,row:d}=i,u=null==(p=a.editRender)?void 0:p.props;switch(o.getCellType(u)){case r.LABEL:{const o=s(d[a.field]);return n(o.labels)?o.labels.map((o=>o.labelName)).join(","):o.labelStr}case r.DEFAULT:{const o=e(d,a);if(t(o)){return l(o).change_text}return o}case r.HTML:return""}},...d.tooltipConfig},p}))}})}export{a as tooltipPlugin};
@@ -1 +1 @@
1
- import{WidgetOptionEnums as e,WidgetTypeEnums as i,WidgetValEnums as t}from"../types/enums.js";import{formatDateRangeInfo as n,presetValToTimestamp as l}from"../components/render-widget/helpers/presetValToTimestamp.js";import{DatePresetValEnums as o}from"../components/render-widget/enums.js";const a={[e.RADIO]:"0",[e.MULTIPLE]:"1",[e.ALL]:"0",[e.SELECT_TIME]:"1",[e.PAST_TIME]:"2",[e.FUTURE_TIME]:"3"};function u(){return{transformData:function(t,n){return t.map((t=>{var l,o,u;const{optionInfo:r={list:[],manualMapping:!0,dynamicOptionInfo:{},showWholeOption:!1},type:E,defaultValue:s,optionType:p,filterExplicit:T,rangeFilter:d}=t,c={},m={title:(f=t).title,alias:f.customTitle,isShowSearch:f.isShowSearch?1:0,filterExplicit:f.filterExplicit?1:0,explicitRequired:f.explicitRequired?1:0,advanceOptionSetting:f.optionType?a[f.optionType]:"",placeholder:f.remark,advanceColWidth:f.width};var f;let g,v,y=E;T?(g=E===i.SELECT&&p===e.MULTIPLE?null==s?void 0:s.valueList:null==(l=null==s?void 0:s.valueList)?void 0:l[0],v=null==s?void 0:s.unit,E===i.LABEL&&(y="SELECTLABEL",g=null==s?void 0:s.valueList),E===i.DATE&&(y="DATE_OUT"),E===i.DATE_TIME&&(y="DATETIME_OUT")):E===i.SELECT&&(null==r?void 0:r.list)&&(null==r?void 0:r.list.length)<10&&(y="CHECKBOX_GROUP"),d&&(E===i.INPUT_NUMBER&&(y="INPUTNUMBER_RANGE"),E===i.DATE&&(y=T?"DATE_RANGE_OUT":"DATE_RANGE_INNER"),E===i.DATE_TIME&&(y=T?"DATETIME_RANGE_OUT":"DATETIME_RANGE_INNER")),E===i.SELECT&&!1===(null==r?void 0:r.manualMapping)&&(y=i.SELECTDYNAMIC);const L={isRender:!0,widgetType:y,originType:E,valueList:null==(o=null==r?void 0:r.list)?void 0:o.map((({name:e,value:i})=>({value:i,label:e}))),defaultValue:g,defValueUnit:v,optionSetting:p,multiple:p===e.MULTIPLE||y===i.SELECTLABEL,manualMapping:null==r?void 0:r.manualMapping,showWholeOption:null==r?void 0:r.showWholeOption,dynamicOptionInfo:null==r?void 0:r.dynamicOptionInfo,classifyStr:null==s?void 0:s.classifyStr,linkageFieldKeys:null!=(u=null==s?void 0:s.linkageFieldKeys)?u:[]};return{...m,fieldType:t.dataType,columnName:t.name,settingObj:c,setting:JSON.stringify(c),widgetCfg:L,rangeFilter:d,unit:null!=v?v:"",_extendData:null!=n?n:{}}}))},getCacheDef:function(e,t){const{widgetType:n,widgetCfg:l}=e;return[i.SELECT,i.CHECKBOX_GROUP,i.SELECTDYNAMIC].includes(n)&&l.multiple?t:t[0]},transformClassifyChild:function(e,t){const a={};return e&&e.length>0&&e.forEach((e=>{const u=e.field_key;a[u]="";const r=t.find((e=>e.name===u));if(r){const t=Array.isArray(e.value)&&r.type===i.SELECT?e.value:e.value.toString();if(a[u]=t,e.unit&&e.unit!==o.CUSTOM){let t="";r.type===i.DATE&&(t=r.rangeFilter?n(e.unit,"YYYY-MM-DD",r.optionType):l(e.unit,"YYYY-MM-DD")),r.type===i.DATE_TIME&&(t=r.rangeFilter?n(e.unit,"YYYY-MM-DD HH:mm:ss",r.optionType):l(e.unit,"YYYY-MM-DD HH:mm:ss")),a[u]=t}}})),a},transformParams:function(e){const n={},l=[i.SELECT,i.SELECTDYNAMIC];return e&&e.length>0&&e.forEach((e=>{const i=e.field_key,o=l.includes(e.widgetType)||e.value&&e.value.length>1?e.value.map((e=>e.includes("&")?e.split("&")[1]:e)):e.value.toString();Array.isArray(o)&&o.length>0&&o.includes(t.WHOLE)||(n[i]=o)})),n}}}export{u as default};
1
+ import{WidgetOptionEnums as e,WidgetTypeEnums as i,WidgetValEnums as t}from"../types/enums.js";import{isString as n}from"lodash-es";import{formatDateRangeInfo as l,presetValToTimestamp as o}from"../components/render-widget/helpers/presetValToTimestamp.js";import{DatePresetValEnums as a}from"../components/render-widget/enums.js";const u={[e.RADIO]:"0",[e.MULTIPLE]:"1",[e.ALL]:"0",[e.SELECT_TIME]:"1",[e.PAST_TIME]:"2",[e.FUTURE_TIME]:"3"};function r(){return{transformData:function(t,n){return t.map((t=>{var l,o,a;const{optionInfo:r={list:[],manualMapping:!0,dynamicOptionInfo:{},showWholeOption:!1},type:E,defaultValue:s,optionType:p,filterExplicit:T,rangeFilter:d}=t,c={},m={title:(f=t).title,alias:f.customTitle,isShowSearch:f.isShowSearch?1:0,filterExplicit:f.filterExplicit?1:0,explicitRequired:f.explicitRequired?1:0,advanceOptionSetting:f.optionType?u[f.optionType]:"",placeholder:f.remark,advanceColWidth:f.width};var f;let g,v,y=E;T?(g=E===i.SELECT&&p===e.MULTIPLE?null==s?void 0:s.valueList:null==(l=null==s?void 0:s.valueList)?void 0:l[0],v=null==s?void 0:s.unit,E===i.LABEL&&(y="SELECTLABEL",g=null==s?void 0:s.valueList),E===i.DATE&&(y="DATE_OUT"),E===i.DATE_TIME&&(y="DATETIME_OUT")):E===i.SELECT&&(null==r?void 0:r.list)&&(null==r?void 0:r.list.length)<10&&(y="CHECKBOX_GROUP"),d&&(E===i.INPUT_NUMBER&&(y="INPUTNUMBER_RANGE"),E===i.DATE&&(y=T?"DATE_RANGE_OUT":"DATE_RANGE_INNER"),E===i.DATE_TIME&&(y=T?"DATETIME_RANGE_OUT":"DATETIME_RANGE_INNER")),E===i.SELECT&&!1===(null==r?void 0:r.manualMapping)&&(y=i.SELECTDYNAMIC);const L={isRender:!0,widgetType:y,originType:E,valueList:null==(o=null==r?void 0:r.list)?void 0:o.map((({name:e,value:i})=>({value:i,label:e}))),defaultValue:g,defValueUnit:v,optionSetting:p,multiple:p===e.MULTIPLE||y===i.SELECTLABEL,manualMapping:null==r?void 0:r.manualMapping,showWholeOption:null==r?void 0:r.showWholeOption,dynamicOptionInfo:null==r?void 0:r.dynamicOptionInfo,classifyStr:null==s?void 0:s.classifyStr,linkageFieldKeys:null!=(a=null==s?void 0:s.linkageFieldKeys)?a:[]};return{...m,fieldType:t.dataType,columnName:t.name,settingObj:c,setting:JSON.stringify(c),widgetCfg:L,rangeFilter:d,unit:null!=v?v:"",_extendData:null!=n?n:{}}}))},getCacheDef:function(e,t){const{widgetType:n,widgetCfg:l}=e;return[i.SELECT,i.CHECKBOX_GROUP,i.SELECTDYNAMIC].includes(n)&&l.multiple?t:t[0]},transformClassifyChild:function(e,t){const n={};return e&&e.length>0&&e.forEach((e=>{const u=e.field_key;n[u]="";const r=t.find((e=>e.name===u));if(r){const t=Array.isArray(e.value)&&r.type===i.SELECT?e.value:e.value.toString();if(n[u]=t,e.unit&&e.unit!==a.CUSTOM){let t="";r.type===i.DATE&&(t=r.rangeFilter?l(e.unit,"YYYY-MM-DD",r.optionType):o(e.unit,"YYYY-MM-DD")),r.type===i.DATE_TIME&&(t=r.rangeFilter?l(e.unit,"YYYY-MM-DD HH:mm:ss",r.optionType):o(e.unit,"YYYY-MM-DD HH:mm:ss")),n[u]=t}}})),n},transformParams:function(e){const l={},o=[i.SELECT,i.SELECTDYNAMIC];return e&&e.length>0&&e.forEach((e=>{const i=e.field_key,a=o.includes(e.widgetType)||e.value&&e.value.length>1?e.value.map((e=>n(e)&&e.includes("&")?e.split("&")[1]:e)):e.value.toString();Array.isArray(a)&&a.length>0&&a.includes(t.WHOLE)||(l[i]=a)})),l}}}export{r as default};
@@ -1 +1 @@
1
- import{computed as e,unref as t}from"vue";import{useEventListener as n}from"@vueuse/core";import{isValid as l}from"date-fns";function i(i,o,u,s){const r=e((()=>{var e;return null==(e=i.value)?void 0:e.$el})),c=e((()=>{const e={};return["date","time","hour","minute","second"].forEach((t=>function(e,t){const n=`is-${t}-disabled`;u[n]&&(e[n.replace(/-(\w)/g,((e,t)=>t.toUpperCase()))]=u[n])}(e,t))),e}));function a(e,t=""){e.value=t,e.dispatchEvent(new InputEvent("input"))}function d(e,n,l){const i=e.value;if(!i)return;const u=e.selectionEnd||0,s=i.length;let r=0,c=0,d=0,f="",v=0;for(;r<s;){const e=i[r++];if(/\d/.test(e)&&(f+=e),r===u){d=f.length;const e=i.slice(r).match(/^\d+/);v=e?e[0].length:0}}const g=t(o),m=Array.isArray(g)?function(e){var t,n;let l=!1,i=e.parentNode||null;for(;i;){if(null==(n=null==(t=i.classList)?void 0:t.contains)?void 0:n.call(t,"n-time-picker")){l=!0;break}i=i.parentNode||null}return l}(e)?g[1]:g[0]:g;let h="",p=0,b=0;for(r=0;r<m.length&&(l||!(c>=f.length));){const e=m[r++];if(/[yMdHms]/.test(e)?h+=f[c++]||"0":h+=e,n&&c===d){d=-1,p=h.length,b=p;let e=m.slice(r).match(/^[yMdHms]+/);e?(v=Math.min(v,e[0].length),v&&(h+=f.slice(c,c+v),c+=v),r+=e[0].length):(e=m.slice(r).match(/^([^yMdHms]+)([yMdHms]*)/),e&&(p+=e[1].length,b=p+e[2].length))}}const D=h!==i;return D&&a(e,h),n&&(p=p||h.length+1,b=b||h.length+1,e.setSelectionRange(p,b)),D}return n(r,"input",(function(e){const t=e.target;if(!t.value||!Reflect.get(t,"_f_"))return;Reflect.set(t,"_f_",0),d(t,!0)&&(e.preventDefault(),e.stopPropagation())}),!0),n(r,"keydown",(function(e){const{key:t}=e,n=e.target;if(/\d/.test(t)&&n)Reflect.set(n,"_f_",1);else if("Enter"===t){d(n,!1,!0);const e=null==n?void 0:n.value,t=Reflect.get(u,"type")||"";e&&!t.includes("range")&&l(new Date(e))&&!function(e){const{isTimeDisabled:t,isDateDisabled:n,isHourDisabled:l,isMinuteDisabled:i,isSecondDisabled:o}=c.value;if(null==n?void 0:n(e.getTime()))return;const u=(null==t?void 0:t(e.getTime()).isHourDisabled)||l,s=(null==t?void 0:t(e.getTime()).isMinuteDisabled)||i,r=(null==t?void 0:t(e.getTime()).isSecondDisabled)||o;if(null==u?void 0:u(e.getHours()))return;if(null==s?void 0:s(e.getMinutes()))return;if(null==r?void 0:r(e.getMinutes()))return;return!0}(new Date(e))&&a(n)}else if("Backspace"===t&&!s){const e=null==n?void 0:n.value;1===(null==e?void 0:e.length)&&(a(n),n.blur(),n.focus())}}),!0),{focus:()=>{var e,t;return null==(t=null==(e=i.value)?void 0:e.focus)?void 0:t.call(e)},blur:()=>{var e,t;return null==(t=null==(e=i.value)?void 0:e.blur)?void 0:t.call(e)}}}export{i as useDateTime};
1
+ import{computed as e,unref as t}from"vue";import{useEventListener as n}from"@vueuse/core";import{isValid as l}from"date-fns";function i(i,o,u,s){const r=e((()=>{var e;return null==(e=i.value)?void 0:e.$el})),c=e((()=>{const e={};return["date","time","hour","minute","second"].forEach((t=>function(e,t){const n=`is-${t}-disabled`;u[n]&&(e[n.replace(/-(\w)/g,((e,t)=>t.toUpperCase()))]=u[n])}(e,t))),e}));function a(e,t=""){e.value=t,e.dispatchEvent(new InputEvent("input"))}function d(e,n,l){const i=e.value;if(!i)return;const u=e.selectionEnd||0,s=i.length;let r=0,c=0,d=0,f="",v=0;for(;r<s;){const e=i[r++];if(/\d/.test(e)&&(f+=e),r===u){d=f.length;const e=i.slice(r).match(/^\d+/);v=e?e[0].length:0}}const g=t(o),m=Array.isArray(g)?function(e){var t,n;let l=!1,i=e.parentNode||null;for(;i;){if(null==(n=null==(t=i.classList)?void 0:t.contains)?void 0:n.call(t,"n-time-picker")){l=!0;break}i=i.parentNode||null}return l}(e)?g[1]:g[0]:g;let h="",p=0,b=0;for(r=0;r<m.length&&(l||!(c>=f.length));){const e=m[r++];if(/[yMdHms]/.test(e)?h+=f[c++]||"0":h+=e,n&&c===d){d=-1,p=h.length,b=p;let e=m.slice(r).match(/^[yMdHms]+/);e?(v=Math.min(v,e[0].length),v&&(h+=f.slice(c,c+v),c+=v),r+=e[0].length):(e=m.slice(r).match(/^([^yMdHms]+)([yMdHms]*)/),e&&(p+=e[1].length,b=p+e[2].length))}}const D=h!==i;return D&&a(e,h),n&&(p=p||h.length+1,b=b||h.length+1,e.setSelectionRange(p,b)),D}return n(r,"input",(function(e){const t=e.target;if(!t.value||!Reflect.get(t,"_f_"))return;Reflect.set(t,"_f_",0),d(t,!0)&&(e.preventDefault(),e.stopPropagation())}),!0),n(r,"keydown",(function(e){const{key:t}=e,n=e.target;if(/\d/.test(t)&&n)Reflect.set(n,"_f_",1);else if("Enter"===t){d(n,!1,!0);const e=null==n?void 0:n.value,t=Reflect.get(u,"type")||"";e&&!t.includes("range")&&l(new Date(e))&&!function(e){const{isTimeDisabled:t,isDateDisabled:n,isHourDisabled:l,isMinuteDisabled:i,isSecondDisabled:o}=c.value;if(null==n?void 0:n(e.getTime()))return;const u=(null==t?void 0:t(e.getTime()).isHourDisabled)||l,s=(null==t?void 0:t(e.getTime()).isMinuteDisabled)||i,r=(null==t?void 0:t(e.getTime()).isSecondDisabled)||o;if(null==u?void 0:u(e.getHours()))return;if(null==s?void 0:s(e.getMinutes()))return;if(null==r?void 0:r(e.getMinutes()))return;return!0}(new Date(e))&&a(n)}else if("Backspace"===t&&!s){const e=null==n?void 0:n.value;1===(null==e?void 0:e.length)&&(a(n),n.blur(),n.focus())}}),!0),n(r,"mouseup",(function(e){const t=e.target;["INPUT"].includes(t.tagName)&&0===e.button&&function(e){const{selectionStart:t=0,selectionEnd:n=0,value:l}=e;if(t!==n)return;const i=/(\d+)/g;let o,u,s;for(;null!==(o=i.exec(l));)if(t&&o.index<=t&&t<=i.lastIndex){u=o.index,s=i.lastIndex;break}void 0!==u&&void 0!==s&&e.setSelectionRange(u,s)}(t)}),!0),{focus:()=>{var e,t;return null==(t=null==(e=i.value)?void 0:e.focus)?void 0:t.call(e)},blur:()=>{var e,t;return null==(t=null==(e=i.value)?void 0:e.blur)?void 0:t.call(e)}}}export{i as useDateTime};
@@ -1 +1 @@
1
- var e="@cnhis-design-vue/shared",s="3.1.48-release.0",i="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.48-release.0",private:!0,main:"index.ts",peerDependencies:n,dependencies:a};export{d as default,a as dependencies,i as main,e as name,n as peerDependencies,s as version};
1
+ var e="@cnhis-design-vue/shared",s="3.1.48-release.1",i="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.48-release.1",private:!0,main:"index.ts",peerDependencies:n,dependencies:a};export{d as default,a as dependencies,i as main,e as name,n as peerDependencies,s as version};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "3.1.48-release.0",
3
+ "version": "3.1.48-release.1",
4
4
  "license": "ISC",
5
5
  "module": "./es/components/index.js",
6
6
  "main": "./es/components/index.js",
@@ -63,5 +63,5 @@
63
63
  "iOS 7",
64
64
  "last 3 iOS versions"
65
65
  ],
66
- "gitHead": "1704f8a8f651cf79cbd370b341551eecf4b50499"
66
+ "gitHead": "665214e9489dcd3bce622ccaa217e852ffd636d3"
67
67
  }