cnhis-design-vue 3.1.41-release.3 → 3.1.41-release.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/button-print/src/utils/print.d.ts +1 -1
- package/es/components/button-print/src/utils/print.js +1 -1
- package/es/components/form-config/index.d.ts +7 -2
- package/es/components/form-config/src/FormConfig.vue.d.ts +7 -2
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +1 -1
- package/es/components/form-config/src/components/FormConfigDragDisplay.vue.js +1 -1
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +4 -1
- package/es/components/form-config/src/components/renderer/DefaultNode.vue.js +1 -1
- package/es/components/form-config/src/hooks/useConfigurationField.js +1 -1
- package/es/components/form-config/src/hooks/useSortalbeConfig.js +1 -1
- package/es/components/form-config/src/types/index.d.ts +1 -0
- package/es/components/form-render/index.d.ts +1 -1
- package/es/components/form-render/index.js +1 -1
- package/es/components/form-render/src/FormRender.vue.d.ts +1 -1
- package/es/components/form-render/src/FormRender.vue.js +1 -1
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +1 -1
- package/es/components/form-render/src/components/renderer/formItem.js +1 -1
- package/es/components/form-render/src/components/renderer/radio_checkbox.js +1 -1
- package/es/components/form-render/src/hooks/useComplexOptions.d.ts +2 -6
- package/es/components/form-render/src/hooks/useComplexOptions.js +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/form-render/src/hooks/useFormEvent.d.ts +1 -1
- package/es/components/form-render/src/hooks/useFormEvent.js +1 -1
- package/es/components/form-render/src/hooks/useFormField.d.ts +1 -0
- package/es/components/form-render/src/hooks/useFormField.js +1 -1
- package/es/components/form-render/src/hooks/useFormValidator.js +1 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +4 -0
- package/es/components/form-render/src/types/index.d.ts +1 -1
- package/es/components/form-render/src/utils/dom.d.ts +2 -1
- package/es/components/form-render/src/utils/dom.js +1 -1
- package/es/components/iho-table/index.d.ts +3 -3
- package/es/components/iho-table/index.js +1 -1
- package/es/components/iho-table/src/IhoTable.vue.d.ts +3 -3
- package/es/components/iho-table/src/constants/index.d.ts +2 -2
- package/es/components/iho-table/src/hooks/tapHooks/useEventHooks.d.ts +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/colorRendererPlugin.js +1 -1
- package/es/components/index.css +1 -1
- package/es/components/index.js +1 -1
- package/es/components/recommend-search/index.d.ts +10 -10
- package/es/components/recommend-search/src/RecommendSearch.vue.d.ts +10 -10
- package/es/components/recommend-search/src/components/BaseSearch.vue.d.ts +2 -2
- package/es/components/recommend-search/src/components/RecommendInput.vue.d.ts +4 -4
- package/es/components/recommend-search/src/components/RecommendSelect.vue.d.ts +4 -4
- package/es/components/scale-view/src/components/formitem/text-over-tooltip/TextOverTooltip.vue.d.ts +1 -1
- package/es/components/shortcut-setter/index.d.ts +2 -1
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +2 -1
- package/es/components/steps-wheel/index.d.ts +1 -1
- package/es/components/steps-wheel/src/StepsWheel.vue.d.ts +1 -1
- package/es/components/table-filter/index.d.ts +905 -7553
- package/es/components/table-filter/index.js +1 -1
- package/es/components/table-filter/src/base-search-com/BaseSearch.vue.d.ts +42 -3315
- package/es/components/table-filter/src/base-search-com/BaseSearch.vue.js +1 -1
- package/es/components/table-filter/src/classification/Classification-com.vue.d.ts +456 -2790
- package/es/components/table-filter/src/classification/Classification-com.vue.js +1 -1
- package/es/components/table-filter/src/components/button-group/ButtonGroup.vue.d.ts +2 -2
- package/es/components/table-filter/src/components/classify-filter/hooks/useFilterConditions.d.ts +1 -42
- package/es/components/table-filter/src/components/classify-filter/hooks/useFilterConditions.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +18 -5
- package/es/components/table-filter/src/components/classify-filter/index.vue.js +1 -1
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.js +1 -1
- package/es/components/table-filter/src/components/search-filter/index.vue.d.ts +456 -0
- package/es/components/table-filter/src/components/search-filter/index.vue.js +1 -0
- package/es/components/table-filter/src/components/{search-modal/set-classification.vue.d.ts → set-classification/index.vue.d.ts} +21 -813
- package/es/components/table-filter/src/components/set-classification/index.vue.js +1 -0
- package/es/components/table-filter/src/components/table-modal/index.vue.js +1 -0
- package/es/components/table-filter/src/const/dataOptions.d.ts +1 -25
- package/es/components/table-filter/src/const/dataOptions.js +1 -1
- package/es/components/table-filter/src/hooks/export.js +1 -1
- package/es/components/table-filter/src/hooks/useAdvanced.d.ts +2 -2
- package/es/components/table-filter/src/hooks/useAdvanced.js +1 -1
- package/es/components/table-filter/src/hooks/useMixins.d.ts +1 -1
- package/es/components/table-filter/src/hooks/useMixins.js +1 -1
- package/es/components/table-filter/src/quick-search/QuickSearch.vue.d.ts +48 -1137
- package/es/components/table-filter/src/quick-search/QuickSearch.vue.js +1 -1
- package/es/components/table-filter/src/types/index.d.ts +4 -14
- package/es/components/table-filter/style/index.css +1 -1
- package/es/shared/components/TextOverTooltip/TextOverTooltip.vue.d.ts +1 -1
- package/package.json +1 -1
- package/es/components/table-filter/src/classification/search-class-name.vue.d.ts +0 -90
- package/es/components/table-filter/src/classification/search-class-name.vue.js +0 -1
- package/es/components/table-filter/src/classification/search-professional-model.vue.d.ts +0 -1472
- package/es/components/table-filter/src/classification/search-professional-model.vue.js +0 -1
- package/es/components/table-filter/src/components/age-com/index.vue.js +0 -1
- package/es/components/table-filter/src/components/button-group/ButtonGroup.vue.js +0 -1
- package/es/components/table-filter/src/components/c-tree-select/tree-select.vue.js +0 -1
- package/es/components/table-filter/src/components/multi-select/multi-select.vue.js +0 -1
- package/es/components/table-filter/src/components/out-quick-search/out-quick-search.vue.js +0 -1
- package/es/components/table-filter/src/components/range-age/index.vue.js +0 -1
- package/es/components/table-filter/src/components/search-condition/SearchCondition.vue.d.ts +0 -789
- package/es/components/table-filter/src/components/search-condition/SearchCondition.vue.js +0 -1
- package/es/components/table-filter/src/components/search-condition/fieldTypeList.d.ts +0 -18
- package/es/components/table-filter/src/components/search-condition/fieldTypeList.js +0 -1
- package/es/components/table-filter/src/components/search-filter/SearchFilter.vue.d.ts +0 -1244
- package/es/components/table-filter/src/components/search-filter/SearchFilter.vue.js +0 -1
- package/es/components/table-filter/src/components/search-modal/set-classification.vue.js +0 -1
- package/es/components/table-filter/src/components/table-modal/TableModal.vue.js +0 -1
- /package/es/components/table-filter/src/components/table-modal/{TableModal.vue.d.ts → index.vue.d.ts} +0 -0
|
@@ -42,7 +42,7 @@ export declare class Print {
|
|
|
42
42
|
_queryPrintFile(formatId: string, params?: string): Promise<any>;
|
|
43
43
|
_browserPrint(result: AnyObject, mode: string): Promise<string | void>;
|
|
44
44
|
preview({ templateId, formatId, params, btnprint }: AnyObject, successCallbackFn?: Func, errorCallbackFn?: Func): Promise<any>;
|
|
45
|
-
printDirect({ templateId, formatId, params, print, printdlgshow, nobillnode }: AnyObject, successCallbackFn: Func, errorCallbackFn: Func, mode?: string): Promise<any>;
|
|
45
|
+
printDirect({ templateId, formatId, params, print, printdlgshow, nobillnode, isDownloadFile }: AnyObject, successCallbackFn: Func, errorCallbackFn: Func, mode?: string): Promise<any>;
|
|
46
46
|
private _downloadPDF;
|
|
47
47
|
/**
|
|
48
48
|
* 下载pdf
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"axios";import{isArray as e}from"lodash-es";import{IdentityVerificationDialog as i,PreviewDialog as n}from"./dialog.js";import{getFileUrl as s,useBrowserPrint as r,isIReport as a}from"./browserPrint.js";import{getCurrentInstance as o}from"vue";import{format as l}from"date-fns";const d=t.create({timeout:1e3,withCredentials:!1}),h=t.create({withCredentials:!1}),c=`${window.location.protocol}//${window.location.host}`,p=`${c}/fdp-api/print/assembly/printIReport`,u=`${c}/bi-api/reprot/print/open/client/getRemote`,m=`${c}/printService/file`;let w=null;class f{constructor(){var t;if(this.webview=null,this.dialog=new i,this.dialogPreview=new n,this.instance=null,this.downloadPath="",this.printOrigin="http://127.0.0.1:11111",this.isRemote=!1,this.messageHandlerQueue=[],w)return w;w=this;const e=window;this.webview=null==(t=e.chrome)?void 0:t.webview,this.webview&&(this.currentMessageHandler=this.messageHandler.bind(this),this.webview.addEventListener("message",this.currentMessageHandler),this.postMessage({exec:"config",data:""}))}messageHandler(t){var e;const i=this.messageHandlerQueue.shift();if(!i)return console.log("当前回执",t,"没有可用的handler");const{resolve:n,reject:s}=i;try{const{exec:i}=JSON.parse(t.data);"config"===i&&(this.downloadPath=(null==(e=JSON.parse(t.data).res)?void 0:e.downloadpath)||""),console.log(t),n(JSON.parse(t.data).res)}catch(t){s(t)}}async postMessage(t){return this.webview?new Promise(((e,i)=>{this.messageHandlerQueue.push({resolve:e,reject:i}),this.webview.postMessage(t)})):Promise.reject()}destroy(){this.webview&&this.currentMessageHandler&&(this.webview.removeEventListener("message",this.currentMessageHandler),this.currentMessageHandler=void 0)}show(...t){return this.dialog.show(...t)}showPreview(...t){return this.dialogPreview.show(...t)}_testConnection(){return this.webview?Promise.resolve(!0):new Promise((t=>{d({url:`${this.printOrigin}/test`,method:"get",withCredentials:!1,params:{inputdata:{result:"success"}}}).then((({data:e})=>{"success"===e.result?t(!0):t(!1)})).catch((e=>{t(!1)}))}))}_queryServicesPrint(t){return this.webview?this.postMessage({exec:"print",data:{inputData:t}}):h({url:this.printOrigin+"/services/print",method:"get",params:{inputData:JSON.stringify(t)}}).then((({data:t})=>t))}_callPrintWithFile(t){const e={cmdid:"7",flag:"1"},i={inputData:JSON.stringify(Object.assign({},e,t))};return this.webview?this.postMessage({exec:"print",data:n(i)}):h({url:this.printOrigin+"/PrintLocal",method:"post",data:i,transformRequest:[n]}).then((({data:t})=>t));function n(t){let e="";for(const i in t)e+=encodeURIComponent(i)+"="+encodeURIComponent(t[i])+"&";return e=e.slice(0,-1),e}}_handleResult(t,e){if("success"!==t.result){const i={type:"printError",message:t.message||t.Message,result:t.result,errinfo:t.errinfo};return null==e||e(i),!1}return t}_handleResultTest(t,e){return!!t||(console.log("notInstalledApp"),null==e||e({type:"notInstalledApp",message:"请打开打印服务器插件"}),!1)}async _handleEventQueryPrintData(t,e,i,n){const s={templateId:t,formatId:e,params:i,cmdid:"7"},r=await this._queryServicesPrint(s);return this._handleQueryPrintDataResult(r,e,n)}_handleQueryPrintDataResult(t,e,i){if(!(null==t?void 0:t.file)){try{const e=t.message||t.Message;console.log(e),null==i||i({type:"queryPrintDataFailure",message:e})}catch(t){console.log(t)}return!1}return{file:t.file,printerName:t.defprinter,pageCount:t.pagecount,formatId:e}}async _handleEventDirect({templateId:t,formatId:e,params:i,cmdid:n,print:s,printdlgshow:r="1",nobillnode:a="1",btnprint:o="1"}){const d={templateId:t,formatId:e,params:i,cmdid:n,nobillnode:a,printdlgshow:r,btnprint:o};if(s){try{s=JSON.parse(s)}catch(t){}d.print=s}else this.isRemote&&(d.print={print:"1",type:"6",zip:"0",filename:`F:\\WorkSpace\\crmweb\\web\\${l(new Date,"yyyyMMddHHmmss")}`});return await this._queryServicesPrint(d)}async _handleEventEditFormat({templateId:t,formatId:e="",params:i="",token:n}){const s={};let r={};try{r=Object.assign({},s,JSON.parse(i))}catch(t){r=s}const a={templateId:t,formatId:e,cmdid:"9",token:n,params:JSON.stringify(r)};return await this._queryServicesPrint(a)}async _queryProxyOrigin(){if(this.isRemote)return;const{data:t}=await h({method:"get",url:u})||{},{map:e={}}=t;e.isRemote&&(this.printOrigin=c+"/printService",this.isRemote=!0)}async _queryPrintFile(t,e=""){const{data:i}=await h({method:"post",url:p,responseType:"blob",params:{formatId:t.split("_")[1],params:e}})||{};return i}async _browserPrint(t,e){if(this.isRemote){const{filedir:i}=t,n=JSON.parse(i)[0].replace(/\\/g,"/").split("/"),a=n[n.length-1],o=await s(`${m}/${a}`),l=r(null,e,o);if("preview"===e)return l}}async preview({templateId:t,formatId:e,params:i="",btnprint:n},s,l){if(a(e)){const t=await this._queryPrintFile(e,i);if(!t)return null==l?void 0:l("获取文件失败!");const n=r(t,"preview");return this.instance||(this.instance=o()),this.showPreview(this.instance,n),void(null==s||s({file:t}))}await this._queryProxyOrigin();const d=await this._testConnection();if(!this._handleResultTest(d,l))return!1;const h=await this._handleEventDirect({templateId:t,formatId:e,params:i,cmdid:this.isRemote?"7":"8",btnprint:n});if(!h)return!1;const c=this._handleResult(h,l);if(!c)return!1;if(this.isRemote){const t=await this._browserPrint(c,"preview");this.instance||(this.instance=o()),this.showPreview(this.instance,t)}s&&s(c)}async printDirect({templateId:t,formatId:e,params:i="",print:n,printdlgshow:s,nobillnode:o
|
|
1
|
+
import t from"axios";import{isArray as e}from"lodash-es";import{IdentityVerificationDialog as i,PreviewDialog as n}from"./dialog.js";import{getFileUrl as s,useBrowserPrint as r,isIReport as a}from"./browserPrint.js";import{getCurrentInstance as o}from"vue";import{format as l}from"date-fns";const d=t.create({timeout:1e3,withCredentials:!1}),h=t.create({withCredentials:!1}),c=`${window.location.protocol}//${window.location.host}`,p=`${c}/fdp-api/print/assembly/printIReport`,u=`${c}/bi-api/reprot/print/open/client/getRemote`,m=`${c}/printService/file`;let w=null;class f{constructor(){var t;if(this.webview=null,this.dialog=new i,this.dialogPreview=new n,this.instance=null,this.downloadPath="",this.printOrigin="http://127.0.0.1:11111",this.isRemote=!1,this.messageHandlerQueue=[],w)return w;w=this;const e=window;this.webview=null==(t=e.chrome)?void 0:t.webview,this.webview&&(this.currentMessageHandler=this.messageHandler.bind(this),this.webview.addEventListener("message",this.currentMessageHandler),this.postMessage({exec:"config",data:""}))}messageHandler(t){var e;const i=this.messageHandlerQueue.shift();if(!i)return console.log("当前回执",t,"没有可用的handler");const{resolve:n,reject:s}=i;try{const{exec:i}=JSON.parse(t.data);"config"===i&&(this.downloadPath=(null==(e=JSON.parse(t.data).res)?void 0:e.downloadpath)||""),console.log(t),n(JSON.parse(t.data).res)}catch(t){s(t)}}async postMessage(t){return this.webview?new Promise(((e,i)=>{this.messageHandlerQueue.push({resolve:e,reject:i}),this.webview.postMessage(t)})):Promise.reject()}destroy(){this.webview&&this.currentMessageHandler&&(this.webview.removeEventListener("message",this.currentMessageHandler),this.currentMessageHandler=void 0)}show(...t){return this.dialog.show(...t)}showPreview(...t){return this.dialogPreview.show(...t)}_testConnection(){return this.webview?Promise.resolve(!0):new Promise((t=>{d({url:`${this.printOrigin}/test`,method:"get",withCredentials:!1,params:{inputdata:{result:"success"}}}).then((({data:e})=>{"success"===e.result?t(!0):t(!1)})).catch((e=>{t(!1)}))}))}_queryServicesPrint(t){return this.webview?this.postMessage({exec:"print",data:{inputData:t}}):h({url:this.printOrigin+"/services/print",method:"get",params:{inputData:JSON.stringify(t)}}).then((({data:t})=>t))}_callPrintWithFile(t){const e={cmdid:"7",flag:"1"},i={inputData:JSON.stringify(Object.assign({},e,t))};return this.webview?this.postMessage({exec:"print",data:n(i)}):h({url:this.printOrigin+"/PrintLocal",method:"post",data:i,transformRequest:[n]}).then((({data:t})=>t));function n(t){let e="";for(const i in t)e+=encodeURIComponent(i)+"="+encodeURIComponent(t[i])+"&";return e=e.slice(0,-1),e}}_handleResult(t,e){if("success"!==t.result){const i={type:"printError",message:t.message||t.Message,result:t.result,errinfo:t.errinfo};return null==e||e(i),!1}return t}_handleResultTest(t,e){return!!t||(console.log("notInstalledApp"),null==e||e({type:"notInstalledApp",message:"请打开打印服务器插件"}),!1)}async _handleEventQueryPrintData(t,e,i,n){const s={templateId:t,formatId:e,params:i,cmdid:"7"},r=await this._queryServicesPrint(s);return this._handleQueryPrintDataResult(r,e,n)}_handleQueryPrintDataResult(t,e,i){if(!(null==t?void 0:t.file)){try{const e=t.message||t.Message;console.log(e),null==i||i({type:"queryPrintDataFailure",message:e})}catch(t){console.log(t)}return!1}return{file:t.file,printerName:t.defprinter,pageCount:t.pagecount,formatId:e}}async _handleEventDirect({templateId:t,formatId:e,params:i,cmdid:n,print:s,printdlgshow:r="1",nobillnode:a="1",btnprint:o="1"}){const d={templateId:t,formatId:e,params:i,cmdid:n,nobillnode:a,printdlgshow:r,btnprint:o};if(s){try{s=JSON.parse(s)}catch(t){}d.print=s}else this.isRemote&&(d.print={print:"1",type:"6",zip:"0",filename:`F:\\WorkSpace\\crmweb\\web\\${l(new Date,"yyyyMMddHHmmss")}`});return await this._queryServicesPrint(d)}async _handleEventEditFormat({templateId:t,formatId:e="",params:i="",token:n}){const s={};let r={};try{r=Object.assign({},s,JSON.parse(i))}catch(t){r=s}const a={templateId:t,formatId:e,cmdid:"9",token:n,params:JSON.stringify(r)};return await this._queryServicesPrint(a)}async _queryProxyOrigin(){if(this.isRemote)return;const{data:t}=await h({method:"get",url:u})||{},{map:e={}}=t;e.isRemote&&(this.printOrigin=c+"/printService",this.isRemote=!0)}async _queryPrintFile(t,e=""){const{data:i}=await h({method:"post",url:p,responseType:"blob",params:{formatId:t.split("_")[1],params:e}})||{};return i}async _browserPrint(t,e){if(this.isRemote){const{filedir:i}=t,n=JSON.parse(i)[0].replace(/\\/g,"/").split("/"),a=n[n.length-1],o=await s(`${m}/${a}`),l=r(null,e,o);if("preview"===e)return l}}async preview({templateId:t,formatId:e,params:i="",btnprint:n},s,l){if(a(e)){const t=await this._queryPrintFile(e,i);if(!t)return null==l?void 0:l("获取文件失败!");const n=r(t,"preview");return this.instance||(this.instance=o()),this.showPreview(this.instance,n),void(null==s||s({file:t}))}await this._queryProxyOrigin();const d=await this._testConnection();if(!this._handleResultTest(d,l))return!1;const h=await this._handleEventDirect({templateId:t,formatId:e,params:i,cmdid:this.isRemote?"7":"8",btnprint:n});if(!h)return!1;const c=this._handleResult(h,l);if(!c)return!1;if(this.isRemote){const t=await this._browserPrint(c,"preview");this.instance||(this.instance=o()),this.showPreview(this.instance,t)}s&&s(c)}async printDirect({templateId:t,formatId:e,params:i="",print:n,printdlgshow:s,nobillnode:o,isDownloadFile:l=!0},d,h,c="printDirect"){if(a(e)){const t=await this._queryPrintFile(e,i);return t?(r(t,c),void(null==d||d({file:t}))):null==h?void 0:h("获取文件失败!")}await this._queryProxyOrigin();const p=await this._testConnection();if(!this._handleResultTest(p,h))return!1;const u=await this._handleEventDirect({templateId:t,formatId:e,params:i,cmdid:"7",print:n,printdlgshow:s,nobillnode:o});if(!u)return!1;const m=this._handleResult(u,h);if(!m)return!1;l&&["downloadPDF"].includes(c)&&await this._browserPrint(m,c),d&&d(m)}_downloadPDF(t){return this.webview?this.postMessage({exec:"pdf",data:{file:t}}):h.get(this.printOrigin+"/download",{params:{inputData:t}}).then((({data:t})=>t))}downloadPDF(t,i,n){this.webview&&this.downloadPath&&(t.print.filename=this.downloadPath.replace(/\\/g,"/")),this.printDirect(t,(async s=>{if(s||n(null),a(t.formatId))return i(s);const r=this,o=await async function(t){const i=[],n=JSON.parse(t);if(!e(n))return await r._downloadPDF("");if(1===n.length)return await r._downloadPDF(n[0]||"");for(let t=0,e=n.length;t<e;t++)i.push(await r._downloadPDF(n[t]||""));return i}(s.filedir);i(o)}),(t=>n(t)),"downloadPDF")}async print({templateId:t,formatId:e,params:i=""},n,s){const r=await this._testConnection();if(!this._handleResultTest(r,s))return!1;const a=await this.queryPrintData({templateId:t,formatId:e,params:i},void 0,s);if(!a)return!1;const o=this.printFileData({formatId:e,file:a.file,printerName:a.printerName},void 0,s);if(!o)return!1;n&&n(o)}async queryPrintData({templateId:t,formatId:e,params:i=""},n,s){const r=await this._testConnection();if(!this._handleResultTest(r,s))return!1;const a=await this._handleEventQueryPrintData(t,e,i,s);return!!a&&(n&&n(a),a)}async printFileData({formatId:t,file:e,printerName:i="Default"},n,s){const r=await this._testConnection();if(!this._handleResultTest(r,s))return!1;const a=await this._callPrintWithFile({formatId:t,printname:i,file:e}),o=this._handleResult(a,s);return!!o&&(n&&n(o),o)}async editPrintFormat({templateId:t,formatId:e,params:i,token:n},s,r){const a=await this._testConnection();if(!this._handleResultTest(a,r))return!1;const o=await this._handleEventEditFormat({templateId:t,formatId:e,params:i,token:n}),l=this._handleResult(o,r);if(!l)return!1;s&&s(l)}async addPrintFormat({templateId:t,params:e,token:i},n,s){const r=await this._testConnection();if(!this._handleResultTest(r,s))return!1;const a=await this._handleEventEditFormat({templateId:t,params:e,token:i}),o=this._handleResult(a,s);if(!o)return!1;n&&n(o)}}export{f as Print};
|
|
@@ -43,6 +43,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
43
43
|
fold?: boolean | undefined;
|
|
44
44
|
required?: boolean | undefined;
|
|
45
45
|
requiredDisabled?: boolean | undefined;
|
|
46
|
+
editableDisabled?: boolean | undefined;
|
|
46
47
|
editable?: boolean | undefined;
|
|
47
48
|
notes?: string | undefined;
|
|
48
49
|
desc?: string | undefined;
|
|
@@ -64,6 +65,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
64
65
|
fold?: boolean | undefined;
|
|
65
66
|
required?: boolean | undefined;
|
|
66
67
|
requiredDisabled?: boolean | undefined;
|
|
68
|
+
editableDisabled?: boolean | undefined;
|
|
67
69
|
editable?: boolean | undefined;
|
|
68
70
|
notes?: string | undefined;
|
|
69
71
|
desc?: string | undefined;
|
|
@@ -579,7 +581,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
579
581
|
clearSpan: (uuid: string) => void;
|
|
580
582
|
exposeEvent: {
|
|
581
583
|
validate(path?: string): Promise<void>;
|
|
582
|
-
getFormValues(needCombineExtendKey?: boolean
|
|
584
|
+
getFormValues(needCombineExtendKey?: boolean): any;
|
|
583
585
|
setFormValues(values: import("../../../es/shared/types").AnyObject, needSplitExtendKey?: boolean): void;
|
|
584
586
|
setFieldState(path: string, handler: (field: Partial<Pick<import("@formily/core").Field<any, any, any, any>, import("@formily/core").NonFunctionPropertyNames<{
|
|
585
587
|
match: (pattern: import("@formily/path").Pattern) => boolean;
|
|
@@ -1115,6 +1117,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
1115
1117
|
extendKey?: string | undefined;
|
|
1116
1118
|
is_not_fold?: string | undefined;
|
|
1117
1119
|
remark?: string | undefined;
|
|
1120
|
+
free_entry?: import("..").FormCommonState | undefined;
|
|
1118
1121
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
1119
1122
|
content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
|
|
1120
1123
|
lazyRequest?: boolean | undefined;
|
|
@@ -2700,6 +2703,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
2700
2703
|
fold?: boolean | undefined;
|
|
2701
2704
|
required?: boolean | undefined;
|
|
2702
2705
|
requiredDisabled?: boolean | undefined;
|
|
2706
|
+
editableDisabled?: boolean | undefined;
|
|
2703
2707
|
editable?: boolean | undefined;
|
|
2704
2708
|
notes?: string | undefined;
|
|
2705
2709
|
desc?: string | undefined;
|
|
@@ -2718,6 +2722,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
2718
2722
|
fold?: boolean | undefined;
|
|
2719
2723
|
required?: boolean | undefined;
|
|
2720
2724
|
requiredDisabled?: boolean | undefined;
|
|
2725
|
+
editableDisabled?: boolean | undefined;
|
|
2721
2726
|
editable?: boolean | undefined;
|
|
2722
2727
|
notes?: string | undefined;
|
|
2723
2728
|
desc?: string | undefined;
|
|
@@ -3146,7 +3151,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
3146
3151
|
clearSpan: (uuid: string) => void;
|
|
3147
3152
|
exposeEvent: {
|
|
3148
3153
|
validate(path?: string): Promise<void>;
|
|
3149
|
-
getFormValues(needCombineExtendKey?: boolean
|
|
3154
|
+
getFormValues(needCombineExtendKey?: boolean): any;
|
|
3150
3155
|
setFormValues(values: import("../../../es/shared/types").AnyObject, needSplitExtendKey?: boolean): void;
|
|
3151
3156
|
setFieldState(path: string, handler: (field: Partial<Pick<import("@formily/core").Field<any, any, any, any>, import("@formily/core").NonFunctionPropertyNames<{
|
|
3152
3157
|
match: (pattern: import("@formily/path").Pattern) => boolean;
|
|
@@ -44,6 +44,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
44
44
|
fold?: boolean | undefined;
|
|
45
45
|
required?: boolean | undefined;
|
|
46
46
|
requiredDisabled?: boolean | undefined;
|
|
47
|
+
editableDisabled?: boolean | undefined;
|
|
47
48
|
editable?: boolean | undefined;
|
|
48
49
|
notes?: string | undefined;
|
|
49
50
|
desc?: string | undefined;
|
|
@@ -65,6 +66,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
65
66
|
fold?: boolean | undefined;
|
|
66
67
|
required?: boolean | undefined;
|
|
67
68
|
requiredDisabled?: boolean | undefined;
|
|
69
|
+
editableDisabled?: boolean | undefined;
|
|
68
70
|
editable?: boolean | undefined;
|
|
69
71
|
notes?: string | undefined;
|
|
70
72
|
desc?: string | undefined;
|
|
@@ -580,7 +582,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
580
582
|
clearSpan: (uuid: string) => void;
|
|
581
583
|
exposeEvent: {
|
|
582
584
|
validate(path?: string): Promise<void>;
|
|
583
|
-
getFormValues(needCombineExtendKey?: boolean
|
|
585
|
+
getFormValues(needCombineExtendKey?: boolean): any;
|
|
584
586
|
setFormValues(values: import("../../../../es/shared/types").AnyObject, needSplitExtendKey?: boolean): void;
|
|
585
587
|
setFieldState(path: string, handler: (field: Partial<Pick<import("@formily/core").Field<any, any, any, any>, import("@formily/core").NonFunctionPropertyNames<{
|
|
586
588
|
match: (pattern: import("@formily/path").Pattern) => boolean;
|
|
@@ -1116,6 +1118,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1116
1118
|
extendKey?: string | undefined;
|
|
1117
1119
|
is_not_fold?: string | undefined;
|
|
1118
1120
|
remark?: string | undefined;
|
|
1121
|
+
free_entry?: import("../..").FormCommonState | undefined;
|
|
1119
1122
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
1120
1123
|
content?: string | import("../..").FormRenderer | Record<string, import("../..").FormRenderer> | undefined;
|
|
1121
1124
|
lazyRequest?: boolean | undefined;
|
|
@@ -2701,6 +2704,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2701
2704
|
fold?: boolean | undefined;
|
|
2702
2705
|
required?: boolean | undefined;
|
|
2703
2706
|
requiredDisabled?: boolean | undefined;
|
|
2707
|
+
editableDisabled?: boolean | undefined;
|
|
2704
2708
|
editable?: boolean | undefined;
|
|
2705
2709
|
notes?: string | undefined;
|
|
2706
2710
|
desc?: string | undefined;
|
|
@@ -2719,6 +2723,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2719
2723
|
fold?: boolean | undefined;
|
|
2720
2724
|
required?: boolean | undefined;
|
|
2721
2725
|
requiredDisabled?: boolean | undefined;
|
|
2726
|
+
editableDisabled?: boolean | undefined;
|
|
2722
2727
|
editable?: boolean | undefined;
|
|
2723
2728
|
notes?: string | undefined;
|
|
2724
2729
|
desc?: string | undefined;
|
|
@@ -3147,7 +3152,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3147
3152
|
clearSpan: (uuid: string) => void;
|
|
3148
3153
|
exposeEvent: {
|
|
3149
3154
|
validate(path?: string): Promise<void>;
|
|
3150
|
-
getFormValues(needCombineExtendKey?: boolean
|
|
3155
|
+
getFormValues(needCombineExtendKey?: boolean): any;
|
|
3151
3156
|
setFormValues(values: import("../../../../es/shared/types").AnyObject, needSplitExtendKey?: boolean): void;
|
|
3152
3157
|
setFieldState(path: string, handler: (field: Partial<Pick<import("@formily/core").Field<any, any, any, any>, import("@formily/core").NonFunctionPropertyNames<{
|
|
3153
3158
|
match: (pattern: import("@formily/path").Pattern) => boolean;
|
|
@@ -429,7 +429,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
429
429
|
clearSpan: (uuid: string) => void;
|
|
430
430
|
exposeEvent: {
|
|
431
431
|
validate(path?: string): Promise<void>;
|
|
432
|
-
getFormValues(needCombineExtendKey?: boolean
|
|
432
|
+
getFormValues(needCombineExtendKey?: boolean): any;
|
|
433
433
|
setFormValues(values: import("../../../../shared/types").AnyObject, needSplitExtendKey?: boolean): void;
|
|
434
434
|
setFieldState(path: string, handler: (field: Partial<Pick<import("../../../../../es/components/form-render").Field<any, any, any, any>, import("../../../../../es/components/form-render").NonFunctionPropertyNames<{
|
|
435
435
|
match: (pattern: import("@formily/path").Pattern) => boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,openBlock as t,createBlock as r,unref as o,mergeProps as
|
|
1
|
+
import{defineComponent as e,openBlock as t,createBlock as r,unref as o,mergeProps as i,withCtx as m,createElementVNode as a,normalizeStyle as s,resolveDynamicComponent as l}from"vue";import n from"../../../../shared/components/VueDraggable/src/vuedraggable.js";import{usePresetRenderer as u}from"../hooks/usePresetRenderer.js";import{useSortableConfig as d}from"../hooks/useSortalbeConfig.js";import"lodash-es";import{layoutWidthEnum2Column as p}from"../utils/index.js";import f from"../../../../_virtual/plugin-vue_export-helper.js";const g=["data-type","data-required"];var y=f(e({__name:"FormConfigDragDisplay",props:{fieldItem:{type:Object},textFormatter:{type:Function,required:!0}},setup(e){function f(e){return{"--item-column":e?p(e.layoutWidthEnum):24}}const{getRenderer:y}=u(),{getCommonConfig:c}=d();return(u,d)=>(t(),r(o(n),i(o(c)(e.fieldItem),{style:f(e.fieldItem)}),{item:m((({element:i})=>[a("div",{class:"form-config__displayContentItem","data-type":i.type,"data-required":i.required,style:s(f(i))},[(t(),r(l(o(y)(i)),{"field-item":i,textFormatter:e.textFormatter},null,8,["field-item","textFormatter"]))],12,g)])),_:1},16,["style"]))}}),[["__file","FormConfigDragDisplay.vue"]]);export{y as default};
|
|
@@ -120,6 +120,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
120
120
|
extendKey?: string | undefined;
|
|
121
121
|
is_not_fold?: string | undefined;
|
|
122
122
|
remark?: string | undefined;
|
|
123
|
+
free_entry?: import("../../../../../es/components/form-render").FormCommonState | undefined;
|
|
123
124
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
124
125
|
content?: string | import("../../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../../es/components/form-render").FormRenderer> | undefined;
|
|
125
126
|
lazyRequest?: boolean | undefined;
|
|
@@ -1705,6 +1706,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1705
1706
|
fold?: boolean | undefined;
|
|
1706
1707
|
required?: boolean | undefined;
|
|
1707
1708
|
requiredDisabled?: boolean | undefined;
|
|
1709
|
+
editableDisabled?: boolean | undefined;
|
|
1708
1710
|
editable?: boolean | undefined;
|
|
1709
1711
|
notes?: string | undefined;
|
|
1710
1712
|
desc?: string | undefined;
|
|
@@ -1723,6 +1725,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1723
1725
|
fold?: boolean | undefined;
|
|
1724
1726
|
required?: boolean | undefined;
|
|
1725
1727
|
requiredDisabled?: boolean | undefined;
|
|
1728
|
+
editableDisabled?: boolean | undefined;
|
|
1726
1729
|
editable?: boolean | undefined;
|
|
1727
1730
|
notes?: string | undefined;
|
|
1728
1731
|
desc?: string | undefined;
|
|
@@ -2151,7 +2154,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2151
2154
|
clearSpan: (uuid: string) => void;
|
|
2152
2155
|
exposeEvent: {
|
|
2153
2156
|
validate(path?: string): Promise<void>;
|
|
2154
|
-
getFormValues(needCombineExtendKey?: boolean
|
|
2157
|
+
getFormValues(needCombineExtendKey?: boolean): any;
|
|
2155
2158
|
setFormValues(values: import("../../../../../es/shared/types").AnyObject, needSplitExtendKey?: boolean): void;
|
|
2156
2159
|
setFieldState(path: string, handler: (field: Partial<Pick<import("../../../../../es/components/form-render").Field<any, any, any, any>, import("../../../../../es/components/form-render").NonFunctionPropertyNames<{
|
|
2157
2160
|
match: (pattern: import("@formily/path").Pattern) => boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,inject as t,computed as i,openBlock as r,createBlock as
|
|
1
|
+
import{defineComponent as e,inject as t,computed as i,openBlock as r,createBlock as d,unref as l,mergeProps as o,withModifiers as f,withCtx as m,createVNode as a,normalizeClass as n,createTextVNode as s,toDisplayString as u,createCommentVNode as p}from"vue";import{NButton as c,NEllipsis as I}from"naive-ui";import _ from"./CloseButton.vue.js";import{InjectionActiveFieldItem as v,WidgetTextMap as y}from"../../constants/index.js";import{bindHover as x}from"../../utils/index.js";import j from"../../../../../_virtual/plugin-vue_export-helper.js";var q=j(e({__name:"DefaultNode",props:{fieldItem:{type:Object,required:!0},textFormatter:{type:Function,required:!0}},setup(e){const j=e,q=t(v);function g(){q.value=j.fieldItem}const h=i((()=>[{"is-active":q.value===j.fieldItem},"form-config__renderer"])),k=i((()=>["form-config__renderer--default",{"is-required":j.fieldItem.required}])),C=i((()=>!1===j.fieldItem.editable));function F(){const e=y.get(j.fieldItem.type);return j.textFormatter(j.fieldItem,`${j.fieldItem.name}${e?`(${e})`:""}`)}return(t,i)=>(r(),d(l(c),o({secondary:!l(C),dashed:l(C)},l(x)(e.fieldItem),{onClick:f(g,["stop"]),class:l(h),"data-type":e.fieldItem.type}),{default:m((()=>[a(l(I),{class:n(l(k))},{default:m((()=>[s(u(F()),1)])),_:1},8,["class"]),e.fieldItem.required?p("v-if",!0):(r(),d(_,{key:0,"field-item":e.fieldItem},null,8,["field-item"]))])),_:1},16,["secondary","dashed","onClick","class","data-type"]))}}),[["__file","DefaultNode.vue"]]);export{q as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isArray as e}from"lodash-es";import{EditAbleField as t,widgetWidthOptionConfig as l,isShowOptionConfig as i,isNotFoldOptionConfig as
|
|
1
|
+
import{isArray as e}from"lodash-es";import{EditAbleField as t,widgetWidthOptionConfig as l,isShowOptionConfig as i,isNotFoldOptionConfig as a,isEditOptionConfig as _,isNullOptionConfig as E}from"../constants/index.js";function n(){const n=new Map([[t.NAME,()=>({alias:"名称",elem_width:6,is_null:"0",html_type:"INPUT"})],[t.NOTES,()=>({alias:"问号提示",elem_width:6,html_type:"INPUT"})],[t.DEFAULT_VALUE,t=>e(null==t?void 0:t.options)&&t.options.length?{alias:"默认值",elem_width:6,html_type:"SELECT",option:null==t?void 0:t.options}:{alias:"默认值",elem_width:6,html_type:"INPUT",validate:{max_length:20}}],[t.LAYOUT_WIDTH_ENUM,()=>({alias:"宽度",fieldType:"number",html_type:"SELECT",elem_width:6,...l()})],[t.DESC,()=>({alias:"说明文本",elem_width:6,html_type:"INPUT",validate:{max_length:30}})],[t.DEFAULT_EXPAND,()=>({alias:"是否默认展开",html_type:"SWITCH",elem_width:6,...i()})],[t.FOLD,()=>({alias:"是否可折叠",html_type:"SWITCH",elem_width:6,...a()})],[t.EDITABLE,e=>({alias:"是否可编辑",html_type:"SWITCH",elem_width:6,is_edit:(null==e?void 0:e.editableDisabled)?"0":"1",..._()})],[t.REQUIRED,e=>({alias:"是否必填",html_type:"SWITCH",elem_width:6,is_edit:(null==e?void 0:e.requiredDisabled)?"0":"1",...E()})]]);function m(e,t){return t.map((t=>{var l,i;return{...null!=(i=null==(l=n.get(t))?void 0:l(e))?i:{},val_key:t}}))}return{generateFieldListByKeys:m,generateFieldListByFieldItem:function(e){const l=new Map([["LINE_BAR",[t.NAME,t.LAYOUT_WIDTH_ENUM,t.NOTES,t.DEFAULT_EXPAND,t.FOLD]],...["NEWLINE","COMPLEX","COMBINATION"].map((e=>[e,[t.NAME,t.LAYOUT_WIDTH_ENUM]]))]),i=[t.NAME,t.DEFAULT_VALUE,t.LAYOUT_WIDTH_ENUM,t.DESC,t.NOTES,t.EDITABLE,t.REQUIRED];return m(e,l.get(e.type)||i)}}}export{n as useConfigurationField};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{findAncestor as o}from"../../../../shared/utils/index.js";import{FORM_CONFIG_GROUP as s}from"../constants/index.js";function
|
|
1
|
+
import{findAncestor as o}from"../../../../shared/utils/index.js";import{FORM_CONFIG_GROUP as s}from"../constants/index.js";function t(){let t,e=null;function i({target:o,item:s}){e=setTimeout((()=>{o.classList.add("is-choosing-area"),s.classList.add("is-choosing")}),200)}function a({from:o,to:s,target:t,item:i}){clearTimeout(e),[o,s,t].forEach((o=>{o.classList.remove("is-choosing-area")})),i.classList.remove("is-choosing")}function n({to:s,from:e,dragged:i}){return("LINE_BAR"!==i.dataset.type||!o(s,(o=>"LINE_BAR"===o.dataset.type)))&&(("true"!==i.dataset.required||!o(s,(o=>o.classList.contains("form-config__materialContent"))))&&(null==t||t.classList.remove("is-choosing-area"),t=s,s!==e&&e.classList.remove("is-choosing-area"),void s.classList.add("is-choosing-area")))}return{getCommonConfig:o=>({move:n,onChoose:i,onUnchoose:a,tag:"section",forceFallback:!1,animation:"150","item-key":"key",group:"COMBINATION"===(null==o?void 0:o.type)?o.key:s})}}export{t as useSortableConfig};
|
|
@@ -416,7 +416,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
|
416
416
|
clearSpan: (uuid: string) => void;
|
|
417
417
|
exposeEvent: {
|
|
418
418
|
validate(path?: string): Promise<void>;
|
|
419
|
-
getFormValues(needCombineExtendKey?: boolean
|
|
419
|
+
getFormValues(needCombineExtendKey?: boolean): any;
|
|
420
420
|
setFormValues(values: import("../../../es/shared/types").AnyObject, needSplitExtendKey?: boolean): void;
|
|
421
421
|
setFieldState(path: string, handler: (field: Partial<Pick<import("@formily/core/esm/models/Field").Field<any, any, any, any>, import("@formily/core/esm/types").NonFunctionPropertyNames<{
|
|
422
422
|
match: (pattern: import("@formily/path").Pattern) => boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{COMPONENT_NAMESPACE as e}from"../../shared/global/variable.js";import{safeComponentRegister as s}from"../../shared/utils/index.js";import r from"./src/FormRenderWrapper.vue.js";export{useFieldListAdaptor}from"./src/hooks/useFieldListAdaptor.js";export{useFormRequest}from"./src/hooks/useFormRequest.js";export{useCommonLog}from"./src/hooks/useCommonLog.js";export{useFormField}from"./src/hooks/useFormField.js";export{AsyncQueue,useAsyncQueue}from"./src/hooks/useAsyncQueue.js";export{useFieldVisitor}from"./src/hooks/useFieldVisitor.js";export{useFieldNormalize}from"./src/hooks/useFieldNormalize.js";export{useFormValidator,validateMessageLocale}from"./src/hooks/useFormValidator.js";export{BusinessCollector,useBusinessBinding}from"./src/hooks/useBusinessBinding.js";export{ContextCollector,useChangeContext}from"./src/hooks/useChangeContext.js";export{FormItemDepsCollector,useFormItemDeps}from"./src/hooks/useFormItemDeps.js";export{useAnchor}from"./src/hooks/useAnchor.js";export{useFormContext}from"./src/hooks/useFormContext.js";export{useCommonInjection,useSelectOptionProps}from"./src/hooks/useCommonInjection.js";export{searchContentMatcher,useAutographOptions,useRecommendOptions,useUrlConfigOptions}from"./src/hooks/useFormRenderOptions.js";export{combineExtendKey,createInputSlot,createSlot,createUrlConfigParams,formRenderLog,injectOrProvide,isNestedFieldType,isNestedType,keywordMatcher,mergeDeepProperties,parseNumberFromMaybeString,presetRequestHandler,splitExtendKey,validateMessageParser}from"./src/utils/index.js";export*from"@formily/core";export{businessDateParser,isIdCard,isMobile,parseAge2Birthday,parseAgeFromContext,parseBirthday,parseIdCard,transformDateFormat}from"./src/utils/business.js";export{findNextWidget,
|
|
1
|
+
import{COMPONENT_NAMESPACE as e}from"../../shared/global/variable.js";import{safeComponentRegister as s}from"../../shared/utils/index.js";import r from"./src/FormRenderWrapper.vue.js";export{useFieldListAdaptor}from"./src/hooks/useFieldListAdaptor.js";export{useFormRequest}from"./src/hooks/useFormRequest.js";export{useCommonLog}from"./src/hooks/useCommonLog.js";export{useFormField}from"./src/hooks/useFormField.js";export{AsyncQueue,useAsyncQueue}from"./src/hooks/useAsyncQueue.js";export{useFieldVisitor}from"./src/hooks/useFieldVisitor.js";export{useFieldNormalize}from"./src/hooks/useFieldNormalize.js";export{useFormValidator,validateMessageLocale}from"./src/hooks/useFormValidator.js";export{BusinessCollector,useBusinessBinding}from"./src/hooks/useBusinessBinding.js";export{ContextCollector,useChangeContext}from"./src/hooks/useChangeContext.js";export{FormItemDepsCollector,useFormItemDeps}from"./src/hooks/useFormItemDeps.js";export{useAnchor}from"./src/hooks/useAnchor.js";export{useFormContext}from"./src/hooks/useFormContext.js";export{useCommonInjection,useSelectOptionProps}from"./src/hooks/useCommonInjection.js";export{searchContentMatcher,useAutographOptions,useRecommendOptions,useUrlConfigOptions}from"./src/hooks/useFormRenderOptions.js";export{combineExtendKey,createInputSlot,createSlot,createUrlConfigParams,formRenderLog,injectOrProvide,isNestedFieldType,isNestedType,keywordMatcher,mergeDeepProperties,parseNumberFromMaybeString,presetRequestHandler,splitExtendKey,validateMessageParser}from"./src/utils/index.js";export*from"@formily/core";export{businessDateParser,isIdCard,isMobile,parseAge2Birthday,parseAgeFromContext,parseBirthday,parseIdCard,transformDateFormat}from"./src/utils/business.js";export{findNextWidget,queryDecoratorByAddress,queryDecoratorByFieldKey,queryInput}from"./src/utils/dom.js";export{assignClearBindVisited,assignUpdateValue,assignValueBindKey,createLinebarId,createObjSchema,createVisitedSetter,dotEscape,fieldKeyEscape,getParentLinebar,traverseDependKey,traverseSchema}from"./src/utils/schema.js";const o=r;o.install=function(r){s(r,o,e+"FormRender")};export{o as default};
|
|
@@ -410,7 +410,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
410
410
|
clearSpan: (uuid: string) => void;
|
|
411
411
|
exposeEvent: {
|
|
412
412
|
validate(path?: string): Promise<void>;
|
|
413
|
-
getFormValues(needCombineExtendKey?: boolean
|
|
413
|
+
getFormValues(needCombineExtendKey?: boolean): any;
|
|
414
414
|
setFormValues(values: AnyObject, needSplitExtendKey?: boolean): void;
|
|
415
415
|
setFieldState(path: string, handler: (field: Partial<Pick<import("@formily/core").Field<any, any, any, any>, import("@formily/core").NonFunctionPropertyNames<{
|
|
416
416
|
match: (pattern: import("@formily/path").Pattern) => boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as o,computed as t,provide as r,onMounted as s,onUnmounted as a,openBlock as i,createBlock as l,unref as n,withCtx as m,createElementBlock as p,createVNode as u,isRef as d,Fragment as c,renderList as f,createCommentVNode as h,createElementVNode as y,normalizeStyle as j,withKeys as v,withModifiers as g,toDisplayString as b}from"vue";import{createForm as k,onFieldValueChange as F,onFieldMount as x,onFieldUnmount as C,onFieldReact as H,onFormMount as S}from"@formily/core";import{FormProvider as A,FormConsumer as R}from"@formily/vue";import{isNumber as _,cloneDeep as L}from"lodash-es";import{NForm as O,NTabs as w,NTabPane as B,NConfigProvider as V}from"naive-ui";import{InjectionFormGraph as I}from"./constants/index.js";import{useAutoHidden as N}from"./hooks/useAutoHidden.js";import{useComplexOptionsSpan as D}from"./hooks/useComplexOptions.js";import{useFormDomEvent as q,useFormExposeEvent as U}from"./hooks/useFormEvent.js";import{useFormGraph as W}from"./hooks/useFormGraph.js";import{useFormRenderLifeCycle as G}from"./hooks/useFormRenderLifeCycle.js";import{useLowCodeReactions as K}from"./hooks/useLowCodeReactions.js";import{useNuiThemeOverrides as M}from"./hooks/useNuiThemeOverrides.js";import"./utils/index.js";import{useFieldListAdaptor as T}from"./hooks/useFieldListAdaptor.js";import"../../../shared/utils/index.js";import"../index.js";import{useFieldVisitor as E}from"./hooks/useFieldVisitor.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{validateMessageLocale as P}from"./hooks/useFormValidator.js";import"@vueuse/core";import"date-fns";import{useAnchor as J}from"./hooks/useAnchor.js";import{useFormContext as z}from"./hooks/useFormContext.js";import"./hooks/useFormRenderOptions.js";import Q from"../../../_virtual/plugin-vue_export-helper.js";import{createObjSchema as X}from"./utils/schema.js";const Y={key:0,style:{height:"54px"}},Z={style:{"white-space":"pre"}};var $=Q(e({__name:"FormRender",props:{fieldList:{type:Array},initialData:{type:Object,default:()=>({})},fieldVisitor:{type:Object},column:{type:Number,default:24},maxHeight:{type:[Number,String],default:""},anchor:{type:Boolean,default:!1},parallelism:{type:Number,default:3},businessFormatter:{type:Function},schema:{type:Object},components:{type:Object,default:()=>({})},scope:{type:Object,default:()=>({})},annotation:{type:Object},consumer:{type:Boolean,default:!1},uuid:{type:String},lifeCycle:{type:Object},requestInstance:{type:Object},enterToNextWidget:{type:[Boolean,Function],default:!0},lowCodeReactions:{type:Array},linebarAutoHidden:{type:Boolean}},emits:["formChange","annotationChange","scroll"],setup(e,{expose:Q,emit:$}){const ee=e,{nuiThemeOverrides:oe}=M();P();const te=o(),re=t((()=>_(ee.maxHeight)?ee.maxHeight+"px":ee.maxHeight)),{SchemaField:se,businessCollector:ae,formItemDepsCollector:ie,changeContextCollector:le,formUUID:ne}=z(ee,$),{anchorBarRef:me,currentAnchor:pe,generateAnchorList:ue,updateAnchorList:de,anchorIdList:ce,onScroll:fe}=J(ee,$,te,ie);G(ee).callLifeCycle("onSetup");const{trigger:he}=N(),{observeFormGraph:ye,setGraph:je,removeGraph:ve}=W();r(I,ye);const ge=k({initialValues:ee.initialData,effects(e){F("*",(o=>{const t=o.props.name.toString();ae.trigger(e,t),ie.trigger(t),$("formChange",{fieldInstance:o,fieldKey:t,fieldName:o.title,value:o.value,context:le.getContext(t,o.value)}),be(t,o.value)})),x("*",je),C("*",ve),ee.linebarAutoHidden&&(H("*",he),S((e=>e.query("*").forEach(he)))),ee.anchor&&(H("*",de),S(ue))}}),{lowCodeReactionsHandler:be,triggerAllReactionsHandler:ke}=K(t((()=>ee.lowCodeReactions)),ge);s(ke);const{schemaAdaptor:Fe}=T(ae);let xe=ee.fieldList||[];const Ce=t((()=>ee.schema?ee.schema:ee.fieldList?(xe=E().traverse(L(ee.fieldList),ee.fieldVisitor),X(Fe(xe))):X({}))),{onKeydown:He}=q({formModel:ge,formRenderRef:te,props:ee}),{clearSpan:Se}=D();a((()=>Se(ne)));const Ae=U({formModel:ge,formRenderRef:te,formItemDepsCollector:ie,getFieldList:()=>xe,formUUID:ne});return Q({formModel:ge,validate:(e="*")=>Ae.validate(e),getFormValues:(e=!0
|
|
1
|
+
import{defineComponent as e,ref as o,computed as t,provide as r,onMounted as s,onUnmounted as a,openBlock as i,createBlock as l,unref as n,withCtx as m,createElementBlock as p,createVNode as u,isRef as d,Fragment as c,renderList as f,createCommentVNode as h,createElementVNode as y,normalizeStyle as j,withKeys as v,withModifiers as g,toDisplayString as b}from"vue";import{createForm as k,onFieldValueChange as F,onFieldMount as x,onFieldUnmount as C,onFieldReact as H,onFormMount as S}from"@formily/core";import{FormProvider as A,FormConsumer as R}from"@formily/vue";import{isNumber as _,cloneDeep as L}from"lodash-es";import{NForm as O,NTabs as w,NTabPane as B,NConfigProvider as V}from"naive-ui";import{InjectionFormGraph as I}from"./constants/index.js";import{useAutoHidden as N}from"./hooks/useAutoHidden.js";import{useComplexOptionsSpan as D}from"./hooks/useComplexOptions.js";import{useFormDomEvent as q,useFormExposeEvent as U}from"./hooks/useFormEvent.js";import{useFormGraph as W}from"./hooks/useFormGraph.js";import{useFormRenderLifeCycle as G}from"./hooks/useFormRenderLifeCycle.js";import{useLowCodeReactions as K}from"./hooks/useLowCodeReactions.js";import{useNuiThemeOverrides as M}from"./hooks/useNuiThemeOverrides.js";import"./utils/index.js";import{useFieldListAdaptor as T}from"./hooks/useFieldListAdaptor.js";import"../../../shared/utils/index.js";import"../index.js";import{useFieldVisitor as E}from"./hooks/useFieldVisitor.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{validateMessageLocale as P}from"./hooks/useFormValidator.js";import"@vueuse/core";import"date-fns";import{useAnchor as J}from"./hooks/useAnchor.js";import{useFormContext as z}from"./hooks/useFormContext.js";import"./hooks/useFormRenderOptions.js";import Q from"../../../_virtual/plugin-vue_export-helper.js";import{createObjSchema as X}from"./utils/schema.js";const Y={key:0,style:{height:"54px"}},Z={style:{"white-space":"pre"}};var $=Q(e({__name:"FormRender",props:{fieldList:{type:Array},initialData:{type:Object,default:()=>({})},fieldVisitor:{type:Object},column:{type:Number,default:24},maxHeight:{type:[Number,String],default:""},anchor:{type:Boolean,default:!1},parallelism:{type:Number,default:3},businessFormatter:{type:Function},schema:{type:Object},components:{type:Object,default:()=>({})},scope:{type:Object,default:()=>({})},annotation:{type:Object},consumer:{type:Boolean,default:!1},uuid:{type:String},lifeCycle:{type:Object},requestInstance:{type:Object},enterToNextWidget:{type:[Boolean,Function],default:!0},lowCodeReactions:{type:Array},linebarAutoHidden:{type:Boolean}},emits:["formChange","annotationChange","scroll"],setup(e,{expose:Q,emit:$}){const ee=e,{nuiThemeOverrides:oe}=M();P();const te=o(),re=t((()=>_(ee.maxHeight)?ee.maxHeight+"px":ee.maxHeight)),{SchemaField:se,businessCollector:ae,formItemDepsCollector:ie,changeContextCollector:le,formUUID:ne}=z(ee,$),{anchorBarRef:me,currentAnchor:pe,generateAnchorList:ue,updateAnchorList:de,anchorIdList:ce,onScroll:fe}=J(ee,$,te,ie);G(ee).callLifeCycle("onSetup");const{trigger:he}=N(),{observeFormGraph:ye,setGraph:je,removeGraph:ve}=W();r(I,ye);const ge=k({initialValues:ee.initialData,effects(e){F("*",(o=>{const t=o.props.name.toString();ae.trigger(e,t),ie.trigger(t),$("formChange",{fieldInstance:o,fieldKey:t,fieldName:o.title,value:o.value,context:le.getContext(t,o.value)}),be(t,o.value)})),x("*",je),C("*",ve),ee.linebarAutoHidden&&(H("*",he),S((e=>e.query("*").forEach(he)))),ee.anchor&&(H("*",de),S(ue))}}),{lowCodeReactionsHandler:be,triggerAllReactionsHandler:ke}=K(t((()=>ee.lowCodeReactions)),ge);s(ke);const{schemaAdaptor:Fe}=T(ae);let xe=ee.fieldList||[];const Ce=t((()=>ee.schema?ee.schema:ee.fieldList?(xe=E().traverse(L(ee.fieldList),ee.fieldVisitor),X(Fe(xe))):X({}))),{onKeydown:He}=q({formModel:ge,formRenderRef:te,props:ee}),{clearSpan:Se}=D();a((()=>Se(ne)));const Ae=U({formModel:ge,formRenderRef:te,formItemDepsCollector:ie,getFieldList:()=>xe,formUUID:ne});return Q({formModel:ge,validate:(e="*")=>Ae.validate(e),getFormValues:(e=!0)=>Ae.getFormValues(e),setFormValues:(e,o=!0)=>Ae.setFormValues(e,o),setFieldState(e,o){Ae.setFieldState(e,o)},resetFields(e="*"){Ae.resetFields(e)},queryWidget:async e=>Ae.queryWidget(e),async reload(){console.error("reload function is abstract,it should be overwrite!")}}),(o,t)=>(i(),l(n(O),{class:"form-render","require-mark-placement":"left"},{default:m((()=>[e.anchor?(i(),p("section",Y,[u(n(w),{value:n(pe),"onUpdate:value":t[0]||(t[0]=e=>d(pe)?pe.value=e:null),type:"line",ref_key:"anchorBarRef",ref:me},{default:m((()=>[(i(!0),p(c,null,f(n(ce),(e=>(i(),l(n(B),{name:e.name,tab:e.title,key:e.name},null,8,["name","tab"])))),128))])),_:1},8,["value"])])):h("v-if",!0),u(n(V),{"theme-overrides":n(oe)},{default:m((()=>[y("section",{class:"form-render__wrapper",style:j({"--column":e.column,"--form-height":n(re)}),ref_key:"formRenderRef",ref:te,onScroll:t[1]||(t[1]=(...e)=>n(fe)&&n(fe)(...e)),onKeydownCapture:t[2]||(t[2]=v(g(((...e)=>n(He)&&n(He)(...e)),["prevent"]),["enter"]))},[u(n(A),{form:n(ge)},{default:m((()=>[u(n(se),{schema:n(Ce)},null,8,["schema"]),e.consumer?(i(),l(n(R),{key:0},{default:m((({form:e})=>[y("div",Z,b(JSON.stringify(e.values,null,2)),1)])),_:1})):h("v-if",!0)])),_:1},8,["form"])],36)])),_:1},8,["theme-overrides"])])),_:1}))}}),[["__file","FormRender.vue"]]);export{$ as default};
|
|
@@ -413,7 +413,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
413
413
|
clearSpan: (uuid: string) => void;
|
|
414
414
|
exposeEvent: {
|
|
415
415
|
validate(path?: string): Promise<void>;
|
|
416
|
-
getFormValues(needCombineExtendKey?: boolean
|
|
416
|
+
getFormValues(needCombineExtendKey?: boolean): any;
|
|
417
417
|
setFormValues(values: import("../../../shared/types").AnyObject, needSplitExtendKey?: boolean): void;
|
|
418
418
|
setFieldState(path: string, handler: (field: Partial<Pick<import("../../../../es/components/form-render").Field<any, any, any, any>, import("../../../../es/components/form-render").NonFunctionPropertyNames<{
|
|
419
419
|
match: (pattern: import("@formily/path").Pattern) => boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,inject as r,computed as o,ref as t,onUnmounted as l,createVNode as i,mergeProps as s}from"vue";import{arrayed as a,widthAppend as m}from"../../../../../shared/utils/index.js";import{isVoidField as n}from"@formily/core";import{observe as u,autorun as f}from"@formily/reactive";import{connect as d,mapProps as p}from"@formily/vue";import{useDebounceFn as v}from"@vueuse/core";import{isArray as c,isString as y}from"lodash-es";import{NFormItem as _}from"naive-ui";import g from"../../../../annotation-edit/index.js";import"../../../index.js";import b from"../tooltipMessage.vue.js";import{InjectionFormUUID as x,InjectionFormGraph as j,InjectionAnnotation as I}from"../../constants/index.js";import{useComplexOptionsSpan as k}from"../../hooks/useComplexOptions.js";import{dotEscape as h}from"../../utils/schema.js";import{useFormField as F}from"../../hooks/useFormField.js";import{validateMessageParser as L}from"../../utils/index.js";const q=d(e({props:{label:String,propertyKey:String,remark:String,span:{type:Number,default:6},suffixFields:{type:Array},annotation:{},fieldItem:{}},setup(e,{slots:a}){const{field:d,fieldKey:p}=F(),
|
|
1
|
+
import{defineComponent as e,inject as r,computed as o,ref as t,onUnmounted as l,createVNode as i,mergeProps as s}from"vue";import{arrayed as a,widthAppend as m}from"../../../../../shared/utils/index.js";import{isVoidField as n}from"@formily/core";import{observe as u,autorun as f}from"@formily/reactive";import{connect as d,mapProps as p}from"@formily/vue";import{useDebounceFn as v}from"@vueuse/core";import{isArray as c,isString as y}from"lodash-es";import{NFormItem as _}from"naive-ui";import g from"../../../../annotation-edit/index.js";import"../../../index.js";import b from"../tooltipMessage.vue.js";import{InjectionFormUUID as x,InjectionFormGraph as j,InjectionAnnotation as I}from"../../constants/index.js";import{useComplexOptionsSpan as k}from"../../hooks/useComplexOptions.js";import{dotEscape as h}from"../../utils/schema.js";import{useFormField as F}from"../../hooks/useFormField.js";import{validateMessageParser as L}from"../../utils/index.js";const q=d(e({name:"FormRenderItem",props:{label:String,propertyKey:String,remark:String,span:{type:Number,default:6},suffixFields:{type:Array},annotation:{},fieldItem:{}},setup(e,{slots:a}){const{field:d,fieldKey:p,fieldAddress:y}=F(),L=r(x),q=o((()=>h(`${L}-${y.value}`))),K=t(!1);if(n(d.value)&&c(e.suffixFields)){const o=r(j);l(u(o,v((()=>{n(d.value)&&c(e.suffixFields)&&(K.value=e.suffixFields.some((e=>{const r=d.value.form.query(e).take();return r&&Reflect.get(r,"required")})))}),100)))}else l(f((()=>{K.value=Reflect.get(d.value,"required")})));const R=r(I),S=o({get(){var r,o;return null!=(o=null==(r=R.value)?void 0:r[e.propertyKey])?o:""},set(r){R.value={property:e.propertyKey,value:r}}});const A=o((()=>R.value&&!1!==e.annotation)),E=o((()=>e.label&&" "!==e.label)),V=o((()=>{let r=0;return A.value&&(r+=18),e.remark&&(r+=18),r}));function $(){return E.value?i("section",{class:"form-render__formItemLabel"},[i("span",{class:"form-render__formItemLabel--text",style:{marginRight:m(V.value)}},[e.label]),V.value?i("section",{class:"form-render__formItemLabel--operation"},[e.remark?i("div",{class:"form-render__formItemLabel--tooltip"},[i(b,{message:e.remark},null)]):null,A.value?i(g,{class:"form-render__formItemLabel--annotation",modelValue:S.value,"onUpdate:modelValue":e=>S.value=e},null):null]):null]):null}const{getSpan:w}=k();return()=>i(_,s({class:"form-render__formItem",style:{"--form-item-column":w(L,d.value.address,!1)+e.span}},{id:q.value,uuid:L,"widget-type":d.value.componentType,"field-key":h(p.value),"field-address":h(y.value),required:K.value}),{...a,label:$})}}),p({title:"label"},((e,r)=>{const o=n(r)?void 0:a(r.selfErrors).length?function(e,r){if(!y(r.defined_error_msg)||!r.defined_error_msg)return e.map((e=>L(e,r))).join(",");return L(r.defined_error_msg,r)}(a(r.selfErrors),e.fieldItem):void 0;return{...e,fieldItem:void 0,feedback:o,"validation-status":o?"error":void 0}})));export{q as FORM_ITEM};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,createVNode as o,isVNode as t}from"vue";import{connect as a,mapProps as
|
|
1
|
+
import{defineComponent as e,createVNode as o,isVNode as t}from"vue";import{connect as a,mapProps as r}from"@formily/vue";import{NSpace as l,NRadio as u,NRadioGroup as i,NCheckbox as n,NCheckboxGroup as p}from"naive-ui";import"../../../index.js";import{useComplexOptions as s}from"../../hooks/useComplexOptions.js";import"../../utils/index.js";import{useAutographOptions as m}from"../../hooks/useFormRenderOptions.js";import{useCommonInjection as v}from"../../hooks/useCommonInjection.js";import{assignUpdateValue as c,createVisitedSetter as d}from"../../utils/schema.js";import{useFormField as f}from"../../hooks/useFormField.js";function y(a,r,u){return e({name:a,props:{value:{type:[String,Number,Object,Array]},options:{type:Array,default:()=>[]},autograph:{type:String},lazyRequest:{type:Boolean,default:!1},requestCache:{type:Boolean,default:!0},wordbook:{type:Object},vertical:{type:Boolean,default:!1},onChange:{}},emits:["update:value"],setup(e,{emit:a}){const{field:i}=f(),{renderComplexOption:n,valueRef:p}=s(e,a),{labelKey:c,valueKey:y,options:j}=m(e,p),{injectValueBindKey:b,injectValueValidate:h}=v();h(p);const k=b(p);return()=>o(r,{key:k.value,value:p.value,"onUpdate:value":e=>p.value=e,onClick:d(i)},{default:()=>[o(l,{vertical:e.vertical,"vertical-space":e.vertical},{default:()=>{var e;return[null==(e=j.value)?void 0:e.map((e=>{let a;return o(u,{key:e[y.value],value:e[y.value],disabled:e.disabled},"function"==typeof(r=a=n({value:p.value,option:e,valueKey:y.value,labelKey:c.value}))||"[object Object]"===Object.prototype.toString.call(r)&&!t(r)?a:{default:()=>[a]});var r}))]}})]})}})}const j=a(y("FormRadio",i,u),r({dataSource:"options"},c)),b=a(y("FormCheckbox",p,n),r({dataSource:"options"},c));export{b as CHECKBOX,j as RADIO};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AnyObject, Func } from '../../../../../es/shared/types';
|
|
2
2
|
import { Path } from '@formily/path';
|
|
3
|
-
import {
|
|
3
|
+
import { FormOptionItem } from '../../../../../es/components/form-render';
|
|
4
4
|
declare function setSpan(uuid: string, address: Path | string, span?: number): void;
|
|
5
|
-
declare function getSpan(uuid: string, address: Path | string): number;
|
|
5
|
+
declare function getSpan(uuid: string, address: Path | string, withSelf?: boolean): number;
|
|
6
6
|
declare function deleteSpan(uuid: string, address: Path | string): void;
|
|
7
7
|
declare function clearSpan(uuid: string): void;
|
|
8
8
|
export declare function useComplexOptions(props: {
|
|
@@ -17,7 +17,6 @@ export declare function useComplexOptions(props: {
|
|
|
17
17
|
}) => any[];
|
|
18
18
|
valueRef: import("vue").WritableComputedRef<unknown>;
|
|
19
19
|
hasComplexOption: import("vue").ComputedRef<boolean>;
|
|
20
|
-
checkValueRef: import("vue").Ref<any>;
|
|
21
20
|
};
|
|
22
21
|
export declare function useComplexOptionsSpan(): {
|
|
23
22
|
getSpan: typeof getSpan;
|
|
@@ -25,7 +24,4 @@ export declare function useComplexOptionsSpan(): {
|
|
|
25
24
|
deleteSpan: typeof deleteSpan;
|
|
26
25
|
clearSpan: typeof clearSpan;
|
|
27
26
|
};
|
|
28
|
-
export declare function useComplexOptionsKey(): {
|
|
29
|
-
combineComplexOptionKey: (fieldList: FieldItem[], values: AnyObject) => AnyObject;
|
|
30
|
-
};
|
|
31
27
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{reactive as e,defineComponent as t,inject as n,computed as
|
|
1
|
+
import{reactive as e,defineComponent as t,inject as r,provide as n,computed as o,watch as l,onUnmounted as s,onMounted as a,withModifiers as i,createVNode as u,mergeProps as c}from"vue";import{checkInSetupEnv as p}from"../../../../shared/utils/index.js";import{useField as d,useForm as m,RecursionField as f}from"@formily/vue";import{noop as v,isArray as h,isNumber as y}from"lodash-es";import"../../index.js";import{InjectionFormUUID as b,InjectionBusinessCollector as j}from"../constants/index.js";import{useFieldListAdaptor as x}from"./useFieldListAdaptor.js";import{createObjSchema as g}from"../utils/schema.js";const F=e(new Map);function O(e,t,r=0){F.set(e,F.get(e)||{});F.get(e)[t+""]=r}function $(e,t,r=!0){const n=F.get(e);return n?Object.entries(n).reduce(((e,[n,o])=>r&&n===`${t}`||n.startsWith(`${t}.`)?e+o:e),0):0}function E(e,t){const r=F.get(e);r&&Reflect.deleteProperty(r,t+"")}function K(e){F.delete(e)}const P=t({props:{fieldItems:{type:Array,default:()=>[]},name:{type:String,required:!0}},setup(e){const t=r(b),p=r(j),h=d(),y=r(t+"_virtualParent",""),F=`${y?y+".":""}${h.value.address}`;function K(e){return`${F}.${e}`}n(t+"_virtualParent",F);const{schemaAdaptor:P}=x(p);function S(e){return Object.assign(e,{"x-decorator-props":{...e["x-decorator-props"],labelPlacement:"left",showFeedback:!1,showLabel:!!e.title},"x-component-props":{...e["x-component-props"],size:"small"}})}const _=o((()=>{const t=P(e.fieldItems);return Object.values(t).forEach(S),g(t)}));l(_,(()=>{return e=_.value,void Object.values(e.properties||{}).forEach((e=>{var r;O(t,K(e.name),null==(r=null==e?void 0:e["x-decorator-props"])?void 0:r.span)}));var e}),{immediate:!0});const k=m();function w(){return e.fieldItems.map((e=>k.value.query(e.val_key).take()))}s((()=>{var e;w().forEach((e=>{e&&(e.display="none")})),e=_.value,Object.values(e.properties||{}).forEach((e=>{E(t,K(e.name))}))})),a((()=>{w().forEach((e=>{e&&(e.display="visible")}))}));const I=i(v,["stop"]),A=["onClick","onKeydown","onKeyup","onKeypress"].reduce(((e,t)=>(e[t]=I,e)),{});return()=>{return u("section",c({class:"form-render__labelField",style:{"--column":(e=_.value,Object.values(e.properties||{}).reduce(((e,r)=>e+$(t,K(r.name))),0))}},A),[u(f,{basePath:".",schema:_.value},null)]);var e}}});function S(e,t){p();const r=o((()=>e.options.some((e=>h(e.childrenFields)&&e.childrenFields.length))));function n(e,t,r="value"){if(h(e)?e.includes(t[r]):e===t[r])return h(t.childrenFields)&&t.childrenFields.length}return{renderComplexOption:function({value:e,option:t,valueKey:o="value",labelKey:l="label"}){return[t[l],r.value&&n(e,t,o)?u(P,{fieldItems:t.childrenFields,name:t[o]},null):null]},valueRef:o({get(){return t=e.value,y(t)?t+"":t;var t},set(e){t("update:value",e)}}),hasComplexOption:r}}function _(){return{getSpan:$,setSpan:O,deleteSpan:E,clearSpan:K}}export{S as useComplexOptions,_ as useComplexOptionsSpan};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,pick as n}from"lodash-es";import"../../index.js";import{parseNumberFromMaybeString as r,formRenderLog as i}from"../utils/index.js";import{useFieldNormalize as s}from"./useFieldNormalize.js";import{fieldKeyEscape as a,createLinebarId as p}from"../utils/schema.js";import{useFormValidator as l}from"./useFormValidator.js";import{transformDateFormat as c}from"../utils/business.js";function m(e,o){Object.assign(e["x-component-props"],{...n(o,["wordbook","autograph"])})}function d(d){const{createValidatorSchema:u}=l(),x=e=>{var t;const n={name:e.val_key,type:null!=(t=e.fieldType)?t:"string",title:e.alias||e.name,"x-component":e.html_type,default:e.default_val,"x-component-props":{placeholder:e.placeholder,clearable:"0"===e.is_empty,...e.componentProps||{}},"x-content":e.slots,"x-display":"0"===e.is_show?"hidden":"visible","x-pattern":"0"===e.is_edit?"disabled":"editable"};e.reactions&&(n["x-reactions"]=e.reactions),e.noDecorator||Object.assign(n,{"x-decorator":"FORM_ITEM","x-decorator-props":{fieldItem:o(e,["reactions"]),span:2*(e.elem_width||3),showLabel:"1"!==e.hide_title,remark:e.remark,propertyKey:e.val_key,annotation:e.annotation,...e.decoratorProps||{}}});const r=u(e);return r&&(n["x-validator"]=r),"0"===e.is_null&&(n.required=!0),n},f=e=>{const o=x(e);e.urlConfig?function(e,o){Object.assign(e["x-component-props"],{...n(o,["urlConfig"])})}(o,e):e.autograph&&m(o,e);const t="0"===e.multi_select;return Object.assign(o["x-component-props"],{multiple:t,options:e.option,maxTagCount:r(e.multi_select_value),...n(e,["lazyRequest","requestCache"])}),t&&(o.type="array"),o},_=e=>{const o=x(e);return Object.assign(o["x-component-props"],{options:e.option,vertical:e.__vertical}),m(o,e),o},h=e=>{const t=x(e);return Object.assign(t["x-component-props"],{fieldItem:o(e,["reactions"])}),t},g=e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINEBAR","x-display":"visible","x-component-props":{disabled:"1"===e.is_not_fold,id:p(e.val_key),show:"0"!==e.is_show,remark:e.remark}}),y=new Map([["LINEBAR",g],["LINE_BREAKS",e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINE_BREAKS","x-display":"0"===e.is_show?"hidden":"visible"})],["INPUT",e=>{const o=x(e);return Object.assign(o["x-component-props"],{...n(e,["prefix","suffix"])}),o}],["INPUT_NUMBER",e=>{const o=x(e),{decimal_length:t,validate:n}=e;return Object.assign(o["x-component-props"],{precision:null!=t?t:null==n?void 0:n.decimal_length,prefix:e.prefix,suffix:e.suffix}),o}],["SELECT",f],["REMOTE_SEARCH",f],["DATE",e=>{const o=x(e);return Object.assign(o["x-component-props"],{valueFormat:e.date_format,type:c(e.date_format),validate:e.validate}),o}],["LEVEL_SEARCH_CASCADER",e=>{const o=x(e);return Object.assign(o["x-component-props"],{...n(e,["wordbook","lazyRequest","autograph"])}),o}],["SEARCH_CASCADER",e=>{var o;const t=x(e);return Object.assign(t["x-component-props"],{urlConfig:e.urlConfig,depth:null==(o=e.wordbook)?void 0:o.level_num,options:e.option}),t}],["COMBINATION",e=>{const o=x(e);return o.type="array",!1!==e.jsonCombination&&(o["x-component"]="JSON_COMBINATION"),Object.assign(o["x-decorator-props"],{showLabel:!1,showFeedback:!1}),Object.assign(o["x-component-props"],{title:e.alias||e.name,maxGroupNum:e.maxGroupNum,getProperties:()=>e.children||[]}),o}],["RADIO",_],["CHECKBOX",_],["SWITCH",e=>{const o=x(e);return Object.assign(o["x-component-props"],{openDescription:e.open,closeDescription:e.close}),o}],["SLIDER",e=>{const o=x(e);return Object.assign(o["x-component-props"],{step:r(e.step_length),max:r(e.max_length),min:r(e.min_length),option:e.option}),o}],["COMPLEX",e=>{const o=x(e);Array.isArray(e.properties)&&i("COMPLEX控件的properties属性已经废弃, 请使用children作为替代, 在之后的版本中properties属性将不再支持");const t=Array.isArray(e.properties||e.children)?
|
|
1
|
+
import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,pick as n}from"lodash-es";import"../../index.js";import{parseNumberFromMaybeString as r,formRenderLog as i}from"../utils/index.js";import{useFieldNormalize as s}from"./useFieldNormalize.js";import{fieldKeyEscape as a,createLinebarId as p}from"../utils/schema.js";import{useFormValidator as l}from"./useFormValidator.js";import{transformDateFormat as c}from"../utils/business.js";function m(e,o){Object.assign(e["x-component-props"],{...n(o,["wordbook","autograph"])})}function d(d){const{createValidatorSchema:u}=l(),x=e=>{var t;const n={name:e.val_key,type:null!=(t=e.fieldType)?t:"string",title:e.alias||e.name,"x-component":e.html_type,default:e.default_val,"x-component-props":{placeholder:e.placeholder,clearable:"0"===e.is_empty,...e.componentProps||{}},"x-content":e.slots,"x-display":"0"===e.is_show?"hidden":"visible","x-pattern":"0"===e.is_edit?"disabled":"editable"};e.reactions&&(n["x-reactions"]=e.reactions),e.noDecorator||Object.assign(n,{"x-decorator":"FORM_ITEM","x-decorator-props":{fieldItem:o(e,["reactions"]),span:2*(e.elem_width||3),showLabel:"1"!==e.hide_title,remark:e.remark,propertyKey:e.val_key,annotation:e.annotation,...e.decoratorProps||{}}});const r=u(e);return r&&(n["x-validator"]=r),"0"===e.is_null&&(n.required=!0),n},f=e=>{const o=x(e);e.urlConfig?function(e,o){Object.assign(e["x-component-props"],{...n(o,["urlConfig"])})}(o,e):e.autograph&&m(o,e);const t="0"===e.multi_select;return Object.assign(o["x-component-props"],{multiple:t,options:e.option,allowCreate:"1"===e.free_entry||!!o["x-component-props"].allowCreate,maxTagCount:r(e.multi_select_value),...n(e,["lazyRequest","requestCache"])}),t&&(o.type="array"),o},_=e=>{const o=x(e);return Object.assign(o["x-component-props"],{options:e.option,vertical:e.__vertical}),m(o,e),o},h=e=>{const t=x(e);return Object.assign(t["x-component-props"],{fieldItem:o(e,["reactions"])}),t},g=e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINEBAR","x-display":"visible","x-component-props":{disabled:"1"===e.is_not_fold,id:p(e.val_key),show:"0"!==e.is_show,remark:e.remark}}),y=new Map([["LINEBAR",g],["LINE_BREAKS",e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINE_BREAKS","x-display":"0"===e.is_show?"hidden":"visible"})],["INPUT",e=>{const o=x(e);return Object.assign(o["x-component-props"],{...n(e,["prefix","suffix"])}),o}],["INPUT_NUMBER",e=>{const o=x(e),{decimal_length:t,validate:n}=e;return Object.assign(o["x-component-props"],{precision:null!=t?t:null==n?void 0:n.decimal_length,prefix:e.prefix,suffix:e.suffix}),o}],["SELECT",f],["REMOTE_SEARCH",f],["DATE",e=>{const o=x(e);return Object.assign(o["x-component-props"],{valueFormat:e.date_format,type:c(e.date_format),validate:e.validate}),o}],["LEVEL_SEARCH_CASCADER",e=>{const o=x(e);return Object.assign(o["x-component-props"],{...n(e,["wordbook","lazyRequest","autograph"])}),o}],["SEARCH_CASCADER",e=>{var o;const t=x(e);return Object.assign(t["x-component-props"],{urlConfig:e.urlConfig,depth:null==(o=e.wordbook)?void 0:o.level_num,options:e.option}),t}],["COMBINATION",e=>{const o=x(e);return o.type="array",!1!==e.jsonCombination&&(o["x-component"]="JSON_COMBINATION"),Object.assign(o["x-decorator-props"],{showLabel:!1,showFeedback:!1}),Object.assign(o["x-component-props"],{title:e.alias||e.name,maxGroupNum:e.maxGroupNum,getProperties:()=>e.children||[]}),o}],["RADIO",_],["CHECKBOX",_],["SWITCH",e=>{const o=x(e);return Object.assign(o["x-component-props"],{openDescription:e.open,closeDescription:e.close}),o}],["SLIDER",e=>{const o=x(e);return Object.assign(o["x-component-props"],{step:r(e.step_length),max:r(e.max_length),min:r(e.min_length),option:e.option}),o}],["COMPLEX",e=>{const o=x(e);Array.isArray(e.properties)&&i("COMPLEX控件的properties属性已经废弃, 请使用children作为替代, 在之后的版本中properties属性将不再支持");const t=Array.isArray(e.properties||e.children)?O(e.properties||e.children):{};return o.type=e.fieldType||"void",o.properties=t,Object.assign(o["x-decorator-props"],{showFeedback:!1}),Object.assign(o["x-component-props"],n(e,["wrapperStyle","display"])),o}]]),b=e=>{if(e.suffixConfig)return v(e);return(y.get(e.html_type)||h)(e)},v=o=>{if(!o.suffixConfig)return b(o);const t=e(o.suffixConfig),n=[{...o,is_show:"1",hide_title:"1",suffixConfig:void 0}].concat(t.map((e=>({...e,hide_title:"1",is_show:"1"})))),r=x(o);return Object.assign(r,{type:"void",name:a(n),title:o.alias||o.name,"x-component":"INPUT_GROUP","x-component-props":{span:2*(o.elem_width||3)},"x-decorator-props":{...r["x-decorator-props"],showFeedback:!1,suffixFields:n.map((e=>e.val_key))},properties:O(n)}),r},{FieldNormalizeWaterfallHook:C}=s();function O(o){let n=null;return o.reduce(((e,o,s)=>{var a;const p=null==(a=(o=C.call(t(o))).validate)?void 0:a.obj_type;return p&&d.collect(p,t(o)),"LINEBAR"===o.html_type?(e[i(o)]=r(g(o),s),n=e[i(o)].properties={}):n?n[i(o)]=r(b(o),s):(n=null,e[i(o)]=r(b(o),s)),e}),{});function r(e,o){return e["x-index"]=o,e}function i(o){return o.suffixConfig?a([o,...e(o.suffixConfig)]):o.val_key}}return{schemaAdaptor:O}}export{d as useFieldListAdaptor};
|
|
@@ -10,7 +10,7 @@ export declare function useFormExposeEvent({ formModel, formRenderRef, formUUID,
|
|
|
10
10
|
formItemDepsCollector: FormItemDepsCollector;
|
|
11
11
|
}): {
|
|
12
12
|
validate(path?: string): Promise<void>;
|
|
13
|
-
getFormValues(needCombineExtendKey?: boolean
|
|
13
|
+
getFormValues(needCombineExtendKey?: boolean): any;
|
|
14
14
|
setFormValues(values: AnyObject, needSplitExtendKey?: boolean): void;
|
|
15
15
|
setFieldState(path: string, handler: (field: IFieldState) => void): void;
|
|
16
16
|
resetFields(path?: string): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{arrayed as e,findAncestor as t}from"../../../../shared/utils/index.js";import{isField as r}from"@formily/core";import{Path as o}from"@formily/path";import{isObject as
|
|
1
|
+
import{arrayed as e,findAncestor as t}from"../../../../shared/utils/index.js";import{isField as r}from"@formily/core";import{Path as o}from"@formily/path";import{isObject as i}from"@vue/shared";import{promiseTimeout as n}from"@vueuse/shared";import{isArray as s,isFunction as a}from"lodash-es";import{nextTick as m}from"vue";import"../../index.js";import{FormItemLineBarDepKeyPrepend as u,NESTED_FORM_ITEM_TYPE as f}from"../constants/index.js";import{queryDecoratorByAddress as l,queryInput as d,queryDecoratorByFieldKey as c,findNextWidget as p}from"../utils/dom.js";import{validateMessageParser as g,combineExtendKey as v,splitExtendKey as y}from"../utils/index.js";import{getParentLinebar as h}from"../utils/schema.js";function I({formModel:t,formRenderRef:n,formUUID:a,getFieldList:f,formItemDepsCollector:p}){return{validate(r="*"){return t.validate(r).catch((e=>Promise.reject(Array.isArray(e)?e.reduce(o,[]):e)));function o(t,r){if(!i(r))return t;let o=!1;return s(r.messages)&&r.messages.forEach((r=>{i(r)&&(t.push(...e(r).map(m)),o=!0)})),!o&&t.push(m(r)),t}function m(e){if(e.decoratorElement)return e;const r=t.query(e.path),o=r.get("title"),s=e.messages.map((e=>function(e,t){var r;return t&&i(t.fieldItem)?g(null!=(r=t.fieldItem.defined_error_msg)?r:e,t.fieldItem):e}(e,r.get("decoratorProps")))),m=l(e.address,n.value,a);return{...e,messages:s,title:o,decoratorElement:m,...d(m)}}},getFormValues(e=!0){let r=t.getFormState().values;return e&&(r=v(f(),r)),r},setFormValues(e,i=!0){i&&(e=y(f(),e)),t.setFieldState("*",(t=>{r(t)&&(t.value=o.getIn(e,t.path))}))},setFieldState(e,r){t.setFieldState(e,r)},resetFields:(e="*")=>t.reset(e),queryWidget:async e=>n.value?await async function(e,t,r){if(!n.value)return s();const o=c(e,t,a);if(o)return s(o);const i=h(e,r);return i?(p.trigger(u+i,!0),await m(),s(c(e,t,a))):s();function s(e){return{decoratorElement:e,...d(e)}}}(e,n.value,f()):null}}function x({props:e,formRenderRef:r,formModel:o}){return{onKeydown:function i(s){var m;if(!e.enterToNextWidget||!r.value)return;const u=t(s.target,(e=>e.classList.contains("form-render__formItem")));if(!u)return;const l=`.form-render__formItem${f.map((e=>`:not([widget-type=${e}])`)).join("")}`,d=Array.from(r.value.querySelectorAll(l)),c=d.findIndex((e=>e.id===u.id));if(!~c)return;const{widget:g,field:v}=p(d,c,s.target);if(g)if(a(e.enterToNextWidget)){const t=v&&o.query(v).take();!t||e.enterToNextWidget(null==(m=t.decoratorProps)?void 0:m.fieldItem)?y():i({target:g})}else y();async function y(){await n(0),g.focus()}}}}export{x as useFormDomEvent,I as useFormExposeEvent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useField as e}from"@formily/vue";import{computed as t}from"vue";function
|
|
1
|
+
import{useField as e}from"@formily/vue";import{computed as t}from"vue";function r(){const r=e();return{field:r,title:t((()=>r.value.title)),fieldKey:t((()=>r.value.props.name.toString())),fieldAddress:t((()=>r.value.address.toString()))}}export{r as useFormField};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{arrayed as e}from"../../../../shared/utils/index.js";import{once as a,isString as r}from"lodash-es";import"../utils/index.js";import{isFunction as s}from"@vueuse/core";import{registerValidateLocale as i}from"@formily/core";import{isIdCard as l}from"../utils/business.js";function t(){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 s;if(null!=a)return r(a)&&l(a)?void 0:null!=(s=null==e?void 0:e.message)?s:"该字段不是合法的身份证格式"}})],["regular",({validate:e,regular_expression:a,regular_error_tip:r})=>({pattern:a||(null==e?void 0:e.regular_expression)||"",message:r||(null==e?void 0:e.regular_error_tip)||(null==e?void 0:e.message)||"格式错误"})]]),i={triggerType:"onBlur"};return{createValidatorSchema:function(r){const l=[],{validate:{vali_obj:t,max_length:o,min_length:n,message:m,max_value:u,min_value:g,decimal_length:d}={},validator:v}=r;if(v&&e(v).forEach((e=>{s(e)&&l.push({validator:a=>e(a,r)})})),o&&l.push({max:o,message:m}),n&&l.push({min:n,message:m}),u&&l.push({maximum:u,message:m}),g&&l.push({minimum:g,message:m}),null!=d&&l.push(((e,a)=>{const r=null!=a?a:`小数位数最多${e}位`;return{validator(a){var s;return(null==(s=String(a).split(".")[1])?void 0:s.length)>e?r:""}}})(+d,m)),t){const e=a.get(t)||(({validate:e})=>({format:t,message:null==e?void 0:e.message}));l.push(Object.assign({},i,e(r)))}return l}}}const o=a((()=>{i({"zh-CN":{required:"${alias}为必填"}})}));export{t as useFormValidator,o as validateMessageLocale};
|
|
1
|
+
import{arrayed as e}from"../../../../shared/utils/index.js";import{once as a,isString as r}from"lodash-es";import"../utils/index.js";import{isFunction as s}from"@vueuse/core";import{registerValidateLocale as i}from"@formily/core";import{isIdCard as l}from"../utils/business.js";function t(){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 s;if(null!=a&&""!==a)return r(a)&&l(a)?void 0:null!=(s=null==e?void 0:e.message)?s:"该字段不是合法的身份证格式"}})],["regular",({validate:e,regular_expression:a,regular_error_tip:r})=>({pattern:a||(null==e?void 0:e.regular_expression)||"",message:r||(null==e?void 0:e.regular_error_tip)||(null==e?void 0:e.message)||"格式错误"})]]),i={triggerType:"onBlur"};return{createValidatorSchema:function(r){const l=[],{validate:{vali_obj:t,max_length:o,min_length:n,message:m,max_value:u,min_value:g,decimal_length:d}={},validator:v}=r;if(v&&e(v).forEach((e=>{s(e)&&l.push({validator:a=>e(a,r)})})),o&&l.push({max:o,message:m}),n&&l.push({min:n,message:m}),u&&l.push({maximum:u,message:m}),g&&l.push({minimum:g,message:m}),null!=d&&l.push(((e,a)=>{const r=null!=a?a:`小数位数最多${e}位`;return{validator(a){var s;return(null==(s=String(a).split(".")[1])?void 0:s.length)>e?r:""}}})(+d,m)),t){const e=a.get(t)||(({validate:e})=>({format:t,message:null==e?void 0:e.message}));l.push(Object.assign({},i,e(r)))}return l}}}const o=a((()=>{i({"zh-CN":{required:"${alias}为必填"}})}));export{t as useFormValidator,o as validateMessageLocale};
|
|
@@ -28,7 +28,7 @@ export declare type IdCardParseInfo = Record<'sex' | 'birthday', string> & AgeCo
|
|
|
28
28
|
export declare type FormRenderExpose = {
|
|
29
29
|
formModel: Form;
|
|
30
30
|
validate(path?: string): Promise<unknown>;
|
|
31
|
-
getFormValues(needCombineExtendKey?: boolean
|
|
31
|
+
getFormValues(needCombineExtendKey?: boolean): AnyObject;
|
|
32
32
|
setFormValues(values: AnyObject, needSplitExtendKey?: boolean): AnyObject;
|
|
33
33
|
setFieldState(path: string, setter: (field: Field) => void): void;
|
|
34
34
|
resetFields(path?: string): void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Nullable } from '../../../../../es/shared/types';
|
|
2
|
-
export declare function
|
|
2
|
+
export declare function queryDecoratorByFieldKey(key: string, wrapperElement: HTMLElement, formUUID: string): HTMLElement | null;
|
|
3
|
+
export declare function queryDecoratorByAddress(key: string, wrapperElement: HTMLElement, formUUID: string): HTMLElement | null;
|
|
3
4
|
export declare function queryInput(decoratorElement?: Nullable<HTMLElement>): {
|
|
4
5
|
widgetElement: HTMLInputElement | null | undefined;
|
|
5
6
|
widgetElementList: HTMLInputElement[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{dotEscape as e}from"./schema.js";function t(t,r,n){return r.querySelector(e(
|
|
1
|
+
import{dotEscape as e}from"./schema.js";function t(t,r,n){return r.querySelector(`[uuid=${n}][field-key=${e(t)}]`)}function r(t,r,n){return r.querySelector(`[uuid=${n}][field-address=${e(t)}]`)}function n(e){var t;return{widgetElement:null==e?void 0:e.querySelector("input"),widgetElementList:Array.from(null!=(t=null==e?void 0:e.querySelectorAll("input"))?t:[])}}function i(e,t,r){const n=d(e[t],r);if(n)return{widget:n,field:u(e[t])};let i=null,l=null;return e.slice(t+1).some((e=>{const t=i=d(e);return t&&(l=u(e)),t})),{widget:i,field:l};function u(e){return e&&e.getAttribute("field-key")}function d(e,t){const r=Array.from(e.querySelectorAll("textarea,input,[tabindex]")),n=t?r.findIndex((e=>e===t)):-1;return r.slice(n+1).find((e=>!Reflect.get(e,"disabled")&&!Array.from(e.classList).some((e=>e.endsWith("--disabled")))))}}export{i as findNextWidget,r as queryDecoratorByAddress,t as queryDecoratorByFieldKey,n as queryInput};
|