cnhis-design-vue 3.1.41-beta.2 → 3.1.41-beta.4

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 (29) hide show
  1. package/es/components/form-config/index.d.ts +5 -0
  2. package/es/components/form-config/src/FormConfig.vue.d.ts +5 -0
  3. package/es/components/form-config/src/components/FormConfigDragDisplay.vue.js +1 -1
  4. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +3 -0
  5. package/es/components/form-config/src/components/renderer/DefaultNode.vue.js +1 -1
  6. package/es/components/form-config/src/hooks/useConfigurationField.js +1 -1
  7. package/es/components/form-config/src/hooks/useSortalbeConfig.js +1 -1
  8. package/es/components/form-config/src/types/index.d.ts +1 -0
  9. package/es/components/form-render/src/components/renderer/select.d.ts +3 -0
  10. package/es/components/form-render/src/components/renderer/select.js +1 -1
  11. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
  12. package/es/components/form-render/src/types/fieldItem.d.ts +4 -0
  13. package/es/components/index.css +1 -1
  14. package/es/components/info-header/src/InfoHeader.vue.js +1 -1
  15. package/es/components/shortcut-setter/index.d.ts +1 -0
  16. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +1 -0
  17. package/es/components/table-filter/index.d.ts +35 -2
  18. package/es/components/table-filter/src/classification/Classification-com.vue.d.ts +38 -2
  19. package/es/components/table-filter/src/classification/Classification-com.vue.js +1 -1
  20. package/es/components/table-filter/src/classification/search-class-name.vue.d.ts +19 -0
  21. package/es/components/table-filter/src/classification/search-class-name.vue.js +1 -1
  22. package/es/components/table-filter/src/classification/search-professional-model.vue.d.ts +38 -2
  23. package/es/components/table-filter/src/classification/search-professional-model.vue.js +1 -1
  24. package/es/components/table-filter/src/components/classify-filter/index.vue.js +1 -1
  25. package/es/components/table-filter/src/components/out-quick-search/out-quick-search.vue.js +1 -1
  26. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.js +1 -1
  27. package/es/components/table-filter/src/hooks/useRenderWidget.js +1 -1
  28. package/es/components/table-filter/style/index.css +1 -1
  29. package/package.json +2 -2
@@ -43,6 +43,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
43
43
  fold?: boolean | undefined;
44
44
  required?: boolean | undefined;
45
45
  requiredDisabled?: boolean | undefined;
46
+ editableDisabled?: boolean | undefined;
46
47
  editable?: boolean | undefined;
47
48
  notes?: string | undefined;
48
49
  desc?: string | undefined;
@@ -64,6 +65,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
64
65
  fold?: boolean | undefined;
65
66
  required?: boolean | undefined;
66
67
  requiredDisabled?: boolean | undefined;
68
+ editableDisabled?: boolean | undefined;
67
69
  editable?: boolean | undefined;
68
70
  notes?: string | undefined;
69
71
  desc?: string | undefined;
@@ -1115,6 +1117,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
1115
1117
  extendKey?: string | undefined;
1116
1118
  is_not_fold?: string | undefined;
1117
1119
  remark?: string | undefined;
1120
+ free_entry?: import("..").FormCommonState | undefined;
1118
1121
  fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
1119
1122
  content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
1120
1123
  lazyRequest?: boolean | undefined;
@@ -2700,6 +2703,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
2700
2703
  fold?: boolean | undefined;
2701
2704
  required?: boolean | undefined;
2702
2705
  requiredDisabled?: boolean | undefined;
2706
+ editableDisabled?: boolean | undefined;
2703
2707
  editable?: boolean | undefined;
2704
2708
  notes?: string | undefined;
2705
2709
  desc?: string | undefined;
@@ -2718,6 +2722,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
2718
2722
  fold?: boolean | undefined;
2719
2723
  required?: boolean | undefined;
2720
2724
  requiredDisabled?: boolean | undefined;
2725
+ editableDisabled?: boolean | undefined;
2721
2726
  editable?: boolean | undefined;
2722
2727
  notes?: string | undefined;
2723
2728
  desc?: string | undefined;
