cnhis-design-vue 3.1.42-beta.4 → 3.1.42-beta.5

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.
Files changed (34) hide show
  1. package/README.md +87 -87
  2. package/es/components/base-search/src/index.vue.js +1 -1
  3. package/es/components/base-search/style/index.css +1 -1
  4. package/es/components/iho-table/src/plugins/keyboardEventPlugin/index.js +1 -1
  5. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
  6. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -1
  7. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.d.ts +1 -1
  8. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.js +1 -1
  9. package/es/components/index.css +1 -1
  10. package/es/components/index.js +1 -1
  11. package/es/components/scale-view/src/ScaleView.vue.js +1 -1
  12. package/es/components/select-label/src/LabelFormContent.vue.js +1 -1
  13. package/es/components/table-filter/index.d.ts +0 -1
  14. package/es/components/table-filter/index.js +1 -1
  15. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.js +1 -1
  16. package/es/components/table-filter/src/hooks/useMixins.js +1 -1
  17. package/es/components/table-filter/src/tool/baseOptions.d.ts +0 -10
  18. package/es/components/table-filter/src/tool/baseOptions.js +1 -1
  19. package/es/components/table-filter/src/tool/generateDefOptions.d.ts +0 -7
  20. package/es/components/table-filter/src/tool/generateDefOptions.js +1 -1
  21. package/es/components/table-filter/src/types/index.d.ts +0 -74
  22. package/es/env.d.ts +24 -24
  23. package/package.json +2 -2
  24. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  25. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
  26. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
  27. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
  28. package/es/components/fabric-chart/src/utils/index.d.ts +0 -6823
  29. package/es/components/table-filter/src/hooks/export.d.ts +0 -1
  30. package/es/components/table-filter/src/hooks/export.js +0 -1
  31. package/es/components/table-filter/src/tool/getWidgetType.d.ts +0 -1
  32. package/es/components/table-filter/src/tool/getWidgetType.js +0 -1
  33. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
  34. package/es/shared/utils/tapable/index.d.ts +0 -139
