cnhis-design-vue 3.1.46-beta.29 → 3.1.46-beta.30

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.
@@ -3484,7 +3484,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
3484
3484
  validate: import("../../../es/shared/types").Func<any[], any>;
3485
3485
  } | undefined>;
3486
3486
  transform: (fieldList: import("./src/types").FormConfigItem[]) => import("./src/types").FormConfigItem[];
3487
- inverseTransform: (fieldList: import("./src/types").FormConfigItem[]) => import("./src/types").FormConfigItem[];
3487
+ inverseTransform: (fieldList: import("./src/types").FormConfigItem[], withOriginalSetting: boolean) => import("./src/types").FormConfigItem[];
3488
3488
  extraValueRef: import("vue").WritableComputedRef<any>;
3489
3489
  _extraOptions: import("vue").Ref<{
3490
3490
  key: string;
@@ -3486,7 +3486,7 @@ declare const _default: import("vue").DefineComponent<{
3486
3486
  validate: Func;
3487
3487
  } | undefined>;
3488
3488
  transform: (fieldList: FormConfigItem[]) => FormConfigItem[];
3489
- inverseTransform: (fieldList: FormConfigItem[]) => FormConfigItem[];
3489
+ inverseTransform: (fieldList: FormConfigItem[], withOriginalSetting: boolean) => FormConfigItem[];
3490
3490
  extraValueRef: import("vue").WritableComputedRef<any>;
3491
3491
  _extraOptions: import("vue").Ref<{
3492
3492
  key: string;
@@ -1 +1 @@
1
- import{defineComponent as e,provide as o,ref as t,computed as a,toRaw as r,openBlock as i,createElementBlock as l,normalizeStyle as n,unref as s,createElementVNode as m,createVNode as f,mergeProps as u,withCtx as c,createBlock as d,isRef as p,createCommentVNode as v,createTextVNode as g}from"vue";import{useTheme as h}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isArray as _,cloneDeep as y,isFunction as x}from"lodash-es";import{uuidGenerator as C}from"../../../shared/utils/index.js";import j from"../../../shared/components/VueDraggable/src/vuedraggable.js";import k from"./components/FormConfigCreator.vue.js";import L from"./components/FormConfigDragDisplay.vue.js";import F from"./components/FormConfigEdit.vue.js";import b from"./components/FormConfigMaterialItem.js";import{useDataNormalize as M}from"./hooks/useDataNormalize.js";import{InjectionFormConfigEmit as V,InjectionFieldList as E,InjectionMaterialList as I,InjectionActiveFieldItem as D,FORM_CONFIG_GROUP as R}from"./constants/index.js";import"@vicons/ionicons5";import{NSelect as H}from"naive-ui";import"./utils/index.js";import{useSortableConfig as N}from"./hooks/useSortalbeConfig.js";import"./hooks/useConfigurationField.js";const O=["id"],A={class:"form-config__material"},S=m("header",{class:"form-config__materialHeader"},"物料区",-1),T={class:"form-config__displayWrapper"},U={class:"form-config__displayHeader"},w={class:"form-config__config"},B=m("header",{class:"form-config__configHeader"},"配置区",-1),z={class:"form-config__configContent"};var W=e({__name:"FormConfig",props:{maxHeight:{type:String},fieldVisitor:{type:Object},textFormatter:{type:Function},formRenderRef:{type:Object},extraMaterialList:{type:[Array,Function]}},emits:["addItem","removeItem"],setup(e,{expose:W,emit:q}){const G=e;o(V,q);const J=C(),K=h(),{getCommonConfig:P}=N(),Q=t([]);o(E,Q);const X=t([]);function Y(e){Q.value.some((o=>o.key===e.key))||Q.value.push(e)}o(I,X);const Z=(e,o)=>x(G.textFormatter)?G.textFormatter(e,o):o,$=t();o(D,$);const ee=t(),{transform:oe,inverseTransform:te}=M(G),ae=a({get:()=>null,set(e){if(!e)return;const o=ie.value.find((o=>o.key===e));o&&(o.__extra=!0,X.value.push(o),q("addItem",o))}}),re=t([]),ie=a((()=>_(re.value)?re.value.filter((e=>!X.value.find((o=>o.key===e.key))&&!Q.value.find((o=>o.key===e.key)))):[]));async function le(){G.extraMaterialList&&!re.value.length&&(re.value=x(G.extraMaterialList)?await G.extraMaterialList():G.extraMaterialList)}return W({loadData({fieldList:e}){let o=[],t=[];e.forEach((e=>function(e){"LINE_BAR"===e.type&&(e.children=[]);!1===e.show?t.push(e):o.push(e),"COMBINATION"===e.type&&_(e.children)&&e.children.length&&e.children.forEach((e=>{e.__isCombinationChild=!0}))}(y(r(e))))),Q.value=oe(o),X.value=t,$.value=void 0},validate(){var e;return null==(e=ee.value)?void 0:e.validate()},getData:()=>({fieldList:te(y(r(Q.value))),materialList:te(y(r(X.value)))}),clearExtraList(){re.value=[]}}),(o,t)=>(i(),l("section",{class:"form-config",style:n({"--max-height":e.maxHeight,...s(K)}),id:s(J)},[m("section",A,[S,f(s(j),u(s(P)(),{class:"form-config__materialContent",modelValue:X.value,"onUpdate:modelValue":t[0]||(t[0]=e=>X.value=e)}),{item:c((({element:e})=>[f(s(b),{"form-config-item":e,"text-formatter":Z,"material-List":X.value},null,8,["form-config-item","material-List"])])),_:1},16,["modelValue"]),e.extraMaterialList?(i(),d(s(H),{key:0,class:"form-config__materialExtraList",filterable:"",value:s(ae),"onUpdate:value":t[1]||(t[1]=e=>p(ae)?ae.value=e:null),placeholder:"请选择额外物料",options:s(ie),"label-field":"name","value-field":"key",onFocus:le},null,8,["value","options"])):v("v-if",!0)]),m("section",T,[m("header",U,[g(" 布局区 "),f(k,{onSubmit:Y})]),f(L,{class:"form-config__displayContent",group:s(R),"text-formatter":Z,modelValue:Q.value,"onUpdate:modelValue":t[2]||(t[2]=e=>Q.value=e)},null,8,["group","modelValue"])]),m("section",w,[B,m("section",z,[f(F,{ref_key:"formConfigEditRef",ref:ee,uuid:s(J),"form-render-ref":e.formRenderRef},null,8,["uuid","form-render-ref"])])])],12,O))}});export{W as default};
1
+ import{defineComponent as e,provide as o,ref as t,computed as a,toRaw as r,openBlock as i,createElementBlock as l,normalizeStyle as n,unref as s,createElementVNode as m,createVNode as f,mergeProps as u,withCtx as c,createBlock as d,isRef as p,createCommentVNode as v,createTextVNode as g}from"vue";import{useTheme as h}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isArray as _,cloneDeep as y,isFunction as x}from"lodash-es";import{uuidGenerator as C}from"../../../shared/utils/index.js";import j from"../../../shared/components/VueDraggable/src/vuedraggable.js";import k from"./components/FormConfigCreator.vue.js";import L from"./components/FormConfigDragDisplay.vue.js";import F from"./components/FormConfigEdit.vue.js";import b from"./components/FormConfigMaterialItem.js";import{useDataNormalize as M}from"./hooks/useDataNormalize.js";import{InjectionFormConfigEmit as V,InjectionFieldList as E,InjectionMaterialList as I,InjectionActiveFieldItem as D,FORM_CONFIG_GROUP as R}from"./constants/index.js";import"@vicons/ionicons5";import{NSelect as H}from"naive-ui";import"./utils/index.js";import{useSortableConfig as N}from"./hooks/useSortalbeConfig.js";import"./hooks/useConfigurationField.js";const O=["id"],A={class:"form-config__material"},S=m("header",{class:"form-config__materialHeader"},"物料区",-1),T={class:"form-config__displayWrapper"},U={class:"form-config__displayHeader"},w={class:"form-config__config"},B=m("header",{class:"form-config__configHeader"},"配置区",-1),z={class:"form-config__configContent"};var W=e({__name:"FormConfig",props:{maxHeight:{type:String},fieldVisitor:{type:Object},textFormatter:{type:Function},formRenderRef:{type:Object},extraMaterialList:{type:[Array,Function]}},emits:["addItem","removeItem"],setup(e,{expose:W,emit:q}){const G=e;o(V,q);const J=C(),K=h(),{getCommonConfig:P}=N(),Q=t([]);o(E,Q);const X=t([]);function Y(e){Q.value.some((o=>o.key===e.key))||Q.value.push(e)}o(I,X);const Z=(e,o)=>x(G.textFormatter)?G.textFormatter(e,o):o,$=t();o(D,$);const ee=t(),{transform:oe,inverseTransform:te}=M(G),ae=a({get:()=>null,set(e){if(!e)return;const o=ie.value.find((o=>o.key===e));o&&(o.__extra=!0,X.value.push(o),q("addItem",o))}}),re=t([]),ie=a((()=>_(re.value)?re.value.filter((e=>!X.value.find((o=>o.key===e.key))&&!Q.value.find((o=>o.key===e.key)))):[]));async function le(){G.extraMaterialList&&!re.value.length&&(re.value=x(G.extraMaterialList)?await G.extraMaterialList():G.extraMaterialList)}return W({loadData({fieldList:e}){let o=[],t=[];e.forEach((e=>function(e){"LINE_BAR"===e.type&&(e.children=[]);!1===e.show?t.push(e):o.push(e),"COMBINATION"===e.type&&_(e.children)&&e.children.length&&e.children.forEach((e=>{e.__isCombinationChild=!0}))}(y(r(e))))),Q.value=oe(o),X.value=t,$.value=void 0},validate(){var e;return null==(e=ee.value)?void 0:e.validate()},getData:(e=!1)=>({fieldList:te(y(r(Q.value)),e),materialList:te(y(r(X.value)),e)}),clearExtraList(){re.value=[]}}),(o,t)=>(i(),l("section",{class:"form-config",style:n({"--max-height":e.maxHeight,...s(K)}),id:s(J)},[m("section",A,[S,f(s(j),u(s(P)(),{class:"form-config__materialContent",modelValue:X.value,"onUpdate:modelValue":t[0]||(t[0]=e=>X.value=e)}),{item:c((({element:e})=>[f(s(b),{"form-config-item":e,"text-formatter":Z,"material-List":X.value},null,8,["form-config-item","material-List"])])),_:1},16,["modelValue"]),e.extraMaterialList?(i(),d(s(H),{key:0,class:"form-config__materialExtraList",filterable:"",value:s(ae),"onUpdate:value":t[1]||(t[1]=e=>p(ae)?ae.value=e:null),placeholder:"请选择额外物料",options:s(ie),"label-field":"name","value-field":"key",onFocus:le},null,8,["value","options"])):v("v-if",!0)]),m("section",T,[m("header",U,[g(" 布局区 "),f(k,{onSubmit:Y})]),f(L,{class:"form-config__displayContent",group:s(R),"text-formatter":Z,modelValue:Q.value,"onUpdate:modelValue":t[2]||(t[2]=e=>Q.value=e)},null,8,["group","modelValue"])]),m("section",w,[B,m("section",z,[f(F,{ref_key:"formConfigEditRef",ref:ee,uuid:s(J),"form-render-ref":e.formRenderRef},null,8,["uuid","form-render-ref"])])])],12,O))}});export{W as default};
@@ -3,5 +3,5 @@ export declare function useDataNormalize(props: {
3
3
  fieldVisitor?: FormConfigVisitor;
4
4
  }): {
5
5
  transform: (fieldList: FormConfigItem[]) => FormConfigItem[];
6
- inverseTransform: (fieldList: FormConfigItem[]) => FormConfigItem[];
6
+ inverseTransform: (fieldList: FormConfigItem[], withOriginalSetting: boolean) => FormConfigItem[];
7
7
  };
