cnhis-design-vue 3.2.3-beta.12 → 3.2.3-beta.13

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.
@@ -457,9 +457,9 @@ declare const _default: import("vue").DefineComponent<{
457
457
  requiredDisable: boolean;
458
458
  hide: boolean;
459
459
  }>;
460
+ isHighlightRow: boolean;
460
461
  idx: number;
461
462
  isHighlight: boolean;
462
- isHighlightRow: boolean;
463
463
  }>;
464
464
  EditDialog: import("vue").DefineComponent<{
465
465
  visible: {
@@ -575,9 +575,9 @@ declare const _default: import("vue").DefineComponent<{
575
575
  requiredDisable: boolean;
576
576
  hide: boolean;
577
577
  }>;
578
+ isHighlightRow: boolean;
578
579
  idx: number;
579
580
  isHighlight: boolean;
580
- isHighlightRow: boolean;
581
581
  }>;
582
582
  isArray: {
583
583
  (value?: any): value is any[];
@@ -282,8 +282,8 @@ declare const _default: import("vue").DefineComponent<{
282
282
  requiredDisable: boolean;
283
283
  hide: boolean;
284
284
  }>;
285
+ isHighlightRow: boolean;
285
286
  idx: number;
286
287
  isHighlight: boolean;
287
- isHighlightRow: boolean;
288
288
  }>;
289
289
  export default _default;
@@ -1 +1 @@
1
- import{findAncestor as e}from"../../../../../../../shared/utils/index.js";import{onBeforeUnmount as t,unref as i}from"vue";import{WIDGET_TYPE as n}from"../../../../constants/index.js";import{isVerticalTable as o,isVerticalHeader as l}from"../utils.js";const d=["RADIO","SWITCH"],r=(r,u,s)=>{u.eventHooks.onCellClick.tap("useEditCell",(({column:e,row:t,$columnIndex:i},n)=>{var l,d;const{uuid:r}=n;if(!r||!o(n))return;const u=s(r);u&&e.editRender&&(u.editCell=t&&i<=(null!=(d=null==(l=u.fixedLeftVerticalData)?void 0:l.length)?d:0)?{row:t,column:e}:null)})),r.config.tap("useEditCell",((t,i)=>(t.uuid&&(i.editStateEvent&&window.removeEventListener("click",i.editStateEvent,{capture:!0}),i.editStateEvent=n=>{e(n.target,(e=>e.getAttribute("uuid")===t.uuid||e.classList.contains("vxe-table--ignore-clear")))||(i.editCell=null)},window.addEventListener("click",i.editStateEvent,{capture:!0})),t.editConfig={...t.editConfig,showIcon:!1,beforeEditMethod({row:e,column:t}){var i;const{originalField:o={}}=e;if(l(t.field))return!1;const{editRender:{name:r=n.DEFAULT}={}}=o;return!Object.values(n).concat(d).includes(r)&&(!(null==(i=o.slots)?void 0:i.default)||!!o.slots.edit)}},t))),u.setupHooks.setup.tap("Vertical-UseEditCell",(e=>{t((()=>{const{uuid:t}=i(e)||{};if(!t)return;const n=s(t);n.editStateEvent&&window.removeEventListener("click",n.editStateEvent,{capture:!0})}))}))};export{r as useEditCell};
1
+ import{findAncestor as e}from"../../../../../../../shared/utils/index.js";import{isFunction as t}from"lodash-es";import{onBeforeUnmount as i,unref as n}from"vue";import{WIDGET_TYPE as o}from"../../../../constants/index.js";import{isVerticalTable as l,createVerticalStateHandler as r,isVerticalHeader as d,basicParamsConvert as u}from"../utils.js";const s=["RADIO","SWITCH"],c=(c,a,f)=>{a.eventHooks.onCellClick.tap("useEditCell",((e,i)=>{var n,o;const{uuid:d}=i;if(!d||!l(i))return;const{row:u,$columnIndex:s,column:c}=e,a=f(d);if(!a||!c.editRender)return;const v=r(a).getTableConfig("editConfig.beforeEditMethod");!t(v)||v(e)?a.editCell=u&&s<=(null!=(o=null==(n=a.fixedLeftVerticalData)?void 0:n.length)?o:0)?{row:u,column:c}:null:a.editCell=null})),c.config.tap("useEditCell",((i,n)=>(i.uuid&&(n.editStateEvent&&window.removeEventListener("click",n.editStateEvent,{capture:!0}),n.editStateEvent=t=>{e(t.target,(e=>e.getAttribute("uuid")===i.uuid||e.classList.contains("vxe-table--ignore-clear")))||(n.editCell=null)},window.addEventListener("click",n.editStateEvent,{capture:!0})),i.editConfig={...i.editConfig,showIcon:!1,beforeEditMethod(e){var i;const{row:l,column:c}=e,{originalField:a={}}=l;if(d(c.field))return!1;const{editRender:{name:f=o.DEFAULT}={}}=a;if(Object.values(o).concat(s).includes(f))return!1;if(null==(i=a.slots)?void 0:i.default)return!!a.slots.edit;const v=r(n).getTableConfig("editConfig.beforeEditMethod");return!t(v)||v(u(e,n))}},i))),a.setupHooks.setup.tap("Vertical-UseEditCell",(e=>{i((()=>{const{uuid:t}=n(e)||{};if(!t)return;const i=f(t);i.editStateEvent&&window.removeEventListener("click",i.editStateEvent,{capture:!0})}))}))};export{c as useEditCell};
@@ -1 +1 @@
1
- import{isObject as e}from"lodash-es";import{unref as l}from"vue";import{isVerticalTable as o,isVerticalHeader as n,getHeaderDepthByField as r,getOriginFieldFromRowData as d,getOriginRowFromRowData as t}from"../utils.js";const c=(c,i,a)=>{i.eventHooks.beforeEvent.tap("Vertical--useEventConvert",((c,i,u,m)=>{var x,v;if(!e(c))return c;const h=null==(x=l(i))?void 0:x.uuid;if(!h||!o(i))return c;const I=c,{$table:f,$event:b,cell:s}=I;let{$columnIndex:k,$rowIndex:C,column:p,columnIndex:w,row:$,rowIndex:y,type:D,_rowIndex:_,_columnIndex:g}=I;if(p&&(D=n(p.field)?"header":"body","headerCellClick"===m&&"body"===D?m="cellClick":"cellClick"===m&&"header"===D&&(m="headerCellClick"),"headerCellDblclick"===m&&"body"===D?m="cellDblclick":"cellDblclick"===m&&"header"===D&&(m="headerCellDblclick"),$)){const e=r(p.field);p=d($),$="header"===D?void 0:t($,e),g=w=k="header"===I.type?C||0:((null==(v=a(h).fixedLeftVerticalData)?void 0:v.length)||0)+(C||0),_=y=C="header"===D?-1:e}return{_originalPayload:I,$table:f,$event:b,cell:s,type:D,row:$,column:p,rowIndex:y,columnIndex:w,$rowIndex:C,$columnIndex:k,_rowIndex:_,_columnIndex:g,eventName:m,verticalState:a(h)}}))};export{c as useEventConvert};
1
+ import{isObject as e}from"lodash-es";import{unref as l}from"vue";import{isVerticalTable as t,basicParamsConvert as r}from"../utils.js";const c=(c,o,i)=>{o.eventHooks.beforeEvent.tap("Vertical--useEventConvert",((c,o,a,n)=>{var d;if(!e(c))return c;const v=null==(d=l(o))?void 0:d.uuid;if(!v||!t(o))return c;const u=c,b=i(v),{$table:k,$event:s,cell:C}=u,m=r(u,b),h=m.type;return u.column&&("headerCellClick"===n&&"body"===h?n="cellClick":"cellClick"===n&&"header"===h&&(n="headerCellClick"),"headerCellDblclick"===n&&"body"===h?n="cellDblclick":"cellDblclick"===n&&"header"===h&&(n="headerCellDblclick")),{_originalPayload:u,$table:k,$event:s,cell:C,...m,eventName:n,verticalState:b}}))};export{c as useEventConvert};
@@ -36,3 +36,24 @@ export declare function createVerticalStateHandler(verticalState: IhoTableVertic
36
36
  readonly getTableConfig: (path: string) => any;
37
37
  };
38
38
  export declare function createDataProxy(originalField: IhoTableFieldItem, dataList: AnyObject[] | (() => AnyObject[])): {};
39
+ export declare function basicParamsConvert({ $columnIndex, $rowIndex, column, columnIndex, row, rowIndex, type, _columnIndex, _rowIndex }: Partial<{
40
+ $columnIndex: number;
41
+ $rowIndex: number;
42
+ column: VxeTableDefines.ColumnInfo;
43
+ columnIndex: number;
44
+ row: AnyObject;
45
+ rowIndex: number;
46
+ type: 'body' | 'header';
47
+ _columnIndex: number;
48
+ _rowIndex: number;
49
+ }>, verticalState: IhoTableVerticalState): {
50
+ column: VxeTableDefines.ColumnInfo | undefined;
51
+ row: AnyObject | undefined;
52
+ _columnIndex: number | undefined;
53
+ _rowIndex: number | undefined;
54
+ columnIndex: number | undefined;
55
+ rowIndex: number | undefined;
56
+ $columnIndex: number | undefined;
57
+ $rowIndex: number | undefined;
58
+ type: "body" | "header" | undefined;
59
+ };
@@ -1 +1 @@
1
- import{traverse as e,findAncestor as n,getStringWidth as t}from"../../../../../../shared/utils/index.js";import{isString as r,isNumber as i,constant as o,isFunction as a,noop as l,range as u,property as c}from"lodash-es";import{IhoTableRenderHelper as d}from"../../../utils/index.js";import{VERTICAL_CELL_TYPE as f}from"./constants.js";function s(e){var n;return!!(null==(n=e.verticalConfig)?void 0:n.enable)}function p(e){return!!r(e)&&e.startsWith("header_")}function h(e){return!!r(e)&&e.startsWith("body_")}function _(e){var n;return r(e)?+(null!=(n=e.split("_")[1])?n:-1):-1}function g(n,t){const r=[];return e(n,((e,n,o)=>{e.parent=o,e.children||(!function(e,n){let t=e,r=n;if(!e.parent)return e[`header_${n}`]=e.title,void u(n+1).forEach((t=>{e[`header_${t}_colspan`]=t===n?n+1:0,e[`header_${t}_rowspan`]=t===n?1:0}));for(;t;)e[`header_${r}`]=t.title,e[`header_${r}_rowspan`]=i(t),e[`header_${r}_colspan`]=1,r--,t=t.parent}(e,t),r.push(e))})),r.forEach(((e,n)=>{const i=r[n-1];i&&Object.entries(e).forEach((([n,r])=>{n.match(/^header_(\d+)$/)&&r===i[n]&&r&&n!==`header_${t}`&&(e[`${n}_colspan`]=0,e[`${n}_rowspan`]=0)}))})),r;function i(n){if(!n.children)return 1;let t=0;return e(n.children,(e=>{e.children||t++})),t}}function m({row:e,column:n}){var t,r;return p(n.field)?{rowspan:null!=(t=e[n.field+"_rowspan"])?t:1,colspan:null!=(r=e[n.field+"_colspan"])?r:1}:{colspan:1,rowspan:1}}const $=({cell:e}={})=>{const n=e&&e.querySelector("input,.n-input__input-el");return n&&n.click(),n};function b(n,r){let i=120;return e(r,((e,r,o,a)=>{a===n&&(i=Math.max(i,t(e.title||"")+20+(d.hasTitlePrefix(e)?20:0)))})),Math.ceil(i)}function y(e,n,t){const r=W(t);let c=r.getTableConfig("verticalConfig.headerWidth");c="auto"===c?b:i(c)?o(c):a(c)?c:b;let d=r.getTableConfig("verticalConfig.bodyWidth");d=i(d)?o(d):a(d)?d:l;let s=r.getTableConfig("verticalConfig.bodyMinWidth");return s=i(s)?o(s):a(s)?s:o(120),[...u(n+1).map((e=>({field:`header_${e}`,title:`header_${e}`,width:c(e,t.originalFieldList),fixed:"left",editRender:{name:f,props:{},enable:!1}}))),...e.map(((e,n)=>({field:`body_${n}`,title:`body_${n}`,minWidth:s(n),width:d(n),editRender:{name:f,props:{},enable:!0,autofocus:$}})))]}function w(e){const t=n(e.target,(e=>"TD"===e.tagName||"TH"===e.tagName));if(!t)return;const r=t.className.match(/(body|header)_(\d+)/);if(!r)return;const[i,o,a]=r;return{fieldKey:i,type:o,sequence:+a}}function x(e){return c("originalField")(e)}function v(e,n){return c(`originalData.${n}`)(e)}function C(e,n){const t=_(n.field),r=x(e);return{row:v(e,t),rowIndex:t,$rowIndex:t,column:r,fixed:r.fixed,type:r.type}}function T(n){const t=[];return e(n,(e=>{"left"===e.fixed&&t.push(e)})),t}function W(e){return{getOriginDataByColumn(n){const{originalData:t=[]}=e;return t[_(n.field)]},getTableConfig:n=>c(n)(e.originalTableConfig)}}function D(e,n){return new Proxy({},{get(t,r){var i;if("originalField"===r)return e;if("originalData"===r)return a(n)?n():n;if(p(r))return e[r];if(h(r)){const t=_(r);return"seq"===e.type?t+1:null==(i=n[t])?void 0:i[e.field]}return t[r]},set(t,r,i){if(!p(r)){const t=_(r);t>=0&&n[t]&&(n[t][e.field]=i)}return!0}})}$.toString=()=>"input,.n-input__input-el";export{g as bindHeaderInfoAndFlatten,D as createDataProxy,y as createVerticalFieldList,W as createVerticalStateHandler,T as findFixedLeftFields,_ as getHeaderDepthByField,C as getOriginBasePayload,x as getOriginFieldFromRowData,v as getOriginRowFromRowData,m as getSpanInfo,w as getVerticalInfoFromEvent,h as isVerticalBody,p as isVerticalHeader,s as isVerticalTable};
1
+ import{traverse as e,findAncestor as n,getStringWidth as t}from"../../../../../../shared/utils/index.js";import{isString as r,isNumber as i,constant as o,isFunction as l,noop as a,range as d,property as u}from"lodash-es";import{IhoTableRenderHelper as c}from"../../../utils/index.js";import{VERTICAL_CELL_TYPE as f}from"./constants.js";function s(e){var n;return!!(null==(n=e.verticalConfig)?void 0:n.enable)}function h(e){return!!r(e)&&e.startsWith("header_")}function p(e){return!!r(e)&&e.startsWith("body_")}function _(e){var n;return r(e)?+(null!=(n=e.split("_")[1])?n:-1):-1}function m(n,t){const r=[];return e(n,((e,n,o)=>{e.parent=o,e.children||(!function(e,n){let t=e,r=n;if(!e.parent)return e[`header_${n}`]=e.title,void d(n+1).forEach((t=>{e[`header_${t}_colspan`]=t===n?n+1:0,e[`header_${t}_rowspan`]=t===n?1:0}));for(;t;)e[`header_${r}`]=t.title,e[`header_${r}_rowspan`]=i(t),e[`header_${r}_colspan`]=1,r--,t=t.parent}(e,t),r.push(e))})),r.forEach(((e,n)=>{const i=r[n-1];i&&Object.entries(e).forEach((([n,r])=>{n.match(/^header_(\d+)$/)&&r===i[n]&&r&&n!==`header_${t}`&&(e[`${n}_colspan`]=0,e[`${n}_rowspan`]=0)}))})),r;function i(n){if(!n.children)return 1;let t=0;return e(n.children,(e=>{e.children||t++})),t}}function g({row:e,column:n}){var t,r;return h(n.field)?{rowspan:null!=(t=e[n.field+"_rowspan"])?t:1,colspan:null!=(r=e[n.field+"_colspan"])?r:1}:{colspan:1,rowspan:1}}const x=({cell:e}={})=>{const n=e&&e.querySelector("input,.n-input__input-el");return n&&n.click(),n};function w(n,r){let i=120;return e(r,((e,r,o,l)=>{l===n&&(i=Math.max(i,t(e.title||"")+20+(c.hasTitlePrefix(e)?20:0)))})),Math.ceil(i)}function $(e,n,t){const r=T(t);let u=r.getTableConfig("verticalConfig.headerWidth");u="auto"===u?w:i(u)?o(u):l(u)?u:w;let c=r.getTableConfig("verticalConfig.bodyWidth");c=i(c)?o(c):l(c)?c:a;let s=r.getTableConfig("verticalConfig.bodyMinWidth");return s=i(s)?o(s):l(s)?s:o(120),[...d(n+1).map((e=>({field:`header_${e}`,title:`header_${e}`,width:u(e,t.originalFieldList),fixed:"left",editRender:{name:f,props:{},enable:!1}}))),...e.map(((e,n)=>({field:`body_${n}`,title:`body_${n}`,minWidth:s(n),width:c(n),editRender:{name:f,props:{},enable:!0,autofocus:x}})))]}function y(e){const t=n(e.target,(e=>"TD"===e.tagName||"TH"===e.tagName));if(!t)return;const r=t.className.match(/(body|header)_(\d+)/);if(!r)return;const[i,o,l]=r;return{fieldKey:i,type:o,sequence:+l}}function b(e){return u("originalField")(e)}function v(e,n){return u(`originalData.${n}`)(e)}function I(e,n){const t=_(n.field),r=b(e);return{row:v(e,t),rowIndex:t,$rowIndex:t,column:r,fixed:r.fixed,type:r.type}}function C(n){const t=[];return e(n,(e=>{"left"===e.fixed&&t.push(e)})),t}function T(e){return{getOriginDataByColumn(n){const{originalData:t=[]}=e;return t[_(n.field)]},getTableConfig:n=>u(n)(e.originalTableConfig)}}function D(e,n){return new Proxy({},{get(t,r){var i;if("originalField"===r)return e;if("originalData"===r)return l(n)?n():n;if(h(r))return e[r];if(p(r)){const t=_(r);return"seq"===e.type?t+1:null==(i=n[t])?void 0:i[e.field]}return t[r]},set(t,r,i){if(!h(r)){const t=_(r);t>=0&&n[t]&&(n[t][e.field]=i)}return!0}})}function W({$columnIndex:e,$rowIndex:n,column:t,columnIndex:r,row:i,rowIndex:o,type:l,_columnIndex:a,_rowIndex:d},u){var c;if(t){const f=l;if(l=h(t.field)?"header":"body",i){const s=_(t.field);t=b(i),i="header"===l?void 0:v(i,s),a=r=e="header"===f?n||0:((null==(c=u.fixedLeftVerticalData)?void 0:c.length)||0)+(n||0),d=o=n="header"===l?-1:s}}return{column:t,row:i,_columnIndex:a,_rowIndex:d,columnIndex:r,rowIndex:o,$columnIndex:e,$rowIndex:n,type:l}}x.toString=()=>"input,.n-input__input-el";export{W as basicParamsConvert,m as bindHeaderInfoAndFlatten,D as createDataProxy,$ as createVerticalFieldList,T as createVerticalStateHandler,C as findFixedLeftFields,_ as getHeaderDepthByField,I as getOriginBasePayload,b as getOriginFieldFromRowData,v as getOriginRowFromRowData,g as getSpanInfo,y as getVerticalInfoFromEvent,p as isVerticalBody,h as isVerticalHeader,s as isVerticalTable};
@@ -1 +1 @@
1
- var e="@cnhis-design-vue/shared",i="3.2.3-beta.12",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.3-beta.12",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.2.3-beta.13",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.3-beta.13",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.3-beta.12",
3
+ "version": "3.2.3-beta.13",
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": "904cab1c33b29aca18683da433a241ac5a6e6ef9"
74
+ "gitHead": "8ec6c5f452bded81b77937a624340f19a77f81f7"
75
75
  }