cnhis-design-vue 3.1.50 → 3.1.51-beta.1

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 (123) hide show
  1. package/README.md +87 -87
  2. package/es/components/base-search/index.d.ts +13 -8
  3. package/es/components/base-search/src/index.vue.d.ts +13 -8
  4. package/es/components/base-search/src/index.vue2.js +1 -1
  5. package/es/components/classification/index.d.ts +57 -15
  6. package/es/components/classification/src/components/search-filter/index.vue.d.ts +57 -15
  7. package/es/components/classification/src/components/set-classification/index.vue.d.ts +57 -15
  8. package/es/components/classification/src/index.vue.d.ts +57 -15
  9. package/es/components/expand-field/src/components/form.vue2.js +1 -1
  10. package/es/components/expand-field/src/index.vue2.js +1 -1
  11. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
  12. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
  13. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
  14. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.js +1 -1
  15. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
  16. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
  17. package/es/components/fabric-chart/src/hooks/temperature/useBottom.js +1 -1
  18. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  19. package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
  20. package/es/components/fabric-chart/src/hooks/temperature/useOther.js +1 -1
  21. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
  22. package/es/components/fabric-chart/src/hooks/temperature/useTop.js +1 -1
  23. package/es/components/fabric-chart/src/hooks/useCommon.d.ts +1 -0
  24. package/es/components/fabric-chart/src/hooks/useCommon.js +1 -1
  25. package/es/components/field-set/index.d.ts +1 -1
  26. package/es/components/field-set/src/FieldSet.vue.d.ts +1 -1
  27. package/es/components/field-set/src/FieldSet.vue2.js +1 -1
  28. package/es/components/form-config/index.d.ts +174 -25
  29. package/es/components/form-config/src/FormConfig.vue.d.ts +175 -26
  30. package/es/components/form-config/src/FormConfig.vue2.js +1 -1
  31. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +4 -4
  32. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +13 -10
  33. package/es/components/form-config/src/components/FormConfigEventSetting.vue.d.ts +121 -0
  34. package/es/components/form-config/src/components/FormConfigEventSetting.vue.js +1 -0
  35. package/es/components/form-config/src/components/FormConfigEventSetting.vue2.js +1 -0
  36. package/es/components/form-config/src/constants/index.d.ts +19 -1
  37. package/es/components/form-config/src/constants/index.js +1 -1
  38. package/es/components/form-config/src/hooks/useDataNormalize.d.ts +1 -1
  39. package/es/components/form-config/src/hooks/useDataNormalize.js +1 -1
  40. package/es/components/form-config/src/types/index.d.ts +7 -3
  41. package/es/components/form-config/style/index.css +1 -1
  42. package/es/components/form-render/index.d.ts +4 -4
  43. package/es/components/form-render/src/FormRender.vue.d.ts +2 -2
  44. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +4 -4
  45. package/es/components/form-render/src/components/renderer/select.d.ts +10 -1
  46. package/es/components/form-render/src/components/renderer/select.js +1 -1
  47. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
  48. package/es/components/form-render/src/hooks/useFieldNormalize.d.ts +2 -2
  49. package/es/components/form-render/src/hooks/useFormValidator.js +1 -1
  50. package/es/components/form-render/src/hooks/useLowCodeReactions.d.ts +1 -1
  51. package/es/components/form-render/src/types/fieldItem.d.ts +2 -1
  52. package/es/components/form-render/src/types/index.d.ts +1 -19
  53. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/numberRendererPlugin.js +1 -1
  54. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.d.ts +1 -1
  55. package/es/components/iho-table/src/types/index.d.ts +2 -1
  56. package/es/components/index.css +1 -1
  57. package/es/components/info-header/index.d.ts +13 -13
  58. package/es/components/info-header/src/InfoHeader.vue.d.ts +13 -13
  59. package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +1 -1
  60. package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +1 -1
  61. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +5 -5
  62. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +4 -4
  63. package/es/components/quick-search/index.d.ts +13 -8
  64. package/es/components/quick-search/src/index.vue.d.ts +13 -8
  65. package/es/components/quick-search/src/index.vue2.js +1 -1
  66. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  67. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
  68. package/es/components/select-person/src/SearchMultiple.vue.d.ts +6 -0
  69. package/es/components/shortcut-setter/index.d.ts +6 -5
  70. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +6 -5
  71. package/es/components/table-export-field/src/components/ExportModal.vue.d.ts +0 -3
  72. package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +52 -7
  73. package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue2.js +1 -1
  74. package/es/components/table-filter/src/components/classify-filter/components/Date.vue.d.ts +1 -1
  75. package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue.d.ts +1 -1
  76. package/es/components/table-filter/src/components/classify-filter/components/InputFilter.vue.d.ts +34 -2
  77. package/es/components/table-filter/src/components/classify-filter/components/InputFilter.vue2.js +1 -1
  78. package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +36 -4
  79. package/es/components/table-filter/src/components/classify-filter/hooks/useFilterConditions.d.ts +1 -6
  80. package/es/components/table-filter/src/components/classify-filter/hooks/useFilterConditions.js +1 -1
  81. package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +57 -15
  82. package/es/components/table-filter/src/components/classify-filter/index.vue2.js +1 -1
  83. package/es/components/table-filter/src/components/render-widget/components/InputCustom.vue.d.ts +58 -0
  84. package/es/components/table-filter/src/components/render-widget/components/InputCustom.vue.js +1 -0
  85. package/es/components/table-filter/src/components/render-widget/components/InputCustom.vue2.js +1 -0
  86. package/es/components/table-filter/src/components/render-widget/components/index.d.ts +56 -1
  87. package/es/components/table-filter/src/components/render-widget/components/index.js +1 -1
  88. package/es/components/table-filter/src/components/render-widget/index.vue.d.ts +4 -1
  89. package/es/components/table-filter/src/components/render-widget/index.vue.js +1 -1
  90. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +55 -1
  91. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.js +1 -1
  92. package/es/components/table-filter/src/hooks/useAdvanced.d.ts +2 -0
  93. package/es/components/table-filter/src/hooks/useAdvanced.js +1 -1
  94. package/es/components/table-filter/src/hooks/useRenderWidget.d.ts +1 -7
  95. package/es/components/table-filter/src/hooks/useRenderWidget.js +1 -1
  96. package/es/components/table-filter/src/tool/transformData.d.ts +1 -6
  97. package/es/components/table-filter/src/tool/transformData.js +1 -1
  98. package/es/components/table-filter/src/types/index.d.ts +16 -1
  99. package/es/env.d.ts +25 -25
  100. package/es/shared/assets/img/failure.png.js +1 -1
  101. package/es/shared/assets/img/no-permission.png.js +1 -1
  102. package/es/shared/assets/img/nodata.png.js +1 -1
  103. package/es/shared/assets/img/notfound.png.js +1 -1
  104. package/es/shared/assets/img/qr.png.js +1 -1
  105. package/es/shared/assets/img/success.png.js +1 -1
  106. package/es/shared/assets/img/video.png.js +1 -1
  107. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  108. package/es/shared/assets/img/xb_big.png.js +1 -1
  109. package/es/shared/assets/img/xb_small.png.js +1 -1
  110. package/es/shared/components/InputNumberSlash/InputNumberSlash.d.ts +19 -1
  111. package/es/shared/components/InputNumberSlash/InputNumberSlash.js +1 -1
  112. package/es/shared/package.json.js +1 -1
  113. package/es/shared/types/business.d.ts +20 -0
  114. package/es/shared/utils/business.d.ts +1 -2
  115. package/es/shared/utils/index.d.ts +3 -3
  116. package/package.json +2 -2
  117. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  118. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
  119. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
  120. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
  121. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
  122. package/es/shared/utils/fabricjs/index.d.ts +0 -6823
  123. package/es/shared/utils/tapable/index.d.ts +0 -139
