cnhis-design-vue 3.1.41-beta.29 → 3.1.41-beta.30

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{createVNode as e}from"vue";import{isArray as r,isString as l}from"lodash-es";import"../../../../index.js";import{WIDGET_TYPE as o}from"../../../constants/index.js";import{defineTablePlugin as t}from"../../../hooks/useTablePlugin.js";function n(){return t({name:"labelRendererPlugin",vxe(t){t.renderer.add(o.LABEL,{renderCell(o,{row:t,column:n}){try{if(!t[n.field])return[];const o=JSON.parse(t[n.field]),i=r(o.labels)?o.labels:(a=o.labelStr,l(a)?a.split(",").map((e=>({labelName:e}))):[]);return e("section",{style:{display:"flex"}},[i.map((function(r){return e("div",{style:{backgroundColor:r.color||"#5585f5",color:"white",flex:"1"}},[r.labelName])}))])}catch(e){return[]}var a}})}})}export{n as labelRendererPlugin};
1
+ import{createVNode as e}from"vue";import{jsonParse as r}from"../../../../../../shared/utils/index.js";import{isArray as l,isString as o}from"lodash-es";import"../../../../index.js";import{WIDGET_TYPE as t}from"../../../constants/index.js";import{defineTablePlugin as n}from"../../../hooks/useTablePlugin.js";function i(){return n({name:"labelRendererPlugin",vxe(n){n.renderer.add(t.LABEL,{renderCell(t,{row:n,column:i}){try{if(!n[i.field])return[];const t=r(n[i.field]),s=l(t.labels)?t.labels:(a=t.labelStr,o(a)?a.split(",").map((e=>({labelName:e}))):[]);return e("section",{style:{display:"flex"}},[s.map((function(r){return e("div",{style:{backgroundColor:r.color||"#5585f5",color:"white",flex:"1"}},[r.labelName])}))])}catch(e){return[]}var a}})}})}export{i as labelRendererPlugin};
@@ -1 +1 @@
1
- import{defineComponent as e,watch as r,onBeforeUnmount as t,createVNode as n}from"vue";import{arrayed as i}from"../../../../../../shared/utils/index.js";import"../../../../index.js";import{WIDGET_TYPE as o}from"../../../constants/index.js";import{getRowHeight as s,IhoTableWarn as l}from"../../../utils/index.js";import u from"viewerjs";import"viewerjs/dist/viewer.css";import{defineTablePlugin as d}from"../../../hooks/useTablePlugin.js";function m(){return d({name:"pictureRendererPlugin",vxe(e){function r(e){return{renderCell(r,{row:t,column:o}){try{if(!t[o.field])return[];const r=JSON.parse(t[o.field]),l=s()-16;return[n("section",{style:"display:flex;justify-content:center"},[n(a,{style:{width:l+"px",height:l+"px",...e},images:i(r).map((e=>e.url))},null)])]}catch(e){return l(`invalid ${r.name} value of field(${o.field}): ${t[o.field]}`),[]}}}}e.renderer.add(o.PICTURE,r({})),e.renderer.add(o.HEADPORTRAIT,r({"border-radius":"50%"}))}})}const a=e({name:"ViewerImage",props:{images:{type:Array,default:()=>[]},options:{type:Object,default:()=>({})}},setup(e){let i=null;function o(){if(i)return i.show();const r=document.createElement("section");e.images.map((e=>r.appendChild(function(e){const r=new Image;return r.src=e,r}(e)))),i=new u(r,e.options).show()}return r([()=>e.images,()=>e.options],(()=>{null==i||i.destroy(),i=null}),{deep:!0}),t((()=>null==i?void 0:i.destroy())),()=>n("img",{style:"cursor:pointer",alt:"",src:e.images[0],onClick:o},null)}});export{m as pictureRendererPlugin};
1
+ import{defineComponent as e,watch as r,onBeforeUnmount as t,createVNode as n}from"vue";import{jsonParse as i,arrayed as o}from"../../../../../../shared/utils/index.js";import"../../../../index.js";import{WIDGET_TYPE as s}from"../../../constants/index.js";import{getRowHeight as l,IhoTableWarn as u}from"../../../utils/index.js";import d from"viewerjs";import"viewerjs/dist/viewer.css";import{defineTablePlugin as m}from"../../../hooks/useTablePlugin.js";function a(){return m({name:"pictureRendererPlugin",vxe(e){function r(e){return{renderCell(r,{row:t,column:s}){try{if(!t[s.field])return[];const r=i(t[s.field]),u=l()-16;return[n("section",{style:"display:flex;justify-content:center"},[n(p,{style:{width:u+"px",height:u+"px",...e},images:o(r).map((e=>e.url))},null)])]}catch(e){return u(`invalid ${r.name} value of field(${s.field}): ${t[s.field]}`),[]}}}}e.renderer.add(s.PICTURE,r({})),e.renderer.add(s.HEADPORTRAIT,r({"border-radius":"50%"}))}})}const p=e({name:"ViewerImage",props:{images:{type:Array,default:()=>[]},options:{type:Object,default:()=>({})}},setup(e){let i=null;function o(){if(i)return i.show();const r=document.createElement("section");e.images.map((e=>r.appendChild(function(e){const r=new Image;return r.src=e,r}(e)))),i=new d(r,e.options).show()}return r([()=>e.images,()=>e.options],(()=>{null==i||i.destroy(),i=null}),{deep:!0}),t((()=>null==i?void 0:i.destroy())),()=>n("img",{style:"cursor:pointer",alt:"",src:e.images[0],onClick:o},null)}});export{a as pictureRendererPlugin};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "3.1.41-beta.29",
3
+ "version": "3.1.41-beta.30",
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": "877c050a41004e6d9a9178b145134300ea1e9d7a"
64
+ "gitHead": "af489addbc42d392ef408555c7de6deb4d543fbe"
65
65
  }