cnhis-design-vue 3.2.4-beta.16 → 3.2.4-beta.18
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/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/seqRendererPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/rowDragPlugin.js +1 -1
- package/es/components/iho-table/src/types/index.d.ts +1 -0
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{reactive as e,inject as o,createVNode as l,mergeProps as
|
|
1
|
+
import{reactive as e,inject as o,createVNode as l,mergeProps as n,onBeforeUnmount as t}from"vue";import{arrayed as i}from"../../../../../../../shared/utils/index.js";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as r,InjectionIhoTableUUID as d}from"../../../../constants/index.js";import{useAutoFocus as u}from"../hooks/useAutoFocus.js";import{getTitle as s,IhoTableRenderHelper as a,IhoTableUtils as c}from"../../../../utils/index.js";import p from"./editSelect.js";import{getDefaultValue as f,isConnectField as m,getArray as v}from"./selectUtils.js";import{getSelectOptions as w,selectOptionsMap as C}from"../hooks/useSelectOption.js";import{cloneDeep as y,isFunction as b,isEqual as g}from"lodash-es";import{defineTablePlugin as h}from"../../../../hooks/useTablePlugin.js";function P(){const P="selectRendererPlugin",x=e(new Map);function E(e){return!0===e||"1"===e}return h({name:P,vxe(e){e.renderer.add(r.SELECT,{renderCell({props:e},{row:n,column:t,$table:r}){var u,a,c,p,m,v;const C=o(d),y=w(C,t.field,n,r);if(e&&e.labelToValue&&y.length){const o=E(null!=(a=null==(u=e.componentProps)?void 0:u.allowModify)?a:e.allowModify),l=E(null!=(p=null==(c=e.componentProps)?void 0:c.allowCreate)?p:e.allowCreate)||o;if(!o&&!l){const o=n[t.field],{aliasField:l="",labelField:i="label",valueField:r="value"}=e.componentProps||{};if(!y.find((e=>e[r]===o))){const e=y.find((e=>e[i]===o||e[l]===o));e?n[t.field]=e[r]:Reflect.deleteProperty(n,t.field)}}}const b=f(n,e,y),g=i(b).join(","),h=e&&(null==(m=e.componentProps)?void 0:m.multiple)&&(E(e.variableHeight)||(null==(v=e.componentProps)?void 0:v.indexedText));return[l("span",{title:s(t,g),class:"iho-table__colorAndIcon"},[h?i(b).reduce(((e,o)=>(null!=o&&e.push([o,";",l("br",null,null)]),e)),[]):g])]},renderEdit:a.createRenderEdit((({fieldItem:e,emitFormClick:t,row:i,column:r,$rowIndex:u,$table:s})=>{var a,c,f,m;const v=o(d),C=w(v,r.field,i,s),y=E(null!=(c=null==(a=e.componentProps)?void 0:a.allowModify)?c:e.allowModify),b=E(null!=(m=null==(f=e.componentProps)?void 0:f.allowCreate)?m:e.allowCreate)||y;return[l(p,n({queryOptions:e.queryOptions},e.componentProps,{options:C,column:r,row:i,"row-index":u,value:i[r.field],"onUpdate:value":e=>i[r.field]=e,allowModify:y,allowCreate:b,onClick:t}),null)]}))})},apply(e){async function o(e,o={}){var l,n,t;const i=null==(l=e.editRender)?void 0:l.props;if(!i)return[];let r=v(i.options)||v(null==(n=i.componentProps)?void 0:n.options)||[];if(i.queryOptions)try{const l={column:e,isFullData:!0,...o};r=await(null==(t=i.queryOptions)?void 0:t.call(i,l))}catch(e){console.log(`获取${i.field}_options错误`)}return r}function l(e){return e&&c.getCellType(e)===r.SELECT}u(e).bindAutoFocusConfig(P,r.SELECT,".n-base-selection-input,.n-base-selection-tags"),e.fieldHooks.fieldList.tap(P,((e,{uuid:n})=>{if(n){C.get(n)||C.set(n,{}),x.set(n,y(e));const t=C.get(n);e.forEach((async n=>{var i;const r=null==(i=n.editRender)?void 0:i.props;if(n.field&&r&&l(r)&&!m(e,n.field)){if(b(r.queryOptions)&&t[n.field])return;t[n.field]=[],t[n.field]=await o(n)}}))}return e})),e.dataHooks.data.tap(P,((e,{uuid:n},t)=>{if(!n)return;const i=x.get(n);if(!i||!i.length)return;const r=C.get(n);i.forEach((async n=>{var t;const d=null==(t=n.editRender)?void 0:t.props;if(n.field&&d&&l(d)&&(null==d?void 0:d.connectField)){const l=d.connectField.split(","),t=e[d.columnName];l.forEach((async l=>{const u=null==i?void 0:i.find((e=>e.field===l));if(!u)return;const s=t?`${l}__${d.columnName}-${t}`:l;r[s]||(r[s]=[],r[s]=await o(u,{row:e,connectColumn:n}))}))}}))})),e.setupHooks.setup.tap(P,(e=>{t((()=>{var o;const l=null==(o=e.value)?void 0:o.uuid;l&&(C.delete(l),x.delete(l))}))})),e.eventHooks.onCellDblclick.tap(P,((e,o,{emits:n})=>{var t,i,r;const{$table:d,row:u,column:s}=e,a=Reflect.get(e,"verticalState");let{column:c,row:p}=d.reactData.editStore.actived;if(!(c&&p||(a&&(c=null==(t=a.editCell)?void 0:t.column,p=null==(i=a.editCell)?void 0:i.row),c&&p)))return;a&&(c=s,p=u);const f=null==(r=c.editRender)?void 0:r.props,{cellDblclickSelectable:m=!1,multiple:v=!1,valueField:C="value"}=f.componentProps||{};if(!m||!l(f))return;const y=o.uuid&&w(o.uuid,c.field,p,d);if(1!==(null==y?void 0:y.length))return;const b=v?[y[0][C]]:y[0][C],h=p[c.field];d.clearEdit(),g(b,h)||(p[c.field]=b,n("formChange",{column:c,row:p,oldValue:h,value:b,index:d.getRowIndex(p),$table:d,option:y[0]}),a&&(a.editCell=null))}))}})}export{P as selectRendererPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{inject as o,createVNode as n}from"vue";import{SettingsSharp as e}from"@vicons/ionicons5";import{isFunction as i}from"lodash-es";import{NIcon as t}from"naive-ui";import"../../../../index.js";import{InjectionIhoTableEmits as l}from"../../../constants/index.js";import{IhoTableStatusHelper as s}from"../../../utils/index.js";import{defineTablePlugin as r}from"../../../hooks/useTablePlugin.js";function f(){const f="seqRendererPlugin";return r({name:f,apply(r){r.fieldHooks.field.tap({name:f,before:"checkRendererPlugin"},((r,{index:u,insertBefore:
|
|
1
|
+
import{inject as o,createVNode as n}from"vue";import{SettingsSharp as e}from"@vicons/ionicons5";import{isFunction as i}from"lodash-es";import{NIcon as t}from"naive-ui";import"../../../../index.js";import{InjectionIhoTableEmits as l}from"../../../constants/index.js";import{IhoTableStatusHelper as s}from"../../../utils/index.js";import{defineTablePlugin as r}from"../../../hooks/useTablePlugin.js";function f(){const f="seqRendererPlugin";return r({name:f,apply(r){r.fieldHooks.field.tap({name:f,before:"checkRendererPlugin"},((r,{index:u,insertBefore:d},m)=>{var c,a,p,g,v;if(0===u&&m.showSeq){const r={align:"center",fixed:"left",width:50,type:"seq",field:f,annotation:!1,...null==(c=m.columnConfig)?void 0:c.seqConfig,slots:{header(){if(s.isPositive(m.hideSettingBtn))return[];const i=o(l);return[n(t,{style:{cursor:"pointer"},size:"14",color:"#777",component:e,onClick:function(){i&&i("settingClick")}},null)]},...null==(p=null==(a=m.columnConfig)?void 0:a.seqConfig)?void 0:p.slots}};i(null==(g=m.columnConfig)?void 0:g.seqSlotFn)&&(r.slots||(r.slots={}),r.slots.default=m.columnConfig.seqSlotFn),(null==(v=m.sortableConfig)?void 0:v.enable)&&(r.className="col--drag",r.fixed=void 0),d(r)}return r}))}})}export{f as seqRendererPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{promiseTimeout as e}from"@vueuse/shared";import{isFunction as l,cloneDeep as n}from"lodash-es";import{nextTick as o,onBeforeUnmount as t}from"vue";import"../../index.js";import i from"sortablejs";import d from"xe-utils";import{defineTablePlugin as r}from"../hooks/useTablePlugin.js";function a(){const n="rowDragPlugin",d=new Map;return r({name:n,apply(r){r.fieldHooks.fieldEnd.tapPromise(n,(async(n,{$table:t,emits:r})=>{const{uuid:a}=n,s=n.sortableConfig||{};a&&s.enable&&!d.get(a)&&(await o(),async function n(o=0){if(o>2)return;const c=function(){var e,l,n,o,i,d,r
|
|
1
|
+
import{promiseTimeout as e}from"@vueuse/shared";import{isFunction as l,cloneDeep as n}from"lodash-es";import{nextTick as o,onBeforeUnmount as t}from"vue";import"../../index.js";import i from"sortablejs";import d from"xe-utils";import{defineTablePlugin as r}from"../hooks/useTablePlugin.js";function a(){const n="rowDragPlugin",d=new Map;return r({name:n,apply(r){r.fieldHooks.fieldEnd.tapPromise(n,(async(n,{$table:t,emits:r})=>{const{uuid:a}=n,s=n.sortableConfig||{};a&&s.enable&&!d.get(a)&&(await o(),async function n(o=0){if(o>2)return;const c=function(){var e,l,n,o,i,d,r;const a=null==(o=null==(n=null==(l=null==(e=t.value)?void 0:e.$el)?void 0:l.querySelector)?void 0:n.call(l,".vxe-table--body"))?void 0:o.scrollWidth,u=".body--wrapper>.vxe-table--body tbody";return a?null==(r=null==(d=null==(i=t.value)?void 0:i.$el)?void 0:d.querySelector)?void 0:r.call(d,u):null}();if(c){const e=i.create(c,{handle:".col--seq",...s,onEnd:e=>{var n,o,i,d,a,c,v;const{oldIndex:f=0,newIndex:p=0}=e,x={oldIndex:f,newIndex:p},{virtualY:b}=(null==(n=t.value)?void 0:n.getScroll())||{};if(b){const e=(null==(d=null==(i=null==(o=t.value)?void 0:o.getTableData())?void 0:i.tableData)?void 0:d[f])||{},l=null!=(v=null!=(c=e.__currentIndex)?c:null==(a=t.value)?void 0:a.getVTRowIndex(e))?v:0,n=l+(p-f);e.__currentIndex=n,x.oldIndex=l,x.newIndex=n}const m={...e,...x,...u(e,x,t.value)};r("rowDrag",m),l(s.onEnd)&&s.onEnd(m)}});return d.set(a,e)}await e(100),n(++o)}())})),r.setupHooks.setup.tap(n,(e=>{t((()=>{var l,n;const o=null==(l=e.value)?void 0:l.uuid;o&&d.has(o)&&(null==(n=d.get(o))||n.destroy(),d.delete(o))}))}))}})}function u(e,l,o){var t;const i=null==(t=null==o?void 0:o.getTableData())?void 0:t.fullData,r=o.treeConfig&&o.treeConfig.transform?function(e,l){var o,t,i,r,a;const{oldIndex:u=0,newIndex:s=0}=e,c={children:"childrenList"},{fullData:v,tableData:f}=l.getTableData(),p=null==f?void 0:f[u],x=null==f?void 0:f[s-1],b=n(v),m=d.findTree(b,(e=>e.__id===p.__id),c);if(x){const e=null==(t=null==(o=l.$el)?void 0:o.querySelector)?void 0:t.call(o,".body--wrapper>.vxe-table--body tbody"),n=null==(r=null==(i=l.$el)?void 0:i.querySelector)?void 0:r.call(i,".fixed-left--wrapper>.vxe-table--body tbody"),v=d.findTree(b,(e=>e.__id===x.__id),c);if(d.findTree(p[c.children],(e=>e.__id===x.__id),c)){const l=e.children[u],o=e.children[s];return e.insertBefore(o,l),null==(a=null==n?void 0:n.insertBefore)||a.call(n,n.children[s],n.children[u]),console.log("不允许自己给自己拖动"),b}const f=m.items.splice(m.index,1)[0];l.isTreeExpandByRow(x)?x[c.children].splice(0,0,f):v.items.splice(v.index+(m.index<v.index?0:1),0,f)}else{const e=m.items.splice(m.index,1)[0];b.unshift(e)}return b}(e,o):function(e,l){var o;const{oldIndex:t=0,newIndex:i=0}=e,d=n((null==(o=null==l?void 0:l.getTableData())?void 0:o.fullData)||[]),r=d.splice(t,1)[0];return d.splice(i,0,r),d}(l,o);return{oldData:i,newData:r}}export{a as rowDragPlugin};
|
|
@@ -211,6 +211,7 @@ export declare type LowCodeTableFieldItem = {
|
|
|
211
211
|
close: LowCodeTypes.switchProperty;
|
|
212
212
|
show_mode: LowCodeTypes.showModeType;
|
|
213
213
|
lazyRequest: boolean;
|
|
214
|
+
labelToValue: boolean;
|
|
214
215
|
}> & Partial<VxeTableDefines.ColumnInfo>;
|
|
215
216
|
export declare type IhoTableFormChangePayload = {
|
|
216
217
|
column: IhoTableFieldItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e="@cnhis-design-vue/shared",i="3.2.4-beta.
|
|
1
|
+
var e="@cnhis-design-vue/shared",i="3.2.4-beta.18",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.4-beta.18",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.4-beta.
|
|
3
|
+
"version": "3.2.4-beta.18",
|
|
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": "e6ba41455a6b75e717ca1e850432aac5bb5d038a"
|
|
75
75
|
}
|