@@ -0,0 +1,121 @@
1
+ import { FormLowCodeReactions, LOW_CODE_VALUE_RELATION } from '../../../../../es/shared/types';
2
+ import { FormConfigItem } from '../../../../../es/components/form-config';
3
+ declare const _default: import("vue").DefineComponent<{
4
+ modelValue: {
5
+ type: ArrayConstructor;
6
+ required: true;
7
+ default: () => never[];
8
+ };
9
+ }, {
10
+ props: {
11
+ modelValue: FormLowCodeReactions.Config[];
12
+ };
13
+ emit: (event: "update:modelValue" | "validateFailure", ...args: any[]) => void;
14
+ cssVars: import("vue").ComputedRef<import("vue").CSSProperties>;
15
+ valueRef: import("vue").Ref<{
16
+ conObj: {
17
+ con: LOW_CODE_VALUE_RELATION;
18
+ field_key: string;
19
+ value: unknown;
20
+ }[];
21
+ sqlExpression?: string | undefined;
22
+ showField?: string[] | undefined;
23
+ hideField?: string[] | undefined;
24
+ requiredField?: string[] | undefined;
25
+ notRequiredField?: string[] | undefined;
26
+ enabledField?: string[] | undefined;
27
+ disabledField?: string[] | undefined;
28
+ __oppositeBindField?: any | undefined;
29
+ __oppositeTargetField?: any | undefined;
30
+ }[]>;
31
+ expandedName: import("vue").Ref<string>;
32
+ addConnection: () => void;
33
+ removeConnection: (index: number) => void;
34
+ getOppositeBtnText: (item: FormLowCodeReactions.Config) => string | undefined;
35
+ unBindOpposite: (item: FormLowCodeReactions.Config) => void;
36
+ addOppositeCondition: (item: FormLowCodeReactions.Config) => void;
37
+ getOppositeSqlExpression: (expression?: string) => string | undefined;
38
+ createOppositeCondition: (config: FormLowCodeReactions.Config) => FormLowCodeReactions.Config;
39
+ isOppositeConfig: (c1: FormLowCodeReactions.Config, c2: FormLowCodeReactions.Config) => boolean;
40
+ onUpdateExpandedNames: (value: string[]) => void;
41
+ getBinderFieldDesc: (index: number) => string;
42
+ addCondition: (config: FormLowCodeReactions.Config) => void;
43
+ removeCondition: (config: FormLowCodeReactions.Config, index: number) => void;
44
+ onUpdateConditionType: (condition: FormLowCodeReactions.ConObj, type: LOW_CODE_VALUE_RELATION) => void;
45
+ showRef: import("vue").Ref<boolean>;
46
+ fieldListRef: import("vue").Ref<FormConfigItem[]>;
47
+ fieldOptions: import("vue").ComputedRef<FormConfigItem[]>;
48
+ currentTypeList: string[];
49
+ dialog: import("naive-ui").DialogApi;
50
+ onNegativeClick: () => Promise<void>;
51
+ onPositiveClick: () => Promise<void>;
52
+ configValidate: () => Promise<void>;
53
+ HelpCircleSharp: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
54
+ NButton: any;
55
+ NModal: any;
56
+ NSpace: any;
57
+ NScrollbar: any;
58
+ NThing: any;
59
+ NInputGroup: import("vue").DefineComponent<{
60
+ [x: string]: never;
61
+ [x: number]: never;
62
+ [x: symbol]: never;
63
+ }, {
64
+ mergedClsPrefix: import("vue").ComputedRef<string>;
65
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
66
+ [x: string]: never;
67
+ [x: number]: never;
68
+ [x: symbol]: never;
69
+ }>>, {}>;
70
+ NSelect: any;
71
+ NInput: any;
72
+ NCollapse: any;
73
+ NCollapseItem: import("vue").DefineComponent<{
74
+ readonly title: StringConstructor;
75
+ readonly name: import("vue").PropType<string | number>;
76
+ readonly disabled: BooleanConstructor;
77
+ readonly displayDirective: import("vue").PropType<"if" | "show">;
78
+ }, {
79
+ rtlEnabled: import("vue").Ref<import("naive-ui/es/config-provider/src/internal-interface").RtlItem | undefined> | undefined;
80
+ collapseSlots: Readonly<{
81
+ [name: string]: import("vue").Slot | undefined;
82
+ }>;
83
+ randomName: string;
84
+ mergedClsPrefix: import("vue").Ref<string>;
85
+ collapsed: import("vue").ComputedRef<boolean>;
86
+ mergedDisplayDirective: import("vue").ComputedRef<"if" | "show">;
87
+ arrowPlacement: import("vue").ComputedRef<"left" | "right">;
88
+ handleClick(e: MouseEvent): void;
89
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
90
+ readonly title: StringConstructor;
91
+ readonly name: import("vue").PropType<string | number>;
92
+ readonly disabled: BooleanConstructor;
93
+ readonly displayDirective: import("vue").PropType<"if" | "show">;
94
+ }>>, {
95
+ readonly disabled: boolean;
96
+ }>;
97
+ NEllipsis: any;
98
+ NEmpty: any;
99
+ NTooltip: any;
100
+ NIcon: any;
101
+ conditionTypeOptions: {
102
+ value: LOW_CODE_VALUE_RELATION;
103
+ label: string;
104
+ }[];
105
+ connectionTypeOptions: {
106
+ value: string;
107
+ label: string;
108
+ }[];
109
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "validateFailure")[], "update:modelValue" | "validateFailure", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
110
+ modelValue: {
111
+ type: ArrayConstructor;
112
+ required: true;
113
+ default: () => never[];
114
+ };
115
+ }>> & {
116
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
117
+ onValidateFailure?: ((...args: any[]) => any) | undefined;
118
+ }, {
119
+ modelValue: unknown[];
120
+ }>;
121
+ export default _default;
@@ -0,0 +1 @@
1
+ import e from"./FormConfigEventSetting.vue2.js";import t from"../../../../_virtual/_plugin-vue_export-helper.js";var r=t(e,[["__file","FormConfigEventSetting.vue"]]);export{r as default};
@@ -0,0 +1 @@
1
+ import{defineComponent as e,ref as l,watchEffect as o,watch as n,inject as i,computed as t,reactive as a,openBlock as s,createElementBlock as d,createVNode as u,unref as p,withCtx as r,createTextVNode as c,normalizeStyle as _,createElementVNode as v,Fragment as f,renderList as m,createBlock as h,toDisplayString as g,withModifiers as y,createCommentVNode as b,normalizeClass as F}from"vue";import{useTheme as k}from"../../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{cloneDeep as x,isEmpty as O,isArray as j,union as C,omit as T}from"lodash-es";import{traverse as B}from"../../../../shared/utils/index.js";import{HelpCircleSharp as E}from"@vicons/ionicons5";import{useDialog as N,NButton as U,NModal as L,NScrollbar as z,NCollapse as q,NCollapseItem as w,NEllipsis as P,NThing as R,NSpace as $,NInputGroup as I,NSelect as A,NInput as D,NTooltip as V,NIcon as M,NEmpty as W}from"naive-ui";import{conditionOppositeMap as H,connectionTypeOptions as S,connectionTypeOppositeMap as X,InjectionFieldList as G,conditionTypeOptions as J}from"../constants/index.js";const K={class:"form-config__connectionOperation"},Q={class:"form-config__connectionConditionHeaderDesc"},Y={class:"form-config__connectionCondition"},Z={class:"form-config__connectionConditionItem"},ee={style:{"margin-right":"8px"}},le={class:"form-config__connectionFieldType"},oe=["onClick"],ne={style:{display:"inline-flex","align-items":"center",gap:"4px","margin-bottom":"4px"}};var ie=e({__name:"FormConfigEventSetting",props:{modelValue:{default:()=>[]}},emits:["update:modelValue","validateFailure"],setup(e,{emit:ie}){const te=e,ae=k(),se=l([]),de=l("");function ue(){se.value.push({conObj:[]}),de.value=se.value.length-1+""}function pe(e){return e.__oppositeBindField?`已绑定互斥联动: 联动${se.value.findIndex((l=>l===e.__oppositeBindField))+1}`:e.__oppositeTargetField?`已关联互斥联动: 联动${se.value.findIndex((l=>l===e.__oppositeTargetField))+1}`:void 0}function re(e){return null==e?void 0:e.replace(/(AND|OR)/g,(e=>"AND"===e?"OR":"AND"))}function ce(e){var l;const o=e.__oppositeTargetField||{conObj:[]};return o.conObj=x(e.conObj),null==(l=o.conObj)||l.forEach((e=>{e.con=H[e.con]})),o.sqlExpression=re(e.sqlExpression),S.forEach((({value:l})=>{O(e[l])?Reflect.deleteProperty(o,X[l]):o[X[l]]=x(e[l])})),o.__oppositeBindField=e,o}function _e(e,l){var o,n,i,t;return(null==(o=e.conObj)?void 0:o.length)===(null==(n=l.conObj)?void 0:n.length)&&(!(e.conObj&&l.conObj&&e.conObj.some((e=>!l.conObj.find((l=>{return n=l,(o=e).field_key===n.field_key&&o.con&&H[o.con]===n.con&&o.value===n.value;var o,n})))))&&(i=e.sqlExpression,t=l.sqlExpression,(!i&&!t||re(i)===t)&&!S.some((({value:o})=>{return n=e[o],i=l[X[o]],!(n&&i?n.length===i.length&&n.every((e=>i.some((l=>e===l)))):!n&&!i);var n,i}))))}function ve(e){de.value=e[0]}function fe(e){const l=se.value[e];if(!l)return"";const o=l.conObj||[],n=S.reduce(((e,{value:o})=>(j(l[o])&&l[o].length&&e.push(...l[o].map(t)),e)),[]),i=C([...o.map((({field_key:e})=>t(e))),...n]).filter((e=>!!e));return i.length?`( 相关字段: ${i} )`:"";function t(e){var l,o;return null!=(o=null==(l=ge.value.find((l=>e===l.key)))?void 0:l.name)?o:e}}o((()=>{se.value.forEach((e=>{e.__oppositeTargetField&&(e.__oppositeTargetField=ce(e))}))}));const me=l(!1);n(me,(e=>{e&&(se.value=x(te.modelValue),se.value.forEach(((e,l)=>{if(e.__oppositeBindField||e.__oppositeTargetField)return;const o=se.value.find(((o,n)=>n!==l&&!o.__oppositeBindField&&!o.__oppositeTargetField&&_e(o,e)));o&&(o.__oppositeBindField=e,e.__oppositeTargetField=o)})))}));const he=i(G,l([])),ge=t((()=>{const e=[];return B(he.value,(l=>{!["NEWLINE","LINE_BAR","COMPLEX","COMBINATION"].includes(l.type)&&e.push(l)})),e})),ye=a([]),be=N();async function Fe(){be.warning({title:"提示",content:"直接关闭弹窗会丢失已编辑的配置, 确定要关闭吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{me.value=!1,se.value=[]}})}async function ke(){try{await function(){var e;const l=[];return null==(e=se.value)||e.forEach(((e,o)=>{const n=[];e.conObj&&e.conObj.length?e.conObj.forEach(((e,l)=>{e.field_key||n.push(`条件${l+1}字段为空`),e.con||n.push(`条件${l+1}判断类型为空`),["NULL","NOT_NULL"].includes(e.con)||!e.con||e.value||n.push(`条件${l+1}值为空`)})):n.push("联动条件为空"),S.every((({value:l})=>!e[l]||!e[l].length))&&n.push("联动字段为空"),n.length&&l.push(`联动${o+1}: ${n}`)})),l.length?Promise.reject(l):Promise.resolve()}(),me.value=!1,ie("update:modelValue",se.value.map((e=>T(e,["__oppositeBindField","__oppositeTargetField"]))))}catch(e){ie("validateFailure",e)}}return(e,l)=>(s(),d("section",null,[u(p(U),{size:"small",onClick:l[0]||(l[0]=e=>me.value=!0)},{default:r((()=>[c("调整联动绑定")])),_:1}),u(p(L),{show:me.value,"onUpdate:show":l[1]||(l[1]=e=>me.value=e),closable:!1,bordered:!1,"show-icon":!1,title:"联动绑定设置",preset:"dialog","mask-closable":!1,"close-on-esc":!1,style:_({width:"1000px",...p(ae)}),class:"form-config__connectionModal"},{action:r((()=>[u(p(U),{size:"small",onClick:Fe},{default:r((()=>[c("取消")])),_:1}),u(p(U),{size:"small",onClick:ke,type:"primary"},{default:r((()=>[c("确定")])),_:1})])),default:r((()=>[v("header",K,[u(p(U),{onClick:ue,size:"small"},{default:r((()=>[c("新增联动")])),_:1})]),u(p(z),{style:{"max-height":"500px","min-height":"500px"}},{default:r((()=>[u(p(q),{accordion:"","expanded-names":de.value,"onUpdate:expandedNames":ve},{default:r((()=>[(s(!0),d(f,null,m(se.value,((e,l)=>(s(),h(p(w),{name:l+""},{header:r((()=>[c(" 联动"+g(l+1)+" ",1),u(p(P),{class:"form-config__connectionConditionHeaderDesc",style:{"max-width":"500px"}},{default:r((()=>[c(g(fe(l)),1)])),_:2},1024)])),"header-extra":r((()=>[e.__oppositeBindField||e.__oppositeTargetField?(s(),d(f,{key:1},[v("span",Q,"( "+g(pe(e))+" )",1),u(p(U),{quaternary:"",type:"primary",size:"small",onClick:y((l=>function(e){const l=e.__oppositeTargetField||e.__oppositeBindField;l&&[l,e].forEach((e=>{Reflect.deleteProperty(e,"__oppositeBindField"),Reflect.deleteProperty(e,"__oppositeTargetField")}))}(e)),["stop"])},{default:r((()=>[c("解除互斥")])),_:2},1032,["onClick"])],64)):(s(),h(p(U),{key:0,onClick:y((l=>function(e){se.value.push(e.__oppositeTargetField=ce(e))}(e)),["stop"]),quaternary:"",type:"primary",size:"small"},{default:r((()=>[c(" 创建互斥条件 ")])),_:2},1032,["onClick"])),u(p(U),{onClick:y((e=>function(e){var l;const o=null==(l=se.value)?void 0:l.splice(e,1);null==o||o.forEach((e=>{const l=e.__oppositeTargetField||e.__oppositeBindField;l&&(Reflect.deleteProperty(l,"__oppositeTargetField"),Reflect.deleteProperty(l,"__oppositeBindField"))})),ye.splice(e,1),!de.value||+de.value<e||(de.value=de.value===e+""?"":+de.value-1+"")}(l)),["stop"]),quaternary:"",type:"error",size:"small"},{default:r((()=>[c("移除")])),_:2},1032,["onClick"])])),default:r((()=>[u(p(R),{class:"form-config__connectionWrapper"},{default:r((()=>[u(p($),{justify:"space-between",wrap:!1},{default:r((()=>[v("section",Y,[v("header",null,[c(" 条件 "),e.__oppositeBindField?b("v-if",!0):(s(),h(p(U),{key:0,size:"small",quaternary:"",type:"primary",onClick:l=>{var o;j((o=e).conObj)?o.conObj.push({}):o.conObj=[{}]}},{default:r((()=>[c(" 添加条件 ")])),_:2},1032,["onClick"]))]),u(p(z),{style:{"max-height":"145px","min-height":"145px"},class:"form-config__connectionWrapper"},{default:r((()=>[(s(!0),d(f,null,m(e.conObj||[],((l,o)=>(s(),d("div",Z,[v("span",ee,g(o+1),1),u(p(I),{size:"small"},{default:r((()=>[u(p(A),{value:l.field_key,"onUpdate:value":e=>l.field_key=e,disabled:!!e.__oppositeBindField,placeholder:"请选择字段",options:p(ge),"label-field":"name","value-field":"key",filterable:""},null,8,["value","onUpdate:value","disabled","options"]),u(p(A),{value:l.con,disabled:!!e.__oppositeBindField,"onUpdate:value":e=>function(e,l){e.con=l,["NOT_NULL","NULL"].includes(l)&&Reflect.deleteProperty(e,"value")}(l,e),placeholder:"请选择判断类型",options:p(J)},null,8,["value","disabled","onUpdate:value","options"]),l.con&&!["NULL","NOT_NULL"].includes(l.con)?(s(),h(p(D),{key:0,disabled:!!e.__oppositeBindField,value:l.value,"onUpdate:value":e=>l.value=e,placeholder:"请输入值",clearable:""},null,8,["disabled","value","onUpdate:value"])):b("v-if",!0)])),_:2},1024),u(p(U),{disabled:!!e.__oppositeBindField,quaternary:"",onClick:l=>function(e,l){j(e.conObj)&&e.conObj.splice(l,1)}(e,o),type:"error",size:"small"},{default:r((()=>[c(" 移除 ")])),_:2},1032,["disabled","onClick"])])))),256))])),_:2},1024)]),v("section",le,[v("div",null,[(s(!0),d(f,null,m(p(S),(o=>{var n,i;return s(),d("div",{key:o.value,class:F({"is-active":ye[l]===o.value}),onClick:e=>ye[l]=o.value},g(o.label)+" ( "+g(null!=(i=null==(n=e[o.value])?void 0:n.length)?i:0)+" ) ",11,oe)})),128))]),v("div",null,[ye[l]?(s(),h(p(A),{key:0,value:e[ye[l]],"onUpdate:value":o=>e[ye[l]]=o,disabled:!!e.__oppositeBindField,multiple:"",placeholder:"请选择字段",options:p(ge),"label-field":"name","value-field":"key",filterable:"","max-tag-count":10},null,8,["value","onUpdate:value","disabled","options"])):b("v-if",!0)])])])),_:2},1024),v("section",null,[v("label",null,[v("span",ne,[c(" 条件逻辑 "),u(p(V),null,{trigger:r((()=>[u(p(M),{size:"16",component:p(E)},null,8,["component"])])),default:r((()=>[c(" 非必填, 默认为需要全部满足. 示例: (1 AND 2) OR 3, 表示 条件1和2需要满足其一, 条件3必须满足 ")])),_:1})]),u(p(D),{value:e.sqlExpression,"onUpdate:value":l=>e.sqlExpression=l,disabled:!!e.__oppositeBindField,placeholder:"请输入条件逻辑"},null,8,["value","onUpdate:value","disabled"])])])])),_:2},1024)])),_:2},1032,["name"])))),256))])),_:1},8,["expanded-names"]),se.value.length?b("v-if",!0):(s(),h(p(W),{key:0,size:"huge",style:{"margin-top":"20px"},description:"无联动配置"}))])),_:1})])),_:1},8,["show","style"])]))}});export{ie as default};
@@ -1,4 +1,4 @@
1
- import { UndefinedAble } from '../../../../../es/shared/types';
1
+ import { FormLowCodeReactions, LOW_CODE_VALUE_RELATION, UndefinedAble } from '../../../../../es/shared/types';
2
2
  import { InjectionKey, Ref } from 'vue';
