@longhongguo/form-create-ant-design-vue 3.2.47 → 3.2.48

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.
@@ -1,8 +1,8 @@
1
1
  /*!
2
- * @longhongguo/form-create-ant-design-vue v3.2.47
2
+ * @longhongguo/form-create-ant-design-vue v3.2.48
3
3
  * (c) 2018-2025 xaboy
4
4
  * Github https://github.com/xaboy/form-create
5
5
  * Released under the MIT License.
6
6
  */
7
- import e from"@form-create/component-antdv-upload/src/index";import t from"@form-create/component-antdv-frame/src/index";import a from"@form-create/component-antdv-group/src/index";import l from"@form-create/component-subform/src/index";import{openBlock as o,createElementBlock as r,createElementVNode as i,defineComponent as s,Fragment as n,createCommentVNode as c,normalizeClass as d,normalizeStyle as p,toDisplayString as u,renderList as m,resolveComponent as h,createVNode as f,nextTick as y}from"vue";import g,{hasProperty as v}from"@form-create/utils/lib/type";import b,{creatorFactory as w}from"@longhongguo/form-create-core/src/index";import k from"@form-create/utils/lib/mergeprops";import C from"@form-create/utils/lib/extend";import{invoke as S}from"@longhongguo/form-create-core/src/frame/util";import P from"@form-create/utils/lib/toarray";var V={name:"QuestionCircleOutlined"};const x={class:"anticon"};V.render=function(e,t,a,l,s,n){return o(),r("span",x,[...t[0]||(t[0]=[i("svg",{height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[i("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448s448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372s372 166.6 372 372s-166.6 372-372 372z",fill:"currentColor"}),i("path",{d:"M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7c-21.2 8.1-39.2 22.3-52.1 40.9c-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0 1 30.9-44.8c59-22.7 97.1-74.7 97.1-132.5c.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1 0 80 0a40 40 0 1 0-80 0z",fill:"currentColor"})],-1)])])};var $=s({name:"CusSelect",props:{modelValue:{type:Array,default:()=>[]},options:{type:Array,default:()=>[]},multiple:{type:Boolean,default:!1},maxTagCount:{type:Number,default:void 0},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},style:{type:[String,Object],default:()=>({width:"100%"})},valueKey:{type:String,default:"value"},labelKey:{type:String,default:"label"},allowClear:{type:Boolean,default:!1},bordered:{type:Boolean,default:!0}},emits:["update:modelValue","change"],computed:{currentValue:{get(){return Array.isArray(this.modelValue)?this.modelValue.map(e=>"object"!=typeof e||null===e||void 0===e.value&&void 0===e[this.valueKey]?{[this.valueKey]:e,[this.labelKey]:this.getLabel(e)}:e):null===this.modelValue||void 0===this.modelValue||""===this.modelValue?[]:"object"==typeof this.modelValue?[this.modelValue]:[{value:this.modelValue,label:this.getLabel(this.modelValue)}]},set(e){let t=[];null!=e&&(t=Array.isArray(e)?e.map(e=>"object"!=typeof e||null===e||void 0===e.value&&void 0===e[this.valueKey]?{[this.valueKey]:e,[this.labelKey]:this.getLabel(e)}:e):"object"==typeof e&&null!==e?[e]:[{[this.valueKey]:e,[this.labelKey]:this.getLabel(e)}]),this.$emit("update:modelValue",t),this.$emit("change",t)}},hasValue(){const e=this.currentValue;return Array.isArray(e)&&e.length>0},displayValue(){return this.hasValue?this.currentValue[0]:null},displayLabel(){if(!this.displayValue)return"";const e=this.displayValue;return"object"==typeof e&&null!==e?e[this.labelKey]||e.label||String(e[this.valueKey]||e.value||""):this.getLabel(e)},allSelectedItems(){const e=this.currentValue;return Array.isArray(e)&&0!==e.length?e.map(e=>"object"==typeof e&&null!==e?{value:e[this.valueKey]||e.value,label:e[this.labelKey]||e.label||String(e[this.valueKey]||e.value||"")}:{value:e,label:this.getLabel(e)}):[]},displayItems(){const e=this.allSelectedItems;return void 0===this.maxTagCount||null===this.maxTagCount?e:e.slice(0,this.maxTagCount)},remainingCount(){if(void 0===this.maxTagCount||null===this.maxTagCount)return 0;const e=this.allSelectedItems.length;return Math.max(0,e-this.maxTagCount)},showClear(){return this.allowClear&&this.hasValue&&!this.disabled}},methods:{findOptionByValue(e){return this.options&&0!==this.options.length?this.options.find(t=>{const a="object"==typeof t?t[this.valueKey]:t;return a===e||String(a)===String(e)}):null},getLabel(e){const t=this.findOptionByValue(e);return t?"object"==typeof t?t[this.labelKey]:t:String(e)},removeItem(e,t){if(this.disabled)return;t.stopPropagation();const a=this.currentValue;if(Array.isArray(a)){const t=a.filter(t=>{if("object"==typeof t&&null!==t){return(t[this.valueKey]||t.value)!==e}return t!==e});this.currentValue=t}},clearValue(e){this.disabled||(e.stopPropagation(),this.currentValue=[])}}});const F=["tabindex"],B=["title"],O={key:1,class:"fc-cus-select-selection-placeholder"},I={key:3,class:"fc-cus-select-arrow"},T=["tabindex"],A={class:"fc-cus-select-selection-overflow"},K=["title"],R={class:"fc-cus-select-selection-item-content"},L=["onClick"],j={key:0,class:"fc-cus-select-selection-overflow-item",style:{opacity:"1"}},E={class:"fc-cus-select-selection-item"},M={class:"fc-cus-select-selection-item-content"},N={key:1,class:"fc-cus-select-selection-placeholder"},z={key:1,class:"fc-cus-select-arrow"};$.render=function(e,t,a,l,s,h){return o(),r(n,null,[c(" 单个展示模式 "),e.multiple?(o(),r(n,{key:1},[c(" 多个展示模式 "),i("div",{class:d(["fc-cus-select fc-cus-select-multiple",{"fc-cus-select-disabled":e.disabled}]),style:p(e.style),tabindex:e.disabled?-1:0},[i("div",{class:d(["fc-cus-select-selector",{"fc-cus-select-selector-borderless":!e.bordered}])},[i("div",A,[c(" 显示的 tags "),(o(!0),r(n,null,m(e.displayItems,(a,l)=>(o(),r("div",{key:l,class:"fc-cus-select-selection-overflow-item",style:{opacity:"1"}},[i("span",{class:"fc-cus-select-selection-item",title:a.label},[i("span",R,u(a.label),1),i("span",{class:"fc-cus-select-selection-item-remove",onClick:t=>e.removeItem(a.value,t)},[...t[4]||(t[4]=[i("span",{role:"img","aria-label":"close",class:"anticon anticon-close"},[i("svg",{focusable:"false","data-icon":"close",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true","fill-rule":"evenodd",viewBox:"64 64 896 896"},[i("path",{d:"M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z"})])],-1)])],8,L)],8,K)]))),128)),c(" 折叠提示 "),e.remainingCount>0?(o(),r("div",j,[i("span",E,[i("span",M," +"+u(e.remainingCount),1)])])):c("v-if",!0),c(" 空值占位符 "),e.hasValue?c("v-if",!0):(o(),r("span",N,u(e.placeholder||"请选择"),1))]),e.showClear?(o(),r("span",{key:0,class:"fc-cus-select-clear",onClick:t[1]||(t[1]=(...t)=>e.clearValue&&e.clearValue(...t))},[...t[5]||(t[5]=[i("span",{role:"img","aria-label":"close-circle",class:"anticon anticon-close-circle"},[i("svg",{focusable:"false","data-icon":"close-circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true","fill-rule":"evenodd",viewBox:"64 64 896 896"},[i("path",{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"})])],-1)])])):(o(),r("span",z,[...t[6]||(t[6]=[i("span",{role:"img","aria-label":"down",class:"anticon anticon-down"},[i("svg",{focusable:"false","data-icon":"down",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"64 64 896 896"},[i("path",{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"})])],-1)])]))],2)],14,T)],2112)):(o(),r("div",{key:0,class:d(["fc-cus-select fc-cus-select-single",{"fc-cus-select-disabled":e.disabled}]),style:p(e.style),tabindex:e.disabled?-1:0},[i("div",{class:d(["fc-cus-select-selector",{"fc-cus-select-selector-borderless":!e.bordered}])},[e.displayValue?(o(),r("span",{key:0,class:"fc-cus-select-selection-item",title:e.displayLabel},u(e.displayLabel),9,B)):(o(),r("span",O,u(e.placeholder||"请选择"),1)),e.showClear?(o(),r("span",{key:2,class:"fc-cus-select-clear",onClick:t[0]||(t[0]=(...t)=>e.clearValue&&e.clearValue(...t))},[...t[2]||(t[2]=[i("span",{role:"img","aria-label":"close-circle",class:"anticon anticon-close-circle"},[i("svg",{focusable:"false","data-icon":"close-circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true","fill-rule":"evenodd",viewBox:"64 64 896 896"},[i("path",{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"})])],-1)])])):(o(),r("span",I,[...t[3]||(t[3]=[i("span",{role:"img","aria-label":"down",class:"anticon anticon-down"},[i("svg",{focusable:"false","data-icon":"down",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"64 64 896 896"},[i("path",{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"})])],-1)])]))],2)],14,F))],2112)};var Y=s({name:"CusStoreSelect",components:{CusSelect:$},props:{formCreateInject:{type:Object,default:null},modelValue:{type:Array,default:()=>[]},options:{type:Array,default:()=>[]},multiple:{type:Boolean,default:!1},maxTagCount:{type:Number,default:void 0},placeholder:{type:String,default:"请选择"},disabled:{type:Boolean,default:!1},style:{type:[String,Object],default:()=>({width:"100%"})},valueKey:{type:String,default:"value"},labelKey:{type:String,default:"label"},allowClear:{type:Boolean,default:!1},field:{type:String,default:""},bordered:{type:Boolean,default:!0}},emits:["update:modelValue","change"],data:()=>({messageId:0,pendingCallbacks:{},internalOptions:[]}),computed:{mergedOptions(){if(this.internalOptions.length>0){const e=new Map;return this.options.forEach(t=>{const a="object"==typeof t?t[this.valueKey]:t;e.set(a,t)}),this.internalOptions.forEach(t=>{const a="object"==typeof t?t[this.valueKey]:t;e.set(a,t)}),Array.from(e.values())}return this.options}},watch:{options:{immediate:!0,handler(e){0===this.internalOptions.length&&Array.isArray(e)&&e.length>0&&(this.internalOptions=[...e])}}},mounted(){window.addEventListener("message",this.handleMessage)},beforeUnmount(){window.removeEventListener("message",this.handleMessage)},methods:{serializeForPostMessage(e){if(null==e)return e;try{return JSON.parse(JSON.stringify(e))}catch(t){if(console.warn("CusStoreSelect: 数据序列化失败,尝试递归处理",t),Array.isArray(e))return 0===e.length?[]:e.map(e=>this.serializeForPostMessage(e));if("object"==typeof e){const t={};for(const a in e)if(Object.prototype.hasOwnProperty.call(e,a))try{t[a]=this.serializeForPostMessage(e[a])}catch(e){console.warn("CusStoreSelect: 跳过无法序列化的属性: "+a,e)}return t}return e}},handleClick(){if(this.disabled)return;const e=`store-select-${this.field||"default"}-${Date.now()}-${++this.messageId}`,t=Array.isArray(this.modelValue)?this.modelValue:[];let a=null;t.length>0&&(a=t);const l=null==a?null:this.serializeForPostMessage(a),o={type:"OPEN_STORE_SELECT",field:this.field||"",multiple:this.multiple,currentValue:l,valueKey:this.valueKey,labelKey:this.labelKey,messageId:e};if(window.parent&&window.parent!==window)try{window.parent.postMessage(o,"*")}catch(e){console.error("CusStoreSelect: 发送消息失败",e)}else console.warn("CusStoreSelect: 当前不在 iframe 环境中,无法向父窗口发送消息");this.pendingCallbacks[e]=(e,t)=>{t&&Array.isArray(t)&&t.length>0&&this.mergeOptions(t),this.handleUpdate(e),this.handleChange(e)}},handleMessage(e){const t=e.data;if(t&&"STORE_SELECT_RESULT"===t.type){const{field:e,value:a,sourceItems:l,messageId:o}=t;if(e!==this.field)return;const r=this.pendingCallbacks[o];r&&(r(a,l),delete this.pendingCallbacks[o])}},mergeOptions(e){if(!Array.isArray(e)||0===e.length)return;const t=new Map;this.internalOptions.forEach(e=>{const a="object"==typeof e?e[this.valueKey]:e;t.set(a,e)}),e.forEach(e=>{const a="object"==typeof e?e[this.valueKey]:e;t.set(a,e)}),this.internalOptions=Array.from(t.values())},handleUpdate(e){this.$emit("update:modelValue",e),this.triggerValidate()},handleChange(e){this.$emit("change",e,this.internalOptions&&this.internalOptions.length>0?this.multiple?this.internalOptions:this.internalOptions[0]:this.multiple?[]:null)},triggerValidate(){this.$nextTick(()=>{this.$nextTick(()=>{try{if(this.formCreateInject&&this.formCreateInject.api&&this.field)return void this.formCreateInject.api.validateField(this.field).catch(()=>{});let e=this.$parent;for(;e;){if(e.$options&&"FormCreate"===e.$options.name&&e.fapi){this.field&&e.fapi.validateField&&e.fapi.validateField(this.field).catch(()=>{});break}e=e.$parent}}catch(e){console.warn("CusStoreSelect: 触发校验失败",e)}})})}}});Y.render=function(e,t,a,l,i,s){const n=h("CusSelect");return o(),r("div",{onClick:t[0]||(t[0]=(...t)=>e.handleClick&&e.handleClick(...t))},[f(n,{"model-value":e.modelValue,options:e.mergedOptions,multiple:e.multiple,"max-tag-count":e.maxTagCount,placeholder:e.placeholder,disabled:e.disabled,style:p(e.style),valueKey:e.valueKey,labelKey:e.labelKey,allowClear:e.allowClear,bordered:e.bordered,"onUpdate:modelValue":e.handleUpdate,onChange:e.handleChange},null,8,["model-value","options","multiple","max-tag-count","placeholder","disabled","style","valueKey","labelKey","allowClear","bordered","onUpdate:modelValue","onChange"])])};var _=[e,t,a,l,V,$,Y],D={name:"checkbox",modelField:"value",mergeProp(e){const t=e.prop.props;v(t,"options")||(t.options=e.prop.options||[])}},q={...D,name:"radio"},U={...D,name:"select",mergeProp(e){const t=e.prop.props;v(t,"options")||(t.options=e.prop.options||[]);const a=e.effectData("fetch");a&&!0===a.loading&&(t.disabled=!0,t.loading=!0)},render(e,t){const a=t.effectData("fetch");if(a&&!0===a.loading&&e.loading){const a={...e};return a.notFoundContent=e.loading,t.$render.defaultRender(t,a)}return t.$render.defaultRender(t,e)}},Q={name:"cascader",mergeProp(e){const t=e.prop.props;v(t,"options")||(t.options=e.prop.options||[]);const a=e.effectData("fetch");a&&!0===a.loading&&(t.disabled=!0,t.loading=!0)},render(e,t){const a=t.effectData("fetch");if(a&&!0===a.loading&&e.loading){const a={...e};return a.notFoundContent=e.loading,t.$render.defaultRender(t,a)}return t.$render.defaultRender(t,e)}};const G={date:"YYYY-MM-DD",month:"YYYY-MM",week:"YYYY-wo",quarter:"YYYY-qQ",year:"YYYY"},H="datePicker";var J={name:H,maker:["date","month","week"].reduce((e,t)=>(e[t]=w(H,{type:t}),e),{dateRange:w(H,{type:"range"}),datetimeRange:w(H,e=>e.props({type:"range",showTime:!0}))}),modelField:"value",mergeProp(e){const t=e.prop.props,a=t.type||t.picker;t.valueFormat||(t.valueFormat=(G[a]||G.date)+(!t.showTime||a&&"date"!==a?"":" HH:mm:ss"))},render:(e,t)=>t.$render.vNode[(!0===t.prop.props.range?"range":"date")+"Picker"](t.prop,e)};var W={name:"hidden",maker:{hidden:(e,t)=>w("hidden")("",e,t)},render:()=>[]};var X={name:"input",maker:["password","url","email","text","textarea","search"].reduce((e,t)=>(e[t]=w("input",{type:t}),e),{idate:w("input",{type:"date"})}),modelField:"value",render(e,t){let a=t.prop.props.type;return-1===["textarea","search","password"].indexOf(a)&&(a="input"),a={textarea:"aTextarea",search:"aInputSearch",password:"aInputPassword"}[a]||"aInput",t.$render.vNode.make(a,t.prop,e)}},Z={name:"timePicker",modelField:"value",mergeProp(e){const t=e.prop.props;t.valueFormat||(t.valueFormat="HH:mm:ss")},render:(e,t)=>t.$render.vNode["time"+(!0===t.prop.props.range?"Range":"")+"Picker"](t.prop,e)},ee={name:"tree",modelField:"checkedKeys",mergeProp(e){const t=e.prop.props;t.fieldNames?t.fieldNames.key||(t.fieldNames.key="id"):t.fieldNames={key:"id"},t.checkedKeys=e.rule.value,t.checkable=!0}},te={name:"FcRow",render:(e,t)=>t.vNode.col({props:{span:24}},{default:()=>[t.vNode.row(t.prop,e)]})};var ae=[D,J,{...J,name:"rangePicker",maker:{},render:(e,t)=>t.$render.vNode.rangePicker(t.prop,e)},W,X,Z,{...Z,name:"timeRangePicker",render:(e,t)=>t.$render.vNode.timeRangePicker(t.prop,e)},ee,q,U,Q,te,{name:"cusStoreSelect",modelField:"modelValue",toFormValue:(e,t)=>null==e||""===e?[]:Array.isArray(e)?e.map(e=>("object"!=typeof e||null===e||void 0===e.value&&e.label,e)):[e],toValue:(e,t)=>e,mergeProp(e){const t=e.prop.props;if(v(t,"options")||(t.options=e.prop.options||[]),v(t,"field")||(t.field=e.rule.field||""),void 0!==e.rule.value){const t=e.rule.value;null==t||""===t?e.rule.value=[]:Array.isArray(t)||(e.rule.value=[t])}},render(e,t){const a=t.$render.defaultRender(t,e);if(a&&a.props&&a.props.on){const e=a.props.on["update:modelValue"],l=()=>{y(()=>{y(()=>{try{const e=t.rule.field;if(e)return void t.$handle.api.validateField(e).catch(()=>{});const a=t.$handle.getFieldCtx(t.rule.field);a&&a.id&&t.$handle.$manager.validateField(a.id).catch(()=>{})}catch(e){console.warn("CusStoreSelect: 触发校验失败",e)}})})};a.props.on["update:modelValue"]=(...t)=>{e&&e(...t),l()};const o=a.props.on.change;a.props.on.change=o?(...e)=>{o(...e),l()}:l}return a}}];var le={tooltip:"aTooltip",popover:"aPopover",button:"aButton",icon:"aIcon",slider:"aSlider",rate:"aRate",upload:"fcUpload",cascader:"aCascader",timePicker:"aTimePicker",timeRangePicker:"aTimeRangePicker",datePicker:"aDatePicker",rangePicker:"aRangePicker",switch:"aSwitch",select:"aSelect",checkbox:"aCheckboxGroup",radio:"aRadioGroup",input:"aInput",inputNumber:"aInputNumber",treeSelect:"aTreeSelect",search:"aInputSearch",inputPassword:"aInputPassword",textarea:"aTextarea",formItem:"aFormItem",form:"aForm",frame:"fcFrame",col:"aCol",row:"aRow",tree:"aTree",autoComplete:"aAutoComplete",transfer:"aTransfer",group:"fcGroup",array:"fcGroup",subForm:"fcSubForm",object:"fcSubForm"};function oe(e,t){v(e,t)&&g.String(e[t])&&(e[t]={[t]:e[t],show:!0})}function re(e){return!1===e}function ie(e){const t={...e};return delete t.children,t}var se={validate(){const e=this.form();return e?e.validate():new Promise(e=>e())},validateField(e){const t=this.form();return t?t.validateFields(e):new Promise(e=>e())},clearValidateState(e){const t=this.vm.refs[e.wrapRef];t&&t.clearValidate()},tidyOptions:e=>(["submitBtn","resetBtn","row","info","wrap","col","title"].forEach(t=>{!function(e,t){v(e,t)&&!g.Object(e[t])&&(e[t]={show:!!e[t]})}(e,t)}),e),tidyRule:({prop:e})=>(oe(e,"title"),oe(e,"info"),e),mergeProp(e){const t={info:{type:"popover",placement:"topLeft",icon:"QuestionCircleOutlined"},title:{},col:{span:24},wrap:{}};if(["info","wrap","col","title"].forEach(a=>{e.prop[a]=k([this.options[a]||{},e.prop[a]||{}],t[a])}),"upload"!==e.rule.type||e.prop.props.onPreview){if("upload"===e.rule.type&&e.prop.props.onPreview){const t=e.prop.props.onPreview,a=function(e){window.parent&&window.parent!==window&&window.parent.postMessage({type:"upload-preview",file:{url:e.url,name:e.name,uid:e.uid,size:e.size,type:e.type},timestamp:Date.now()},"*")};e.prop.props.onPreview=function(e){a(e),t&&"function"==typeof t&&t.apply(this,arguments)}}}else{const t=function(e){window.parent&&window.parent!==window&&window.parent.postMessage({type:"upload-preview",file:{url:e.url,name:e.name,uid:e.uid,size:e.size,type:e.type},timestamp:Date.now()},"*")};e.prop.props.onPreview=function(e){t(e)}}},getDefaultOptions:()=>({form:{hideRequiredMark:!1,layout:"horizontal",labelAlign:"right",labelCol:{span:3},wrapperCol:{span:21},validateOnRuleChange:!0},row:{gutter:0},submitBtn:{disabled:!1,loading:!1,type:"primary",innerText:"",show:!1,col:void 0,click:void 0},resetBtn:{disabled:!1,loading:!1,type:"default",innerText:"",show:!1,col:void 0,click:void 0}}),adapterValidate:(e,t)=>(e.validator=(e,a)=>new Promise((e,l)=>t(a,t=>{t?l(t):e()})),e),update(){const e=this.options.form;this.rule={props:{...e},on:{submit:e=>{e.preventDefault()}},style:e.style,type:"form"}},beforeRender(){const{key:e,ref:t,$handle:a}=this,l=this.options.form;C(this.rule,{key:e,ref:t,class:[l.className,l.class,"form-create",this.$handle.preview?"is-preview":""]}),C(this.rule.props,{model:a.formData})},render(e){return e.slotLen()&&!this.$handle.preview&&e.setSlot(void 0,()=>this.makeFormBtn()),this.$r(this.rule,re(this.options.row.show)?e.getSlots():[this.makeRow(e)])},makeWrap(e,t){const a=e.prop,l=`${this.key}${e.key}`,o=a.col,r=this.isTitle(a)&&!1!==a.wrap.title,{layout:i,col:s}=this.rule.props,n=a.wrap.class;delete a.wrap.class,delete a.wrap.title;const c=re(a.wrap.show)?t:this.$r(k([a.wrap,{props:{...ie(a.wrap||{}),hasFeedback:a.hasFeedback||!1,name:e.id,rules:e.injectValidate(),..."horizontal"!==i?{labelCol:{},wrapperCol:{}}:{}},class:this.$render.mergeClass(n||a.className,"fc-form-item"),key:l+"fi",ref:e.wrapRef,type:"formItem"}]),{default:()=>t,...r?{label:()=>this.makeInfo(a,l,e)}:{}});return"inline"===i||re(s)||re(o.show)?c:this.makeCol(a,l,[c])},isTitle(e){if(!1===this.options.form.title)return!1;const t=e.title;return!(!t.title&&!t.native||re(t.show))},makeInfo(e,t,a){var l,o;const r={...e.title},i={...e.info};if(!1===this.options.form.title)return!1;if(!r.title&&!r.native||re(r.show))return;const s="tooltip"===i.type;const n=this.getSlot("title"),c=[n?n({title:null===(l=a.refRule)||void 0===l||null===(l=l.__$title)||void 0===l?void 0:l.value,rule:a.rule,options:this.options}):null===(o=a.refRule)||void 0===o||null===(o=o.__$title)||void 0===o?void 0:o.value];if(!re(i.show)&&(i.info||i.native)&&!re(i.icon)){const e={type:i.type||"popover",props:ie(i),key:t+"pop"};delete e.props.icon,delete e.props.show,delete e.props.info,delete e.props.align,delete e.props.native;const l=s?"title":"content";var d;if(i.info&&!v(e.props,l))e.props[l]=null===(d=a.refRule)||void 0===d||null===(d=d.__$info)||void 0===d?void 0:d.value;c["left"!==i.align?"unshift":"push"](this.$r(k([i,e]),{[r.slot||"default"]:()=>this.$r({type:!0===i.icon?"QuestionCircleOutlined":i.icon||"",props:{type:!0===i.icon?"QuestionCircleOutlined":i.icon},key:t+"i"})}))}const p=k([r,{props:ie(r),key:t+"tit",class:"fc-form-title",type:r.type||"span"}]);return delete p.props.show,delete p.props.title,delete p.props.native,this.$r(p,c)},makeCol(e,t,a){const l=e.col;return this.$r({class:this.$render.mergeClass(l.class,"fc-form-col"),type:"col",props:l||{span:24},key:t+"col"},a)},makeRow(e){const t=this.options.row||{};return this.$r({type:"row",props:t,class:this.$render.mergeClass(t.class,"fc-form-row"),key:this.key+"row"},e)},makeFormBtn(){let e=[];if(re(this.options.submitBtn.show)||e.push(this.makeSubmitBtn()),re(this.options.resetBtn.show)||e.push(this.makeResetBtn()),!e.length)return;let{labelCol:t,wrapperCol:a,layout:l}=this.rule.props;"horizontal"!==l&&(t=a={});const o=this.$r({type:"formItem",class:"fc-form-item fc-form-footer",key:this.key+"fb",props:{labelCol:t,wrapperCol:a,label:" ",colon:!1}},e);return"inline"===l?o:this.$r({type:"col",class:"fc-form-col",props:{span:24},key:this.key+"fc"},[o])},makeResetBtn(){const e={...this.options.resetBtn},t=e.innerText||this.$handle.api.t("reset")||"重置";return delete e.innerText,delete e.click,delete e.col,delete e.show,this.$r({type:"button",props:e,class:"fc-reset-btn",style:{width:e.width,marginLeft:"10px"},on:{click:()=>{const e=this.$handle.api;this.options.resetBtn.click?this.options.resetBtn.click(e):e.resetFields()}},key:this.key+"b2"},[t])},makeSubmitBtn(){const e={...this.options.submitBtn},t=e.innerText||this.$handle.api.t("submit")||"提交";return delete e.innerText,delete e.click,delete e.col,delete e.show,this.$r({type:"button",props:e,class:"fc-submit-btn",style:{width:e.width},on:{click:()=>{const e=this.$handle.api;this.options.submitBtn.click?this.options.submitBtn.click(e):e.submit().catch(()=>{})}},key:this.key+"b1"},[t])}};const ne={};var ce;function de(e,t){return g.Boolean(e)?e={show:e}:g.Undef(e)||g.Object(e)||(e={show:t}),e}function pe(e,t){return{formEl:()=>t.$manager.form(),wrapEl(e){const a=t.getFieldCtx(e);if(a)return t.vm.refs[a.wrapRef]},validate:a=>new Promise((l,o)=>{const r=e.children,i=[t.$manager.validate()];r.filter(e=>!e.isScope).forEach(e=>{i.push(e.validate())}),Promise.all(i).then(()=>{l(!0),a&&a(!0)}).catch(l=>{o(l),a&&a(l),t.vm.emit("validate-fail",l,{api:e}),t.emitEvent("validate-fail",l,{api:e})})}),validateField:(a,l)=>new Promise((o,r)=>{const i=t.getFieldCtx(a);if(!i)return;const s=t.subForm[i.id],n=[t.$manager.validateField(i.id)];P(s).filter(e=>!e.isScope).forEach(e=>{n.push(e.validate())}),Promise.all(n).then(()=>{o(null),l&&l(null)}).catch(o=>{r(o),l&&l(o),t.vm.emit("validate-field-fail",o,{field:a,api:e})})}),clearValidateState(a,l=!0){e.helper.tidyFields(a).forEach(e=>{l&&this.clearSubValidateState(e),t.getCtxs(e).forEach(e=>{t.$manager.clearValidateState(e)})})},clearSubValidateState(a){e.helper.tidyFields(a).forEach(e=>{t.getCtxs(e).forEach(e=>{const a=t.subForm[e.id];a&&(Array.isArray(a)?a.forEach(e=>{e.clearValidateState()}):a&&a.clearValidateState())})})},btn:{loading:(t=!0)=>{e.submitBtnProps({loading:!!t})},disabled:(t=!0)=>{e.submitBtnProps({disabled:!!t})},show:(t=!0)=>{e.submitBtnProps({show:!!t})}},resetBtn:{loading:(t=!0)=>{e.resetBtnProps({loading:!!t})},disabled:(t=!0)=>{e.resetBtnProps({disabled:!!t})},show:(t=!0)=>{e.resetBtnProps({show:!!t})}},submitBtnProps:(a={})=>{let l=de(t.options.submitBtn,!0);C(l,a),t.options.submitBtn=l,e.refreshOptions()},resetBtnProps:(a={})=>{let l=de(t.options.resetBtn,!1);C(l,a),t.options.resetBtn=l,e.refreshOptions()},submit:(a,l)=>new Promise((o,r)=>{(!1===t.options.validateOnSubmit?Promise.resolve():e.validate()).then(()=>{let l=e.formData();t.beforeSubmit(l).then(()=>{g.Function(a)&&S(()=>a(l,e)),g.Function(t.options.onSubmit)&&S(()=>t.options.onSubmit(l,e)),t.vm.emit("submit",l,e),o(l)}).catch(e=>{})}).catch((...t)=>{g.Function(l)&&S(()=>l(e,...t)),r(...t)})}),request:t=>("string"==typeof t&&(t={action:t}),e.fetch(t)),throttle(e,t){let a=0;return function(...l){const o=this,r=Date.now();r-a>=(t||0)&&(a=r,e.call(o,...l))}},debounce(e,t){let a=null;return function(...l){const o=this;null!==a&&clearTimeout(a),a=setTimeout(()=>{e.call(o,...l)},t||0)}}}}!function(e){["treeSelect","upload","frame","autoComplete","cascader","datePicker","frame","inputNumber","inputPassword","radio","rate","switch","rate","slider","timePicker"].reduce((e,t)=>(e[t]=w(t),e),e),e.auto=e.autoComplete,e.number=e.inputNumber,e.time=e.timePicker,e.password=e.inputPassword}(ne),function(e){e.sliderRange=w("slider",{range:!0})}(ne),function(e){const t={frameInputs:["input",0],frameFiles:["file",0],frameImages:["image",0],frameInputOne:["input",1],frameFileOne:["file",1],frameImageOne:["image",1]};Object.keys(t).reduce((e,a)=>(e[a]=w("frame",e=>e.props({type:t[a][0],maxLength:t[a][1]})),e),e),e.frameInput=e.frameInputs,e.frameFile=e.frameFiles,e.frameImage=e.frameImages}(ne),function(e){const t={image:["image",0],file:["file",0],uploadFileOne:["file",1],uploadImageOne:["image",1]};Object.keys(t).reduce((e,a)=>(e[a]=w("upload",e=>e.props({uploadType:t[a][0],maxLength:t[a][1]})),e),e),e.uploadImage=e.image,e.uploadFile=e.file}(ne),(ce=ne).selectMultiple=w("select",{mode:"multiple"}),ce.selectTags=w("select",{mode:"tags"}),ce.selectCombobox=w("select",{mode:"combobox"}),function(e){e.cusStoreSelect=w("cusStoreSelect"),e.storeSelect=e.cusStoreSelect}(ne);var ue={autoComplete:"value",cascader:"value",inputNumber:"value",inputPassword:"value",textarea:"value",rate:"value",slider:"value",treeSelect:"value",switch:"checked",cusStoreSelect:"modelValue"};const me={name:"required",load(e,t,a){const l=function(e){return g.Boolean(e)?{required:e}:g.String(e)?{message:e}:g.Undef(e)?{required:!1}:g.Function(e)?{validator:e}:g.Object(e)?e:{}}(e.getValue());if(!1===l.required)e.clearProp(),a.clearValidateState([t.field]);else{var o;const r={required:!0,validator:(e,t)=>new Promise((e,a)=>{g.empty(t)?a(r.message):e()}),...l},i=null===(o=t.__fc__.refRule)||void 0===o||null===(o=o.__$title)||void 0===o?void 0:o.value;if(r.message){const e=r.message.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);e&&(r.message=a.t(e[1],{title:i}))}else r.message=a.t("required",{title:i})||i+("en"===a.getLocale()?" is required":"不能为空");e.getProp().validate=[r]}a.sync(t)},watch(...e){me.load(...e)}};function he(e){e.componentAlias(le),Object.keys(ue).forEach(t=>{e.setModelField(t,ue[t])}),_.forEach(t=>{e.component(t.name,t)}),e.register(me),ae.forEach(t=>{e.parser(t)}),Object.keys(ne).forEach(t=>{e.maker[t]=ne[t]}),"undefined"!=typeof window&&window.antd&&e.useApp((e,t)=>{t.use(window.antd)})}const fe=b({ui:'"ant-design-vue"',version:'"3.2.47"',manager:se,install:he,extendApi:pe,attrs:{normal:["col","wrap"],array:["className"],key:["title","info"]}});"undefined"!=typeof window&&(window.formCreate=fe);const ye=fe.maker;export{fe as default,ye as maker};
7
+ import e from"@form-create/component-antdv-upload/src/index";import t from"@form-create/component-antdv-frame/src/index";import a from"@form-create/component-antdv-group/src/index";import l from"@form-create/component-subform/src/index";import{openBlock as r,createElementBlock as o,createElementVNode as i,defineComponent as s,Fragment as n,createCommentVNode as c,normalizeClass as d,normalizeStyle as p,toDisplayString as u,renderList as h,resolveComponent as m,createVNode as f,nextTick as y}from"vue";import g,{hasProperty as v}from"@form-create/utils/lib/type";import b,{creatorFactory as w}from"@longhongguo/form-create-core/src/index";import C from"@form-create/utils/lib/mergeprops";import k from"@form-create/utils/lib/extend";import{invoke as S}from"@longhongguo/form-create-core/src/frame/util";import V from"@form-create/utils/lib/toarray";var $={name:"QuestionCircleOutlined"};const P={class:"anticon"};$.render=function(e,t,a,l,s,n){return r(),o("span",P,[...t[0]||(t[0]=[i("svg",{height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[i("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448s448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372s372 166.6 372 372s-166.6 372-372 372z",fill:"currentColor"}),i("path",{d:"M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7c-21.2 8.1-39.2 22.3-52.1 40.9c-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0 1 30.9-44.8c59-22.7 97.1-74.7 97.1-132.5c.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1 0 80 0a40 40 0 1 0-80 0z",fill:"currentColor"})],-1)])])};var O=s({name:"CusSelect",props:{modelValue:{type:Array,default:()=>[]},options:{type:Array,default:()=>[]},multiple:{type:Boolean,default:!1},maxTagCount:{type:Number,default:void 0},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},style:{type:[String,Object],default:()=>({width:"100%"})},valueKey:{type:String,default:"value"},labelKey:{type:String,default:"label"},allowClear:{type:Boolean,default:!1},bordered:{type:Boolean,default:!0}},emits:["update:modelValue","change"],computed:{currentValue:{get(){return Array.isArray(this.modelValue)?this.modelValue.map(e=>"object"!=typeof e||null===e||void 0===e.value&&void 0===e[this.valueKey]?{[this.valueKey]:e,[this.labelKey]:this.getLabel(e)}:e):null===this.modelValue||void 0===this.modelValue||""===this.modelValue?[]:"object"==typeof this.modelValue?[this.modelValue]:[{value:this.modelValue,label:this.getLabel(this.modelValue)}]},set(e){let t=[];null!=e&&(t=Array.isArray(e)?e.map(e=>"object"!=typeof e||null===e||void 0===e.value&&void 0===e[this.valueKey]?{[this.valueKey]:e,[this.labelKey]:this.getLabel(e)}:e):"object"==typeof e&&null!==e?[e]:[{[this.valueKey]:e,[this.labelKey]:this.getLabel(e)}]),this.$emit("update:modelValue",t),this.$emit("change",t)}},hasValue(){const e=this.currentValue;return Array.isArray(e)&&e.length>0},displayValue(){return this.hasValue?this.currentValue[0]:null},displayLabel(){if(!this.displayValue)return"";const e=this.displayValue;return"object"==typeof e&&null!==e?e[this.labelKey]||e.label||String(e[this.valueKey]||e.value||""):this.getLabel(e)},allSelectedItems(){const e=this.currentValue;return Array.isArray(e)&&0!==e.length?e.map(e=>"object"==typeof e&&null!==e?{value:e[this.valueKey]||e.value,label:e[this.labelKey]||e.label||String(e[this.valueKey]||e.value||"")}:{value:e,label:this.getLabel(e)}):[]},displayItems(){const e=this.allSelectedItems;return void 0===this.maxTagCount||null===this.maxTagCount?e:e.slice(0,this.maxTagCount)},remainingCount(){if(void 0===this.maxTagCount||null===this.maxTagCount)return 0;const e=this.allSelectedItems.length;return Math.max(0,e-this.maxTagCount)},showClear(){return this.allowClear&&this.hasValue&&!this.disabled}},methods:{findOptionByValue(e){return this.options&&0!==this.options.length?this.options.find(t=>{const a="object"==typeof t?t[this.valueKey]:t;return a===e||String(a)===String(e)}):null},getLabel(e){const t=this.findOptionByValue(e);return t?"object"==typeof t?t[this.labelKey]:t:String(e)},removeItem(e,t){if(this.disabled)return;t.stopPropagation();const a=this.currentValue;if(Array.isArray(a)){const t=a.filter(t=>{if("object"==typeof t&&null!==t){return(t[this.valueKey]||t.value)!==e}return t!==e});this.currentValue=t}},clearValue(e){this.disabled||(e.stopPropagation(),this.currentValue=[])}}});const F=["tabindex"],x=["title"],A={key:1,class:"fc-cus-select-selection-placeholder"},B={key:3,class:"fc-cus-select-arrow"},K=["tabindex"],I={class:"fc-cus-select-selection-overflow"},j=["title"],T={class:"fc-cus-select-selection-item-content"},E=["onClick"],L={key:0,class:"fc-cus-select-selection-overflow-item",style:{opacity:"1"}},R={class:"fc-cus-select-selection-item"},M={class:"fc-cus-select-selection-item-content"},U={key:1,class:"fc-cus-select-selection-placeholder"},N={key:1,class:"fc-cus-select-arrow"};O.render=function(e,t,a,l,s,m){return r(),o(n,null,[c(" 单个展示模式 "),e.multiple?(r(),o(n,{key:1},[c(" 多个展示模式 "),i("div",{class:d(["fc-cus-select fc-cus-select-multiple",{"fc-cus-select-disabled":e.disabled}]),style:p(e.style),tabindex:e.disabled?-1:0},[i("div",{class:d(["fc-cus-select-selector",{"fc-cus-select-selector-borderless":!e.bordered}])},[i("div",I,[c(" 显示的 tags "),(r(!0),o(n,null,h(e.displayItems,(a,l)=>(r(),o("div",{key:l,class:"fc-cus-select-selection-overflow-item",style:{opacity:"1"}},[i("span",{class:"fc-cus-select-selection-item",title:a.label},[i("span",T,u(a.label),1),i("span",{class:"fc-cus-select-selection-item-remove",onClick:t=>e.removeItem(a.value,t)},[...t[4]||(t[4]=[i("span",{role:"img","aria-label":"close",class:"anticon anticon-close"},[i("svg",{focusable:"false","data-icon":"close",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true","fill-rule":"evenodd",viewBox:"64 64 896 896"},[i("path",{d:"M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z"})])],-1)])],8,E)],8,j)]))),128)),c(" 折叠提示 "),e.remainingCount>0?(r(),o("div",L,[i("span",R,[i("span",M," +"+u(e.remainingCount),1)])])):c("v-if",!0),c(" 空值占位符 "),e.hasValue?c("v-if",!0):(r(),o("span",U,u(e.placeholder||"请选择"),1))]),e.showClear?(r(),o("span",{key:0,class:"fc-cus-select-clear",onClick:t[1]||(t[1]=(...t)=>e.clearValue&&e.clearValue(...t))},[...t[5]||(t[5]=[i("span",{role:"img","aria-label":"close-circle",class:"anticon anticon-close-circle"},[i("svg",{focusable:"false","data-icon":"close-circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true","fill-rule":"evenodd",viewBox:"64 64 896 896"},[i("path",{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"})])],-1)])])):(r(),o("span",N,[...t[6]||(t[6]=[i("span",{role:"img","aria-label":"down",class:"anticon anticon-down"},[i("svg",{focusable:"false","data-icon":"down",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"64 64 896 896"},[i("path",{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"})])],-1)])]))],2)],14,K)],2112)):(r(),o("div",{key:0,class:d(["fc-cus-select fc-cus-select-single",{"fc-cus-select-disabled":e.disabled}]),style:p(e.style),tabindex:e.disabled?-1:0},[i("div",{class:d(["fc-cus-select-selector",{"fc-cus-select-selector-borderless":!e.bordered}])},[e.displayValue?(r(),o("span",{key:0,class:"fc-cus-select-selection-item",title:e.displayLabel},u(e.displayLabel),9,x)):(r(),o("span",A,u(e.placeholder||"请选择"),1)),e.showClear?(r(),o("span",{key:2,class:"fc-cus-select-clear",onClick:t[0]||(t[0]=(...t)=>e.clearValue&&e.clearValue(...t))},[...t[2]||(t[2]=[i("span",{role:"img","aria-label":"close-circle",class:"anticon anticon-close-circle"},[i("svg",{focusable:"false","data-icon":"close-circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true","fill-rule":"evenodd",viewBox:"64 64 896 896"},[i("path",{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"})])],-1)])])):(r(),o("span",B,[...t[3]||(t[3]=[i("span",{role:"img","aria-label":"down",class:"anticon anticon-down"},[i("svg",{focusable:"false","data-icon":"down",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"64 64 896 896"},[i("path",{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"})])],-1)])]))],2)],14,F))],2112)};var z=s({name:"CusStoreSelect",components:{CusSelect:O},props:{formCreateInject:{type:Object,default:null},modelValue:{type:Array,default:()=>[]},options:{type:Array,default:()=>[]},multiple:{type:Boolean,default:!1},maxTagCount:{type:Number,default:void 0},placeholder:{type:String,default:"请选择"},disabled:{type:Boolean,default:!1},style:{type:[String,Object],default:()=>({width:"100%"})},valueKey:{type:String,default:"value"},labelKey:{type:String,default:"label"},allowClear:{type:Boolean,default:!1},field:{type:String,default:""},bordered:{type:Boolean,default:!0}},emits:["update:modelValue","change"],data:()=>({messageId:0,pendingCallbacks:{},internalOptions:[]}),computed:{mergedOptions(){if(this.internalOptions.length>0){const e=new Map;return this.options.forEach(t=>{const a="object"==typeof t?t[this.valueKey]:t;e.set(a,t)}),this.internalOptions.forEach(t=>{const a="object"==typeof t?t[this.valueKey]:t;e.set(a,t)}),Array.from(e.values())}return this.options}},watch:{options:{immediate:!0,handler(e){0===this.internalOptions.length&&Array.isArray(e)&&e.length>0&&(this.internalOptions=[...e])}}},mounted(){window.addEventListener("message",this.handleMessage)},beforeUnmount(){window.removeEventListener("message",this.handleMessage)},methods:{serializeForPostMessage(e){if(null==e)return e;try{return JSON.parse(JSON.stringify(e))}catch(t){if(console.warn("CusStoreSelect: 数据序列化失败,尝试递归处理",t),Array.isArray(e))return 0===e.length?[]:e.map(e=>this.serializeForPostMessage(e));if("object"==typeof e){const t={};for(const a in e)if(Object.prototype.hasOwnProperty.call(e,a))try{t[a]=this.serializeForPostMessage(e[a])}catch(e){console.warn("CusStoreSelect: 跳过无法序列化的属性: "+a,e)}return t}return e}},handleClick(){if(this.disabled)return;const e=`store-select-${this.field||"default"}-${Date.now()}-${++this.messageId}`,t=Array.isArray(this.modelValue)?this.modelValue:[];let a=null;t.length>0&&(a=t);const l=null==a?null:this.serializeForPostMessage(a),r={type:"OPEN_STORE_SELECT",field:this.field||"",multiple:this.multiple,currentValue:l,valueKey:this.valueKey,labelKey:this.labelKey,messageId:e};if(window.parent&&window.parent!==window)try{window.parent.postMessage(r,"*")}catch(e){console.error("CusStoreSelect: 发送消息失败",e)}else console.warn("CusStoreSelect: 当前不在 iframe 环境中,无法向父窗口发送消息");this.pendingCallbacks[e]=(e,t)=>{t&&Array.isArray(t)&&t.length>0&&this.mergeOptions(t),this.handleUpdate(e),this.handleChange(e)}},handleMessage(e){const t=e.data;if(t&&"STORE_SELECT_RESULT"===t.type){const{field:e,value:a,sourceItems:l,messageId:r}=t;if(e!==this.field)return;const o=this.pendingCallbacks[r];o&&(o(a,l),delete this.pendingCallbacks[r])}},mergeOptions(e){if(!Array.isArray(e)||0===e.length)return;const t=new Map;this.internalOptions.forEach(e=>{const a="object"==typeof e?e[this.valueKey]:e;t.set(a,e)}),e.forEach(e=>{const a="object"==typeof e?e[this.valueKey]:e;t.set(a,e)}),this.internalOptions=Array.from(t.values())},handleUpdate(e){this.$emit("update:modelValue",e),this.triggerValidate()},handleChange(e){this.$emit("change",e,this.internalOptions&&this.internalOptions.length>0?this.multiple?this.internalOptions:this.internalOptions[0]:this.multiple?[]:null)},triggerValidate(){this.$nextTick(()=>{this.$nextTick(()=>{try{if(this.formCreateInject&&this.formCreateInject.api&&this.field)return void this.formCreateInject.api.validateField(this.field).catch(()=>{});let e=this.$parent;for(;e;){if(e.$options&&"FormCreate"===e.$options.name&&e.fapi){this.field&&e.fapi.validateField&&e.fapi.validateField(this.field).catch(()=>{});break}e=e.$parent}}catch(e){console.warn("CusStoreSelect: 触发校验失败",e)}})})}}});z.render=function(e,t,a,l,i,s){const n=m("CusSelect");return r(),o("div",{onClick:t[0]||(t[0]=(...t)=>e.handleClick&&e.handleClick(...t))},[f(n,{"model-value":e.modelValue,options:e.mergedOptions,multiple:e.multiple,"max-tag-count":e.maxTagCount,placeholder:e.placeholder,disabled:e.disabled,style:p(e.style),valueKey:e.valueKey,labelKey:e.labelKey,allowClear:e.allowClear,bordered:e.bordered,"onUpdate:modelValue":e.handleUpdate,onChange:e.handleChange},null,8,["model-value","options","multiple","max-tag-count","placeholder","disabled","style","valueKey","labelKey","allowClear","bordered","onUpdate:modelValue","onChange"])])};var Y=s({name:"CusUserSelect",components:{CusSelect:O},props:{formCreateInject:{type:Object,default:null},modelValue:{type:Array,default:()=>[]},options:{type:Array,default:()=>[]},multiple:{type:Boolean,default:!1},maxTagCount:{type:Number,default:void 0},placeholder:{type:String,default:"请选择"},disabled:{type:Boolean,default:!1},style:{type:[String,Object],default:()=>({width:"100%"})},valueKey:{type:String,default:"value"},labelKey:{type:String,default:"label"},allowClear:{type:Boolean,default:!1},field:{type:String,default:""},bordered:{type:Boolean,default:!0}},emits:["update:modelValue","change"],data:()=>({messageId:0,pendingCallbacks:{},internalOptions:[]}),computed:{mergedOptions(){if(this.internalOptions.length>0){const e=new Map;return this.options.forEach(t=>{const a="object"==typeof t?t[this.valueKey]:t;e.set(a,t)}),this.internalOptions.forEach(t=>{const a="object"==typeof t?t[this.valueKey]:t;e.set(a,t)}),Array.from(e.values())}return this.options}},watch:{options:{immediate:!0,handler(e){0===this.internalOptions.length&&Array.isArray(e)&&e.length>0&&(this.internalOptions=[...e])}}},mounted(){window.addEventListener("message",this.handleMessage)},beforeUnmount(){window.removeEventListener("message",this.handleMessage)},methods:{serializeForPostMessage(e){if(null==e)return e;try{return JSON.parse(JSON.stringify(e))}catch(t){if(console.warn("CusUserSelect: 数据序列化失败,尝试递归处理",t),Array.isArray(e))return 0===e.length?[]:e.map(e=>this.serializeForPostMessage(e));if("object"==typeof e){const t={};for(const a in e)if(Object.prototype.hasOwnProperty.call(e,a))try{t[a]=this.serializeForPostMessage(e[a])}catch(e){console.warn("CusUserSelect: 跳过无法序列化的属性: "+a,e)}return t}return e}},handleClick(){if(this.disabled)return;const e=`user-select-${this.field||"default"}-${Date.now()}-${++this.messageId}`,t=Array.isArray(this.modelValue)?this.modelValue:[];let a=null;t.length>0&&(a=t);const l=null==a?null:this.serializeForPostMessage(a),r={type:"OPEN_USER_SELECT",field:this.field||"",multiple:this.multiple,currentValue:l,valueKey:this.valueKey,labelKey:this.labelKey,messageId:e};if(window.parent&&window.parent!==window)try{window.parent.postMessage(r,"*")}catch(e){console.error("CusUserSelect: 发送消息失败",e)}else console.warn("CusUserSelect: 当前不在 iframe 环境中,无法向父窗口发送消息");this.pendingCallbacks[e]=(e,t)=>{t&&Array.isArray(t)&&t.length>0&&this.mergeOptions(t),this.handleUpdate(e),this.handleChange(e)}},handleMessage(e){const t=e.data;if(t&&"USER_SELECT_RESULT"===t.type){const{field:e,value:a,sourceItems:l,messageId:r}=t;if(e!==this.field)return;const o=this.pendingCallbacks[r];o&&(o(a,l),delete this.pendingCallbacks[r])}},mergeOptions(e){if(!Array.isArray(e)||0===e.length)return;const t=new Map;this.internalOptions.forEach(e=>{const a="object"==typeof e?e[this.valueKey]:e;t.set(a,e)}),e.forEach(e=>{const a="object"==typeof e?e[this.valueKey]:e;t.set(a,e)}),this.internalOptions=Array.from(t.values())},handleUpdate(e){this.$emit("update:modelValue",e),this.triggerValidate()},handleChange(e){this.$emit("change",e,this.internalOptions&&this.internalOptions.length>0?this.multiple?this.internalOptions:this.internalOptions[0]:this.multiple?[]:null)},triggerValidate(){this.$nextTick(()=>{this.$nextTick(()=>{try{if(this.formCreateInject&&this.formCreateInject.api&&this.field)return void this.formCreateInject.api.validateField(this.field).catch(()=>{});let e=this.$parent;for(;e;){if(e.$options&&"FormCreate"===e.$options.name&&e.fapi){this.field&&e.fapi.validateField&&e.fapi.validateField(this.field).catch(()=>{});break}e=e.$parent}}catch(e){console.warn("CusUserSelect: 触发校验失败",e)}})})}}});Y.render=function(e,t,a,l,i,s){const n=m("CusSelect");return r(),o("div",{onClick:t[0]||(t[0]=(...t)=>e.handleClick&&e.handleClick(...t))},[f(n,{"model-value":e.modelValue,options:e.mergedOptions,multiple:e.multiple,"max-tag-count":e.maxTagCount,placeholder:e.placeholder,disabled:e.disabled,style:p(e.style),valueKey:e.valueKey,labelKey:e.labelKey,allowClear:e.allowClear,bordered:e.bordered,"onUpdate:modelValue":e.handleUpdate,onChange:e.handleChange},null,8,["model-value","options","multiple","max-tag-count","placeholder","disabled","style","valueKey","labelKey","allowClear","bordered","onUpdate:modelValue","onChange"])])};var _=[e,t,a,l,$,O,z,Y],D={name:"checkbox",modelField:"value",mergeProp(e){const t=e.prop.props;v(t,"options")||(t.options=e.prop.options||[])}},q={...D,name:"radio"},Q={...D,name:"select",mergeProp(e){const t=e.prop.props;v(t,"options")||(t.options=e.prop.options||[]);const a=e.effectData("fetch");a&&!0===a.loading&&(t.disabled=!0,t.loading=!0)},render(e,t){const a=t.effectData("fetch");if(a&&!0===a.loading&&e.loading){const a={...e};return a.notFoundContent=e.loading,t.$render.defaultRender(t,a)}return t.$render.defaultRender(t,e)}},G={name:"cascader",mergeProp(e){const t=e.prop.props;v(t,"options")||(t.options=e.prop.options||[]);const a=e.effectData("fetch");a&&!0===a.loading&&(t.disabled=!0,t.loading=!0)},render(e,t){const a=t.effectData("fetch");if(a&&!0===a.loading&&e.loading){const a={...e};return a.notFoundContent=e.loading,t.$render.defaultRender(t,a)}return t.$render.defaultRender(t,e)}};const H={date:"YYYY-MM-DD",month:"YYYY-MM",week:"YYYY-wo",quarter:"YYYY-qQ",year:"YYYY"},J="datePicker";var W={name:J,maker:["date","month","week"].reduce((e,t)=>(e[t]=w(J,{type:t}),e),{dateRange:w(J,{type:"range"}),datetimeRange:w(J,e=>e.props({type:"range",showTime:!0}))}),modelField:"value",mergeProp(e){const t=e.prop.props,a=t.type||t.picker;t.valueFormat||(t.valueFormat=(H[a]||H.date)+(!t.showTime||a&&"date"!==a?"":" HH:mm:ss"))},render:(e,t)=>t.$render.vNode[(!0===t.prop.props.range?"range":"date")+"Picker"](t.prop,e)};var X={name:"hidden",maker:{hidden:(e,t)=>w("hidden")("",e,t)},render:()=>[]};var Z={name:"input",maker:["password","url","email","text","textarea","search"].reduce((e,t)=>(e[t]=w("input",{type:t}),e),{idate:w("input",{type:"date"})}),modelField:"value",render(e,t){let a=t.prop.props.type;return-1===["textarea","search","password"].indexOf(a)&&(a="input"),a={textarea:"aTextarea",search:"aInputSearch",password:"aInputPassword"}[a]||"aInput",t.$render.vNode.make(a,t.prop,e)}},ee={name:"timePicker",modelField:"value",mergeProp(e){const t=e.prop.props;t.valueFormat||(t.valueFormat="HH:mm:ss")},render:(e,t)=>t.$render.vNode["time"+(!0===t.prop.props.range?"Range":"")+"Picker"](t.prop,e)},te={name:"tree",modelField:"checkedKeys",mergeProp(e){const t=e.prop.props;t.fieldNames?t.fieldNames.key||(t.fieldNames.key="id"):t.fieldNames={key:"id"},t.checkedKeys=e.rule.value,t.checkable=!0}},ae={name:"FcRow",render:(e,t)=>t.vNode.col({props:{span:24}},{default:()=>[t.vNode.row(t.prop,e)]})};var le=[D,W,{...W,name:"rangePicker",maker:{},render:(e,t)=>t.$render.vNode.rangePicker(t.prop,e)},X,Z,ee,{...ee,name:"timeRangePicker",render:(e,t)=>t.$render.vNode.timeRangePicker(t.prop,e)},te,q,Q,G,ae,{name:"cusStoreSelect",modelField:"modelValue",toFormValue:(e,t)=>null==e||""===e?[]:Array.isArray(e)?e.map(e=>("object"!=typeof e||null===e||void 0===e.value&&e.label,e)):[e],toValue:(e,t)=>e,mergeProp(e){const t=e.prop.props;if(v(t,"options")||(t.options=e.prop.options||[]),v(t,"field")||(t.field=e.rule.field||""),void 0!==e.rule.value){const t=e.rule.value;null==t||""===t?e.rule.value=[]:Array.isArray(t)||(e.rule.value=[t])}},render(e,t){const a=t.$render.defaultRender(t,e);if(a&&a.props&&a.props.on){const e=a.props.on["update:modelValue"],l=()=>{y(()=>{y(()=>{try{const e=t.rule.field;if(e)return void t.$handle.api.validateField(e).catch(()=>{});const a=t.$handle.getFieldCtx(t.rule.field);a&&a.id&&t.$handle.$manager.validateField(a.id).catch(()=>{})}catch(e){console.warn("CusStoreSelect: 触发校验失败",e)}})})};a.props.on["update:modelValue"]=(...t)=>{e&&e(...t),l()};const r=a.props.on.change;a.props.on.change=r?(...e)=>{r(...e),l()}:l}return a}},{name:"cusUserSelect",modelField:"modelValue",toFormValue:(e,t)=>null==e||""===e?[]:Array.isArray(e)?e.map(e=>("object"!=typeof e||null===e||void 0===e.value&&e.label,e)):[e],toValue:(e,t)=>e,mergeProp(e){const t=e.prop.props;if(v(t,"options")||(t.options=e.prop.options||[]),v(t,"field")||(t.field=e.rule.field||""),v(t,"formCreateInject")||(t.formCreateInject=e.inject),void 0!==e.rule.value){const t=e.rule.value;null==t||""===t?e.rule.value=[]:Array.isArray(t)||(e.rule.value=[t])}},render(e,t){const a=t.$render.defaultRender(t,e);if(a&&a.props&&a.props.on){const e=a.props.on["update:modelValue"],l=()=>{y(()=>{y(()=>{try{const e=t.rule.field;if(e)return void t.$handle.api.validateField(e).catch(()=>{});const a=t.$handle.getFieldCtx(t.rule.field);a&&a.id&&t.$handle.$manager.validateField(a.id).catch(()=>{})}catch(e){console.warn("CusUserSelect: 触发校验失败",e)}})})};a.props.on["update:modelValue"]=(...t)=>{e&&e(...t),l()};const r=a.props.on.change;a.props.on.change=r?(...e)=>{r(...e),l()}:l}return a}}];var re={tooltip:"aTooltip",popover:"aPopover",button:"aButton",icon:"aIcon",slider:"aSlider",rate:"aRate",upload:"fcUpload",cascader:"aCascader",timePicker:"aTimePicker",timeRangePicker:"aTimeRangePicker",datePicker:"aDatePicker",rangePicker:"aRangePicker",switch:"aSwitch",select:"aSelect",checkbox:"aCheckboxGroup",radio:"aRadioGroup",input:"aInput",inputNumber:"aInputNumber",treeSelect:"aTreeSelect",search:"aInputSearch",inputPassword:"aInputPassword",textarea:"aTextarea",formItem:"aFormItem",form:"aForm",frame:"fcFrame",col:"aCol",row:"aRow",tree:"aTree",autoComplete:"aAutoComplete",transfer:"aTransfer",group:"fcGroup",array:"fcGroup",subForm:"fcSubForm",object:"fcSubForm"};function oe(e,t){v(e,t)&&g.String(e[t])&&(e[t]={[t]:e[t],show:!0})}function ie(e){return!1===e}function se(e){const t={...e};return delete t.children,t}var ne={validate(){const e=this.form();return e?e.validate():new Promise(e=>e())},validateField(e){const t=this.form();return t?t.validateFields(e):new Promise(e=>e())},clearValidateState(e){const t=this.vm.refs[e.wrapRef];t&&t.clearValidate()},tidyOptions:e=>(["submitBtn","resetBtn","row","info","wrap","col","title"].forEach(t=>{!function(e,t){v(e,t)&&!g.Object(e[t])&&(e[t]={show:!!e[t]})}(e,t)}),e),tidyRule:({prop:e})=>(oe(e,"title"),oe(e,"info"),e),mergeProp(e){const t={info:{type:"popover",placement:"topLeft",icon:"QuestionCircleOutlined"},title:{},col:{span:24},wrap:{}};if(["info","wrap","col","title"].forEach(a=>{e.prop[a]=C([this.options[a]||{},e.prop[a]||{}],t[a])}),"upload"!==e.rule.type||e.prop.props.onPreview){if("upload"===e.rule.type&&e.prop.props.onPreview){const t=e.prop.props.onPreview,a=function(e){window.parent&&window.parent!==window&&window.parent.postMessage({type:"upload-preview",file:{url:e.url,name:e.name,uid:e.uid,size:e.size,type:e.type},timestamp:Date.now()},"*")};e.prop.props.onPreview=function(e){a(e),t&&"function"==typeof t&&t.apply(this,arguments)}}}else{const t=function(e){window.parent&&window.parent!==window&&window.parent.postMessage({type:"upload-preview",file:{url:e.url,name:e.name,uid:e.uid,size:e.size,type:e.type},timestamp:Date.now()},"*")};e.prop.props.onPreview=function(e){t(e)}}},getDefaultOptions:()=>({form:{hideRequiredMark:!1,layout:"horizontal",labelAlign:"right",labelCol:{span:3},wrapperCol:{span:21},validateOnRuleChange:!0},row:{gutter:0},submitBtn:{disabled:!1,loading:!1,type:"primary",innerText:"",show:!1,col:void 0,click:void 0},resetBtn:{disabled:!1,loading:!1,type:"default",innerText:"",show:!1,col:void 0,click:void 0}}),adapterValidate:(e,t)=>(e.validator=(e,a)=>new Promise((e,l)=>t(a,t=>{t?l(t):e()})),e),update(){const e=this.options.form;this.rule={props:{...e},on:{submit:e=>{e.preventDefault()}},style:e.style,type:"form"}},beforeRender(){const{key:e,ref:t,$handle:a}=this,l=this.options.form;k(this.rule,{key:e,ref:t,class:[l.className,l.class,"form-create",this.$handle.preview?"is-preview":""]}),k(this.rule.props,{model:a.formData})},render(e){return e.slotLen()&&!this.$handle.preview&&e.setSlot(void 0,()=>this.makeFormBtn()),this.$r(this.rule,ie(this.options.row.show)?e.getSlots():[this.makeRow(e)])},makeWrap(e,t){const a=e.prop,l=`${this.key}${e.key}`,r=a.col,o=this.isTitle(a)&&!1!==a.wrap.title,{layout:i,col:s}=this.rule.props,n=a.wrap.class;delete a.wrap.class,delete a.wrap.title;const c=ie(a.wrap.show)?t:this.$r(C([a.wrap,{props:{...se(a.wrap||{}),hasFeedback:a.hasFeedback||!1,name:e.id,rules:e.injectValidate(),..."horizontal"!==i?{labelCol:{},wrapperCol:{}}:{}},class:this.$render.mergeClass(n||a.className,"fc-form-item"),key:l+"fi",ref:e.wrapRef,type:"formItem"}]),{default:()=>t,...o?{label:()=>this.makeInfo(a,l,e)}:{}});return"inline"===i||ie(s)||ie(r.show)?c:this.makeCol(a,l,[c])},isTitle(e){if(!1===this.options.form.title)return!1;const t=e.title;return!(!t.title&&!t.native||ie(t.show))},makeInfo(e,t,a){var l,r;const o={...e.title},i={...e.info};if(!1===this.options.form.title)return!1;if(!o.title&&!o.native||ie(o.show))return;const s="tooltip"===i.type;const n=this.getSlot("title"),c=[n?n({title:null===(l=a.refRule)||void 0===l||null===(l=l.__$title)||void 0===l?void 0:l.value,rule:a.rule,options:this.options}):null===(r=a.refRule)||void 0===r||null===(r=r.__$title)||void 0===r?void 0:r.value];if(!ie(i.show)&&(i.info||i.native)&&!ie(i.icon)){const e={type:i.type||"popover",props:se(i),key:t+"pop"};delete e.props.icon,delete e.props.show,delete e.props.info,delete e.props.align,delete e.props.native;const l=s?"title":"content";var d;if(i.info&&!v(e.props,l))e.props[l]=null===(d=a.refRule)||void 0===d||null===(d=d.__$info)||void 0===d?void 0:d.value;c["left"!==i.align?"unshift":"push"](this.$r(C([i,e]),{[o.slot||"default"]:()=>this.$r({type:!0===i.icon?"QuestionCircleOutlined":i.icon||"",props:{type:!0===i.icon?"QuestionCircleOutlined":i.icon},key:t+"i"})}))}const p=C([o,{props:se(o),key:t+"tit",class:"fc-form-title",type:o.type||"span"}]);return delete p.props.show,delete p.props.title,delete p.props.native,this.$r(p,c)},makeCol(e,t,a){const l=e.col;return this.$r({class:this.$render.mergeClass(l.class,"fc-form-col"),type:"col",props:l||{span:24},key:t+"col"},a)},makeRow(e){const t=this.options.row||{};return this.$r({type:"row",props:t,class:this.$render.mergeClass(t.class,"fc-form-row"),key:this.key+"row"},e)},makeFormBtn(){let e=[];if(ie(this.options.submitBtn.show)||e.push(this.makeSubmitBtn()),ie(this.options.resetBtn.show)||e.push(this.makeResetBtn()),!e.length)return;let{labelCol:t,wrapperCol:a,layout:l}=this.rule.props;"horizontal"!==l&&(t=a={});const r=this.$r({type:"formItem",class:"fc-form-item fc-form-footer",key:this.key+"fb",props:{labelCol:t,wrapperCol:a,label:" ",colon:!1}},e);return"inline"===l?r:this.$r({type:"col",class:"fc-form-col",props:{span:24},key:this.key+"fc"},[r])},makeResetBtn(){const e={...this.options.resetBtn},t=e.innerText||this.$handle.api.t("reset")||"重置";return delete e.innerText,delete e.click,delete e.col,delete e.show,this.$r({type:"button",props:e,class:"fc-reset-btn",style:{width:e.width,marginLeft:"10px"},on:{click:()=>{const e=this.$handle.api;this.options.resetBtn.click?this.options.resetBtn.click(e):e.resetFields()}},key:this.key+"b2"},[t])},makeSubmitBtn(){const e={...this.options.submitBtn},t=e.innerText||this.$handle.api.t("submit")||"提交";return delete e.innerText,delete e.click,delete e.col,delete e.show,this.$r({type:"button",props:e,class:"fc-submit-btn",style:{width:e.width},on:{click:()=>{const e=this.$handle.api;this.options.submitBtn.click?this.options.submitBtn.click(e):e.submit().catch(()=>{})}},key:this.key+"b1"},[t])}};const ce={};var de;function pe(e,t){return g.Boolean(e)?e={show:e}:g.Undef(e)||g.Object(e)||(e={show:t}),e}function ue(e,t){return{formEl:()=>t.$manager.form(),wrapEl(e){const a=t.getFieldCtx(e);if(a)return t.vm.refs[a.wrapRef]},validate:a=>new Promise((l,r)=>{const o=e.children,i=[t.$manager.validate()];o.filter(e=>!e.isScope).forEach(e=>{i.push(e.validate())}),Promise.all(i).then(()=>{l(!0),a&&a(!0)}).catch(l=>{r(l),a&&a(l),t.vm.emit("validate-fail",l,{api:e}),t.emitEvent("validate-fail",l,{api:e})})}),validateField:(a,l)=>new Promise((r,o)=>{const i=t.getFieldCtx(a);if(!i)return;const s=t.subForm[i.id],n=[t.$manager.validateField(i.id)];V(s).filter(e=>!e.isScope).forEach(e=>{n.push(e.validate())}),Promise.all(n).then(()=>{r(null),l&&l(null)}).catch(r=>{o(r),l&&l(r),t.vm.emit("validate-field-fail",r,{field:a,api:e})})}),clearValidateState(a,l=!0){e.helper.tidyFields(a).forEach(e=>{l&&this.clearSubValidateState(e),t.getCtxs(e).forEach(e=>{t.$manager.clearValidateState(e)})})},clearSubValidateState(a){e.helper.tidyFields(a).forEach(e=>{t.getCtxs(e).forEach(e=>{const a=t.subForm[e.id];a&&(Array.isArray(a)?a.forEach(e=>{e.clearValidateState()}):a&&a.clearValidateState())})})},btn:{loading:(t=!0)=>{e.submitBtnProps({loading:!!t})},disabled:(t=!0)=>{e.submitBtnProps({disabled:!!t})},show:(t=!0)=>{e.submitBtnProps({show:!!t})}},resetBtn:{loading:(t=!0)=>{e.resetBtnProps({loading:!!t})},disabled:(t=!0)=>{e.resetBtnProps({disabled:!!t})},show:(t=!0)=>{e.resetBtnProps({show:!!t})}},submitBtnProps:(a={})=>{let l=pe(t.options.submitBtn,!0);k(l,a),t.options.submitBtn=l,e.refreshOptions()},resetBtnProps:(a={})=>{let l=pe(t.options.resetBtn,!1);k(l,a),t.options.resetBtn=l,e.refreshOptions()},submit:(a,l)=>new Promise((r,o)=>{(!1===t.options.validateOnSubmit?Promise.resolve():e.validate()).then(()=>{let l=e.formData();t.beforeSubmit(l).then(()=>{g.Function(a)&&S(()=>a(l,e)),g.Function(t.options.onSubmit)&&S(()=>t.options.onSubmit(l,e)),t.vm.emit("submit",l,e),r(l)}).catch(e=>{})}).catch((...t)=>{g.Function(l)&&S(()=>l(e,...t)),o(...t)})}),request:t=>("string"==typeof t&&(t={action:t}),e.fetch(t)),throttle(e,t){let a=0;return function(...l){const r=this,o=Date.now();o-a>=(t||0)&&(a=o,e.call(r,...l))}},debounce(e,t){let a=null;return function(...l){const r=this;null!==a&&clearTimeout(a),a=setTimeout(()=>{e.call(r,...l)},t||0)}}}}!function(e){["treeSelect","upload","frame","autoComplete","cascader","datePicker","frame","inputNumber","inputPassword","radio","rate","switch","rate","slider","timePicker"].reduce((e,t)=>(e[t]=w(t),e),e),e.auto=e.autoComplete,e.number=e.inputNumber,e.time=e.timePicker,e.password=e.inputPassword}(ce),function(e){e.sliderRange=w("slider",{range:!0})}(ce),function(e){const t={frameInputs:["input",0],frameFiles:["file",0],frameImages:["image",0],frameInputOne:["input",1],frameFileOne:["file",1],frameImageOne:["image",1]};Object.keys(t).reduce((e,a)=>(e[a]=w("frame",e=>e.props({type:t[a][0],maxLength:t[a][1]})),e),e),e.frameInput=e.frameInputs,e.frameFile=e.frameFiles,e.frameImage=e.frameImages}(ce),function(e){const t={image:["image",0],file:["file",0],uploadFileOne:["file",1],uploadImageOne:["image",1]};Object.keys(t).reduce((e,a)=>(e[a]=w("upload",e=>e.props({uploadType:t[a][0],maxLength:t[a][1]})),e),e),e.uploadImage=e.image,e.uploadFile=e.file}(ce),(de=ce).selectMultiple=w("select",{mode:"multiple"}),de.selectTags=w("select",{mode:"tags"}),de.selectCombobox=w("select",{mode:"combobox"}),function(e){e.cusStoreSelect=w("cusStoreSelect"),e.storeSelect=e.cusStoreSelect}(ce),function(e){e.cusUserSelect=w("cusUserSelect"),e.userSelect=e.cusUserSelect}(ce);var he={autoComplete:"value",cascader:"value",inputNumber:"value",inputPassword:"value",textarea:"value",rate:"value",slider:"value",treeSelect:"value",switch:"checked",cusStoreSelect:"modelValue",cusUserSelect:"modelValue"};const me={name:"required",load(e,t,a){const l=function(e){return g.Boolean(e)?{required:e}:g.String(e)?{message:e}:g.Undef(e)?{required:!1}:g.Function(e)?{validator:e}:g.Object(e)?e:{}}(e.getValue());if(!1===l.required)e.clearProp(),a.clearValidateState([t.field]);else{var r;const o={required:!0,validator:(e,t)=>new Promise((e,a)=>{g.empty(t)?a(o.message):e()}),...l},i=null===(r=t.__fc__.refRule)||void 0===r||null===(r=r.__$title)||void 0===r?void 0:r.value;if(o.message){const e=o.message.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);e&&(o.message=a.t(e[1],{title:i}))}else o.message=a.t("required",{title:i})||i+("en"===a.getLocale()?" is required":"不能为空");e.getProp().validate=[o]}a.sync(t)},watch(...e){me.load(...e)}};function fe(e){e.componentAlias(re),Object.keys(he).forEach(t=>{e.setModelField(t,he[t])}),_.forEach(t=>{e.component(t.name,t)}),e.register(me),le.forEach(t=>{e.parser(t)}),Object.keys(ce).forEach(t=>{e.maker[t]=ce[t]}),"undefined"!=typeof window&&window.antd&&e.useApp((e,t)=>{t.use(window.antd)})}const ye=b({ui:'"ant-design-vue"',version:'"3.2.48"',manager:ne,install:fe,extendApi:ue,attrs:{normal:["col","wrap"],array:["className"],key:["title","info"]}});"undefined"!=typeof window&&(window.formCreate=ye);const ge=ye.maker;export{ye as default,ge as maker};
8
8
  //# sourceMappingURL=form-create.esm.js.map