@@ -1 +1 @@
1
- import{isObject as e,omit as n}from"lodash-es";function r(r){return{transform:function(n){let i=null;const t=r.fieldVisitor;return n.reduce(((n,r)=>(r.originalSetting&&e(t)&&t[r.key]&&t[r.key]({field:r.originalSetting,replace(e){r.originalSetting=e}}),"LINE_BAR"===r.type?(r.children=[],i=r.children,n.push(r),n):i?(i.push(r),n):(n.push(r),n))),[])},inverseTransform:function(e){return e.reduce(((e,r)=>("LINE_BAR"===r.type?(e.push(n(r,["children"])),e.push(...r.children||[])):e.push(r),e)),[]).map((e=>n(e,["originalSetting"])))}}}export{r as useDataNormalize};
1
+ import{isObject as e,omit as n}from"lodash-es";function r(r){return{transform:function(n){let i=null;const t=r.fieldVisitor;return n.reduce(((n,r)=>(r.originalSetting&&e(t)&&t[r.key]&&t[r.key]({field:r.originalSetting,replace(e){r.originalSetting=e}}),"LINE_BAR"===r.type?(r.children=[],i=r.children,n.push(r),n):i?(i.push(r),n):(n.push(r),n))),[])},inverseTransform:function(e,r){return e.reduce(((e,r)=>("LINE_BAR"===r.type?(e.push(n(r,["children"])),e.push(...r.children||[])):e.push(r),e)),[]).map((e=>r?e:n(e,["originalSetting"])))}}}export{r as useDataNormalize};
@@ -38,7 +38,7 @@ export interface FormConfigTextFormatter {
38
38
  export interface FormConfigExpose {
39
39
  loadData(payload: Record<'fieldList', FormConfigItem[]>): void;
40
40
  validate(): Promise<unknown>;
41
- getData(): Record<'fieldList' | 'materialList', FormConfigItem[]>;
41
+ getData(withOriginalSetting?: boolean): Record<'fieldList' | 'materialList', FormConfigItem[]>;
42
42
  clearExtraList(): void;
43
43
  }
44
44
  interface FieldVisitorContext {
@@ -1 +1 @@
1
- var e="@cnhis-design-vue/shared",i="3.1.46-beta.29",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.46-beta.29",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.46-beta.30",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.46-beta.30",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.46-beta.29",
3
+ "version": "3.1.46-beta.30",
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": "d3d24411ebc8bf6b46bf234ccd7497d8105ca038"
64
+ "gitHead": "24ff2c7d8c1e433caed796756010b7440009a150"
65
65
  }