3
3
  import { FormConfigItem } from '../../../../../es/components/form-config';
4
4
  export declare const WidgetTextMap: Map<string, string>;
@@ -77,8 +77,26 @@ export declare function isVisibleOptionConfig(): {
77
77
  value: boolean;
78
78
  };
79
79
  };
80
+ export declare const conditionOppositeMap: Record<LOW_CODE_VALUE_RELATION, LOW_CODE_VALUE_RELATION>;
81
+ export declare const conditionTypeOptions: {
82
+ value: LOW_CODE_VALUE_RELATION;
83
+ label: string;
84
+ }[];
85
+ export declare const connectionTypeOppositeMap: {
86
+ showField: string;
87
+ hideField: string;
88
+ requiredField: string;
89
+ notRequiredField: string;
90
+ enabledField: string;
91
+ disabledField: string;
92
+ };
93
+ export declare const connectionTypeOptions: {
94
+ value: string;
95
+ label: string;
96
+ }[];
80
97
  export declare const FORM_CONFIG_GROUP = "__display";
81
98
  export declare const InjectionFieldList: InjectionKey<Ref<FormConfigItem[]>>;
82
99
  export declare const InjectionMaterialList: InjectionKey<Ref<FormConfigItem[]>>;
100
+ export declare const InjectionLowCodeReactions: InjectionKey<Ref<FormLowCodeReactions.Config[]>>;
83
101
  export declare const InjectionActiveFieldItem: InjectionKey<Ref<UndefinedAble<FormConfigItem>>>;
84
102
  export declare const InjectionFormConfigEmit: InjectionKey<(event: 'addItem' | 'removeItem', ...args: unknown[]) => void>;
@@ -1 +1 @@
1
- import{range as e}from"lodash-es";const t=new Map([["LINE_BAR","分线栏"],["NEWLINE","分行符"]]);var n=(e=>(e.NAME="name",e.NOTES="notes",e.DEFAULT_VALUE="defaultValue",e.LAYOUT_WIDTH_ENUM="layoutWidthEnum",e.DESC="desc",e.DEFAULT_EXPAND="defaultExpand",e.FOLD="fold",e.REQUIRED="required",e.EDITABLE="editable",e.SHOW="show",e.ROWS="initialHigh",e))(n||{});function l(){return{option:[{text:"整行",value:"ALL_LINE"},{text:"半行",value:"HALF_LINE"},{text:"5/6",value:"FIVE_SIX"},{text:"2/3",value:"TWO_THREE"},{text:"1/3",value:"ONE_THREE"},{text:"3/4",value:"THREE_FOUR"},{text:"1/4",value:"ONE_FOUR"},{text:"1/6",value:"ONE_SIX"},{text:"1/8",value:"ONE_EIGHT"}]}}function o(){return{option:e(1,11).map((e=>({text:`${e}行`,value:e})))}}function i(){return{open:{describe:"默认展开",value:!0},close:{describe:"默认收起",value:!1}}}function u(){return{open:{describe:"可折叠",value:!0},close:{describe:"不可折叠",value:!1}}}function a(){return{open:{describe:"可编辑",value:!0},close:{describe:"不可编辑",value:!1}}}function r(){return{open:{describe:"必填",value:!0},close:{describe:"不必填",value:!1}}}function E(){return{open:{describe:"显示",value:!0},close:{describe:"隐藏",value:!1}}}const c="__display",s=Symbol("InjectionFieldList"),d=Symbol("InjectionMaterialList"),v=Symbol("InjectionActiveFieldItem"),I=Symbol("InjectionFormConfigEmit");export{n as EditAbleField,c as FORM_CONFIG_GROUP,v as InjectionActiveFieldItem,s as InjectionFieldList,I as InjectionFormConfigEmit,d as InjectionMaterialList,t as WidgetTextMap,a as isEditOptionConfig,u as isNotFoldOptionConfig,r as isNullOptionConfig,i as isShowOptionConfig,E as isVisibleOptionConfig,o as rowsOptionConfig,l as widgetWidthOptionConfig};
1
+ import{range as e}from"lodash-es";const l=new Map([["LINE_BAR","分线栏"],["NEWLINE","分行符"]]);var a=(e=>(e.NAME="name",e.NOTES="notes",e.DEFAULT_VALUE="defaultValue",e.LAYOUT_WIDTH_ENUM="layoutWidthEnum",e.DESC="desc",e.DEFAULT_EXPAND="defaultExpand",e.FOLD="fold",e.REQUIRED="required",e.EDITABLE="editable",e.SHOW="show",e.ROWS="initialHigh",e))(a||{});function i(){return{option:[{text:"整行",value:"ALL_LINE"},{text:"半行",value:"HALF_LINE"},{text:"5/6",value:"FIVE_SIX"},{text:"2/3",value:"TWO_THREE"},{text:"1/3",value:"ONE_THREE"},{text:"3/4",value:"THREE_FOUR"},{text:"1/4",value:"ONE_FOUR"},{text:"1/6",value:"ONE_SIX"},{text:"1/8",value:"ONE_EIGHT"}]}}function t(){return{option:e(1,11).map((e=>({text:`${e}行`,value:e})))}}function u(){return{open:{describe:"默认展开",value:!0},close:{describe:"默认收起",value:!1}}}function d(){return{open:{describe:"可折叠",value:!0},close:{describe:"不可折叠",value:!1}}}function n(){return{open:{describe:"可编辑",value:!0},close:{describe:"不可编辑",value:!1}}}function o(){return{open:{describe:"必填",value:!0},close:{describe:"不必填",value:!1}}}function E(){return{open:{describe:"显示",value:!0},close:{describe:"隐藏",value:!1}}}const r={EQ:"NEQ",NEQ:"EQ",CL:"NC",NC:"CL",NULL:"NOT_NULL",NOT_NULL:"NULL",BIG:"LESSEQ",BIGEQ:"LESS",LESS:"BIGEQ",LESSEQ:"BIG"},b=[{value:"EQ",label:"等于"},{value:"NEQ",label:"不等于"},{value:"CL",label:"包含"},{value:"NC",label:"不包含"},{value:"NULL",label:"为空"},{value:"NOT_NULL",label:"不为空"},{value:"BIG",label:"大于"},{value:"BIGEQ",label:"大于等于"},{value:"LESS",label:"小于"},{value:"LESSEQ",label:"小于等于"}],v={showField:"hideField",hideField:"showField",requiredField:"notRequiredField",notRequiredField:"requiredField",enabledField:"disabledField",disabledField:"enabledField"},L=[{value:"showField",label:"显示字段"},{value:"hideField",label:"隐藏字段"},{value:"requiredField",label:"必填字段"},{value:"notRequiredField",label:"非必填字段"},{value:"enabledField",label:"启用字段"},{value:"disabledField",label:"禁用字段"}],c="__display",s=Symbol("InjectionFieldList"),F=Symbol("InjectionMaterialList"),N=Symbol("InjectionLowCodeReactions"),I=Symbol("InjectionActiveFieldItem"),S=Symbol("InjectionFormConfigEmit");export{a as EditAbleField,c as FORM_CONFIG_GROUP,I as InjectionActiveFieldItem,s as InjectionFieldList,S as InjectionFormConfigEmit,N as InjectionLowCodeReactions,F as InjectionMaterialList,l as WidgetTextMap,r as conditionOppositeMap,b as conditionTypeOptions,v as connectionTypeOppositeMap,L as connectionTypeOptions,n as isEditOptionConfig,d as isNotFoldOptionConfig,o as isNullOptionConfig,u as isShowOptionConfig,E as isVisibleOptionConfig,t as rowsOptionConfig,i as widgetWidthOptionConfig};
@@ -3,5 +3,5 @@ export declare function useDataNormalize(props: {
3
3
  fieldVisitor?: FormConfigVisitor;
4
4
  }): {
5
5
  transform: (fieldList: FormConfigItem[]) => FormConfigItem[];
6
- inverseTransform: (fieldList: FormConfigItem[], withOriginalSetting: boolean) => FormConfigItem[];
6
+ inverseTransform: (fieldList: FormConfigItem[], withOriginalSetting: boolean, otherConfig?: Partial<FormConfigItem>) => FormConfigItem[];
7
7
  };
