cnhis-design-vue 3.2.5-beta.7 → 3.2.5-beta.9
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/iho-table/src/plugins/pagerScrollPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/checkRendererPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/stickyFixedPlugin.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useThrottleFn as t}from"@vueuse/core";import{onBeforeUnmount as
|
|
1
|
+
import{useThrottleFn as t}from"@vueuse/core";import{onBeforeUnmount as o}from"vue";import"../../../index.js";import{LOWEST_PRIORITY as e}from"../../constants/index.js";import{isPagerScrollEnable as r,scrollStateMap as a,pageCapacityCalc as i}from"./utils.js";import{defineTablePlugin as l}from"../../hooks/useTablePlugin.js";function n(){const n="pagerScrollPlugin";return l({name:n,apply(l){l.configHooks.config.tap(n,(t=>r(t)&&t.uuid?(t.scrollY={...t.scrollY,gt:0},t):t));l.eventHooks.onScroll.tap(n,t((async({$event:t},o,{$table:e,loading:i})=>{if(!r(o)||!o.uuid)return;const l=t.target;if(l&&l.classList.contains("body--wrapper")&&(console.log("target_scroll=>",l,l.scrollHeight,l.scrollTop,l.clientHeight),l.scrollHeight-l.scrollTop-l.clientHeight<3)){const t=a.getItemFromUUID(o.uuid),{capacityInfo:r,currentPage:l=0}=t;if(!r)return;if(l<r.length-1){t.currentPage=l+1;try{i.value=!0,await(null==e?void 0:e.insertAt(r[l+1].pageData,-1))}finally{i.value=!1}}}}),300)),l.dataHooks.dataList.tap({name:n,stage:e},((t,o)=>{var e,l;if(!r(o)||!o.uuid)return t;const n=a.getItemFromUUID(o.uuid);return n.dataList=t,n.capacityInfo=i(t,o),n.currentPage=0,null!=(l=null==(e=n.capacityInfo[0])?void 0:e.pageData)?l:[]})),l.setupHooks.setup.tap(n,(t=>{o((()=>{t.value.uuid&&a.removeItemFromUUID(t.value.uuid)}))}))}})}export{n as pagerScrollPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createVNode as e,defineComponent as o,inject as
|
|
1
|
+
import{createVNode as e,defineComponent as o,inject as l,computed as n}from"vue";import{isNumber as t,constant as a,isString as i}from"lodash-es";import"../../../../index.js";import{NCheckbox as d}from"naive-ui";import{defineTablePlugin as c}from"../../../hooks/useTablePlugin.js";function r(){const o="checkRendererPlugin";return c({name:o,apply(l){l.fieldHooks.field.tap(o,((l,{index:n,insertBefore:i},d)=>{if(0===n&&d.selectType&&["checkbox","radio"].includes(d.selectType)){const{radioConfig:l,checkboxConfig:n={}}=d,c={width:45,align:"center",fixed:"left",..."radio"===d.selectType?l:n,field:o,type:d.selectType,annotation:!1};n.disableHeader&&(c.slots={header:()=>e("span",{class:"checkbox-cell--disable"},null),...c.slots}),n.useNCheckbox&&(c.slots={checkbox:e=>s(e,n),header:t(n.maxCheckSize)?a([]):e=>s(e,n),...c.slots}),i(c)}return l}))}})}function s(o,l){return[e(p,{payload:o,checkboxConfig:l},null)]}const p=o({name:"IhoTableNCheckbox",props:{payload:{type:Object,default:()=>({})},checkboxConfig:{type:Object,default:()=>({})}},setup(o){const t=l("$xetable");function a(e,l){var n;l.stopPropagation(),"header"===(null==(n=o.payload)?void 0:n.type)?null==t||t.triggerCheckAllEvent(l,e):null==t||t.triggerCheckRowEvent(l,o.payload,e)}const c=n((()=>{var e,l;return i(null==(e=o.checkboxConfig)?void 0:e.indeterminateField)?null==(l=o.payload.row)?void 0:l[o.checkboxConfig.indeterminateField]:o.payload.indeterminate}));return()=>!1===o.payload.visible?null:e(d,{checked:o.payload.checked,"onUpdate:checked":e=>o.payload.checked=e,indeterminate:c.value,disabled:o.payload.disabled,onUpdateChecked:a},null)}});export{r as checkRendererPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{onBeforeUnmount as e,createVNode as l,defineComponent as t,inject as i,computed as r,watch as u,onMounted as o}from"vue";import{traverse as d}from"../../../../shared/utils/index.js";import{promiseTimeout as n}from"@vueuse/shared";import{last as s,first as a}from"lodash-es";import"../../index.js";import{LOWEST_PRIORITY as f,InjectionIhoTableConfig as h,InjectionIhoTableXeInstance as c}from"../constants/index.js";import{mergeVxeStyle as v,useUUIDMap as g,mergeVxeClass as m}from"../utils/index.js";import{defineTablePlugin as x}from"../hooks/useTablePlugin.js";function p(){const p="stickyFixedPlugin";return x({name:p,apply(x){x.configHooks.config.tap(p,((e,{$table:l})=>{var t;if(null==(t=e.stickyFixedConfig)?void 0:t.enable){const t=e=>{if(!l.value)return{left:0,right:0};return{left:l.value.getColumns().slice(0,e).reduce(((e,l)=>e+l.renderWidth),0),right:l.value.getColumns().slice(e+1).reduce(((e,l)=>e+l.renderWidth),0)}};e.cellStyle=v((({_columnIndex:e})=>({"--iho-table-fixed-left":t(e).left,"--iho-table-fixed-right":t(e).right})),e.cellStyle),e.headerCellStyle=v((({_columnIndex:e})=>({"--iho-table-fixed-left":t(e).left,"--iho-table-fixed-right":t(e).right})),e.headerCellStyle)}return e}));const{getItemFromUUID:b,removeItemFromUUID:y}=g((()=>({left:[],noFixed:[],right:[],leftEle:null,leftBorderEle:null,rightEle:null,rightBorderEle:null})));function E(e,l){const{leftEle:t,rightEle:i}=e;t&&(l.scrollLeft>0?t.classList.add("scrolling--middle"):null==t||t.classList.remove("scrolling--middle")),i&&(Math.ceil(l.scrollLeft)<l.scrollWidth-l.clientWidth?i.classList.add("scrolling--middle"):null==i||i.classList.remove("scrolling--middle"))}x.fieldHooks.fieldList.tap({name:p,stage:f},((e,l)=>{var t;if(!(null==(t=l.stickyFixedConfig)?void 0:t.enable)||!l.uuid)return e;const i=b(l.uuid);return i.left=[],i.noFixed=[],i.right=[],d(e,(e=>{e.fixed?(i[e.fixed].push(e),e.className=m(e.className,`iho-table--fixed-${e.fixed}`),e.headerClassName=m(e.headerClassName,`iho-table--fixed-${e.fixed}`)):i.noFixed.push(e),e.fixed=void 0})),[...i.left||[],...i.noFixed||[],...i.right||[]]})),x.setupHooks.setup.tap(p,(l=>{e((()=>{var e;(null==(e=l.value)?void 0:e.uuid)&&y(l.value.uuid)}))})),x.eventHooks.onScroll.tap(p,(({isX:e,$event:l},t)=>{var i;if(!e||!(null==(i=t.stickyFixedConfig)?void 0:i.enable)||!t.uuid)return;const r=l.target;if(!r)return;E(b(t.uuid),r)}));const k=t({setup(){const e=i(h),t=i(c),d=r((()=>{const l=b(e.value.uuid);return!(!l.left||!l.left.length)})),f=r((()=>{const l=b(e.value.uuid);return!(!l.right||!l.right.length)})),v=l=>{b(e.value.uuid).leftEle=l},g=l=>{b(e.value.uuid).leftBorderEle=l},m=l=>{b(e.value.uuid).rightEle=l},x=l=>{b(e.value.uuid).rightBorderEle=l};function p(){var l,i;if(!t.value||!e.value.uuid)return;const{refTableBody:r,refTableHeader:u}=t.value.getRefMaps();if(!r.value)return;const o=b(e.value.uuid);if(E(o,r.value.$el),!u.value)return;const{leftEle:d,rightBorderEle:n,rightEle:f,leftBorderEle:h}=o;if(d){const e=s(null==(l=u.value.$el)?void 0:l.querySelectorAll("th.iho-table--fixed-left"));e&&(d.style.width=e.offsetLeft+e.clientWidth+"px",h.style.width=d.style.width)}if(f){const e=a(null==(i=u.value.$el)?void 0:i.querySelectorAll("th.iho-table--fixed-right"));e&&(f.style.width=u.value.$el.clientWidth-e.offsetLeft-10+"px",n.style.width=f.style.width)}}return u([()=>b(e.value.uuid).left,()=>b(e.value.uuid).right],p),o((async()=>{await n(100),p()})),()=>[d.value?[l("div",{class:"iho-table__fixedLeftWrapper",ref:v},null),l("div",{class:"iho-table__fixedLeftTopBorder",ref:g},null)]:null,f.value?[l("div",{class:"iho-table__fixedRightWrapper",ref:m},null),l("div",{class:"iho-table__fixedRightTopBorder",ref:x},null)]:null]}}),
|
|
1
|
+
import{onBeforeUnmount as e,createVNode as l,defineComponent as t,inject as i,computed as r,watch as u,onMounted as o}from"vue";import{traverse as d}from"../../../../shared/utils/index.js";import{promiseTimeout as n}from"@vueuse/shared";import{last as s,first as a}from"lodash-es";import"../../index.js";import{LOWEST_PRIORITY as f,InjectionIhoTableConfig as h,InjectionIhoTableXeInstance as c}from"../constants/index.js";import{mergeVxeStyle as v,useUUIDMap as g,mergeVxeClass as m}from"../utils/index.js";import{defineTablePlugin as x}from"../hooks/useTablePlugin.js";function p(){const p="stickyFixedPlugin";return x({name:p,apply(x){x.configHooks.config.tap(p,((e,{$table:l})=>{var t;if(null==(t=e.stickyFixedConfig)?void 0:t.enable){const t=e=>{if(!l.value)return{left:0,right:0};return{left:l.value.getColumns().slice(0,e).reduce(((e,l)=>e+(l.resizeWidth||l.renderWidth)),0),right:l.value.getColumns().slice(e+1).reduce(((e,l)=>e+(l.resizeWidth||l.renderWidth)),0)}};e.cellStyle=v((({_columnIndex:e})=>({"--iho-table-fixed-left":t(e).left,"--iho-table-fixed-right":t(e).right})),e.cellStyle),e.headerCellStyle=v((({_columnIndex:e})=>({"--iho-table-fixed-left":t(e).left,"--iho-table-fixed-right":t(e).right})),e.headerCellStyle)}return e}));const{getItemFromUUID:b,removeItemFromUUID:y}=g((()=>({tableBody:null,left:[],noFixed:[],right:[],leftEle:null,leftBorderEle:null,rightEle:null,rightBorderEle:null})));function E(e,l){const{leftEle:t,rightEle:i}=e;t&&(l.scrollLeft>0?t.classList.add("scrolling--middle"):null==t||t.classList.remove("scrolling--middle")),i&&(Math.ceil(l.scrollLeft)<l.scrollWidth-l.clientWidth?i.classList.add("scrolling--middle"):null==i||i.classList.remove("scrolling--middle"))}x.fieldHooks.fieldList.tap({name:p,stage:f},((e,l)=>{var t;if(!(null==(t=l.stickyFixedConfig)?void 0:t.enable)||!l.uuid)return e;const i=b(l.uuid);return i.left=[],i.noFixed=[],i.right=[],d(e,(e=>{e.fixed?(i[e.fixed].push(e),e.className=m(e.className,`iho-table--fixed-${e.fixed}`),e.headerClassName=m(e.headerClassName,`iho-table--fixed-${e.fixed}`)):i.noFixed.push(e),e.fixed=void 0})),[...i.left||[],...i.noFixed||[],...i.right||[]]})),x.setupHooks.setup.tap(p,(l=>{e((()=>{var e;(null==(e=l.value)?void 0:e.uuid)&&y(l.value.uuid)}))})),x.eventHooks.onScroll.tap(p,(({isX:e,$event:l},t)=>{var i;if(!e||!(null==(i=t.stickyFixedConfig)?void 0:i.enable)||!t.uuid)return;const r=l.target;if(!r)return;E(b(t.uuid),r)})),x.eventHooks.onResizableChange.tap(p,((e,l)=>{var t;if(!(null==(t=l.stickyFixedConfig)?void 0:t.enable)||!l.uuid)return;const i=b(l.uuid);E(i,i.tableBody)}));const k=t({setup(){const e=i(h),t=i(c),d=r((()=>{const l=b(e.value.uuid);return!(!l.left||!l.left.length)})),f=r((()=>{const l=b(e.value.uuid);return!(!l.right||!l.right.length)})),v=l=>{b(e.value.uuid).leftEle=l},g=l=>{b(e.value.uuid).leftBorderEle=l},m=l=>{b(e.value.uuid).rightEle=l},x=l=>{b(e.value.uuid).rightBorderEle=l};function p(){var l,i;if(!t.value||!e.value.uuid)return;const{refTableBody:r,refTableHeader:u}=t.value.getRefMaps();if(!r.value)return;const o=b(e.value.uuid);if(o.tableBody=r.value.$el,E(o,r.value.$el),!u.value)return;const{leftEle:d,rightBorderEle:n,rightEle:f,leftBorderEle:h}=o;if(d){const e=s(null==(l=u.value.$el)?void 0:l.querySelectorAll("th.iho-table--fixed-left"));e&&(d.style.width=e.offsetLeft+e.clientWidth+"px",h.style.width=d.style.width)}if(f){const e=a(null==(i=u.value.$el)?void 0:i.querySelectorAll("th.iho-table--fixed-right"));e&&(f.style.width=u.value.$el.clientWidth-e.offsetLeft-10+"px",n.style.width=f.style.width)}}return u([()=>b(e.value.uuid).left,()=>b(e.value.uuid).right],p),o((async()=>{await n(100),p()})),()=>[d.value?[l("div",{class:"iho-table__fixedLeftWrapper",ref:v},null),l("div",{class:"iho-table__fixedLeftTopBorder",ref:g},null)]:null,f.value?[l("div",{class:"iho-table__fixedRightWrapper",ref:m},null),l("div",{class:"iho-table__fixedRightTopBorder",ref:x},null)]:null]}}),B=t({setup(){const e=i(h);return()=>{var t,i;return(null==(i=null==(t=e.value)?void 0:t.stickyFixedConfig)?void 0:i.enable)?l(k,null,null):null}}});x.domInsertHooks.header.tap(p,(e=>(e.push(l(B,null,null)),e)))}})}export{p as stickyFixedPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e="@cnhis-design-vue/shared",i="3.2.5-beta.
|
|
1
|
+
var e="@cnhis-design-vue/shared",i="3.2.5-beta.9",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.2.5-beta.9",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.2.5-beta.
|
|
3
|
+
"version": "3.2.5-beta.9",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"module": "./es/components/index.js",
|
|
6
6
|
"main": "./es/components/index.js",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"iOS 7",
|
|
72
72
|
"last 3 iOS versions"
|
|
73
73
|
],
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "4f3d48dd57218249df03603f061d4058af8f60fa"
|
|
75
75
|
}
|