cnhis-design-vue 3.1.51-beta.22 → 3.1.51-beta.23

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{defineComponent as e,computed as t,provide as a,ref as o,watch as l,resolveComponent as n,openBlock as s,createElementBlock as r,unref as i,normalizeStyle as u,createBlock as d,resolveDynamicComponent as c,createElementVNode as f,createVNode as m,mergeProps as v,createSlots as p,renderList as b,withCtx as h,createCommentVNode as g,renderSlot as x,normalizeProps as k,guardReactiveProps as y}from"vue";import{useTheme as D}from"../../../shared/hooks/useTheme.js";import{useDebounceFn as C}from"@vueuse/core";import"date-fns";import{isString as $,isFunction as j,pick as w}from"lodash-es";import{widthAppend as I,uuidGenerator as H}from"../../../shared/utils/index.js";import{promiseTimeout as T}from"@vueuse/shared";import{VxeTableEventNameList as _,InjectionIhoTableEmits as A,InjectionIhoTableAnnotation as L,InjectionIhoTableUUID as R,InjectionIhoTableInstance as E,InjectionIhoTableConfig as F,InjectionIhoTableFieldList as O,InjectionIhoTableHandler as B}from"./constants/index.js";import{createTableHooks as S,applyTableConfigHooks as W,applyTableFieldHooks as q,createTableEventHandlers as z,createDomInsertComponent as G,createDataTransfer as J}from"./hooks/tapHooks/index.js";import{provideIhoTableEventListener as K}from"./hooks/tapHooks/useEventHooks.js";import{eventName2EventListener as M}from"./utils/index.js";const N=["id"];var P=e({__name:"IhoTable",props:{tableConfig:{type:Object,default:()=>({})},fieldList:{type:Array,default:()=>[]},tableData:{type:Array,default:()=>[]},annotation:{type:Object}},emits:["formChange","settingClick","formClick","keyboard","rowDrag",..._],setup(e,{expose:_,emit:P}){var Q,U;const V=e,X=D({"--c-border-color":"#e2e2e2","--c-head-bg-color":"#f2f2f2","--c-hover-color":"#f7f7f7"}),Y=t((()=>{var e,t;const a=null!=(t=null==(e=V.tableConfig)?void 0:e.height)?t:"100%";return{height:"auto"===a?"100%":$(a)&&(a.includes("calc")||a.endsWith("%"))?a:I(a)}})),Z=K(),ee=function(e,...t){P(e,...t);const a=i(le)[M(e)];j(a)&&a(...t),Z.trigger(e,...t)};a(A,ee);const te=S();a(L,t((()=>V.annotation)));const ae=H();a(R,ae);const oe=o();a(E,oe);const le=o({uuid:null!=(U=null==(Q=V.tableConfig)?void 0:Q.uuid)?U:ae});a(F,le);const ne=C(se,10);function se(){le.value=W(te,V.tableConfig,{$table:oe,emits:ee}),le.value.uuid=ae}const re=o([]);a(O,re);const ie=C(ue,10);function ue(){re.value=q(te,V.fieldList,le.value,{$table:oe,emits:ee})}const de=J(te,le,oe),ce=o([]);async function fe(){var e,t;const a=await de(V.tableData),o=null==(e=oe.value)?void 0:e.getTableData().fullData;if(o){let e=0;if(!(o.some((t=>{var o;if(!(null==(o=oe.value)?void 0:o.isInsertByRow(t))){if(t!==a[e])return!0;e++}}))||e!==a.length))return}ce.value=a,null==(t=oe.value)||t.recalculate(!0)}const me={updateTableDataRef:C(fe,10),updateConfigRef:ne,updateFieldListRef:ie};a(B,me);const ve=z({hooks:te,config:le,$table:oe,context:me,emits:ee}),pe=t((()=>({...le.value,...ve})));let be=!1,he=!1,ge=!1;const xe=C((()=>{be&&se(),he&&ue(),ge&&fe(),be=!1,he=!1,ge=!1}),10);l((()=>V.tableConfig),(()=>{be=!0,he=!0,ge=!0,xe()}),{deep:!0}),l((()=>V.fieldList),(()=>{he=!0,ge=!0,xe()}),{deep:!0}),l([()=>[...V.tableData],()=>{var e;return null==(e=V.tableData)?void 0:e.length}],(()=>{ge=!0,xe()})),l([()=>V.tableData,()=>{var e;return null==(e=V.tableData)?void 0:e.length}],(async()=>{var e,t;(null==(e=le.value.treeConfig)?void 0:e.expandAll)&&(await T(11),null==(t=oe.value)||t.setAllTreeExpand(!0))})),se(),ue(),fe();const{header:ke,footer:ye}=G(te);function De(e){return w(e,["row","rowIndex","$rowIndex","column","columnIndex","$columnIndex","_columnIndex","checked","disabled","indeterminate"])}return _({$table:oe,async loadData(e){var t;null==(t=oe.value)||t.loadData(await de(e))},setSort:(e,t)=>({field:e,value:t}),setFilter:(e,t)=>({field:e,value:t}),reload(){var e,t;null==(e=oe.value)||e.loadColumn([]),null==(t=oe.value)||t.loadData([]),se(),ue(),fe()},...te.exposeHooks.expose.call({},le,{$table:oe,emits:ee})}),te.setupHooks.setup.call(le,re,{$table:oe,emits:ee}),(e,t)=>{const a=n("vxe-grid");return s(),r("section",{class:"iho-table",id:i(ae),style:u(i(X))},[(s(),d(c(i(ke)))),f("section",{style:u(i(Y))},[m(a,v({ref_key:"$table",ref:oe},i(pe),{columns:re.value,data:ce.value}),p({_:2},[b(e.$slots,((t,a)=>({name:a,fn:h((t=>[g(" 实际上所有的vxe-grid插槽都支持 "),x(e.$slots,a,k(y(De(t))))]))})))]),1040,["columns","data"])],4),(s(),d(c(i(ye))))],12,N)}}});export{P as default};
1
+ import{defineComponent as e,computed as t,provide as a,ref as o,toRaw as l,watch as n,resolveComponent as r,openBlock as s,createElementBlock as i,unref as u,normalizeStyle as d,createBlock as c,resolveDynamicComponent as f,createElementVNode as v,createVNode as m,mergeProps as p,createSlots as b,renderList as g,withCtx as h,createCommentVNode as x,renderSlot as k,normalizeProps as y,guardReactiveProps as D}from"vue";import{useTheme as C}from"../../../shared/hooks/useTheme.js";import{useDebounceFn as $}from"@vueuse/core";import"date-fns";import{isString as j,isEqualWith as w,isFunction as I,pick as H}from"lodash-es";import{widthAppend as T,uuidGenerator as _}from"../../../shared/utils/index.js";import{promiseTimeout as A}from"@vueuse/shared";import{VxeTableEventNameList as L,InjectionIhoTableEmits as R,InjectionIhoTableAnnotation as S,InjectionIhoTableUUID as E,InjectionIhoTableInstance as F,InjectionIhoTableConfig as O,InjectionIhoTableFieldList as B,InjectionIhoTableHandler as W}from"./constants/index.js";import{createTableHooks as q,applyTableConfigHooks as z,applyTableFieldHooks as G,createTableEventHandlers as J,createDomInsertComponent as K,createDataTransfer as M}from"./hooks/tapHooks/index.js";import{provideIhoTableEventListener as N}from"./hooks/tapHooks/useEventHooks.js";import{eventName2EventListener as P}from"./utils/index.js";const Q=["id"];var U=e({__name:"IhoTable",props:{tableConfig:{type:Object,default:()=>({})},fieldList:{type:Array,default:()=>[]},tableData:{type:Array,default:()=>[]},annotation:{type:Object}},emits:["formChange","settingClick","formClick","keyboard","rowDrag",...L],setup(e,{expose:L,emit:U}){var V,X;const Y=e,Z=C({"--c-border-color":"#e2e2e2","--c-head-bg-color":"#f2f2f2","--c-hover-color":"#f7f7f7"}),ee=t((()=>{var e,t;const a=null!=(t=null==(e=Y.tableConfig)?void 0:e.height)?t:"100%";return{height:"auto"===a?"100%":j(a)&&(a.includes("calc")||a.endsWith("%"))?a:T(a)}})),te=N(),ae=function(e,...t){U(e,...t);const a=u(re)[P(e)];I(a)&&a(...t),te.trigger(e,...t)};a(R,ae);const oe=q();a(S,t((()=>Y.annotation)));const le=_();a(E,le);const ne=o();a(F,ne);const re=o({uuid:null!=(X=null==(V=Y.tableConfig)?void 0:V.uuid)?X:le});a(O,re);const se=$(ie,10);function ie(){re.value=z(oe,Y.tableConfig,{$table:ne,emits:ae}),re.value.uuid=le}const ue=o([]);a(B,ue);const de=$(ce,10);function ce(){const e=G(oe,Y.fieldList,re.value,{$table:ne,emits:ae});w(e,l(ue.value),((e,t)=>{if(I(e)&&I(t))return e.toString()===t.toString()}))||(ue.value=e)}const fe=M(oe,re,ne),ve=o([]);async function me(){var e,t;const a=await fe(Y.tableData),o=null==(e=ne.value)?void 0:e.getTableData().fullData;if(o){let e=0;if(!(o.some((t=>{var o;if(!(null==(o=ne.value)?void 0:o.isInsertByRow(t))){if(t!==a[e])return!0;e++}}))||e!==a.length))return}ve.value=a,null==(t=ne.value)||t.recalculate(!0)}const pe={updateTableDataRef:$(me,10),updateConfigRef:se,updateFieldListRef:de};a(W,pe);const be=J({hooks:oe,config:re,$table:ne,context:pe,emits:ae}),ge=t((()=>({...re.value,...be})));let he=!1,xe=!1,ke=!1;const ye=$((()=>{he&&ie(),xe&&ce(),ke&&me(),he=!1,xe=!1,ke=!1}),10);n((()=>Y.tableConfig),(()=>{he=!0,xe=!0,ke=!0,ye()}),{deep:!0}),n((()=>Y.fieldList),(()=>{xe=!0,ke=!0,ye()}),{deep:!0}),n([()=>[...Y.tableData],()=>{var e;return null==(e=Y.tableData)?void 0:e.length}],(()=>{ke=!0,ye()})),n([()=>Y.tableData,()=>{var e;return null==(e=Y.tableData)?void 0:e.length}],(async()=>{var e,t;(null==(e=re.value.treeConfig)?void 0:e.expandAll)&&(await A(11),null==(t=ne.value)||t.setAllTreeExpand(!0))})),ie(),ce(),me();const{header:De,footer:Ce}=K(oe);function $e(e){return H(e,["row","rowIndex","$rowIndex","column","columnIndex","$columnIndex","_columnIndex","checked","disabled","indeterminate"])}return L({$table:ne,async loadData(e){var t;null==(t=ne.value)||t.loadData(await fe(e))},setSort:(e,t)=>({field:e,value:t}),setFilter:(e,t)=>({field:e,value:t}),reload(){var e,t;null==(e=ne.value)||e.loadColumn([]),null==(t=ne.value)||t.loadData([]),ie(),ce(),me()},...oe.exposeHooks.expose.call({},re,{$table:ne,emits:ae})}),oe.setupHooks.setup.call(re,ue,{$table:ne,emits:ae}),(e,t)=>{const a=r("vxe-grid");return s(),i("section",{class:"iho-table",id:u(le),style:d(u(Z))},[(s(),c(f(u(De)))),v("section",{style:d(u(ee))},[m(a,p({ref_key:"$table",ref:ne},u(ge),{columns:ue.value,data:ve.value}),b({_:2},[g(e.$slots,((t,a)=>({name:a,fn:h((t=>[x(" 实际上所有的vxe-grid插槽都支持 "),k(e.$slots,a,y(D($e(t))))]))})))]),1040,["columns","data"])],4),(s(),c(f(u(Ce))))],12,Q)}}});export{U as default};
@@ -1 +1 @@
1
- var e="@cnhis-design-vue/shared",i="3.1.51-beta.22",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.51-beta.22",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};
1
+ var e="@cnhis-design-vue/shared",i="3.1.51-beta.23",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.51-beta.23",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.51-beta.22",
3
+ "version": "3.1.51-beta.23",
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": "7af86b94363fdf437375f9cef0ec6a62e082afc4"
66
+ "gitHead": "4de78eb82319e59a692b6a00651de15a8e702a9d"
67
67
  }