@@ -1 +1 @@
1
- import{isObject as e,omit as n}from"lodash-es";function r(r){return{transform:function(n){let i=null;const t=r.fieldVisitor;return n.reduce(((n,r)=>(r.originalSetting&&e(t)&&t[r.key]&&t[r.key]({field:r.originalSetting,replace(e){r.originalSetting=e}}),"LINE_BAR"===r.type?(r.children=[],i=r.children,n.push(r),n):i?(i.push(r),n):(n.push(r),n))),[])},inverseTransform:function(e,r){return e.reduce(((e,r)=>("LINE_BAR"===r.type?(e.push(n(r,["children"])),e.push(...r.children||[])):e.push(r),e)),[]).map((e=>r?e:n(e,["originalSetting"])))}}}export{r as useDataNormalize};
1
+ import{isObject as e,omit as n}from"lodash-es";function r(r){return{transform:function(n){let i=null;const t=r.fieldVisitor;return n.reduce(((n,r)=>(r.originalSetting&&e(t)&&t[r.key]&&t[r.key]({field:r.originalSetting,replace(e){r.originalSetting=e}}),"LINE_BAR"===r.type?(r.children=[],i=r.children,n.push(r),n):i?(i.push(r),n):(n.push(r),n))),[])},inverseTransform:function(e,r,i){return e.reduce(((e,r)=>("LINE_BAR"===r.type?(e.push(n(r,["children"])),e.push(...r.children||[])):e.push(r),e)),[]).map((e=>{const t=r?e:n(e,["originalSetting"]);return i?{...t,...i}:t}))}}}export{r as useDataNormalize};
@@ -1,5 +1,5 @@
1
1
  import { Component, FunctionalComponent } from 'vue';
2
- import { ArrayAble } from '../../../../../es/shared/types';
2
+ import { ArrayAble, FormLowCodeReactions } from '../../../../../es/shared/types';
3
3
  import { FieldItem } from '../../../../../es/components/form-render';