package/README.md CHANGED
@@ -1,87 +1,87 @@
1
- # 安装
2
-
3
- ```shell
4
- npm i cnhis-design-vue@[版本号]
5
- # or
6
- yarn add cnhis-design-vue@[版本号] #推荐
7
- ```
8
-
9
- ## 1.全局引入
10
-
11
- ```typescript
12
- // main.ts
13
- import { createApp } from 'vue';
14
- import App from './App.vue';
15
- import 'cnhis-design-vue/es/packages/index.css';
16
- import cui from 'cnhis-design-vue';
17
-
18
- const app = createApp(App);
19
- app.use(cui).mount('#app');
20
- ```
21
-
22
- ## 2. 按需引入
23
-
24
- 组件现在支持了自动按需引入, 但是样式文件需要额外的处理
25
-
26
- ### 2.1 样式处理方式1 (按需引入样式)
27
-
28
- ```shell
29
- # 安装自动导入样式的插件
30
- npm i -d vite-plugin-style-import
31
- ```
32
-
33
- ```typescript
34
- // vite.config.ts
35
- import { defineConfig } from 'vite';
36
- import { createStyleImportPlugin } from 'vite-plugin-style-import';
37
-
38
- export default defineConfig({
39
- plugins: [
40
- // ...otherPlugins
41
- createStyleImportPlugin({
42
- libs: [
43
- {
44
- libraryName: 'cnhis-design-vue',
45
- esModule: true,
46
- ensureStyleFile: true,
47
- resolveStyle: name => {
48
- return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
49
- }
50
- }
51
- ]
52
- })
53
- ]
54
- });
55
- ```
56
-
57
- ### 2.2 样式处理方式2 (全局引入样式)
58
-
59
- ```typescript
60
- // main.ts
61
- import 'cnhis-design-vue/es/components/index.css';
62
- ```
63
-
64
- ## 3.FAQ
65
-
66
- ### 3.1 项目打包后样式丢失
67
-
68
- 处理方法, 将 cnhis-design-vue 从 vendor 包中移除 (没有出现此问题则不需要)
69
-
70
- ```typescript
71
- // vite.config.ts
72
- import { defineConfig } from 'vite';
73
-
74
- export default defineConfig({
75
- build: {
76
- rollupOptions: {
77
- // ..otherOptions
78
- output: {
79
- dir: './dist',
80
- manualChunks: {
81
- 'cnhis-vendor': ['cnhis-design-vue']
82
- }
83
- }
84
- }
85
- }
86
- });
87
- ```
1
+ # 安装
2
+
3
+ ```shell
4
+ npm i cnhis-design-vue@[版本号]
5
+ # or
6
+ yarn add cnhis-design-vue@[版本号] #推荐
7
+ ```
8
+
9
+ ## 1.全局引入
10
+
11
+ ```typescript
12
+ // main.ts
13
+ import { createApp } from 'vue';
14
+ import App from './App.vue';
15
+ import 'cnhis-design-vue/es/packages/index.css';
16
+ import cui from 'cnhis-design-vue';
17
+
18
+ const app = createApp(App);
19
+ app.use(cui).mount('#app');
20
+ ```
21
+
22
+ ## 2. 按需引入
23
+
24
+ 组件现在支持了自动按需引入, 但是样式文件需要额外的处理
25
+
26
+ ### 2.1 样式处理方式1 (按需引入样式)
27
+
28
+ ```shell
29
+ # 安装自动导入样式的插件
30
+ npm i -d vite-plugin-style-import
31
+ ```
32
+
33
+ ```typescript
34
+ // vite.config.ts
35
+ import { defineConfig } from 'vite';
36
+ import { createStyleImportPlugin } from 'vite-plugin-style-import';
37
+
38
+ export default defineConfig({
39
+ plugins: [
40
+ // ...otherPlugins
41
+ createStyleImportPlugin({
42
+ libs: [
43
+ {
44
+ libraryName: 'cnhis-design-vue',
45
+ esModule: true,
46
+ ensureStyleFile: true,
47
+ resolveStyle: name => {
48
+ return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
49
+ }
50
+ }
51
+ ]
52
+ })
53
+ ]
54
+ });
55
+ ```
56
+
57
+ ### 2.2 样式处理方式2 (全局引入样式)
58
+
59
+ ```typescript
60
+ // main.ts
61
+ import 'cnhis-design-vue/es/components/index.css';
62
+ ```
63
+
64
+ ## 3.FAQ
65
+
66
+ ### 3.1 项目打包后样式丢失
67
+
68
+ 处理方法, 将 cnhis-design-vue 从 vendor 包中移除 (没有出现此问题则不需要)
69
+
70
+ ```typescript
71
+ // vite.config.ts
72
+ import { defineConfig } from 'vite';
73
+
74
+ export default defineConfig({
75
+ build: {
76
+ rollupOptions: {
77
+ // ..otherOptions
78
+ output: {
79
+ dir: './dist',
80
+ manualChunks: {
81
+ 'cnhis-vendor': ['cnhis-design-vue']
82
+ }
83
+ }
84
+ }
85
+ }
86
+ });
87
+ ```
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,computed as l,watch as a,openBlock as i,createElementBlock as r,createElementVNode as n,createCommentVNode as s,renderSlot as o,unref as u,createVNode as c,withCtx as f,createTextVNode as d,toDisplayString as m,Fragment as h,renderList as p}from"vue";import v from"../../table-filter/src/components/render-widget/index.vue.js";import g from"../../table-filter/src/hooks/useMixins.js";import b from"../../table-filter/src/hooks/useAdvanced.js";import y from"../../table-filter/src/hooks/useRenderWidget.js";import{NButton as k,NIcon as x}from"naive-ui";import{Search as C}from"@vicons/ionicons5";import{cloneDeep as S}from"lodash-es";import j from"../../../_virtual/plugin-vue_export-helper.js";const q={class:"base-search-block"},_={class:"base-container"},F={class:"bease-left"},O={class:"base-ul"},R={key:0,class:"baseli showQuickBtn"},Q=n("i",{class:"iconfont-table-filter icon-table-filter-shaixuan",style:{color:"inherit","margin-right":"6px"}},null,-1),V={key:0,class:"qqConObjCount"},A={key:1,class:"baseli"},w={key:2,class:"baseli"},I=n("i",{class:"iconfont-table-filter icon-table-filter-reset",style:{"margin-right":"6px"}},null,-1);var D=j(e({__name:"index",props:{showSettings:{type:Object,default:()=>({hideQuickSearch:0})},searchFieldList:{type:Array,default:()=>[]},qqConObjCount:{type:Number,default:0}},emits:["foldQuickSearch","onFilterSearch","handleReset","getFilterParam"],setup(e,{emit:j}){const D=e,{outQuickSearchFn:E}=g(),{isRender:L,getRenderSearchConObj:N,isExistDefValByRenderWidget:P,resetRenderWidgetValue:W}=y(),{transformData:B,transformParams:U}=b(),z=t([]),M=t(!1),T=t([]),$=l((()=>{var e;return e="hideQuickSearch",0==D.showSettings[e]}));function G(){j("foldQuickSearch",!0)}function H(e={}){const t=J()||[];!function(e,t,l=!1,a={}){let i=[];T.value.length>0&&(i=S(T.value));j("onFilterSearch",e,t,l,i,a)}(t,U(t),!0,e)}function J(){return function(e){if(!Array.isArray(e))return[];let t=[];for(let l=0;l<e.length;l++){let a=e[l];const i=N(a);i&&t.push(i)}return t.filter((e=>e.value))}(T.value)}function K(){!function(e){if(!Array.isArray(e))return;e.forEach((e=>{W(e)})),E.handlerInitSearchItem(e)}(T.value),j("handleReset",{targetType:"outQuickSearchReset"})}return a((()=>D.searchFieldList),(e=>{e&&e.length>0&&function(e={}){T.value=[];let t=S(B(D.searchFieldList)).filter((e=>1==e.isShowSearch&&1==e.filterExplicit));T.value=t,E.handlerInitSearchItem(T.value),T.value.some((e=>L(e)?P(e):!!e.explicitDefaultVal))}()}),{immediate:!0,deep:!0}),a((()=>D.qqConObjCount),(e=>{const t=z.value.length||0;M.value=t+Number(e)>0}),{immediate:!0}),a((()=>T),(()=>{z.value=J()||[];const e=U(z.value);M.value=z.value.length+Number(D.qqConObjCount)>0,j("getFilterParam",z.value,e)}),{immediate:!0,deep:!0}),(t,l)=>(i(),r("div",q,[n("div",_,[n("div",F,[n("ul",O,[s(" 筛选分类插槽内容 "),o(t.$slots,"classification"),u($)?(i(),r("li",R,[c(u(k),{class:"search-default",type:"default",onClick:G},{default:f((()=>[Q,d(" 筛选"),e.qqConObjCount?(i(),r("span",V,"("+m(e.qqConObjCount)+")",1)):s("v-if",!0)])),_:1})])):s("v-if",!0),s(" start--筛选外显--start "),(i(!0),r(h,null,p(T.value,(e=>(i(),r(h,null,[e.isRender?(i(),r("li",{class:"baseli outQuickSearch-li",key:e._frontId},[c(v,{style:{margin:"0 8px 8px 0"},cfg:e,modelValue:e.value,"onUpdate:modelValue":t=>e.value=t,onOutFilterChange:H},null,8,["cfg","modelValue","onUpdate:modelValue"])])):s("v-if",!0)],64)))),256)),s(" end--筛选外显--end "),s(" 查询按钮 "),T.value&&T.value.length>0?(i(),r("li",A,[c(u(k),{type:"primary",onClick:H,style:{margin:"0 8px 8px 0"}},{default:f((()=>[c(u(x),{component:u(C),size:"16",style:{"margin-right":"6px"}},null,8,["component"]),d(" 查询 ")])),_:1})])):s("v-if",!0),s(" 重置按钮 "),M.value?(i(),r("li",w,[c(u(k),{onClick:K,style:{margin:"0 8px 8px 0"}},{default:f((()=>[I,d(" 重置 ")])),_:1})])):s("v-if",!0)])])])]))}}),[["__file","index.vue"]]);export{D as default};
1
+ import{defineComponent as e,ref as t,computed as l,watch as a,openBlock as i,createElementBlock as r,createElementVNode as n,createCommentVNode as s,renderSlot as o,unref as u,createVNode as c,withCtx as f,createTextVNode as d,toDisplayString as m,Fragment as h,renderList as v}from"vue";import p from"../../table-filter/src/components/render-widget/index.vue.js";import b from"../../table-filter/src/hooks/useMixins.js";import g from"../../table-filter/src/hooks/useAdvanced.js";import y from"../../table-filter/src/hooks/useRenderWidget.js";import{NButton as k,NIcon as C}from"naive-ui";import{Search as S}from"@vicons/ionicons5";import{cloneDeep as j}from"lodash-es";import x from"../../../_virtual/plugin-vue_export-helper.js";const q={class:"base-search-block"},_={class:"base-container"},F={class:"bease-left"},O={class:"base-ul"},R={key:0,class:"baseli showQuickBtn"},Q=n("i",{class:"iconfont-table-filter icon-table-filter-shaixuan",style:{color:"inherit","margin-right":"6px"}},null,-1),V={key:0,class:"qqConObjCount"},A={key:1,class:"baseli"},w={key:2,class:"baseli"},I=n("i",{class:"iconfont-table-filter icon-table-filter-reset",style:{"margin-right":"6px"}},null,-1);var D=x(e({__name:"index",props:{showSettings:{type:Object,default:()=>({hideQuickSearch:0})},searchFieldList:{type:Array,default:()=>[]},qqConObjCount:{type:Number,default:0}},emits:["foldQuickSearch","onFilterSearch","handleReset","getFilterParam"],setup(e,{emit:x}){const D=e,{outQuickSearchFn:E}=b(),{isRender:L,getRenderSearchConObj:N,isExistDefValByRenderWidget:P,resetRenderWidgetValue:W}=y(),{transformData:B,transformParams:U}=g(),$=t([]),z=t(!1),M=t([]),T=l((()=>{var e;return e="hideQuickSearch",0==D.showSettings[e]}));function G(){x("foldQuickSearch",!0)}function H(e={}){const t=J()||[];!function(e,t,l=!1,a={}){let i=[];M.value.length>0&&(i=j(M.value));x("onFilterSearch",e,t,l,i,a)}(t,U(t),!0,e)}function J(){return function(e){if(!Array.isArray(e))return[];let t=[];for(let l=0;l<e.length;l++){let a=e[l];const i=N(a);i&&t.push(i)}return t.filter((e=>e.value))}(M.value)}function K(){!function(e){if(!Array.isArray(e))return;e.forEach((e=>{W(e)})),E.handlerInitSearchItem(e)}(M.value),x("handleReset",{targetType:"outQuickSearchReset"})}return a((()=>D.searchFieldList),(e=>{e&&e.length>0&&function(e={}){M.value=[];let t=j(B(D.searchFieldList)).filter((e=>1==e.isShowSearch&&1==e.filterExplicit));M.value=t,E.handlerInitSearchItem(M.value),M.value.some((e=>L(e)?P(e):!!e.explicitDefaultVal))}()}),{immediate:!0,deep:!0}),a((()=>D.qqConObjCount),(e=>{const t=$.value.length||0;z.value=t+Number(e)>0}),{immediate:!0}),a((()=>M),(()=>{$.value=J()||[];const e=U($.value);z.value=$.value.length+Number(D.qqConObjCount)>0,x("getFilterParam",$.value,e)}),{immediate:!0,deep:!0}),(t,l)=>(i(),r("div",q,[n("div",_,[n("div",F,[n("ul",O,[s(" 筛选分类插槽 "),o(t.$slots,"classification"),u(T)?(i(),r("li",R,[c(u(k),{class:"search-default",type:"default",onClick:G},{default:f((()=>[Q,d(" 筛选"),e.qqConObjCount?(i(),r("span",V,"("+m(e.qqConObjCount)+")",1)):s("v-if",!0)])),_:1})])):s("v-if",!0),s(" start--筛选外显--start "),(i(!0),r(h,null,v(M.value,(e=>(i(),r(h,null,[e.isRender?(i(),r("li",{class:"baseli outQuickSearch-li",key:e._frontId},[c(p,{cfg:e,modelValue:e.value,"onUpdate:modelValue":t=>e.value=t,onOutFilterChange:H},null,8,["cfg","modelValue","onUpdate:modelValue"])])):s("v-if",!0)],64)))),256)),s(" end--筛选外显--end "),s(" 查询按钮 "),M.value&&M.value.length>0?(i(),r("li",A,[c(u(k),{type:"primary",onClick:H},{default:f((()=>[c(u(C),{component:u(S),size:"16",style:{"margin-right":"6px"}},null,8,["component"]),d(" 查询 ")])),_:1})])):s("v-if",!0),s(" 重置按钮 "),z.value?(i(),r("li",w,[c(u(k),{onClick:K},{default:f((()=>[I,d(" 重置 ")])),_:1})])):s("v-if",!0),s(" 业务按钮插槽 "),o(t.$slots,"buttons")])])])]))}}),[["__file","index.vue"]]);export{D as default};
@@ -1 +1 @@
1
- @font-face{font-family:iconfont;src:url(iconfont.ttf) format("truetype")}.iconfont-table-filter{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:iconfont!important;font-size:14px;font-style:normal}.icon-table-filter-menzhenyishengzhananniuqingchu:before{content:"\e74e"}.icon-table-filter-menzhenyishengzhananniushanchu2:before{content:"\e757"}.icon-table-filter-menzhenyishengzhanxitongtubiaoguanbi:before{content:"\e76e"}.icon-table-filter-menzhenyishengzhanxitongtubiaozuixiaohua2:before{content:"\e778"}.icon-table-filter-menzhenyishengzhanxitongtubiaozuidahua:before{content:"\e779"}.icon-table-filter-reset:before{content:"\e611"}.icon-table-filter-shaixuan:before{content:"\e64b"}.base-search-block .base-container{display:flex;justify-content:space-between;text-align:left}.base-search-block .base-container .bease-left{align-items:flex-start;display:flex;flex:1;justify-content:flex-start}.base-search-block .base-container .bease-left .base-ul{align-items:center;display:flex;flex-wrap:wrap;margin-top:0}.base-search-block .base-container .bease-left .base-ul .baseli{display:flex}.base-search-block .base-container .bease-left .base-ul .baseli .search-default{height:32px;line-height:32px;margin-bottom:8px;margin-right:8px}
1
+ @font-face{font-family:iconfont;src:url(iconfont.ttf) format("truetype")}.iconfont-table-filter{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:iconfont!important;font-size:14px;font-style:normal}.icon-table-filter-menzhenyishengzhananniuqingchu:before{content:"\e74e"}.icon-table-filter-menzhenyishengzhananniushanchu2:before{content:"\e757"}.icon-table-filter-menzhenyishengzhanxitongtubiaoguanbi:before{content:"\e76e"}.icon-table-filter-menzhenyishengzhanxitongtubiaozuixiaohua2:before{content:"\e778"}.icon-table-filter-menzhenyishengzhanxitongtubiaozuidahua:before{content:"\e779"}.icon-table-filter-reset:before{content:"\e611"}.icon-table-filter-shaixuan:before{content:"\e64b"}.base-search-block .base-container{display:flex;justify-content:space-between;text-align:left}.base-search-block .base-container .bease-left{align-items:flex-start;display:flex;flex:1;justify-content:flex-start}.base-search-block .base-container .bease-left .base-ul{align-items:center;display:flex;flex-wrap:wrap;margin-top:0}.base-search-block .base-container .bease-left .base-ul .baseli{display:flex;margin-bottom:8px;margin-right:8px}.base-search-block .base-container .bease-left .base-ul .baseli .search-default{height:32px;line-height:32px}
@@ -1 +1 @@
1
- import{targetStringIncludes as e}from"../../../../../shared/utils/index.js";import{promiseTimeout as t}from"@vueuse/shared";import"../../../index.js";import{defineTablePlugin as o}from"../../hooks/useTablePlugin.js";function n(){const n="keyboardEventPlugin";return o({name:n,apply(o){o.eventHooks.onKeydown.tap(n,(async({$event:o,$table:n},r,{emits:i})=>{await t(0);const{row:a,column:l}=n.getSelectedCell()||n.getEditRecord()||{};if(!a||!l)return;const s=o.key;!e(["Arrow","Escape","Control","Shift","Alt","Meta"],s)&&await n.setEditCell(a,l),i("keyboard",{key:s,index:n.getRowIndex(a),value:a[l.field],row:a,column:l})}))}})}export{n as keyboardEventPlugin};
1
+ import{promiseTimeout as e}from"@vueuse/shared";import"../../../index.js";import{defineTablePlugin as o}from"../../hooks/useTablePlugin.js";function t(){const t="keyboardEventPlugin";return o({name:t,apply(o){o.eventHooks.onKeydown.tap(t,(async({$event:o,$table:t},n,{emits:r})=>{await e(0);const{row:i,column:a}=t.getSelectedCell()||t.getEditRecord()||{};if(!i||!a)return;r("keyboard",{key:o.key,index:t.getRowIndex(i),value:i[a.field],row:i,column:a})}))}})}export{t as keyboardEventPlugin};
@@ -1 +1 @@
1
- import{defineComponent as e,reactive as o,createVNode as t,mergeProps as r}from"vue";import{NSelect as n}from"naive-ui";import{useIhoTableFormEvent as l}from"../../../../utils/index.js";import{useAutoFocus as i}from"../hooks/useAutoFocus.js";var a=e({name:"EditSelect",inheritAttrs:!1,components:{NSelect:n},props:{value:{type:[Array,String,Number],default:void 0},column:{type:Object,required:!0},row:{type:Object,required:!0},rowIndex:{type:Number,required:!0}},emits:["update:value"],setup(e,{attrs:a,emit:u}){const{isShow:s,setRef:d}=i(),{emitFormChangeWithParams:p}=l(e),c=o({placeholder:a.placeholder||"请选择",options:a.options});function m(o){const t=e.value;u("update:value",o),p({oldValue:t})}return c.options||(c.remote=!0,c.loading=!1,c.onSearch=async o=>{var t,r;c.loading=!0;const n={keyword:o,row:e.row,column:e.column,rowIndex:e.rowIndex};try{c.options=await(null==(t=a.queryOptions)?void 0:t.call(a,n)),c.loading=!1,(null==(r=e.row)?void 0:r[`${e.column.field}_options`])||(e.row[`${e.column.field}_options`]=c.options)}catch(o){console.log(`获取${e.column.field}_options错误`)}},c.onSearch("")),()=>t(n,r({ref:d,show:s.value,"onUpdate:show":e=>s.value=e},a,c,{value:e.value,consistentMenuWidth:!1,clearable:!0,filterable:!0,onUpdateValue:m}),null)}});export{a as default};
1
+ import{defineComponent as e,reactive as o,createVNode as t,mergeProps as r}from"vue";import{NSelect as n}from"naive-ui";import{useIhoTableFormEvent as a}from"../../../../utils/index.js";import{useAutoFocus as l}from"../hooks/useAutoFocus.js";import{useDebounceFn as i}from"@vueuse/core";var u=e({name:"EditSelect",inheritAttrs:!1,components:{NSelect:n},props:{value:{type:[Array,String,Number],default:void 0},column:{type:Object,required:!0},row:{type:Object,required:!0},rowIndex:{type:Number,required:!0}},emits:["update:value"],setup(e,{attrs:u,emit:s}){const{isShow:c,setRef:p}=l(),{emitFormChangeWithParams:d}=a(e),m=o({placeholder:u.placeholder||"请选择",options:u.options});async function v(o){var t;m.loading=!0;const r={keyword:o,row:e.row,column:e.column,rowIndex:e.rowIndex};try{m.options=await(null==(t=u.queryOptions)?void 0:t.call(u,r)),m.loading=!1}catch(o){console.log(`获取${e.column.field}_options错误`)}}function f(o){const t=e.value;s("update:value",o),d({oldValue:t})}return m.options||(m.remote=!0,m.loading=!1,m.onSearch=i(v,800),m.onSearch("")),()=>t(n,r({ref:p,show:c.value,"onUpdate:show":e=>c.value=e},u,m,{value:e.value,consistentMenuWidth:!1,clearable:!0,filterable:!0,onUpdateValue:f}),null)}});export{u as default};
@@ -1 +1 @@
1
- import{createVNode as e,mergeProps as o}from"vue";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as r}from"../../../../constants/index.js";import{createIhoTableClearActivedInterceptor as n,IhoTableRenderHelper as t}from"../../../../utils/index.js";import i from"./editSelect.js";import{getDefaultValue as s}from"./selectUtils.js";import{defineTablePlugin as l}from"../../../../hooks/useTablePlugin.js";function d(){return l({name:"selectRendererPlugin",vxe(l){l.interceptor.add("event.clearActived",n(r.SELECT,(e=>e.classList.contains("n-base-select-menu-option-wrapper")))),l.renderer.add(r.SELECT,{renderCell:({props:o},{row:r})=>[e("span",null,[s(r,o)])],renderEdit:t.createRenderEdit((({fieldItem:r,emitFormClick:n,row:t,column:s,$rowIndex:l})=>[e(i,o({options:r.options,queryOptions:r.queryOptions},r.componentProps,{column:s,row:t,"row-index":l,value:t[s.field],"onUpdate:value":e=>t[s.field]=e,onClick:n}),null)]))})}})}export{d as selectRendererPlugin};
1
+ import{reactive as e,inject as o,createVNode as i,mergeProps as n}from"vue";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as t,InjectionIhoTableUUID as r}from"../../../../constants/index.js";import{createIhoTableClearActivedInterceptor as l,IhoTableRenderHelper as d}from"../../../../utils/index.js";import s from"./editSelect.js";import{getDefaultValue as p}from"./selectUtils.js";import{defineTablePlugin as u}from"../../../../hooks/useTablePlugin.js";function a(){const a="selectRendererPlugin",c=e(new Map),f=e(new Map);return u({name:a,vxe(e){e.interceptor.add("event.clearActived",l(t.SELECT,(e=>e.classList.contains("n-base-select-menu-option-wrapper")))),e.renderer.add(t.SELECT,{renderCell({props:e},{row:n,column:t,rowIndex:l}){var d;const s=o(r),u=(null==(d=c.get(s).find((e=>e.field===t.field)))?void 0:d.options)||[],a=p(n,e,u);return[i("span",null,[a])]},renderEdit:d.createRenderEdit((({fieldItem:e,emitFormClick:o,row:t,column:r,$rowIndex:l})=>[i(s,n({options:e.options,queryOptions:e.queryOptions},e.componentProps,{column:r,row:t,"row-index":l,value:t[r.field],"onUpdate:value":e=>t[r.field]=e,onClick:o}),null)]))})},apply(e){e.fieldHooks.fieldList.tap(a,((e,{uuid:o})=>(o&&f.set(o,e),e))),e.dataHooks.data.tapPromise(a,(async(e,o,{index:i,$table:n})=>{var t;if(!o.uuid)return;const r=f.get(o.uuid),l=c.get(o.uuid)||[];for(const n of r)if(n.field){if("select"===n.formType){if(l.findIndex((e=>e.field===n.field))>-1)continue;let o=n.options||[];if(n.queryOptions)try{const r={keyword:"",row:e,column:n,rowIndex:i};o=await(null==(t=n.queryOptions)?void 0:t.call(n,r))}catch(e){console.log(`获取${n.field}_options错误`)}l.push({field:n.field,options:o})}c.set(o.uuid,l)}}))}})}export{a as selectRendererPlugin};
@@ -1,2 +1,2 @@
1
1
  import { LowCodeTableFieldItem } from '../../../../../../../../es/components/iho-table/src/types';
2
- export declare function getDefaultValue(row: any, item: LowCodeTableFieldItem | any): any;
2
+ export declare function getDefaultValue(row: any, item: LowCodeTableFieldItem | any, options?: never[]): any;
@@ -1 +1 @@
1
- function n(n,o){const r=n[o.columnName];return Array.isArray(r)?r.map((n=>i(n))).join(","):i(r);function i(r){var i;return l=(null==(i=o.componentProps)?void 0:i.options)||o.options||n[`${o.columnName}_options`]||[],(null==(t=null==l?void 0:l.find((n=>n.value==r)))?void 0:t.label)||r||"";var l,t}}export{n as getDefaultValue};
1
+ function n(n,o,r=[]){const i=n[o.columnName];return Array.isArray(i)?i.map((n=>l(n))).join(","):l(i);function l(n){var i;return l=(null==(i=o.componentProps)?void 0:i.options)||o.options||r,(null==(t=null==l?void 0:l.find((o=>o.value==n)))?void 0:t.label)||n||"";var l,t}}export{n as getDefaultValue};