cnhis-design-vue 3.1.42-beta.76 → 3.1.42-beta.77

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 +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,normalizeClass as m,normalizeStyle as p,withCtx as d,createElementBlock as u,createVNode as c,isRef as f,Fragment as h,renderList as y,createCommentVNode as j,createElementVNode as g,withKeys as b,withModifiers as k,toDisplayString as v,renderSlot as F}from"vue";import{useTheme as x}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isNumber as C,cloneDeep as H}from"lodash-es";import{createForm as S,onFieldValueChange as A,onFieldMount as L,onFieldUnmount as R,onFieldReact as _,onFormMount as O}from"@formily/core";import{FormProvider as B,FormConsumer as w}from"@formily/vue";import{NForm as V,NTabs as I,NTabPane as N,NConfigProvider as D}from"naive-ui";import{InjectionFormGraph as q}from"./constants/index.js";import{useAutoHidden as U}from"./hooks/useAutoHidden.js";import{useComplexOptionsSpan as W}from"./hooks/useComplexOptions.js";import{useFormDomEvent as G,useFormExposeEvent as T}from"./hooks/useFormEvent.js";import{useFormGraph as K}from"./hooks/useFormGraph.js";import{useFormRenderLifeCycle as M}from"./hooks/useFormRenderLifeCycle.js";import{useLowCodeReactions as E}from"./hooks/useLowCodeReactions.js";import{useNuiThemeOverrides as P}from"./hooks/useNuiThemeOverrides.js";import"./utils/index.js";import{useFieldListAdaptor as J}from"./hooks/useFieldListAdaptor.js";import"../../../shared/utils/index.js";import"../index.js";import{useFieldVisitor as $}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 z}from"./hooks/useFormValidator.js";import{useAnchor as Q}from"./hooks/useAnchor.js";import{useFormContext as X}from"./hooks/useFormContext.js";import"./hooks/useFormRenderOptions.js";import Y from"../../../_virtual/plugin-vue_export-helper.js";import{createObjSchema as Z}from"./utils/schema.js";const ee={key:0,style:{height:"54px"}},oe={style:{"white-space":"pre"}};var te=Y(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},bordered:{type:Boolean,default:!0}},emits:["formChange","annotationChange","scroll"],setup(e,{expose:Y,emit:te}){const re=e,se=x(),{nuiThemeOverrides:ae}=P();z();const ie=o(),le=t((()=>C(re.maxHeight)?re.maxHeight+"px":re.maxHeight)),{SchemaField:ne,businessCollector:me,formItemDepsCollector:pe,changeContextCollector:de,formUUID:ue}=X(re,te),{anchorBarRef:ce,currentAnchor:fe,generateAnchorList:he,updateAnchorList:ye,anchorIdList:je,onScroll:ge}=Q(re,te,ie,pe);M(re).callLifeCycle("onSetup");const{trigger:be}=U(),{observeFormGraph:ke,setGraph:ve,removeGraph:Fe}=K();r(q,ke);const xe=S({initialValues:re.initialData,effects(e){A("*",(o=>{const t=o.props.name.toString();me.trigger(e,t),pe.trigger(t),te("formChange",{fieldInstance:o,fieldKey:t,fieldName:o.title,value:o.value,context:de.getContext(t,o.value)}),Ce(t,o.value)})),L("*",ve),R("*",Fe),re.linebarAutoHidden&&(_("*",be),O((e=>e.query("*").forEach(be)))),re.anchor&&(_("*",ye),O(he))}}),{lowCodeReactionsHandler:Ce,triggerAllReactionsHandler:He}=E(t((()=>re.lowCodeReactions)),xe);s(He);const{schemaAdaptor:Se}=J(me);let Ae=re.fieldList||[];const Le=t((()=>re.schema?re.schema:re.fieldList?(Ae=$().traverse(H(re.fieldList),re.fieldVisitor),Z(Se(Ae))):Z({}))),{onKeydown:Re}=G({formModel:xe,formRenderRef:ie,props:re}),{clearSpan:_e}=W();a((()=>_e(ue)));const Oe=T({formModel:xe,formRenderRef:ie,formItemDepsCollector:pe,getFieldList:()=>Ae,formUUID:ue});return Y({formModel:xe,validate:(e="*")=>Oe.validate(e),getFormValues:(e=!0)=>Oe.getFormValues(e),setFormValues(e,o=!0,t=!1,r=!0){t&&(me.triggerLock=!0),Oe.setFormValues(e,o,r),me.triggerLock=!1},setFieldState(e,o){Oe.setFieldState(e,o)},resetFields(e="*"){Oe.resetFields(e)},queryWidget:async e=>Oe.queryWidget(e),getFieldList:()=>Ae,async reload(){console.error("reload function is abstract,it should be overwrite!")}}),(o,t)=>(i(),l(n(V),{class:m(["form-render",{"form-render--no-border":!e.bordered}]),"require-mark-placement":"left",style:p(n(se))},{default:d((()=>[e.anchor?(i(),u("section",ee,[c(n(I),{value:n(fe),"onUpdate:value":t[0]||(t[0]=e=>f(fe)?fe.value=e:null),type:"line",ref_key:"anchorBarRef",ref:ce},{default:d((()=>[(i(!0),u(h,null,y(n(je),(e=>(i(),l(n(N),{name:e.name,tab:e.title,key:e.name},null,8,["name","tab"])))),128))])),_:1},8,["value"])])):j("v-if",!0),c(n(D),{"theme-overrides":n(ae)},{default:d((()=>[g("section",{class:"form-render__wrapper",style:p({"--column":e.column,"--form-height":n(le)}),ref_key:"formRenderRef",ref:ie,onScroll:t[1]||(t[1]=(...e)=>n(ge)&&n(ge)(...e)),onKeydownCapture:t[2]||(t[2]=b(k(((...e)=>n(Re)&&n(Re)(...e)),["prevent"]),["enter"]))},[c(n(B),{form:n(xe)},{default:d((()=>[c(n(ne),{schema:n(Le)},null,8,["schema"]),e.consumer?(i(),l(n(w),{key:0},{default:d((({form:e})=>[g("div",oe,v(JSON.stringify(e.values,null,2)),1)])),_:1})):j("v-if",!0),F(o.$slots,"default")])),_:3},8,["form"])],36)])),_:3},8,["theme-overrides"])])),_:3},8,["class","style"]))}}),[["__file","FormRender.vue"]]);export{te as default};
1
+ import{defineComponent as e,ref as o,computed as t,provide as r,onMounted as s,onUnmounted as a,nextTick as i,openBlock as l,createBlock as n,unref as m,normalizeClass as p,normalizeStyle as d,withCtx as u,createElementBlock as c,createVNode as f,isRef as h,Fragment as y,renderList as j,createCommentVNode as g,createElementVNode as b,withKeys as k,withModifiers as v,toDisplayString as F,renderSlot as x}from"vue";import{useTheme as C}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isNumber as H,cloneDeep as S}from"lodash-es";import{createForm as A,onFieldValueChange as L,onFieldMount as R,onFieldUnmount as _,onFieldReact as O,onFormMount as w}from"@formily/core";import{FormProvider as B,FormConsumer as V}from"@formily/vue";import{NForm as I,NTabs as N,NTabPane as D,NConfigProvider as q}from"naive-ui";import{InjectionFormGraph as U}from"./constants/index.js";import{useAutoHidden as W}from"./hooks/useAutoHidden.js";import{useComplexOptionsSpan as G}from"./hooks/useComplexOptions.js";import{useFormDomEvent as T,useFormExposeEvent as K}from"./hooks/useFormEvent.js";import{useFormGraph as M}from"./hooks/useFormGraph.js";import{useFormRenderLifeCycle as E}from"./hooks/useFormRenderLifeCycle.js";import{useLowCodeReactions as P}from"./hooks/useLowCodeReactions.js";import{useNuiThemeOverrides as J}from"./hooks/useNuiThemeOverrides.js";import"./utils/index.js";import{useFieldListAdaptor as $}from"./hooks/useFieldListAdaptor.js";import"../../../shared/utils/index.js";import"../index.js";import{useFieldVisitor as z}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 Q}from"./hooks/useFormValidator.js";import{useAnchor as X}from"./hooks/useAnchor.js";import{useFormContext as Y}from"./hooks/useFormContext.js";import"./hooks/useFormRenderOptions.js";import Z from"../../../_virtual/plugin-vue_export-helper.js";import{createObjSchema as ee}from"./utils/schema.js";const oe={key:0,style:{height:"54px"}},te={style:{"white-space":"pre"}};var re=Z(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},bordered:{type:Boolean,default:!0}},emits:["formChange","annotationChange","scroll"],setup(e,{expose:Z,emit:re}){const se=e,ae=C(),{nuiThemeOverrides:ie}=J();Q();const le=o(),ne=t((()=>H(se.maxHeight)?se.maxHeight+"px":se.maxHeight)),{SchemaField:me,businessCollector:pe,formItemDepsCollector:de,changeContextCollector:ue,formUUID:ce}=Y(se,re),{anchorBarRef:fe,currentAnchor:he,generateAnchorList:ye,updateAnchorList:je,anchorIdList:ge,onScroll:be}=X(se,re,le,de);E(se).callLifeCycle("onSetup");const{trigger:ke}=W(),{observeFormGraph:ve,setGraph:Fe,removeGraph:xe}=M();r(U,ve);const Ce=A({initialValues:se.initialData,effects(e){L("*",(o=>{const t=o.props.name.toString();pe.trigger(e,t),de.trigger(t),re("formChange",{fieldInstance:o,fieldKey:t,fieldName:o.title,value:o.value,context:ue.getContext(t,o.value)}),He(t,o.value)})),R("*",Fe),_("*",xe),se.linebarAutoHidden&&(O("*",ke),w((e=>e.query("*").forEach(ke)))),se.anchor&&(O("*",je),w(ye))}}),{lowCodeReactionsHandler:He,triggerAllReactionsHandler:Se}=P(t((()=>se.lowCodeReactions)),Ce);s(Se);const{schemaAdaptor:Ae}=$(pe);let Le=se.fieldList||[];const Re=t((()=>se.schema?se.schema:se.fieldList?(Le=z().traverse(S(se.fieldList),se.fieldVisitor),ee(Ae(Le))):ee({}))),{onKeydown:_e}=T({formModel:Ce,formRenderRef:le,props:se}),{clearSpan:Oe}=G();a((()=>Oe(ce)));const we=K({formModel:Ce,formRenderRef:le,formItemDepsCollector:de,getFieldList:()=>Le,formUUID:ce});return Z({formModel:Ce,validate:(e="*")=>we.validate(e),getFormValues:(e=!0)=>we.getFormValues(e),async setFormValues(e,o=!0,t=!1,r=!0){t&&(pe.triggerLock=!0),we.setFormValues(e,o,r),await i(),pe.triggerLock=!1},setFieldState(e,o){we.setFieldState(e,o)},resetFields(e="*"){we.resetFields(e)},queryWidget:async e=>we.queryWidget(e),getFieldList:()=>Le,async reload(){console.error("reload function is abstract,it should be overwrite!")}}),(o,t)=>(l(),n(m(I),{class:p(["form-render",{"form-render--no-border":!e.bordered}]),"require-mark-placement":"left",style:d(m(ae))},{default:u((()=>[e.anchor?(l(),c("section",oe,[f(m(N),{value:m(he),"onUpdate:value":t[0]||(t[0]=e=>h(he)?he.value=e:null),type:"line",ref_key:"anchorBarRef",ref:fe},{default:u((()=>[(l(!0),c(y,null,j(m(ge),(e=>(l(),n(m(D),{name:e.name,tab:e.title,key:e.name},null,8,["name","tab"])))),128))])),_:1},8,["value"])])):g("v-if",!0),f(m(q),{"theme-overrides":m(ie)},{default:u((()=>[b("section",{class:"form-render__wrapper",style:d({"--column":e.column,"--form-height":m(ne)}),ref_key:"formRenderRef",ref:le,onScroll:t[1]||(t[1]=(...e)=>m(be)&&m(be)(...e)),onKeydownCapture:t[2]||(t[2]=k(v(((...e)=>m(_e)&&m(_e)(...e)),["prevent"]),["enter"]))},[f(m(B),{form:m(Ce)},{default:u((()=>[f(m(me),{schema:m(Re)},null,8,["schema"]),e.consumer?(l(),n(m(V),{key:0},{default:u((({form:e})=>[b("div",te,F(JSON.stringify(e.values,null,2)),1)])),_:1})):g("v-if",!0),x(o.$slots,"default")])),_:3},8,["form"])],36)])),_:3},8,["theme-overrides"])])),_:3},8,["class","style"]))}}),[["__file","FormRender.vue"]]);export{re as default};
@@ -31,7 +31,7 @@ export declare type FormRenderExpose = {
31
31
  formModel: Form;
32
32
  validate(path?: string): Promise<unknown>;
33
33
  getFormValues(needCombineExtendKey?: boolean): AnyObject;
34
- setFormValues(values: AnyObject, needSplitExtendKey?: boolean, avoidBusinessConnection?: boolean, overwrite?: boolean): AnyObject;
34
+ setFormValues(values: AnyObject, needSplitExtendKey?: boolean, avoidBusinessConnection?: boolean, overwrite?: boolean): any;
35
35
  setFieldState(path: string, setter: (field: Field) => void): void;
36
36
  resetFields(path?: string): void;
37
37
  queryWidget(key: string): Promise<{
@@ -1 +1 @@
1
- var e="@cnhis-design-vue/shared",i="3.1.42-beta.76",s="index.ts",n={"naive-ui":"^2.30.0",vue:"^3.2.0"},a={"@vicons/ionicons5":"^0.12.0","lodash-es":"^4.17.21",moment:"^2.29.1","video.js":"^7.19.2","videojs-contrib-hls":"^5.15.0",viewerjs:"^1.10.5","xe-utils":"^3.5.4"},d={name:e,version:"3.1.42-beta.76",private:!0,main:"index.ts",peerDependencies:n,dependencies:a};export{d as default,a as dependencies,s as main,e as name,n as peerDependencies,i as version};
1
+ var e="@cnhis-design-vue/shared",i="3.1.42-beta.77",s="index.ts",n={"naive-ui":"^2.30.0",vue:"^3.2.0"},a={"@vicons/ionicons5":"^0.12.0","lodash-es":"^4.17.21",moment:"^2.29.1","video.js":"^7.19.2","videojs-contrib-hls":"^5.15.0",viewerjs:"^1.10.5","xe-utils":"^3.5.4"},d={name:e,version:"3.1.42-beta.77",private:!0,main:"index.ts",peerDependencies:n,dependencies:a};export{d as default,a as dependencies,s as main,e as name,n as peerDependencies,i as version};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "3.1.42-beta.76",
3
+ "version": "3.1.42-beta.77",
4
4
  "license": "ISC",
5
5
  "module": "./es/components/index.js",
6
6
  "main": "./es/components/index.js",
@@ -61,5 +61,5 @@
61
61
  "iOS 7",
62
62
  "last 3 iOS versions"
63
63
  ],
64
- "gitHead": "5ce8b71c40010a68849b7937c47c0d76a29d2a1f"
64
+ "gitHead": "ecf3b395754cc893aa1920cfb0eaa597b050bda2"
65
65
  }