4
4
  interface Matcher {
5
5
  (type: string): boolean;
@@ -36,9 +36,13 @@ export interface FormConfigTextFormatter {
36
36
  (formConfigItem: FormConfigItem, parsedText: string): string;
37
37
  }
38
38
  export interface FormConfigExpose {
39
- loadData(payload: Record<'fieldList', FormConfigItem[]>): void;
39
+ loadData(payload: Record<'fieldList', FormConfigItem[]> & {
40
+ lowCodeReactions?: FormLowCodeReactions.Config[];
41
+ }): void;
40
42
  validate(): Promise<unknown>;
41
- getData(withOriginalSetting?: boolean): Record<'fieldList' | 'materialList', FormConfigItem[]>;
43
+ getData(withOriginalSetting?: boolean): Record<'fieldList' | 'materialList', FormConfigItem[]> & {
44
+ lowCodeReactions: FormLowCodeReactions.Config[];
45
+ };
42
46
  clearExtraList(): void;
43
47
  }
44
48
  interface FieldVisitorContext {
@@ -1 +1 @@
1
- .form-config,.form-config__material{display:flex;justify-content:space-between}.form-config__material{border-radius:8px;box-sizing:border-box;flex-direction:column;flex-shrink:0;padding:16px;width:200px}.form-config__materialHeader{align-items:center;display:flex;height:40px;justify-content:space-between}.form-config__materialContent{border:1px dashed hsla(0,0%,50%,.35);border-radius:8px;box-sizing:border-box;display:flex;flex-direction:column;flex-shrink:0;flex:1;gap:8px;max-height:var(--max-height);min-height:200px;overflow-y:auto;padding:16px}.form-config__materialExtraList{margin-top:12px}.form-config__displayWrapper{border-radius:8px;box-sizing:border-box;flex-shrink:0;flex:1;min-width:400px;padding:16px 0}.form-config__displayHeader{align-items:center;display:flex;height:40px;justify-content:space-between}.form-config__displayContent{border:1px dashed hsla(0,0%,50%,.35);border-radius:8px;box-sizing:border-box;display:grid!important;flex-shrink:0;gap:8px;grid-template-columns:repeat(24,minmax(0,1fr));height:fit-content;max-height:var(--max-height);overflow-y:auto;padding:16px}.form-config__displayContentItem{grid-column:span var(--item-column) /span var(--item-column);position:relative}.form-config__config{border-radius:8px;box-sizing:border-box;flex-shrink:0;padding:16px;width:240px}.form-config__configHeader{align-items:center;display:flex;height:40px;justify-content:space-between}.form-config__configContent{border:none;border-radius:8px;box-sizing:border-box;flex-shrink:0;max-height:var(--max-height);min-height:38px;overflow-y:auto;padding:16px}.form-config__renderer{box-sizing:border-box;cursor:move;justify-content:flex-start;width:100%}.form-config__renderer--default{align-items:center;box-sizing:border-box;display:flex;padding:8px 0;position:relative;user-select:none;width:100%}.form-config__renderer--defaultWrapper{align-items:center;border-radius:2px;box-sizing:border-box;display:inline-flex;height:34px;padding:0 14px;transition:all .3s linear}.form-config__renderer--defaultWrapper.is-disabled{background-color:transparent;border:1px dashed var(--c-primary-color)}.form-config__renderer--defaultWrapper:not(.is-disabled){background-color:rgba(46,51,56,.05);border:1px dashed transparent}.form-config__renderer--defaultWrapper:not(.is-disabled):hover{background-color:rgba(46,51,56,.09)}.form-config__renderer--defaultWrapper:not(.is-disabled):active{background-color:rgba(46,51,56,.15)}.form-config__renderer--complex{border:1px dashed var(--c-primary-color);border-radius:8px;padding:8px}.form-config__renderer--complexHeader{display:flex;justify-content:center;margin-top:-8px;padding:8px;position:relative}.form-config__renderer--complex--grid{display:grid!important;gap:8px;grid-column:span var(--item-column) /span var(--item-column);grid-template-columns:repeat(24,minmax(0,1fr));min-height:24px}.form-config__renderer--complex--flex{display:flex;min-height:24px}.form-config .is-required{padding-left:16px!important}.form-config .is-required:before{color:red;content:"*";left:8px;position:absolute}.form-config .is-extra:before{border-bottom:6px solid transparent;border-left:6px solid var(--c-primary-color);border-right:6px solid transparent;border-top:6px solid var(--c-primary-color);content:"";height:0;left:0;position:absolute;top:0;width:0}.form-config .is-active{color:var(--c-primary-color)!important}.form-config .is-choosing{box-shadow:inset var(--c-primary-color) 0 0 0 2px;opacity:.7}.form-config .is-choosing-area{background:hsla(0,0%,50%,.1)}.form-config [is-hovering=true] .form-config__renderer--closeButton{visibility:visible}.form-config .form-config__renderer--closeButton{position:absolute;right:4px;top:50%;transform:translateY(-50%);visibility:hidden}
1
+ .form-config,.form-config__material{display:flex;justify-content:space-between}.form-config__material{border-radius:8px;box-sizing:border-box;flex-direction:column;flex-shrink:0;padding:16px;width:200px}.form-config__materialHeader{align-items:center;display:flex;height:40px;justify-content:space-between}.form-config__materialContent{border:1px dashed hsla(0,0%,50%,.35);border-radius:8px;box-sizing:border-box;display:flex;flex-direction:column;flex-shrink:0;flex:1;gap:8px;max-height:var(--max-height);min-height:200px;overflow-y:auto;padding:16px}.form-config__materialExtraList{margin-top:12px}.form-config__displayWrapper{border-radius:8px;box-sizing:border-box;flex-shrink:0;flex:1;min-width:400px;padding:16px 0}.form-config__displayHeader{align-items:center;display:flex;height:40px;justify-content:space-between}.form-config__displayContent{border:1px dashed hsla(0,0%,50%,.35);border-radius:8px;box-sizing:border-box;display:grid!important;flex-shrink:0;gap:8px;grid-template-columns:repeat(24,minmax(0,1fr));height:fit-content;max-height:var(--max-height);overflow-y:auto;padding:16px}.form-config__displayContentItem{grid-column:span var(--item-column) /span var(--item-column);position:relative}.form-config__config{border-radius:8px;box-sizing:border-box;flex-shrink:0;padding:16px;width:240px}.form-config__configHeader{align-items:center;display:flex;height:40px;justify-content:space-between}.form-config__configContent{border:none;border-radius:8px;box-sizing:border-box;flex-shrink:0;max-height:var(--max-height);min-height:38px;overflow-y:auto;padding:16px}.form-config__renderer{box-sizing:border-box;cursor:move;justify-content:flex-start;width:100%}.form-config__renderer--default{align-items:center;box-sizing:border-box;display:flex;padding:8px 0;position:relative;user-select:none;width:100%}.form-config__renderer--defaultWrapper{align-items:center;border-radius:2px;box-sizing:border-box;display:inline-flex;height:34px;padding:0 14px;transition:all .3s linear}.form-config__renderer--defaultWrapper.is-disabled{background-color:transparent;border:1px dashed var(--c-primary-color)}.form-config__renderer--defaultWrapper:not(.is-disabled){background-color:rgba(46,51,56,.05);border:1px dashed transparent}.form-config__renderer--defaultWrapper:not(.is-disabled):hover{background-color:rgba(46,51,56,.09)}.form-config__renderer--defaultWrapper:not(.is-disabled):active{background-color:rgba(46,51,56,.15)}.form-config__renderer--complex{border:1px dashed var(--c-primary-color);border-radius:8px;padding:8px}.form-config__renderer--complexHeader{display:flex;justify-content:center;margin-top:-8px;padding:8px;position:relative}.form-config__renderer--complex--grid{display:grid!important;gap:8px;grid-column:span var(--item-column) /span var(--item-column);grid-template-columns:repeat(24,minmax(0,1fr));min-height:24px}.form-config__renderer--complex--flex{display:flex;min-height:24px}.form-config .is-required{padding-left:16px!important}.form-config .is-required:before{color:red;content:"*";left:8px;position:absolute}.form-config .is-extra:before{border-bottom:6px solid transparent;border-left:6px solid var(--c-primary-color);border-right:6px solid transparent;border-top:6px solid var(--c-primary-color);content:"";height:0;left:0;position:absolute;top:0;width:0}.form-config .is-active{color:var(--c-primary-color)!important}.form-config .is-choosing{box-shadow:inset var(--c-primary-color) 0 0 0 2px;opacity:.7}.form-config .is-choosing-area{background:hsla(0,0%,50%,.1)}.form-config [is-hovering=true] .form-config__renderer--closeButton{visibility:visible}.form-config .form-config__renderer--closeButton{position:absolute;right:4px;top:50%;transform:translateY(-50%);visibility:hidden}.form-config__connectionModal .n-collapse .n-collapse-item:not(:first-of-type){margin-top:4px}.form-config__connectionModal .n-collapse .n-collapse-item .n-collapse-item__header{padding-top:4px}.form-config__connectionOperation{margin-bottom:8px}.form-config__connectionWrapper{border:1px solid #e5e5e5;border-radius:4px;padding:8px}.form-config__connectionCondition{width:450px}.form-config__connectionCondition>header{align-items:center;display:flex;gap:12px}.form-config__connectionConditionHeaderDesc{color:#a5a5a5;display:inline-block;margin-left:12px}.form-config__connectionConditionItem{align-items:center;display:flex;margin-bottom:4px}.form-config__connectionConditionItem>div:first-of-type{flex:1}.form-config__connectionFieldType{display:flex;height:100%}.form-config__connectionFieldType>div:first-of-type{display:flex;flex-direction:column;height:100%;justify-content:space-between;margin-right:-1px}.form-config__connectionFieldType>div:first-of-type>div{background:#f5f5f5;border:1px solid #e5e5e5;cursor:pointer;padding:2px 4px 2px 8px}.form-config__connectionFieldType>div:first-of-type>div:not(:last-of-type){margin-bottom:4px}.form-config__connectionFieldType>div:first-of-type>div.is-active{background:#fff;border-right-color:#fff;color:var(--c-primary-color);z-index:1}.form-config__connectionFieldType>div:nth-of-type(2){border:1px solid #e5e5e5;padding:8px;width:300px}
@@ -131,7 +131,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
131
131
  default: boolean;
132
132
  };
133
133
  lowCodeReactions: {
134
- type: import("vue").PropType<import("./src/types").FormLowCodeReactions.Config[]>;
134
+ type: import("vue").PropType<import("../../../es/shared/types").FormLowCodeReactions.Config[]>;
135
135
  };
136
136
  operationalForm: {
137
137
  type: import("vue").PropType<import("../../../es/shared/types").FormOperationalConfig[]>;
@@ -276,7 +276,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
276
276
  default: boolean;
277
277
  };
278
278
  lowCodeReactions: {
279
- type: import("vue").PropType<import("./src/types").FormLowCodeReactions.Config[]>;
279
+ type: import("vue").PropType<import("../../../es/shared/types").FormLowCodeReactions.Config[]>;
280
280
  };
281
281
  operationalForm: {
282
282
  type: import("vue").PropType<import("../../../es/shared/types").FormOperationalConfig[]>;
@@ -435,7 +435,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
435
435
  businessFormatter: import("./src/types").FormBusinessFormatter;
436
436
  requestInstance: import("./src/hooks").RequestInstance;
437
437
  enterToNextWidget: boolean | ((fieldItem: import("./src/types").FieldItem) => boolean | void);
438
- lowCodeReactions: import("./src/types").FormLowCodeReactions.Config[];
438
+ lowCodeReactions: import("../../../es/shared/types").FormLowCodeReactions.Config[];
439
439
  linebarAutoHidden: boolean;
440
440
  bordered: string | boolean;
441
441
  uniqueCacheData: boolean;
@@ -846,7 +846,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
846
846
  default: boolean;
847
847
  };
848
848
  lowCodeReactions: {
849
- type: import("vue").PropType<import("./src/types").FormLowCodeReactions.Config[]>;
849
+ type: import("vue").PropType<import("../../../es/shared/types").FormLowCodeReactions.Config[]>;
850
850
  };
851
851
  operationalForm: {
852
852
  type: import("vue").PropType<import("../../../es/shared/types").FormOperationalConfig[]>;
@@ -1,8 +1,8 @@
1
- import { AnyObject, FormOperationalConfig } from '../../../../es/shared/types';
1
+ import { AnyObject, FormLowCodeReactions, FormOperationalConfig } from '../../../../es/shared/types';
2
2
  import { Field } from '@formily/core';
3
3
  import { Component, FunctionalComponent, PropType } from 'vue';
4
4
  import { RequestInstance } from './hooks';
5
- import { FieldItem, FieldVisitor, FormBusinessFormatter, FormLowCodeReactions } from './types';
5
+ import { FieldItem, FieldVisitor, FormBusinessFormatter } from './types';
6
6
  declare const _default: import("vue").DefineComponent<{
7
7
  fieldList: {
8
8
  type: PropType<FieldItem[]>;
@@ -129,7 +129,7 @@ declare const _default: import("vue").DefineComponent<{}, {
129
129
  default: boolean;
130
130
  };
131
131
  lowCodeReactions: {
132
- type: import("vue").PropType<import("../../../../es/components/form-render").FormLowCodeReactions.Config[]>;
132
+ type: import("vue").PropType<import("../../../../es/shared/types").FormLowCodeReactions.Config[]>;
133
133
  };
134
134
  operationalForm: {
135
135
  type: import("vue").PropType<import("../../../../es/shared/types").FormOperationalConfig[]>;
@@ -274,7 +274,7 @@ declare const _default: import("vue").DefineComponent<{}, {
274
274
  default: boolean;
275
275
  };
276
276
  lowCodeReactions: {
277
- type: import("vue").PropType<import("../../../../es/components/form-render").FormLowCodeReactions.Config[]>;
277
+ type: import("vue").PropType<import("../../../../es/shared/types").FormLowCodeReactions.Config[]>;
278
278
  };
279
279
  operationalForm: {
280
280
  type: import("vue").PropType<import("../../../../es/shared/types").FormOperationalConfig[]>;
@@ -433,7 +433,7 @@ declare const _default: import("vue").DefineComponent<{}, {
433
433
  businessFormatter: import("../../../../es/components/form-render").FormBusinessFormatter;
434
434
  requestInstance: import("../../../../es/components/form-render").RequestInstance;
435
435
  enterToNextWidget: boolean | ((fieldItem: import("../../../../es/components/form-render").FieldItem) => boolean | void);
436
- lowCodeReactions: import("../../../../es/components/form-render").FormLowCodeReactions.Config[];
436
+ lowCodeReactions: import("../../../../es/shared/types").FormLowCodeReactions.Config[];
437
437
  linebarAutoHidden: boolean;
438
438
  bordered: string | boolean;
439
439
  uniqueCacheData: boolean;
@@ -844,7 +844,7 @@ declare const _default: import("vue").DefineComponent<{}, {
844
844
  default: boolean;
845
845
  };
846
846
  lowCodeReactions: {
847
- type: import("vue").PropType<import("../../../../es/components/form-render").FormLowCodeReactions.Config[]>;
847
+ type: import("vue").PropType<import("../../../../es/shared/types").FormLowCodeReactions.Config[]>;
848
848
  };
849
849
  operationalForm: {
850
850
  type: import("vue").PropType<import("../../../../es/shared/types").FormOperationalConfig[]>;
@@ -102,6 +102,10 @@ export declare const SELECT: import("vue").DefineComponent<{
102
102
  multiple: {
103
103
  type: BooleanConstructor;
104
104
  };
105
+ deletable: {
106
+ type: BooleanConstructor;
107
+ default: boolean;
108
+ };
105
109
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:value" | "postRecommend")[], "update:value" | "postRecommend", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
106
110
  value: {
107
111
  type: PropType<ArrayAble<string | number> | null>;
@@ -201,6 +205,10 @@ export declare const SELECT: import("vue").DefineComponent<{
201
205
  multiple: {
202
206
  type: BooleanConstructor;
203
207
  };
208
+ deletable: {
209
+ type: BooleanConstructor;
210
+ default: boolean;
211
+ };
204
212
  }>> & {
205
213
  "onUpdate:value"?: ((...args: any[]) => any) | undefined;
206
214
  onPostRecommend?: ((...args: any[]) => any) | undefined;
@@ -212,13 +220,14 @@ export declare const SELECT: import("vue").DefineComponent<{
212
220
  allowModify: boolean;
213
221
  lazyRequest: boolean;
214
222
  requestCache: boolean;
223
+ deletable: boolean;
224
+ shouldSave: boolean;
215
225
  recommend: boolean;
216
226
  recommendCache: boolean;
217
227
  commonNum: number;
218
228
  recentNum: number;
219
229
  allowCreate: boolean;
220
230
  useLoading: boolean;
221
- shouldSave: boolean;
222
231
  showCustomValue: boolean;
223
232
  cursorPlacement: "end" | "start";
224
233
  }>;
@@ -1 +1 @@
1
- import{defineComponent as e,computed as l,inject as t,useAttrs as o,ref as a,createVNode as u,mergeProps as n,toRaw as r,nextTick as s}from"vue";import{arrayed as i}from"../../../../../shared/utils/index.js";import{HelpCircleSharp as p}from"@vicons/ionicons5";import{promiseTimeout as m}from"@vueuse/shared";import{cloneDeep as c,isArray as d,isString as v,isObject as f,omit as y}from"lodash-es";import{useCommonInjection as h,useSelectOptionProps as g}from"../../hooks/useCommonInjection.js";import{useComplexOptions as S,useComplexOptionsSpan as j}from"../../hooks/useComplexOptions.js";import{InjectionChangeContextCollector as b,InjectionFormUUID as C}from"../../constants/index.js";import"../../../index.js";import"@formily/core";import"@formily/path";import"@vue/shared";import"@vueuse/core";import{NSelect as w,NTooltip as k,NIcon as F,NTag as B}from"naive-ui";import"date-fns";import{assignUpdateValue as x,assignClearBindVisited as O,createVisitedSetter as A}from"../../utils/schema.js";import{useFormField as H}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{connect as P,mapProps as R}from"@formily/vue";import"./index.js";import{useUrlConfigOptions as V,useAutographOptions as K,useRecommendOptions as L,searchContentMatcher as E}from"../../hooks/useFormRenderOptions.js";const _=P(e({name:"FormSelect",props:{value:{type:[String,Array,Number]},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},onChange:{},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},showField:{type:String},allowCreate:Boolean,shouldSave:Boolean,allowModify:Boolean,showCustomValue:Boolean,cursorPlacement:{type:String,default:"end"},urlConfig:{type:Object},autograph:{type:String},wordbook:{type:Object},recommend:{type:Boolean,default:!1},commonList:{type:Array},recentList:{type:Array},getRecommendInfo:{type:Function},commonNum:{type:Number,default:10},recentNum:{type:Number,default:10},recommendCache:{type:Boolean,default:!1},useLoading:{type:Boolean,default:!0},multiple:{type:Boolean}},emits:["update:value","postRecommend"],setup(e,{slots:x,emit:O}){const P=l({get:()=>e.value,async set(e){O("update:value",e),Q(e)}}),R=l((()=>(e.multiple&&e.allowModify&&console.warn("多选模式下不支持allowModify"),!e.multiple&&e.allowModify))),{labelKey:_,valueKey:I,showKey:N,fetchData:M,searchContent:W,fullOptions:q,filterOptions:U,remoteOptions:z,loading:D}=e.urlConfig?V(e,P):K(e,P),{renderComplexOption:T,hasComplexOption:G}=S(e,P),{getRecommend:J,postRecommend:Q,sortedOptions:X}=L(e,U,O,_,I),{field:Y,fieldKey:Z}=H();t(b).setContext(Z.value,(e=>({currentOption:c(function(e){const l=re(q.value);return d(e)?function(e){const t=l.reduce(((e,l)=>(e[l[I.value]]=l,e)),{});return e.map((e=>t[e]))}(e):(t=e,l.find((e=>e[I.value]===t)));var t}(e))})));const $=async(e="")=>(W.value=e,Promise.allSettled([M(e),J(e)])),{injectValueValidate:ee,injectValueWatchFromEmpty:le,injectValueBindKey:te}=h();le(P,$),ee(P);const oe=te(P),{menuProps:ae,nodeProps:ue}=g();function ne(e){const l=e[_.value];if(!l||!v(l))return"";const t=W.value?E(W.value,l):null,o=t?u("section",null,[t.map(((e,l)=>0!==l&&e?u("span",{style:{color:l%2==0?"var(--n-option-text-color-active)":""}},[e]):null))]):l;return e.desc?u("section",{style:{display:"flex",alignItems:"center",gap:"4px"}},[o,e.desc?u(k,null,{trigger:()=>u(F,{component:p},null),default:()=>e.desc}):null]):o}function re(l){return e.allowCreate&&W.value&&!l.some((e=>e[_.value]===W.value))?[...l,{[_.value]:W.value,[I.value]:W.value,created:!0,shouldSave:e.shouldSave}]:l}const se=l((()=>re(R.value?q.value:X.value))),ie=o(),pe=l((()=>{if(e.allowCreate||e.showCustomValue)return P.value;const l=e.multiple&&d(P.value);return q.value.find((e=>l?P.value.includes(e[I.value]):e[I.value]===P.value))?P.value:null})),me=a(!1);async function ce(e){e&&await $(),me.value=e}let de=null;async function ve(l,t){P.value=l,de&&f(t)&&R.value&&(de.focus(),await s(),de.value=t[_.value]||"",de.dispatchEvent(new CustomEvent("input")),"start"===e.cursorPlacement&&de.setSelectionRange(0,0)),z.value&&t&&i(t).forEach((e=>{if(!f(e))return;const l=e;l.created&&l.shouldSave&&z.value.push(y(r(l),["created","shouldSave"]))}))}const fe=t(C),{getSpan:ye}=j(),he=A(Y,(async l=>{var t,o,a;R.value&&(de=l.target,de&&P.value&&(await s(),de.value=null!=(a=null!=(o=null==(t=q.value.find((e=>e[I.value]===P.value)))?void 0:t[_.value])?o:P.value)?a:"",de.dispatchEvent(new CustomEvent("input")),"start"===e.cursorPlacement&&(await m(0),de.setSelectionRange(0,0))))}));function ge(e){if(!R.value)return;if(de=e.target,!de)return;if(!de.value)return P.value=null;const l=q.value.find((e=>e[_.value]===de.value));l?P.value=l[I.value]:(W.value=de.value,P.value=de.value)}function Se({option:l,handleClose:t}){var o;const a=null!=(o=N.value&&l[N.value])?o:l[_.value];return e.multiple?u(B,{closable:!0,onClose:e=>{e.stopPropagation(),t()}},{default:()=>a}):a}function je(l){return u(w,n({key:oe.value,multiple:e.multiple,remote:!0,filterable:!0,loading:D.value,value:pe.value,onUpdateValue:ve,"menu-props":ae,"node-props":ue,labelField:_.value,valueField:I.value,options:se.value,onSearch:$,show:me.value,"onUpdate:show":ce,onFocus:he,onBlur:ge,renderLabel:ne,renderTag:Se},l,ie),x)}return()=>{var e,l;if(!G.value)return je();const t=null!=(l=null==(e=Y.value.decoratorProps)?void 0:e.span)?l:6,o=ye(fe,Y.value.address);return u("section",{class:"form-render__selectChildField",style:{"--column":o+t}},[je({class:"form-render__selectChildFieldItem",style:{"--form-item-column":t}}),q.value.map((e=>T({option:e,value:P.value,valueKey:I.value,labelKey:_.value,childFieldStrategy:"checked",renderLabel:!1,attrs:{class:"form-render__selectChildFieldItem",style:{"--form-item-column":o}}})))])}}}),R({dataSource:"options"},x,O));export{_ as SELECT};
1
+ import{defineComponent as e,computed as l,inject as t,useAttrs as o,ref as a,createVNode as u,mergeProps as n,toRaw as r,nextTick as s}from"vue";import{arrayed as i}from"../../../../../shared/utils/index.js";import{HelpCircleSharp as p}from"@vicons/ionicons5";import{promiseTimeout as m}from"@vueuse/shared";import{cloneDeep as c,isArray as d,isString as v,isObject as f,omit as y}from"lodash-es";import{useCommonInjection as h,useSelectOptionProps as g}from"../../hooks/useCommonInjection.js";import{useComplexOptions as S,useComplexOptionsSpan as b}from"../../hooks/useComplexOptions.js";import{InjectionChangeContextCollector as j,InjectionFormUUID as C}from"../../constants/index.js";import"../../../index.js";import"@formily/core";import"@formily/path";import"@vue/shared";import"@vueuse/core";import{NSelect as w,NTooltip as k,NIcon as F,NTag as B}from"naive-ui";import"date-fns";import{assignUpdateValue as x,assignClearBindVisited as O,createVisitedSetter as A}from"../../utils/schema.js";import{useFormField as H}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{connect as P,mapProps as R}from"@formily/vue";import"./index.js";import{useUrlConfigOptions as V,useAutographOptions as K,useRecommendOptions as L,searchContentMatcher as E}from"../../hooks/useFormRenderOptions.js";const _=P(e({name:"FormSelect",props:{value:{type:[String,Array,Number]},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},onChange:{},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},showField:{type:String},allowCreate:Boolean,shouldSave:Boolean,allowModify:Boolean,showCustomValue:Boolean,cursorPlacement:{type:String,default:"end"},urlConfig:{type:Object},autograph:{type:String},wordbook:{type:Object},recommend:{type:Boolean,default:!1},commonList:{type:Array},recentList:{type:Array},getRecommendInfo:{type:Function},commonNum:{type:Number,default:10},recentNum:{type:Number,default:10},recommendCache:{type:Boolean,default:!1},useLoading:{type:Boolean,default:!0},multiple:{type:Boolean},deletable:{type:Boolean,default:!0}},emits:["update:value","postRecommend"],setup(e,{slots:x,emit:O}){const P=l({get:()=>e.value,async set(e){O("update:value",e),J(e)}}),R=l((()=>(e.multiple&&e.allowModify&&console.warn("多选模式下不支持allowModify"),!e.multiple&&e.allowModify))),{labelKey:_,valueKey:I,showKey:N,fetchData:M,searchContent:W,fullOptions:q,filterOptions:U,remoteOptions:z,loading:D}=e.urlConfig?V(e,P):K(e,P),{renderComplexOption:T,hasComplexOption:$}=S(e,P),{getRecommend:G,postRecommend:J,sortedOptions:Q}=L(e,U,O,_,I),{field:X,fieldKey:Y}=H();t(j).setContext(Y.value,(e=>({currentOption:c(function(e){const l=re(q.value);return d(e)?function(e){const t=l.reduce(((e,l)=>(e[l[I.value]]=l,e)),{});return e.map((e=>t[e]))}(e):(t=e,l.find((e=>e[I.value]===t)));var t}(e))})));const Z=async(e="")=>(W.value=e,Promise.allSettled([M(e),G(e)])),{injectValueValidate:ee,injectValueWatchFromEmpty:le,injectValueBindKey:te}=h();le(P,Z),ee(P);const oe=te(P),{menuProps:ae,nodeProps:ue}=g();function ne(e){const l=e[_.value];if(!l||!v(l))return"";const t=W.value?E(W.value,l):null,o=t?u("section",null,[t.map(((e,l)=>0!==l&&e?u("span",{style:{color:l%2==0?"var(--n-option-text-color-active)":""}},[e]):null))]):l;return e.desc?u("section",{style:{display:"flex",alignItems:"center",gap:"4px"}},[o,e.desc?u(k,null,{trigger:()=>u(F,{component:p},null),default:()=>e.desc}):null]):o}function re(l){return e.allowCreate&&W.value&&!l.some((e=>e[_.value]===W.value))?[...l,{[_.value]:W.value,[I.value]:W.value,created:!0,shouldSave:e.shouldSave}]:l}const se=l((()=>re(R.value?q.value:Q.value))),ie=o(),pe=l((()=>{if(e.allowCreate||e.showCustomValue)return P.value;const l=e.multiple&&d(P.value);return q.value.find((e=>l?P.value.includes(e[I.value]):e[I.value]===P.value))?P.value:null})),me=a(!1);async function ce(e){e&&await Z(),me.value=e}let de=null;async function ve(l,t){P.value=l,de&&f(t)&&R.value&&(de.focus(),await s(),de.value=t[_.value]||"",de.dispatchEvent(new CustomEvent("input")),"start"===e.cursorPlacement&&de.setSelectionRange(0,0)),z.value&&t&&i(t).forEach((e=>{if(!f(e))return;const l=e;l.created&&l.shouldSave&&z.value.push(y(r(l),["created","shouldSave"]))}))}const fe=t(C),{getSpan:ye}=b(),he=A(X,(async l=>{var t,o,a;R.value&&(de=l.target,de&&P.value&&(await s(),de.value=null!=(a=null!=(o=null==(t=q.value.find((e=>e[I.value]===P.value)))?void 0:t[_.value])?o:P.value)?a:"",de.dispatchEvent(new CustomEvent("input")),"start"===e.cursorPlacement&&(await m(0),de.setSelectionRange(0,0))))}));function ge(e){if(!R.value)return;if(de=e.target,!de)return;if(!de.value)return P.value=null;const l=q.value.find((e=>e[_.value]===de.value));l?P.value=l[I.value]:(W.value=de.value,P.value=de.value)}function Se({option:l,handleClose:t}){var o;const a=null!=(o=N.value&&l[N.value])?o:l[_.value];return e.multiple?e.deletable?u(B,{closable:!0,onClose:e=>{e.stopPropagation(),t()}},{default:()=>a}):`${a} ;`:a}function be(l){return u(w,n({key:oe.value,multiple:e.multiple,remote:!0,filterable:!0,loading:D.value,value:pe.value,onUpdateValue:ve,"menu-props":ae,"node-props":ue,labelField:_.value,valueField:I.value,options:se.value,onSearch:Z,show:me.value,"onUpdate:show":ce,onFocus:he,onBlur:ge,renderLabel:ne,renderTag:Se},l,ie),x)}return()=>{var e,l;if(!$.value)return be();const t=null!=(l=null==(e=X.value.decoratorProps)?void 0:e.span)?l:6,o=ye(fe,X.value.address);return u("section",{class:"form-render__selectChildField",style:{"--column":o+t}},[be({class:"form-render__selectChildFieldItem",style:{"--form-item-column":t}}),q.value.map((e=>T({option:e,value:P.value,valueKey:I.value,labelKey:_.value,childFieldStrategy:"checked",renderLabel:!1,attrs:{class:"form-render__selectChildFieldItem",style:{"--form-item-column":o}}})))])}}}),R({dataSource:"options"},x,O));export{_ 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 i,formRenderLog as r}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(e,o){Object.assign(e["x-component-props"],{...n(o,["urlConfig","wordbook"])})}function u(u){const{createValidatorSchema:f}=l(),_=e=>{var o;const t={name:e.val_key,type:null!=(o=e.fieldType)?o:"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","x-compile-omitted":["title","x-component-props","x-decorator-props"]};e.reactions&&(t["x-reactions"]=e.reactions),e.noDecorator||Object.assign(t,{"x-decorator":"FORM_ITEM","x-decorator-props":{fieldItem:e,span:2*(e.elem_width||3),showLabel:"1"!==e.hide_title,remark:e.remark,propertyKey:e.val_key,annotation:e.annotation,...e.decoratorProps||{}}});const n=f(e);return n&&(t["x-validator"]=n),"0"===e.is_null&&(t.required=!0),t},x=e=>{var o;const t=_(e);e.urlConfig?d(t,e):e.autograph&&m(t,e);const r=!!e.__multiple;return Object.assign(t["x-component-props"],{multiple:r,options:e.option||(null==(o=e.componentProps)?void 0:o.options),allowModify:"1"===e.allowModify,allowCreate:"1"===e.free_entry||!!t["x-component-props"].allowCreate||"1"===e.allowModify,shouldSave:"1"===e.save_free_entry,showField:e.show_key,maxTagCount:i(e.multi_select_value),...n(e,["lazyRequest","requestCache"])}),r&&(t.type="array"),t},h=e=>{const o=_(e);return Object.assign(o["x-component-props"],{options:e.option,childFieldStrategy:e.childFieldStrategy,vertical:e.__vertical}),e.urlConfig?d(o,e):e.autograph&&m(o,e),o},g=e=>{const t=_(e);return Object.assign(t["x-component-props"],{fieldItem:o(e,["reactions"])}),t},y=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}}),b=new Map([["LINEBAR",y],["LINE_BREAKS",e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINE_BREAKS","x-component-props":{border:e.lineBreaksBorder},"x-display":"0"===e.is_show?"hidden":"visible"})],["INPUT",e=>{const o=_(e);return Object.assign(o["x-component-props"],{...n(e,["prefix","suffix"])}),o}],["TEXTAREA",e=>{const o=_(e);return Object.assign(o["x-component-props"],{rows:e.initialize_high||3}),o}],["INPUT_NUMBER",e=>{const o=_(e),{decimal_length:t,validate:n,allowSlash:i}=e;return i&&(o["x-component"]="INPUT_NUMBER_SLASH",o.type="string"),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=_(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=_(e);return Object.assign(o["x-component-props"],{...n(e,["wordbook","lazyRequest","autograph"])}),"1"===e.is_allow_check_mid&&e.allow_check_mid_level&&(o["x-component-props"].checkAbleLevel=+e.allow_check_mid_level),o}],["SEARCH_CASCADER",e=>{var o;const t=_(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=_(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,properties:e.children||[],combinationItemDeletable:e.combinationItemDeletable}),o}],["RADIO",h],["CHECKBOX",h],["SWITCH",e=>{const o=_(e);return Object.assign(o["x-component-props"],{openDescription:e.open,closeDescription:e.close}),o}],["SLIDER",e=>{const o=_(e);return Object.assign(o["x-component-props"],{step:i(e.step_length),max:i(e.max_length),min:i(e.min_length),option:e.option}),o}],["COMPLEX",e=>{const o=_(e);Array.isArray(e.properties)&&r("COMPLEX控件的properties属性已经废弃, 请使用children作为替代, 在之后的版本中properties属性将不再支持");const t=Array.isArray(e.properties||e.children)?j(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}]]),v=e=>{if(e.suffixConfig)return w(e);return(b.get(e.html_type)||g)(e)},w=o=>{if(!o.suffixConfig&&!o.prefixConfig)return v(o);const t=o.suffixConfig?e(o.suffixConfig):[],n=[...(o.prefixConfig?e(o.prefixConfig):[]).map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:"1"}))),{...o,is_show:"1",hide_title:"1",suffixConfig:void 0,prefixConfig:void 0},...t.map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:"1"})))],i=_(o),r=n.reduce(((e,o)=>e+2*(o.elem_width||3)),0);return Object.assign(i,{type:"void",name:a(n),title:o.alias||o.name,"x-component":"INPUT_GROUP","x-component-props":{span:r},"x-decorator-props":{...i["x-decorator-props"],showFeedback:!1,suffixFields:n.map((e=>e.val_key))},properties:j(n)}),i},{FieldNormalizeWaterfallHook:C,FieldListNormalizeWaterfallHook:O}=s();function j(o,n={column:9999}){let i=null;return O.call(t(o),n).reduce(((e,o,a)=>{var p;const l=null==(p=(o=C.call(o,n)).validate)?void 0:p.obj_type;return l&&u&&u.collect(l,t(o)),"LINEBAR"===o.html_type?(e[s(o)]=r(y(o),a),i=e[s(o)].properties={}):i?i[s(o)]=r(v(o),a):(i=null,e[s(o)]=r(v(o),a)),e}),{});function r(e,o){return e["x-index"]=o,e}function s(o){return o.suffixConfig?a([o,...e(o.suffixConfig)]):o.val_key}}return{schemaAdaptor:j}}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 i,formRenderLog as r}from"../utils/index.js";import{useFieldNormalize as s}from"./useFieldNormalize.js";import{fieldKeyEscape as p,createLinebarId as a}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(e,o){Object.assign(e["x-component-props"],{...n(o,["urlConfig","wordbook"])})}function u(u){const{createValidatorSchema:f}=l(),x=e=>{var o;const t={name:e.val_key,type:null!=(o=e.fieldType)?o:"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","x-compile-omitted":["title","x-component-props","x-decorator-props"]};e.reactions&&(t["x-reactions"]=e.reactions),e.noDecorator||Object.assign(t,{"x-decorator":"FORM_ITEM","x-decorator-props":{fieldItem:e,span:2*(e.elem_width||3),showLabel:"1"!==e.hide_title,remark:e.remark,propertyKey:e.val_key,annotation:e.annotation,...e.decoratorProps||{}}});const n=f(e);return n&&(t["x-validator"]=n),"0"===e.is_null&&(t.required=!0),t},_=e=>{var o,t,r,s,p;const a=x(e);e.urlConfig?d(a,e):e.autograph&&m(a,e);const l=!!e.__multiple,c="1"===e.allowModify;return Object.assign(a["x-component-props"],{multiple:l,options:e.option||(null==(o=e.componentProps)?void 0:o.options),allowModify:c,allowCreate:"1"===e.free_entry||!!a["x-component-props"].allowCreate||c,shouldSave:"1"===e.save_free_entry,showField:null!=(r=e.show_key)?r:null==(t=e.componentProps)?void 0:t.showField,maxTagCount:null!=(p=i(e.multi_select_value))?p:null==(s=a["x-component-props"])?void 0:s.maxTagCount,...n(e,["lazyRequest","requestCache"])}),l&&(a.type="array"),a},h=e=>{const o=x(e);return Object.assign(o["x-component-props"],{options:e.option,childFieldStrategy:e.childFieldStrategy,vertical:e.__vertical}),e.urlConfig?d(o,e):e.autograph&&m(o,e),o},g=e=>{const t=x(e);return Object.assign(t["x-component-props"],{fieldItem:o(e,["reactions"])}),t},y=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:a(e.val_key),show:"0"!==e.is_show,remark:e.remark}}),b=new Map([["LINEBAR",y],["LINE_BREAKS",e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINE_BREAKS","x-component-props":{border:e.lineBreaksBorder},"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}],["TEXTAREA",e=>{const o=x(e);return Object.assign(o["x-component-props"],{rows:e.initialize_high||3}),o}],["INPUT_NUMBER",e=>{const o=x(e),{decimal_length:t,validate:n,allowSlash:i}=e;return!0!==i&&"1"!==i||(o["x-component"]="INPUT_NUMBER_SLASH",o.type="string"),Object.assign(o["x-component-props"],{precision:null!=t?t:null==n?void 0:n.decimal_length,whiteList:e.whiteList,prefix:e.prefix,suffix:e.suffix}),o}],["SELECT",_],["REMOTE_SEARCH",_],["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"])}),"1"===e.is_allow_check_mid&&e.allow_check_mid_level&&(o["x-component-props"].checkAbleLevel=+e.allow_check_mid_level),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,properties:e.children||[],combinationItemDeletable:e.combinationItemDeletable}),o}],["RADIO",h],["CHECKBOX",h],["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:i(e.step_length),max:i(e.max_length),min:i(e.min_length),option:e.option}),o}],["COMPLEX",e=>{const o=x(e);Array.isArray(e.properties)&&r("COMPLEX控件的properties属性已经废弃, 请使用children作为替代, 在之后的版本中properties属性将不再支持");const t=Array.isArray(e.properties||e.children)?j(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}]]),v=e=>{if(e.suffixConfig)return w(e);return(b.get(e.html_type)||g)(e)},w=o=>{if(!o.suffixConfig&&!o.prefixConfig)return v(o);const t=o.suffixConfig?e(o.suffixConfig):[],n=[...(o.prefixConfig?e(o.prefixConfig):[]).map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:"1"}))),{...o,is_show:"1",hide_title:"1",suffixConfig:void 0,prefixConfig:void 0},...t.map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:"1"})))],i=x(o),r=n.reduce(((e,o)=>e+2*(o.elem_width||3)),0);return Object.assign(i,{type:"void",name:p(n),title:o.alias||o.name,"x-component":"INPUT_GROUP","x-component-props":{span:r},"x-decorator-props":{...i["x-decorator-props"],showFeedback:!1,suffixFields:n.map((e=>e.val_key))},properties:j(n)}),i},{FieldNormalizeWaterfallHook:C,FieldListNormalizeWaterfallHook:O}=s();function j(o,n={column:9999}){let i=null;return O.call(t(o),n).reduce(((e,o,p)=>{var a;const l=null==(a=(o=C.call(o,n)).validate)?void 0:a.obj_type;return l&&u&&u.collect(l,t(o)),"LINEBAR"===o.html_type?(e[s(o)]=r(y(o),p),i=e[s(o)].properties={}):i?i[s(o)]=r(v(o),p):(i=null,e[s(o)]=r(v(o),p)),e}),{});function r(e,o){return e["x-index"]=o,e}function s(o){return o.suffixConfig?p([o,...e(o.suffixConfig)]):o.val_key}}return{schemaAdaptor:j}}export{u as useFieldListAdaptor};
@@ -80,7 +80,7 @@ export declare function useFieldNormalize(): {
80
80
  businessFormatter: import("../types").FormBusinessFormatter;
81
81
  requestInstance: import("./useFormRequest").RequestInstance;
82
82
  enterToNextWidget: boolean | ((fieldItem: FieldItem) => boolean | void);
83
- lowCodeReactions: import("../types").FormLowCodeReactions.Config[];
83
+ lowCodeReactions: import("../../../../../es/shared/types").FormLowCodeReactions.Config[];
84
84
  linebarAutoHidden: boolean;
85
85
  bordered: string | boolean;
86
86
  uniqueCacheData: boolean;
@@ -167,7 +167,7 @@ export declare function useFieldNormalize(): {
167
167
  businessFormatter: import("../types").FormBusinessFormatter;
168
168
  requestInstance: import("./useFormRequest").RequestInstance;
169
169
  enterToNextWidget: boolean | ((fieldItem: FieldItem) => boolean | void);
170
- lowCodeReactions: import("../types").FormLowCodeReactions.Config[];
170
+ lowCodeReactions: import("../../../../../es/shared/types").FormLowCodeReactions.Config[];
171
171
  linebarAutoHidden: boolean;
172
172
  bordered: string | boolean;
173
173
  uniqueCacheData: boolean;
@@ -1 +1 @@
1
- import{arrayed as e}from"../../../../shared/utils/index.js";import{once as a,isNumber as i,isString as m}from"lodash-es";import"vue";import{registerValidateLocale as r,registerValidateRules as s}from"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import{isFunction as l}from"@vueuse/core";import"naive-ui";import"../../index.js";import{isIdCard as n}from"../utils/business.js";function o(){const a=new Map([["mobile",({validate:e})=>({format:"phone",message:null==e?void 0:e.message})],["integer",({validate:e})=>({format:"integer",message:null==e?void 0:e.message})],["number",({validate:e})=>({format:"number",message:null==e?void 0:e.message})],["id_card",({validate:e})=>({validator(a){var i;if(null!=a&&""!==a)return m(a)&&n(a)?void 0:null!=(i=null==e?void 0:e.message)?i:"该字段不是合法的身份证格式"}})],["regular",({validate:e,regular_expression:a,regular_error_tip:i})=>({pattern:a||(null==e?void 0:e.regular_expression)||"",message:i||(null==e?void 0:e.regular_error_tip)||(null==e?void 0:e.message)||"格式错误"})]]),i={triggerType:"onBlur"};return{createValidatorSchema:function(m){const r=[],{validate:{vali_obj:s,max_length:n,min_length:o,message:u,max_value:t,min_value:g,decimal_length:d}={},validator:v}=m;if(v&&e(v).forEach((e=>{l(e)&&r.push({validator:a=>e(a,m)})})),n&&r.push({max:n,message:u}),o&&r.push({min:o,message:u}),t&&r.push({maximum:t,message:u}),g&&r.push({minimum:g,message:u}),null!=d&&r.push(((e,a)=>{const i=null!=a?a:`小数位数最多${e}位`;return{validator(a){var m;return(null==(m=String(a).split(".")[1])?void 0:m.length)>e?i:""}}})(+d,u)),s){const e=a.get(s)||(({validate:e})=>({format:s,message:null==e?void 0:e.message}));r.push(Object.assign({},i,e(m)))}return r}}}const u=a((()=>{r({"zh-CN":{required:"${alias||name}为必填"}}),s({maximum:(e,a)=>i(Number(a.maximum))&&null!=e&&""!==e&&"/"!==e?(m(e)&&(e=+e),!i(e)||isNaN(e)?a.message||"":e>Number(a.maximum)&&a.message||""):"",minimum:(e,a)=>i(Number(a.minimum))&&null!=e&&""!==e&&"/"!==e?(m(e)&&(e=+e),!i(e)||isNaN(e)?a.message||"":e<Number(a.minimum)&&a.message||""):""})}));export{o as useFormValidator,u as validateMessageLocale};
1
+ import{arrayed as e}from"../../../../shared/utils/index.js";import{once as i,isNumber as a,isString as m}from"lodash-es";import"vue";import{registerValidateLocale as r,registerValidateRules as s}from"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import{isFunction as l}from"@vueuse/core";import"naive-ui";import"../../index.js";import{isIdCard as n}from"../utils/business.js";function o(){const i=new Map([["mobile",({validate:e})=>({format:"phone",message:null==e?void 0:e.message})],["integer",({validate:e})=>({format:"integer",message:null==e?void 0:e.message})],["number",({validate:e})=>({format:"number",message:null==e?void 0:e.message})],["id_card",({validate:e})=>({validator(i){var a;if(null!=i&&""!==i)return m(i)&&n(i)?void 0:null!=(a=null==e?void 0:e.message)?a:"该字段不是合法的身份证格式"}})],["regular",({validate:e,regular_expression:i,regular_error_tip:a})=>({pattern:i||(null==e?void 0:e.regular_expression)||"",message:a||(null==e?void 0:e.regular_error_tip)||(null==e?void 0:e.message)||"格式错误"})]]),a={triggerType:"onBlur"};return{createValidatorSchema:function(m){const r=[],{validate:{vali_obj:s,max_length:n,min_length:o,message:u,max_value:t,min_value:g,decimal_length:d}={},validator:v}=m;if(v&&e(v).forEach((e=>{l(e)&&r.push({validator:i=>e(i,m)})})),n&&r.push({max:n,message:u}),o&&r.push({min:o,message:u}),t&&r.push({maximum:t,message:u}),g&&r.push({minimum:g,message:u}),null!=d&&r.push(((e,i)=>{const a=null!=i?i:`小数位数最多${e}位`;return{validator(i){var m;return(null==(m=String(i).split(".")[1])?void 0:m.length)>e?a:""}}})(+d,u)),s){const e=i.get(s)||(({validate:e})=>({format:s,message:null==e?void 0:e.message}));r.push(Object.assign({},a,e(m)))}return r}}}const u=i((()=>{r({"zh-CN":{required:"${alias||name}为必填"}}),s({maximum:(e,i)=>a(Number(i.maximum))&&null!=e&&""!==e&&"/"!==e?(m(e)&&(e=+e),!a(e)||isNaN(e)?"":e>Number(i.maximum)&&i.message||""):"",minimum:(e,i)=>a(Number(i.minimum))&&null!=e&&""!==e&&"/"!==e?(m(e)&&(e=+e),!a(e)||isNaN(e)?"":e<Number(i.minimum)&&i.message||""):""})}));export{o as useFormValidator,u as validateMessageLocale};
@@ -1,6 +1,6 @@
1
+ import { FormLowCodeReactions } from '../../../../../es/shared/types';
1
2
  import { Form } from '@formily/core';
2
3
  import { MaybeRef } from '@vueuse/core';
3
- import { FormLowCodeReactions } from '../../../../../es/components/form-render';
4
4
  export declare function useLowCodeReactions(configListRef: MaybeRef<FormLowCodeReactions.Config[] | undefined>, formModel: Form): {
5
5
  lowCodeReactionsHandler: (field: string) => void;
6
6
  triggerAllReactionsHandler: () => void;
@@ -149,9 +149,10 @@ export declare type FieldItem = {
149
149
  allow_check_mid_level: '1' | '2' | '3' | '4';
150
150
  prefix: string | AnyObject | (() => any);
151
151
  suffix: string | AnyObject | (() => any);
152
- allowSlash: boolean;
152
+ allowSlash: boolean | string;
153
153
  allowModify: '0' | '1';
154
154
  show_key: string;
155
+ whiteList: string[];
155
156
  bordered: boolean | string;
156
157
  fieldType: SchemaTypes;
157
158
  content: string | FormRenderer | Record<string, FormRenderer>;
@@ -1,5 +1,5 @@
1
1
  import { AsyncQueue } from '../../../../../es/shared/hooks';
2
- import { AnyObject, FormOperationalConfig, LOW_CODE_VALUE_RELATION, UndefinedAble } from '../../../../../es/shared/types';
2
+ import { AnyObject, FormLowCodeReactions, FormOperationalConfig, UndefinedAble } from '../../../../../es/shared/types';
3
3
  import { DataField, Field, Form } from '@formily/core';
4
4
  import { ISchema } from '@formily/json-schema/esm/types';
5
5
  import { Component, FunctionalComponent } from 'vue';
@@ -152,21 +152,3 @@ export declare type FormBusinessFormatter = (payload: {
152
152
  type: FIELD_BUSINESS_TYPE;
153
153
  from: FIELD_BUSINESS_TYPE;
154
154
  }) => unknown;
155
- export declare namespace FormLowCodeReactions {
156
- type ConObj = {
157
- con: LOW_CODE_VALUE_RELATION;
158
- field_key: string;
159
- value: unknown;
160
- };
161
- type Config = {
162
- conObj: ConObj[];
163
- } & Partial<{
164
- sqlExpression: string;
165
- showField: string[];
166
- hideField: string[];
167
- requiredField: string[];
168
- notRequiredField: string[];
169
- enabledField: string[];
170
- disabledField: string[];
171
- }>;
172
- }
@@ -1 +1 @@
1
- import{createVNode as e,mergeProps as l,defineComponent as o,computed as r}from"vue";import n from"../../../../../../shared/components/InputNumberSlash/InputNumberSlash.js";import{isNumber as u}from"lodash-es";import{NInputNumber as t}from"naive-ui";import"../../../../index.js";import{EDITABLE_WIDGET_TYPE as a}from"../../../constants/index.js";import{useAutoFocus as s}from"./hooks/useAutoFocus.js";import{IhoTableRenderHelper as i}from"../../../utils/index.js";import{defineTablePlugin as m}from"../../../hooks/useTablePlugin.js";const p=o({name:"IhoTableInputNumber",props:{value:[String,Number]},emits:["update:value"],setup(l,{emit:o}){const n=r({get:()=>u(l.value)?l.value:l.value&&u(+l.value)?+l.value:null,set(e){o("update:value",e)}});return()=>e(t,{value:n.value,"onUpdate:value":e=>n.value=e},null)}});function d(){const o="numberRendererPlugin";return m({name:o,vxe(o){o.renderer.add(a.NUMBER,{renderCell:i.createDefaultRenderCell(),renderEdit:i.createRenderEdit((({row:o,column:r,fieldItem:u,emitFormClick:t,emitFormChangeWithParams:a})=>{const{placeholder:s="请输入"}=u.componentProps||{},i={clearable:!0,placeholder:s,onBlur:()=>a({type:"blur",oldValue:o[r.field]}),[u.allowSlash?"onChange":"onUpdateValue"]:e=>{const l=o[r.field];o[r.field]=e,a({oldValue:l})},onClick:t};return u.allowSlash?e(n,l({value:o[r.field]},i,u.componentProps),null):e(p,l({value:o[r.field]},i,u.componentProps),null)}))})},apply(e){s(e).bindAutoFocusConfig(o,a.NUMBER,".n-input__input-el",{focusType:"class"})}})}export{d as numberRendererPlugin};
1
+ import{createVNode as e,mergeProps as o,defineComponent as l,computed as n}from"vue";import r from"../../../../../../shared/components/InputNumberSlash/InputNumberSlash.js";import{isNumber as t}from"lodash-es";import{NInputNumber as u}from"naive-ui";import"../../../../index.js";import{EDITABLE_WIDGET_TYPE as a}from"../../../constants/index.js";import{useAutoFocus as s}from"./hooks/useAutoFocus.js";import{createIhoTableClearActivedInterceptor as p,IhoTableRenderHelper as i}from"../../../utils/index.js";import{defineTablePlugin as m}from"../../../hooks/useTablePlugin.js";const d=l({name:"IhoTableInputNumber",props:{value:[String,Number]},emits:["update:value"],setup(o,{emit:l}){const r=n({get:()=>t(o.value)?o.value:o.value&&t(+o.value)?+o.value:null,set(e){l("update:value",e)}});return()=>e(u,{value:r.value,"onUpdate:value":e=>r.value=e},null)}});function c(){const l="numberRendererPlugin";return m({name:l,vxe(l){l.interceptor.add("event.clearActived",p(a.NUMBER,(e=>e.classList.contains("iho-table_numberInputSlashPopper")))),l.renderer.add(a.NUMBER,{renderCell:i.createDefaultRenderCell(),renderEdit:i.createRenderEdit((({row:l,column:n,fieldItem:t,emitFormClick:u,emitFormChangeWithParams:a})=>{var s;const{placeholder:p="请输入"}=t.componentProps||{};function i(e){const o=l[n.field];l[n.field]=e,a({oldValue:o})}const m={clearable:!0,placeholder:p,onBlur:()=>a({type:"blur",oldValue:l[n.field]}),onClick:u};return!0===t.allowSlash||"1"===t.allowSlash?e(r,o({value:l[n.field],onChange:i},m,{whiteList:t.whiteList},t.componentProps,{popperProps:{...null==(s=t.componentProps)?void 0:s.popperProps,class:"iho-table_numberInputSlashPopper"}}),null):e(d,o({value:l[n.field],"onUpdate:value":i},m,t.componentProps),null)}))})},apply(e){s(e).bindAutoFocusConfig(l,a.NUMBER,".n-input__input-el",{focusType:"class"})}})}export{c as numberRendererPlugin};
@@ -115,8 +115,8 @@ declare const _default: import("vue").DefineComponent<{
115
115
  labelField: string;
116
116
  valueField: string;
117
117
  placeholder: string;
118
+ shouldSave: boolean;
118
119
  consistentMenuWidth: boolean;
119
120
  allowCreate: boolean;
120
- shouldSave: boolean;
121
121
  }>;
122
122
  export default _default;
@@ -131,7 +131,8 @@ export declare type LowCodeTableFieldItem = {
131
131
  variableHeight: boolean | '0' | '1';
132
132
  filterSetting: IhoTableLowCodeField.FilterSetting;
133
133
  bindEventSetting: BindEventSettingItem[];
134
- allowSlash: boolean;
134
+ allowSlash: boolean | string;
135
+ whiteList: string[];
135
136
  }> & Partial<VxeTableDefines.ColumnInfo>;
136
137
  export declare type IhoTableFormChangePayload = {
137
138
  column: IhoTableFieldItem;