cnhis-design-vue 3.1.43-beta.17 → 3.1.43-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/keyboardEventPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useSelectOption.d.ts +2 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useSelectOption.js +1 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{promiseTimeout as e}from"@vueuse/shared";import"../../../index.js";import{
|
|
1
|
+
import{promiseTimeout as e}from"@vueuse/shared";import"../../../index.js";import{useSessionStorage as o}from"@vueuse/core";import{selectOptionsMap as l}from"../rendererPlugins/editableWidgets/hooks/useSelectOption.js";import{defineTablePlugin as n}from"../../hooks/useTablePlugin.js";function t(){const t="keyboardEventPlugin",i=o("ihoTableClipData",null);return n({name:t,apply(o){function n(e,o,n,t){var u,d,a,s;if(!(null==(u=null==n?void 0:n.keyboardConfig)?void 0:u.isClip))return;const{row:f,column:v}=o.getSelectedCell()||o.getEditRecord()||{};if(!f||!v||!r(v)&&i.value===f[v.field])return;const c=n.uuid&&r(v)&&l.get(n.uuid)[v.field],p=f[v.field];if("copy"===e){const e=(null==(d=(c||[]).find((e=>e.value===p)))?void 0:d.label)||p;i.value=e}else{if(!(null==(s=null==(a=v.editRender)?void 0:a.props)?void 0:s.formType))return;let e=i.value;const l=(c||[]).find((o=>o.label===e));if(c&&(!l||p===l.value))return;l&&(e=l.value),f[v.field]=e,t("formChange",{column:v,row:f,oldValue:p,value:e,index:o.getRowIndex(f)})}}function r(e){var o;return"SELECT"===(null==(o=e.editRender)?void 0:o.name)}o.eventHooks.onCopy.tap(t,(({$table:e},o,{emits:l})=>n("copy",e,o,l))),o.eventHooks.onPaste.tap(t,(({$table:e},o,{emits:l})=>n("paste",e,o,l))),o.eventHooks.onKeydown.tap(t,(async({$event:o,$table:l},n,{emits:t})=>{await e(0);const{row:i,column:r}=l.getSelectedCell()||l.getEditRecord()||{};if(!i||!r)return;t("keyboard",{key:o.key,index:l.getRowIndex(i),value:i[r.field],row:i,column:r})}))}})}export{t as keyboardEventPlugin};
|
package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useSelectOption.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{reactive as o}from"vue";const e=o(new Map);export{e as selectOptionsMap};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{reactive as e,inject as o,createVNode as t,mergeProps as i,onBeforeUnmount as n}from"vue";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as l,InjectionIhoTableUUID as r}from"../../../../constants/index.js";import{createIhoTableClearActivedInterceptor as s,IhoTableRenderHelper as d,IhoTableUtils as u}from"../../../../utils/index.js";import p from"./editSelect.js";import{getDefaultValue as
|
|
1
|
+
import{reactive as e,inject as o,createVNode as t,mergeProps as i,onBeforeUnmount as n}from"vue";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as l,InjectionIhoTableUUID as r}from"../../../../constants/index.js";import{createIhoTableClearActivedInterceptor as s,IhoTableRenderHelper as d,IhoTableUtils as u}from"../../../../utils/index.js";import p from"./editSelect.js";import{getDefaultValue as c,getArray as a}from"./selectUtils.js";import{selectOptionsMap as f}from"../hooks/useSelectOption.js";import{defineTablePlugin as m}from"../../../../hooks/useTablePlugin.js";function v(){const v="selectRendererPlugin",E=e(new Map);return m({name:v,vxe(e){e.interceptor.add("event.clearActived",s(l.SELECT,(e=>e.classList.contains("iho-table__selectMenu")))),e.renderer.add(l.SELECT,{renderCell({props:e},{row:i,column:n}){const l=o(r),s=f.get(l)[n.field]||[];return[t("span",null,[c(i,e,s)])]},renderEdit:d.createRenderEdit((({fieldItem:e,emitFormClick:n,row:l,column:s,$rowIndex:d})=>{const u=o(r),c=f.get(u)[s.field]||[];return[t(p,i({queryOptions:e.queryOptions},e.componentProps,{options:c,column:s,row:l,"row-index":d,value:l[s.field],"onUpdate:value":e=>l[s.field]=e,onClick:n}),null)]}))})},apply(e){e.fieldHooks.fieldList.tap(v,((e,{uuid:o})=>(o&&(E.set(o,e),f.set(o,{})),e))),e.fieldHooks.fieldEnd.tapPromise(v,(async({uuid:e})=>{if(!e)return;const o=E.get(e),t=f.get(e);o.forEach((async e=>{var o,i,n;const l=null==(o=e.editRender)?void 0:o.props;if(e.field&&l&&"SELECT"===u.getCellType(l)){if(t[e.field])return;let o=a(l.options)||a(null==(i=l.componentProps)?void 0:i.options)||[];if(l.queryOptions)try{const t={column:e,isFullData:!0};o=await(null==(n=l.queryOptions)?void 0:n.call(l,t))}catch(e){console.log(`获取${l.field}_options错误`)}t[e.field]=o}}))})),e.setupHooks.setup.tap(v,(e=>{n((()=>{e.value.uuid&&(E.delete(e.value.uuid),f.delete(e.value.uuid))}))}))}})}export{v as selectRendererPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e="@cnhis-design-vue/shared",i="3.1.43-beta.
|
|
1
|
+
var e="@cnhis-design-vue/shared",i="3.1.43-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.1.43-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.1.43-beta.
|
|
3
|
+
"version": "3.1.43-beta.18",
|
|
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": "
|
|
64
|
+
"gitHead": "ccfc0944bffb190a2f6da7cdedeea484ce91ad3a"
|
|
65
65
|
}
|