@@ -44,6 +44,7 @@ declare const _default: import("vue").DefineComponent<{
44
44
  fold?: boolean | undefined;
45
45
  required?: boolean | undefined;
46
46
  requiredDisabled?: boolean | undefined;
47
+ editableDisabled?: boolean | undefined;
47
48
  editable?: boolean | undefined;
48
49
  notes?: string | undefined;
49
50
  desc?: string | undefined;
@@ -65,6 +66,7 @@ declare const _default: import("vue").DefineComponent<{
65
66
  fold?: boolean | undefined;
66
67
  required?: boolean | undefined;
67
68
  requiredDisabled?: boolean | undefined;
69
+ editableDisabled?: boolean | undefined;
68
70
  editable?: boolean | undefined;
69
71
  notes?: string | undefined;
70
72
  desc?: string | undefined;
@@ -1116,6 +1118,7 @@ declare const _default: import("vue").DefineComponent<{
1116
1118
  extendKey?: string | undefined;
1117
1119
  is_not_fold?: string | undefined;
1118
1120
  remark?: string | undefined;
1121
+ free_entry?: import("../..").FormCommonState | undefined;
1119
1122
  fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
1120
1123
  content?: string | import("../..").FormRenderer | Record<string, import("../..").FormRenderer> | undefined;
1121
1124
  lazyRequest?: boolean | undefined;
@@ -2701,6 +2704,7 @@ declare const _default: import("vue").DefineComponent<{
2701
2704
  fold?: boolean | undefined;
2702
2705
  required?: boolean | undefined;
2703
2706
  requiredDisabled?: boolean | undefined;
2707
+ editableDisabled?: boolean | undefined;
2704
2708
  editable?: boolean | undefined;
2705
2709
  notes?: string | undefined;
2706
2710
  desc?: string | undefined;
@@ -2719,6 +2723,7 @@ declare const _default: import("vue").DefineComponent<{
2719
2723
  fold?: boolean | undefined;
2720
2724
  required?: boolean | undefined;
2721
2725
  requiredDisabled?: boolean | undefined;
2726
+ editableDisabled?: boolean | undefined;
2722
2727
  editable?: boolean | undefined;
2723
2728
  notes?: string | undefined;
2724
2729
  desc?: string | undefined;
@@ -1 +1 @@
1
- import{defineComponent as e,openBlock as t,createBlock as r,unref as o,mergeProps as m,withCtx as i,createElementVNode as s,normalizeStyle as a,resolveDynamicComponent as l}from"vue";import n from"../../../../shared/components/VueDraggable/src/vuedraggable.js";import{usePresetRenderer as p}from"../hooks/usePresetRenderer.js";import{useSortableConfig as u}from"../hooks/useSortalbeConfig.js";import"lodash-es";import{layoutWidthEnum2Column as f}from"../utils/index.js";import d from"../../../../_virtual/plugin-vue_export-helper.js";const g=["data-type"];var y=d(e({__name:"FormConfigDragDisplay",props:{fieldItem:{type:Object},textFormatter:{type:Function,required:!0}},setup(e){function d(e){return{"--item-column":e?f(e.layoutWidthEnum):24}}const{getRenderer:y}=p(),{getCommonConfig:c}=u();return(p,u)=>(t(),r(o(n),m(o(c)(e.fieldItem),{style:d(e.fieldItem)}),{item:i((({element:m})=>[s("div",{class:"form-config__displayContentItem","data-type":m.type,style:a(d(m))},[(t(),r(l(o(y)(m)),{"field-item":m,textFormatter:e.textFormatter},null,8,["field-item","textFormatter"]))],12,g)])),_:1},16,["style"]))}}),[["__file","FormConfigDragDisplay.vue"]]);export{y as default};
1
+ import{defineComponent as e,openBlock as t,createBlock as r,unref as o,mergeProps as i,withCtx as m,createElementVNode as a,normalizeStyle as s,resolveDynamicComponent as l}from"vue";import n from"../../../../shared/components/VueDraggable/src/vuedraggable.js";import{usePresetRenderer as u}from"../hooks/usePresetRenderer.js";import{useSortableConfig as d}from"../hooks/useSortalbeConfig.js";import"lodash-es";import{layoutWidthEnum2Column as p}from"../utils/index.js";import f from"../../../../_virtual/plugin-vue_export-helper.js";const g=["data-type","data-required"];var y=f(e({__name:"FormConfigDragDisplay",props:{fieldItem:{type:Object},textFormatter:{type:Function,required:!0}},setup(e){function f(e){return{"--item-column":e?p(e.layoutWidthEnum):24}}const{getRenderer:y}=u(),{getCommonConfig:c}=d();return(u,d)=>(t(),r(o(n),i(o(c)(e.fieldItem),{style:f(e.fieldItem)}),{item:m((({element:i})=>[a("div",{class:"form-config__displayContentItem","data-type":i.type,"data-required":i.required,style:s(f(i))},[(t(),r(l(o(y)(i)),{"field-item":i,textFormatter:e.textFormatter},null,8,["field-item","textFormatter"]))],12,g)])),_:1},16,["style"]))}}),[["__file","FormConfigDragDisplay.vue"]]);export{y as default};
@@ -120,6 +120,7 @@ declare const _default: import("vue").DefineComponent<{
120
120
  extendKey?: string | undefined;
121
121
  is_not_fold?: string | undefined;
122
122
  remark?: string | undefined;
123
+ free_entry?: import("../../../../../es/components/form-render").FormCommonState | undefined;
123
124
  fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
124
125
  content?: string | import("../../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../../es/components/form-render").FormRenderer> | undefined;
125
126
  lazyRequest?: boolean | undefined;
@@ -1705,6 +1706,7 @@ declare const _default: import("vue").DefineComponent<{
1705
1706
  fold?: boolean | undefined;
1706
1707
  required?: boolean | undefined;
1707
1708
  requiredDisabled?: boolean | undefined;
1709
+ editableDisabled?: boolean | undefined;
1708
1710
  editable?: boolean | undefined;
1709
1711
  notes?: string | undefined;
1710
1712
  desc?: string | undefined;
@@ -1723,6 +1725,7 @@ declare const _default: import("vue").DefineComponent<{
1723
1725
  fold?: boolean | undefined;
1724
1726
  required?: boolean | undefined;
1725
1727
  requiredDisabled?: boolean | undefined;
1728
+ editableDisabled?: boolean | undefined;
1726
1729
  editable?: boolean | undefined;
1727
1730
  notes?: string | undefined;
1728
1731
  desc?: string | undefined;
@@ -1 +1 @@
1
- import{defineComponent as e,inject as t,computed as i,openBlock as r,createBlock as o,unref as d,mergeProps as l,withModifiers as f,withCtx as a,createVNode as m,normalizeClass as n,createTextVNode as s,toDisplayString as u}from"vue";import{NButton as p,NEllipsis as c}from"naive-ui";import _ from"./CloseButton.vue.js";import{InjectionActiveFieldItem as I,WidgetTextMap as v}from"../../constants/index.js";import{bindHover as y}from"../../utils/index.js";import x from"../../../../../_virtual/plugin-vue_export-helper.js";var j=x(e({__name:"DefaultNode",props:{fieldItem:{type:Object,required:!0},textFormatter:{type:Function,required:!0}},setup(e){const x=e,j=t(I);function g(){j.value=x.fieldItem}const q=i((()=>[{"is-active":j.value===x.fieldItem},"form-config__renderer"])),h=i((()=>["form-config__renderer--default",{"is-required":x.fieldItem.required}])),C=i((()=>!1===x.fieldItem.editable));function F(){const e=v.get(x.fieldItem.type);return x.textFormatter(x.fieldItem,`${x.fieldItem.name}${e?`(${e})`:""}`)}return(t,i)=>(r(),o(d(p),l({secondary:!d(C),dashed:d(C)},d(y)(e.fieldItem),{onClick:f(g,["stop"]),class:d(q),"data-type":e.fieldItem.type}),{default:a((()=>[m(d(c),{class:n(d(h))},{default:a((()=>[s(u(F()),1)])),_:1},8,["class"]),m(_,{"field-item":e.fieldItem},null,8,["field-item"])])),_:1},16,["secondary","dashed","onClick","class","data-type"]))}}),[["__file","DefaultNode.vue"]]);export{j as default};
1
+ import{defineComponent as e,inject as t,computed as i,openBlock as r,createBlock as d,unref as l,mergeProps as o,withModifiers as f,withCtx as m,createVNode as a,normalizeClass as n,createTextVNode as s,toDisplayString as u,createCommentVNode as p}from"vue";import{NButton as c,NEllipsis as I}from"naive-ui";import _ from"./CloseButton.vue.js";import{InjectionActiveFieldItem as v,WidgetTextMap as y}from"../../constants/index.js";import{bindHover as x}from"../../utils/index.js";import j from"../../../../../_virtual/plugin-vue_export-helper.js";var q=j(e({__name:"DefaultNode",props:{fieldItem:{type:Object,required:!0},textFormatter:{type:Function,required:!0}},setup(e){const j=e,q=t(v);function g(){q.value=j.fieldItem}const h=i((()=>[{"is-active":q.value===j.fieldItem},"form-config__renderer"])),k=i((()=>["form-config__renderer--default",{"is-required":j.fieldItem.required}])),C=i((()=>!1===j.fieldItem.editable));function F(){const e=y.get(j.fieldItem.type);return j.textFormatter(j.fieldItem,`${j.fieldItem.name}${e?`(${e})`:""}`)}return(t,i)=>(r(),d(l(c),o({secondary:!l(C),dashed:l(C)},l(x)(e.fieldItem),{onClick:f(g,["stop"]),class:l(h),"data-type":e.fieldItem.type}),{default:m((()=>[a(l(I),{class:n(l(k))},{default:m((()=>[s(u(F()),1)])),_:1},8,["class"]),e.fieldItem.required?p("v-if",!0):(r(),d(_,{key:0,"field-item":e.fieldItem},null,8,["field-item"]))])),_:1},16,["secondary","dashed","onClick","class","data-type"]))}}),[["__file","DefaultNode.vue"]]);export{q as default};
@@ -1 +1 @@
1
- import{isArray as e}from"lodash-es";import{EditAbleField as t,widgetWidthOptionConfig as l,isShowOptionConfig as i,isNotFoldOptionConfig as _,isEditOptionConfig as a,isNullOptionConfig as E}from"../constants/index.js";function n(){const n=new Map([[t.NAME,()=>({alias:"名称",elem_width:6,is_null:"0",html_type:"INPUT"})],[t.NOTES,()=>({alias:"问号提示",elem_width:6,html_type:"INPUT"})],[t.DEFAULT_VALUE,t=>e(null==t?void 0:t.options)&&t.options.length?{alias:"默认值",elem_width:6,html_type:"SELECT",option:null==t?void 0:t.options}:{alias:"默认值",elem_width:6,html_type:"INPUT",validate:{max_length:20}}],[t.LAYOUT_WIDTH_ENUM,()=>({alias:"宽度",fieldType:"number",html_type:"SELECT",elem_width:6,...l()})],[t.DESC,()=>({alias:"说明文本",elem_width:6,html_type:"INPUT",validate:{max_length:30}})],[t.DEFAULT_EXPAND,()=>({alias:"是否默认展开",html_type:"SWITCH",elem_width:6,...i()})],[t.FOLD,()=>({alias:"是否可折叠",html_type:"SWITCH",elem_width:6,..._()})],[t.EDITABLE,()=>({alias:"是否可编辑",html_type:"SWITCH",elem_width:6,...a()})],[t.REQUIRED,e=>({alias:"是否必填",html_type:"SWITCH",elem_width:6,is_edit:(null==e?void 0:e.requiredDisabled)?"0":"1",...E()})]]);function m(e,t){return t.map((t=>{var l,i;return{...null!=(i=null==(l=n.get(t))?void 0:l(e))?i:{},val_key:t}}))}return{generateFieldListByKeys:m,generateFieldListByFieldItem:function(e){const l=new Map([["LINE_BAR",[t.NAME,t.LAYOUT_WIDTH_ENUM,t.NOTES,t.DEFAULT_EXPAND,t.FOLD]],...["NEWLINE","COMPLEX","COMBINATION"].map((e=>[e,[t.NAME,t.LAYOUT_WIDTH_ENUM]]))]),i=[t.NAME,t.DEFAULT_VALUE,t.LAYOUT_WIDTH_ENUM,t.DESC,t.NOTES,t.EDITABLE,t.REQUIRED];return m(e,l.get(e.type)||i)}}}export{n as useConfigurationField};
1
+ import{isArray as e}from"lodash-es";import{EditAbleField as t,widgetWidthOptionConfig as l,isShowOptionConfig as i,isNotFoldOptionConfig as a,isEditOptionConfig as _,isNullOptionConfig as E}from"../constants/index.js";function n(){const n=new Map([[t.NAME,()=>({alias:"名称",elem_width:6,is_null:"0",html_type:"INPUT"})],[t.NOTES,()=>({alias:"问号提示",elem_width:6,html_type:"INPUT"})],[t.DEFAULT_VALUE,t=>e(null==t?void 0:t.options)&&t.options.length?{alias:"默认值",elem_width:6,html_type:"SELECT",option:null==t?void 0:t.options}:{alias:"默认值",elem_width:6,html_type:"INPUT",validate:{max_length:20}}],[t.LAYOUT_WIDTH_ENUM,()=>({alias:"宽度",fieldType:"number",html_type:"SELECT",elem_width:6,...l()})],[t.DESC,()=>({alias:"说明文本",elem_width:6,html_type:"INPUT",validate:{max_length:30}})],[t.DEFAULT_EXPAND,()=>({alias:"是否默认展开",html_type:"SWITCH",elem_width:6,...i()})],[t.FOLD,()=>({alias:"是否可折叠",html_type:"SWITCH",elem_width:6,...a()})],[t.EDITABLE,e=>({alias:"是否可编辑",html_type:"SWITCH",elem_width:6,is_edit:(null==e?void 0:e.editableDisabled)?"0":"1",..._()})],[t.REQUIRED,e=>({alias:"是否必填",html_type:"SWITCH",elem_width:6,is_edit:(null==e?void 0:e.requiredDisabled)?"0":"1",...E()})]]);function m(e,t){return t.map((t=>{var l,i;return{...null!=(i=null==(l=n.get(t))?void 0:l(e))?i:{},val_key:t}}))}return{generateFieldListByKeys:m,generateFieldListByFieldItem:function(e){const l=new Map([["LINE_BAR",[t.NAME,t.LAYOUT_WIDTH_ENUM,t.NOTES,t.DEFAULT_EXPAND,t.FOLD]],...["NEWLINE","COMPLEX","COMBINATION"].map((e=>[e,[t.NAME,t.LAYOUT_WIDTH_ENUM]]))]),i=[t.NAME,t.DEFAULT_VALUE,t.LAYOUT_WIDTH_ENUM,t.DESC,t.NOTES,t.EDITABLE,t.REQUIRED];return m(e,l.get(e.type)||i)}}}export{n as useConfigurationField};
@@ -1 +1 @@
1
- import{findAncestor as o}from"../../../../shared/utils/index.js";import{FORM_CONFIG_GROUP as s}from"../constants/index.js";function e(){let e,t=null;function i({target:o,item:s}){t=setTimeout((()=>{o.classList.add("is-choosing-area"),s.classList.add("is-choosing")}),200)}function a({from:o,to:s,target:e,item:i}){clearTimeout(t),[o,s,e].forEach((o=>{o.classList.remove("is-choosing-area")})),i.classList.remove("is-choosing")}function n({to:s,from:t,dragged:i}){if("LINE_BAR"===i.dataset.type&&o(s,(o=>"LINE_BAR"===o.dataset.type)))return!1;null==e||e.classList.remove("is-choosing-area"),e=s,s!==t&&t.classList.remove("is-choosing-area"),s.classList.add("is-choosing-area")}return{getCommonConfig:o=>({move:n,onChoose:i,onUnchoose:a,tag:"section",forceFallback:!1,animation:"150","item-key":"key",group:"COMBINATION"===(null==o?void 0:o.type)?o.key:s})}}export{e as useSortableConfig};
1
+ import{findAncestor as o}from"../../../../shared/utils/index.js";import{FORM_CONFIG_GROUP as s}from"../constants/index.js";function t(){let t,e=null;function i({target:o,item:s}){e=setTimeout((()=>{o.classList.add("is-choosing-area"),s.classList.add("is-choosing")}),200)}function a({from:o,to:s,target:t,item:i}){clearTimeout(e),[o,s,t].forEach((o=>{o.classList.remove("is-choosing-area")})),i.classList.remove("is-choosing")}function n({to:s,from:e,dragged:i}){return("LINE_BAR"!==i.dataset.type||!o(s,(o=>"LINE_BAR"===o.dataset.type)))&&(("true"!==i.dataset.required||!o(s,(o=>o.classList.contains("form-config__materialContent"))))&&(null==t||t.classList.remove("is-choosing-area"),t=s,s!==e&&e.classList.remove("is-choosing-area"),void s.classList.add("is-choosing-area")))}return{getCommonConfig:o=>({move:n,onChoose:i,onUnchoose:a,tag:"section",forceFallback:!1,animation:"150","item-key":"key",group:"COMBINATION"===(null==o?void 0:o.type)?o.key:s})}}export{t as useSortableConfig};
@@ -22,6 +22,7 @@ export declare type FormConfigItem = {
22
22
  fold: boolean;
23
23
  required: boolean;
24
24
  requiredDisabled: boolean;
25
+ editableDisabled: boolean;
25
26
  editable: boolean;
26
27
  notes: string;
27
28
  desc: string;
@@ -20,6 +20,7 @@ export declare const SELECT: import("vue").DefineComponent<{
20
20
  default: () => never[];
21
21
  };
22
22
  onChange: {};
23
+ allowCreate: BooleanConstructor;
23
24
  urlConfig: {
24
25
  type: PropType<UrlConfig>;
25
26
  };
@@ -82,6 +83,7 @@ export declare const SELECT: import("vue").DefineComponent<{
82
83
  default: () => never[];
83
84
  };
84
85
  onChange: {};
86
+ allowCreate: BooleanConstructor;
85
87
  urlConfig: {
86
88
  type: PropType<UrlConfig>;
87
89
  };
@@ -137,4 +139,5 @@ export declare const SELECT: import("vue").DefineComponent<{
137
139
  recommend: boolean;
138
140
  recommendCache: boolean;
139
141
  recommendNum: number;
142
+ allowCreate: boolean;
140
143
  }>;
@@ -1 +1 @@
1
- import{defineComponent as e,computed as o,inject as t,createVNode as r}from"vue";import{useDebounceFn as a}from"@vueuse/core";import{cloneDeep as s,isString as l}from"lodash-es";import{useCommonInjection as i,useSelectOptionProps as n}from"../../hooks/useCommonInjection.js";import{InjectionChangeContextCollector as p}from"../../constants/index.js";import"../../../../../shared/utils/index.js";import"../../../index.js";import"../../utils/index.js";import{useFormField as m}from"../../hooks/useFormField.js";import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import"../../hooks/useFormValidator.js";import"@formily/core";import"date-fns";import"@formily/reactive";import{connect as u,mapProps as c}from"@formily/vue";import"@vue/shared";import"./index.js";import{useUrlConfigOptions as d,useAutographOptions as y,useRecommendOptions as f,searchContentMatcher as v}from"../../hooks/useFormRenderOptions.js";import{NSelect as h}from"naive-ui";import{createVisitedSetter as j,assignUpdateValue as b,assignClearBindVisited as k}from"../../utils/schema.js";const S=u(e({name:"FormSelect",props:{value:{type:[String,Array]},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},onChange:{},urlConfig:{type:Object},autograph:{type:String},wordbook:{type:Object},recommend:{type:Boolean,default:!1},commonList:{type:Array},recentList:{type:Array},getRecommendInfo:{type:Function},recommendNum:{type:Number,default:10},recommendCache:{type:Boolean,default:!1}},emits:["update:value","postRecommend"],setup(e,{slots:u,emit:c}){const b=o({get:()=>e.value,async set(e){c("update:value",e),g(e)}}),{labelKey:k,valueKey:S,fetchData:A,options:F}=e.urlConfig?d(e,b):y(e,b),{getRecommend:H,postRecommend:g,sortedOptions:x}=f(e,F,c,k,S),{field:B,fieldKey:C}=m();t(p).setContext(C.value,(e=>{return{currentOption:s((o=e,x.value.find((e=>e[S.value]===o))))};var o}));let R="";const L=a((async(e="")=>{R=e,A(e),H(e)}),400),{injectValueValidate:O,injectValueWatchFromEmpty:V,injectValueBindKey:K}=i();V(b,L),O(b);const P=K(b),{menuProps:W,nodeProps:q}=n();function w(e){const o=e[k.value];if(!o||!l(o))return"";const t=v(R,o);return t?r("section",null,[t.map(((e,o)=>0!==o&&e?r("span",{style:{color:o%2==0?"var(--n-option-text-color-active)":""}},[e]):null))]):o}return()=>r(h,{key:P.value,remote:!0,filterable:!0,value:b.value,"onUpdate:value":e=>b.value=e,"menu-props":W,"node-props":q,labelField:k.value,valueField:S.value,options:x.value,onSearch:L,"onUpdate:show":e=>e&&L(),onFocus:j(B),renderLabel:w},u)}}),c({dataSource:"options"},b,k));export{S as SELECT};
1
+ import{defineComponent as e,computed as o,inject as t,ref as a,createVNode as r}from"vue";import{useDebounceFn as l}from"@vueuse/core";import{cloneDeep as s,isString as i}from"lodash-es";import{useCommonInjection as n,useSelectOptionProps as u}from"../../hooks/useCommonInjection.js";import{InjectionChangeContextCollector as p}from"../../constants/index.js";import"../../../../../shared/utils/index.js";import"../../../index.js";import"../../utils/index.js";import{useFormField as m}from"../../hooks/useFormField.js";import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import"../../hooks/useFormValidator.js";import"@formily/core";import"date-fns";import"@formily/reactive";import{connect as c,mapProps as d}from"@formily/vue";import"@vue/shared";import"./index.js";import{useUrlConfigOptions as y,useAutographOptions as v,useRecommendOptions as f,searchContentMatcher as h}from"../../hooks/useFormRenderOptions.js";import{NSelect as j}from"naive-ui";import{createVisitedSetter as b,assignUpdateValue as k,assignClearBindVisited as S}from"../../utils/schema.js";const g=c(e({name:"FormSelect",props:{value:{type:[String,Array]},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},onChange:{},allowCreate:Boolean,urlConfig:{type:Object},autograph:{type:String},wordbook:{type:Object},recommend:{type:Boolean,default:!1},commonList:{type:Array},recentList:{type:Array},getRecommendInfo:{type:Function},recommendNum:{type:Number,default:10},recommendCache:{type:Boolean,default:!1}},emits:["update:value","postRecommend"],setup(e,{slots:c,emit:d}){const k=o({get:()=>e.value,async set(e){d("update:value",e),B(e)}}),{labelKey:S,valueKey:g,fetchData:A,options:F}=e.urlConfig?y(e,k):v(e,k),{getRecommend:H,postRecommend:B,sortedOptions:C}=f(e,F,d,S,g),{field:x,fieldKey:R}=m();t(p).setContext(R.value,(e=>{return{currentOption:s((o=e,C.value.find((e=>e[g.value]===o))))};var o}));const L=a(""),O=l((async(e="")=>{L.value=e,A(e),H(e)}),300),{injectValueValidate:V,injectValueWatchFromEmpty:w,injectValueBindKey:K}=n();w(k,O),V(k);const P=K(k),{menuProps:W,nodeProps:q}=u();function I(e){const o=e[S.value];if(!o||!i(o))return"";const t=h(L.value,o);return t?r("section",null,[t.map(((e,o)=>0!==o&&e?r("span",{style:{color:o%2==0?"var(--n-option-text-color-active)":""}},[e]):null))]):o}const N=o((()=>C.value.length||!e.allowCreate?C.value:L.value?[{[S.value]:L.value,[g.value]:L.value},...C.value]:C.value));return()=>r(j,{key:P.value,remote:!0,filterable:!0,value:k.value,"onUpdate:value":e=>k.value=e,"menu-props":W,"node-props":q,labelField:S.value,valueField:g.value,options:N.value,onSearch:O,"onUpdate:show":e=>e&&O(),onFocus:b(x),renderLabel:I},c)}}),d({dataSource:"options"},k,S));export{g as SELECT};
@@ -1 +1 @@
1
- import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,pick as n}from"lodash-es";import"../../index.js";import{parseNumberFromMaybeString as r,formRenderLog as i}from"../utils/index.js";import{useFieldNormalize as s}from"./useFieldNormalize.js";import{fieldKeyEscape as a,createLinebarId as p}from"../utils/schema.js";import{useFormValidator as l}from"./useFormValidator.js";import{transformDateFormat as c}from"../utils/business.js";function m(e,o){Object.assign(e["x-component-props"],{...n(o,["wordbook","autograph"])})}function u(u){const{createValidatorSchema:d}=l(),x=e=>{var t;const n={name:e.val_key,type:null!=(t=e.fieldType)?t:"string",title:e.alias||e.name,"x-component":e.html_type,default:e.default_val,"x-component-props":{placeholder:e.placeholder,clearable:"0"===e.is_empty,...e.componentProps||{}},"x-content":e.slots,"x-display":"0"===e.is_show?"hidden":"visible","x-pattern":"0"===e.is_edit?"disabled":"editable"};e.reactions&&(n["x-reactions"]=e.reactions),e.noDecorator||Object.assign(n,{"x-decorator":"FORM_ITEM","x-decorator-props":{fieldItem:o(e,["reactions"]),span:2*(e.elem_width||3),showLabel:"1"!==e.hide_title,remark:e.remark,propertyKey:e.val_key,annotation:e.annotation,...e.decoratorProps||{}}});const r=d(e);return r&&(n["x-validator"]=r),"0"===e.is_null&&(n.required=!0),n},f=e=>{const o=x(e);e.urlConfig?function(e,o){Object.assign(e["x-component-props"],{...n(o,["urlConfig"])})}(o,e):e.autograph&&m(o,e);const t="0"===e.multi_select;return Object.assign(o["x-component-props"],{multiple:t,options:e.option,maxTagCount:r(e.multi_select_value),...n(e,["lazyRequest","requestCache"])}),t&&(o.type="array"),o},_=e=>{const o=x(e);return Object.assign(o["x-component-props"],{options:e.option,vertical:e.__vertical}),m(o,e),o},h=e=>{const t=x(e);return Object.assign(t["x-component-props"],{fieldItem:o(e,["reactions"])}),t},g=e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINEBAR","x-display":"visible","x-component-props":{disabled:"1"===e.is_not_fold,id:p(e.val_key),show:"0"!==e.is_show,remark:e.remark}}),y=new Map([["LINEBAR",g],["LINE_BREAKS",e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINE_BREAKS","x-display":"0"===e.is_show?"hidden":"visible"})],["INPUT",e=>{const o=x(e);return Object.assign(o["x-component-props"],{...n(e,["prefix","suffix"])}),o}],["INPUT_NUMBER",e=>{const o=x(e),{decimal_length:t,validate:n}=e;return Object.assign(o["x-component-props"],{precision:null!=t?t:null==n?void 0:n.decimal_length,prefix:e.prefix,suffix:e.suffix}),o}],["SELECT",f],["REMOTE_SEARCH",f],["DATE",e=>{const o=x(e);return Object.assign(o["x-component-props"],{valueFormat:e.date_format,type:c(e.date_format),validate:e.validate}),o}],["LEVEL_SEARCH_CASCADER",e=>{const o=x(e);return Object.assign(o["x-component-props"],{...n(e,["wordbook","lazyRequest","autograph"])}),o}],["SEARCH_CASCADER",e=>{var o;const t=x(e);return Object.assign(t["x-component-props"],{urlConfig:e.urlConfig,depth:null==(o=e.wordbook)?void 0:o.level_num,options:e.option}),t}],["COMBINATION",e=>{const o=x(e);return o.type="array",!1!==e.jsonCombination&&(o["x-component"]="JSON_COMBINATION"),Object.assign(o["x-decorator-props"],{showLabel:!1,showFeedback:!1}),Object.assign(o["x-component-props"],{title:e.alias||e.name,maxGroupNum:e.maxGroupNum,getProperties:()=>e.children||[]}),o}],["RADIO",_],["CHECKBOX",_],["SWITCH",e=>{const o=x(e);return Object.assign(o["x-component-props"],{openDescription:e.open,closeDescription:e.close}),o}],["SLIDER",e=>{const o=x(e);return Object.assign(o["x-component-props"],{step:r(e.step_length),max:r(e.max_length),min:r(e.min_length),option:e.option}),o}],["COMPLEX",e=>{const o=x(e);Array.isArray(e.properties)&&i("COMPLEX控件的properties属性已经废弃, 请使用children作为替代, 在之后的版本中properties属性将不再支持");const t=Array.isArray(e.properties||e.children)?C(e.properties||e.children):{};return o.type=e.fieldType||"void",o.properties=t,Object.assign(o["x-decorator-props"],{showFeedback:!1}),Object.assign(o["x-component-props"],n(e,["wrapperStyle","display"])),o}]]),b=e=>{if(e.suffixConfig)return v(e);return(y.get(e.html_type)||h)(e)},v=o=>{if(!o.suffixConfig)return b(o);const t=e(o.suffixConfig),n=[{...o,hide_title:"1",suffixConfig:void 0}].concat(t.map((e=>({...e,hide_title:"1",is_show:o.is_show})))),r=x(o);return Object.assign(r,{type:"void",name:a(n),title:o.alias||o.name,"x-component":"INPUT_GROUP","x-component-props":{span:2*(o.elem_width||3)},"x-decorator-props":{...r["x-decorator-props"],suffixFields:n.map((e=>e.val_key))},properties:C(n)}),r},{FieldNormalizeWaterfallHook:O}=s();function C(o){let n=null;return o.reduce(((e,o,s)=>{var a;const p=null==(a=(o=O.call(t(o))).validate)?void 0:a.obj_type;return p&&u.collect(p,t(o)),"LINEBAR"===o.html_type?(e[i(o)]=r(g(o),s),n=e[i(o)].properties={}):n?n[i(o)]=r(b(o),s):(n=null,e[i(o)]=r(b(o),s)),e}),{});function r(e,o){return e["x-index"]=o,e}function i(o){return o.suffixConfig?a([o,...e(o.suffixConfig)]):o.val_key}}return{schemaAdaptor:C}}export{u as useFieldListAdaptor};
1
+ import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,pick as n}from"lodash-es";import"../../index.js";import{parseNumberFromMaybeString as r,formRenderLog as i}from"../utils/index.js";import{useFieldNormalize as s}from"./useFieldNormalize.js";import{fieldKeyEscape as a,createLinebarId as p}from"../utils/schema.js";import{useFormValidator as l}from"./useFormValidator.js";import{transformDateFormat as c}from"../utils/business.js";function m(e,o){Object.assign(e["x-component-props"],{...n(o,["wordbook","autograph"])})}function d(d){const{createValidatorSchema:u}=l(),f=e=>{var t;const n={name:e.val_key,type:null!=(t=e.fieldType)?t:"string",title:e.alias||e.name,"x-component":e.html_type,default:e.default_val,"x-component-props":{placeholder:e.placeholder,clearable:"0"===e.is_empty,...e.componentProps||{}},"x-content":e.slots,"x-display":"0"===e.is_show?"hidden":"visible","x-pattern":"0"===e.is_edit?"disabled":"editable"};e.reactions&&(n["x-reactions"]=e.reactions),e.noDecorator||Object.assign(n,{"x-decorator":"FORM_ITEM","x-decorator-props":{fieldItem:o(e,["reactions"]),span:2*(e.elem_width||3),showLabel:"1"!==e.hide_title,remark:e.remark,propertyKey:e.val_key,annotation:e.annotation,...e.decoratorProps||{}}});const r=u(e);return r&&(n["x-validator"]=r),"0"===e.is_null&&(n.required=!0),n},x=e=>{const o=f(e);e.urlConfig?function(e,o){Object.assign(e["x-component-props"],{...n(o,["urlConfig"])})}(o,e):e.autograph&&m(o,e);const t="0"===e.multi_select;return Object.assign(o["x-component-props"],{multiple:t,options:e.option,allowCreate:"1"===e.free_entry,maxTagCount:r(e.multi_select_value),...n(e,["lazyRequest","requestCache"])}),t&&(o.type="array"),o},_=e=>{const o=f(e);return Object.assign(o["x-component-props"],{options:e.option,vertical:e.__vertical}),m(o,e),o},h=e=>{const t=f(e);return Object.assign(t["x-component-props"],{fieldItem:o(e,["reactions"])}),t},g=e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINEBAR","x-display":"visible","x-component-props":{disabled:"1"===e.is_not_fold,id:p(e.val_key),show:"0"!==e.is_show,remark:e.remark}}),y=new Map([["LINEBAR",g],["LINE_BREAKS",e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINE_BREAKS","x-display":"0"===e.is_show?"hidden":"visible"})],["INPUT",e=>{const o=f(e);return Object.assign(o["x-component-props"],{...n(e,["prefix","suffix"])}),o}],["INPUT_NUMBER",e=>{const o=f(e),{decimal_length:t,validate:n}=e;return Object.assign(o["x-component-props"],{precision:null!=t?t:null==n?void 0:n.decimal_length,prefix:e.prefix,suffix:e.suffix}),o}],["SELECT",x],["REMOTE_SEARCH",x],["DATE",e=>{const o=f(e);return Object.assign(o["x-component-props"],{valueFormat:e.date_format,type:c(e.date_format),validate:e.validate}),o}],["LEVEL_SEARCH_CASCADER",e=>{const o=f(e);return Object.assign(o["x-component-props"],{...n(e,["wordbook","lazyRequest","autograph"])}),o}],["SEARCH_CASCADER",e=>{var o;const t=f(e);return Object.assign(t["x-component-props"],{urlConfig:e.urlConfig,depth:null==(o=e.wordbook)?void 0:o.level_num,options:e.option}),t}],["COMBINATION",e=>{const o=f(e);return o.type="array",!1!==e.jsonCombination&&(o["x-component"]="JSON_COMBINATION"),Object.assign(o["x-decorator-props"],{showLabel:!1,showFeedback:!1}),Object.assign(o["x-component-props"],{title:e.alias||e.name,maxGroupNum:e.maxGroupNum,getProperties:()=>e.children||[]}),o}],["RADIO",_],["CHECKBOX",_],["SWITCH",e=>{const o=f(e);return Object.assign(o["x-component-props"],{openDescription:e.open,closeDescription:e.close}),o}],["SLIDER",e=>{const o=f(e);return Object.assign(o["x-component-props"],{step:r(e.step_length),max:r(e.max_length),min:r(e.min_length),option:e.option}),o}],["COMPLEX",e=>{const o=f(e);Array.isArray(e.properties)&&i("COMPLEX控件的properties属性已经废弃, 请使用children作为替代, 在之后的版本中properties属性将不再支持");const t=Array.isArray(e.properties||e.children)?C(e.properties||e.children):{};return o.type=e.fieldType||"void",o.properties=t,Object.assign(o["x-decorator-props"],{showFeedback:!1}),Object.assign(o["x-component-props"],n(e,["wrapperStyle","display"])),o}]]),b=e=>{if(e.suffixConfig)return v(e);return(y.get(e.html_type)||h)(e)},v=o=>{if(!o.suffixConfig)return b(o);const t=e(o.suffixConfig),n=[{...o,is_show:"1",hide_title:"1",suffixConfig:void 0}].concat(t.map((e=>({...e,hide_title:"1",is_show:"1"})))),r=f(o);return Object.assign(r,{type:"void",name:a(n),title:o.alias||o.name,"x-component":"INPUT_GROUP","x-component-props":{span:2*(o.elem_width||3)},"x-decorator-props":{...r["x-decorator-props"],showFeedback:!1,suffixFields:n.map((e=>e.val_key))},properties:C(n)}),r},{FieldNormalizeWaterfallHook:O}=s();function C(o){let n=null;return o.reduce(((e,o,s)=>{var a;const p=null==(a=(o=O.call(t(o))).validate)?void 0:a.obj_type;return p&&d.collect(p,t(o)),"LINEBAR"===o.html_type?(e[i(o)]=r(g(o),s),n=e[i(o)].properties={}):n?n[i(o)]=r(b(o),s):(n=null,e[i(o)]=r(b(o),s)),e}),{});function r(e,o){return e["x-index"]=o,e}function i(o){return o.suffixConfig?a([o,...e(o.suffixConfig)]):o.val_key}}return{schemaAdaptor:C}}export{d as useFieldListAdaptor};
@@ -198,6 +198,10 @@ export declare type FieldItem = {
198
198
  * 控件中的备注
199
199
  */
200
200
  remark: string;
201
+ /**
202
+ * 是否允许用户在下拉控件中创建自定义选项
203
+ */
204
+ free_entry: FormCommonState;
201
205
  /**
202
206
  * 数据类型
203
207
  */