cnhis-design-vue 3.1.53-beta.2 → 3.1.53-beta.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/annotation-edit/src/AnnotationEdit.js +1 -1
- package/es/components/body-select/index.d.ts +9 -4
- package/es/components/body-select/src/config/index.js +1 -1
- package/es/components/body-select/src/hooks/renderCanvas.d.ts +1 -1
- package/es/components/body-select/src/hooks/renderCanvas.js +1 -1
- package/es/components/body-select/src/index.vue.d.ts +9 -4
- package/es/components/body-select/src/index.vue2.js +1 -1
- package/es/components/callback/src/components/render/popupMaps.d.ts +25 -1
- package/es/components/card-reader-sdk/src/cardReaderSDK.js +1 -1
- package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
- package/es/components/form-config/index.d.ts +74 -2
- package/es/components/form-config/src/FormConfig.vue.d.ts +74 -2
- package/es/components/form-config/src/FormConfig.vue2.js +1 -1
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +25 -1
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +37 -1
- package/es/components/form-config/src/components/FormConfigEventSetting.vue2.js +1 -1
- package/es/components/form-render/index.d.ts +25 -1
- package/es/components/form-render/index.js +1 -1
- package/es/components/form-render/src/FormRender.vue.d.ts +25 -1
- package/es/components/form-render/src/FormRender.vue2.js +1 -1
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +25 -1
- package/es/components/form-render/src/components/renderer/combination.js +1 -1
- package/es/components/form-render/src/components/renderer/levelSearchCascader/index.js +1 -1
- package/es/components/form-render/src/components/renderer/searchCascade.js +1 -1
- package/es/components/form-render/src/components/renderer/select.d.ts +1 -1
- package/es/components/form-render/src/components/renderer/select.js +1 -1
- package/es/components/form-render/src/hooks/index.js +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.d.ts +2 -2
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/form-render/src/hooks/useFieldNormalize.d.ts +8 -0
- package/es/components/form-render/src/hooks/useFormContext.js +1 -1
- package/es/components/form-render/src/hooks/useFormRenderLifeCycle.d.ts +9 -1
- package/es/components/form-render/src/hooks/useFormRenderOptions.d.ts +0 -1
- package/es/components/form-render/src/hooks/useFormRenderOptions.js +1 -1
- package/es/components/form-render/src/types/index.d.ts +5 -1
- package/es/components/form-render/src/utils/schema.js +1 -1
- package/es/components/guide/src/renderer.js +1 -1
- package/es/components/iho-table/src/IhoTable.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/levelSearchCascadePlugin/levelSearchCascade.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.d.ts +4 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -1
- package/es/components/index.js +1 -1
- package/es/components/info-header/index.d.ts +70 -2
- package/es/components/info-header/src/InfoHeader.vue.d.ts +70 -2
- package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +4 -0
- package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +4 -0
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +29 -1
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +25 -1
- package/es/components/keyboard/src/Keyboard.vue2.js +1 -1
- package/es/components/search-cascader/src/SearchCascader.vue2.js +1 -1
- package/es/components/shortcut-setter/index.d.ts +25 -1
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +25 -1
- package/es/components/steps-wheel/src/StepsWheel.vue2.js +1 -1
- package/es/components/time-picker/src/TimePicker.vue2.js +1 -1
- package/es/shared/hooks/index.d.ts +1 -0
- package/es/shared/hooks/index.js +1 -1
- package/es/shared/hooks/selectHooks/index.d.ts +4 -0
- package/es/shared/hooks/selectHooks/index.js +1 -0
- package/es/shared/hooks/selectHooks/useOptionFiltered.d.ts +10 -0
- package/es/shared/hooks/selectHooks/useOptionFiltered.js +1 -0
- package/es/shared/hooks/selectHooks/useSearchContent.d.ts +6 -0
- package/es/shared/hooks/selectHooks/useSearchContent.js +1 -0
- package/es/shared/hooks/selectHooks/useSelectAllowModify.d.ts +23 -0
- package/es/shared/hooks/selectHooks/useSelectAllowModify.js +1 -0
- package/es/shared/hooks/selectHooks/useSelectRenders.d.ts +19 -0
- package/es/shared/hooks/selectHooks/useSelectRenders.js +1 -0
- package/es/shared/hooks/useFormRequest/index.js +1 -1
- package/es/shared/hooks/useLevelSearchCascader.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
|
@@ -113,6 +113,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
113
113
|
lifeCycle: {
|
|
114
114
|
type: PropType<Partial<{
|
|
115
115
|
onSetup(): void;
|
|
116
|
+
beforeSetValue(fieldKey: string, value: unknown, payload: {
|
|
117
|
+
field: import("@formily/core").GeneralField;
|
|
118
|
+
oldValue: unknown;
|
|
119
|
+
}): any;
|
|
116
120
|
beforeRequest(fieldKey: string, params?: AnyObject | undefined, payload?: AnyObject | undefined): void | import("../../../../es/shared/types").UndefinedAble<AnyObject>;
|
|
117
121
|
afterRequest(fieldKey: string, res?: any, payload?: AnyObject | undefined): AnyObject[];
|
|
118
122
|
afterOptionInit(fieldKey: string, options: AnyObject[], payload?: AnyObject | undefined): void;
|
|
@@ -258,6 +262,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
258
262
|
lifeCycle: {
|
|
259
263
|
type: PropType<Partial<{
|
|
260
264
|
onSetup(): void;
|
|
265
|
+
beforeSetValue(fieldKey: string, value: unknown, payload: {
|
|
266
|
+
field: import("@formily/core").GeneralField;
|
|
267
|
+
oldValue: unknown;
|
|
268
|
+
}): any;
|
|
261
269
|
beforeRequest(fieldKey: string, params?: AnyObject | undefined, payload?: AnyObject | undefined): void | import("../../../../es/shared/types").UndefinedAble<AnyObject>;
|
|
262
270
|
afterRequest(fieldKey: string, res?: any, payload?: AnyObject | undefined): AnyObject[];
|
|
263
271
|
afterOptionInit(fieldKey: string, options: AnyObject[], payload?: AnyObject | undefined): void;
|
|
@@ -327,13 +335,21 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
327
335
|
title: string;
|
|
328
336
|
}[]>;
|
|
329
337
|
onScroll: (scrollEvent: Event) => void;
|
|
330
|
-
callLifeCycle: <T extends "onSetup" | "beforeRequest" | "afterRequest" | "afterOptionInit">(lifeCycleName: T, payload?: Parameters<Required<Partial<{
|
|
338
|
+
callLifeCycle: <T extends "onSetup" | "beforeSetValue" | "beforeRequest" | "afterRequest" | "afterOptionInit">(lifeCycleName: T, payload?: Parameters<Required<Partial<{
|
|
331
339
|
onSetup(): void;
|
|
340
|
+
beforeSetValue(fieldKey: string, value: unknown, payload: {
|
|
341
|
+
field: import("@formily/core").GeneralField;
|
|
342
|
+
oldValue: unknown;
|
|
343
|
+
}): any;
|
|
332
344
|
beforeRequest(fieldKey: string, params?: AnyObject | undefined, payload?: AnyObject | undefined): void | import("../../../../es/shared/types").UndefinedAble<AnyObject>;
|
|
333
345
|
afterRequest(fieldKey: string, res?: any, payload?: AnyObject | undefined): AnyObject[];
|
|
334
346
|
afterOptionInit(fieldKey: string, options: AnyObject[], payload?: AnyObject | undefined): void;
|
|
335
347
|
}>>[T]> | undefined) => import("../../../../es/shared/types").UndefinedAble<ReturnType<Required<Partial<{
|
|
336
348
|
onSetup(): void;
|
|
349
|
+
beforeSetValue(fieldKey: string, value: unknown, payload: {
|
|
350
|
+
field: import("@formily/core").GeneralField;
|
|
351
|
+
oldValue: unknown;
|
|
352
|
+
}): any;
|
|
337
353
|
beforeRequest(fieldKey: string, params?: AnyObject | undefined, payload?: AnyObject | undefined): void | import("../../../../es/shared/types").UndefinedAble<AnyObject>;
|
|
338
354
|
afterRequest(fieldKey: string, res?: any, payload?: AnyObject | undefined): AnyObject[];
|
|
339
355
|
afterOptionInit(fieldKey: string, options: AnyObject[], payload?: AnyObject | undefined): void;
|
|
@@ -426,6 +442,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
426
442
|
uuid: string;
|
|
427
443
|
lifeCycle: Partial<{
|
|
428
444
|
onSetup(): void;
|
|
445
|
+
beforeSetValue(fieldKey: string, value: unknown, payload: {
|
|
446
|
+
field: import("@formily/core").GeneralField;
|
|
447
|
+
oldValue: unknown;
|
|
448
|
+
}): any;
|
|
429
449
|
beforeRequest(fieldKey: string, params?: AnyObject | undefined, payload?: AnyObject | undefined): void | import("../../../../es/shared/types").UndefinedAble<AnyObject>;
|
|
430
450
|
afterRequest(fieldKey: string, res?: any, payload?: AnyObject | undefined): AnyObject[];
|
|
431
451
|
afterOptionInit(fieldKey: string, options: AnyObject[], payload?: AnyObject | undefined): void;
|
|
@@ -833,6 +853,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
833
853
|
lifeCycle: {
|
|
834
854
|
type: PropType<Partial<{
|
|
835
855
|
onSetup(): void;
|
|
856
|
+
beforeSetValue(fieldKey: string, value: unknown, payload: {
|
|
857
|
+
field: import("@formily/core").GeneralField;
|
|
858
|
+
oldValue: unknown;
|
|
859
|
+
}): any;
|
|
836
860
|
beforeRequest(fieldKey: string, params?: AnyObject | undefined, payload?: AnyObject | undefined): void | import("../../../../es/shared/types").UndefinedAble<AnyObject>;
|
|
837
861
|
afterRequest(fieldKey: string, res?: any, payload?: AnyObject | undefined): AnyObject[];
|
|
838
862
|
afterOptionInit(fieldKey: string, options: AnyObject[], payload?: AnyObject | undefined): void;
|
|
@@ -1 +1 @@
|
|
|
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 d,normalizeStyle as p,withCtx as u,createElementBlock as c,createVNode as f,isRef as h,Fragment as y,renderList as g,createCommentVNode as b,createElementVNode as j,withKeys as v,toDisplayString as k,renderSlot as
|
|
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 d,normalizeStyle as p,withCtx as u,createElementBlock as c,createVNode as f,isRef as h,Fragment as y,renderList as g,createCommentVNode as b,createElementVNode as j,withKeys as v,toDisplayString as k,renderSlot as C}from"vue";import{useTheme as F}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isNumber as S,cloneDeep as H,isObject as x,isBoolean as A}from"lodash-es";import"@vue/shared";import"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{NForm as L,NTabs as B,NTabPane as O,NConfigProvider as R}from"naive-ui";import{createForm as w,onFormMount as D,onFieldValueChange as _,onFieldMount as V,onFieldUnmount as I,onFieldReact as N}from"@formily/core";import{Path as W}from"@formily/path";import{FormProvider as q,FormConsumer as E}from"@formily/vue";import{InjectionFormLifeCycleCaller as K,InjectionFormGraph as T}from"./constants/index.js";import{useAutoHidden as U}from"./hooks/useAutoHidden.js";import{useComplexOptionsSpan as G}from"./hooks/useComplexOptions.js";import{useFormDomEvent as M,useFormExposeEvent as P}from"./hooks/useFormEvent.js";import{useFormGraph as J}from"./hooks/useFormGraph.js";import{useFormRenderLifeCycle as $}from"./hooks/useFormRenderLifeCycle.js";import{useLowCodeEvent as z}from"./hooks/useLowCodeEvent.js";import{useLowCodeReactions as Q}from"./hooks/useLowCodeReactions.js";import{useNuiThemeOverrides as X}from"./hooks/useNuiThemeOverrides.js";import{useOperationalForm as Y}from"./hooks/useOperationalForm.js";import{useWordbookSetting as Z}from"./hooks/useWordbookSetting.js";import"../index.js";import{createObjSchema as ee}from"./utils/schema.js";import{useFieldListAdaptor as oe}from"./hooks/useFieldListAdaptor.js";import{useFieldVisitor as te}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 re}from"./hooks/useFormValidator.js";import{useAnchor as se}from"./hooks/useAnchor.js";import{useFormContext as ae}from"./hooks/useFormContext.js";const ie={key:0,style:{height:"54px"}},le={style:{"white-space":"pre"}};var ne=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},operationalForm:{type:Object},linebarAutoHidden:{type:Boolean},bordered:{type:[Boolean,String],default:!0},outBordered:{type:Boolean,default:!1},uniqueCacheData:{type:Boolean,default:!1},forceClearable:Boolean},emits:["formChange","annotationChange","scroll"],setup(e,{expose:ne,emit:me}){const de=e,pe=F(),{nuiThemeOverrides:ue}=X();re();const ce=o(),fe=t((()=>S(de.maxHeight)?de.maxHeight+"px":de.maxHeight)),{SchemaField:he,businessCollector:ye,formItemDepsCollector:ge,changeContextCollector:be,formUUID:je}=ae(de,me),{anchorBarRef:ve,currentAnchor:ke,updateAnchorList:Ce,anchorIdList:Fe,onScroll:Se}=se(de,me,ce,ge),{callLifeCycle:He}=$(de);r(K,He),He("onSetup");const{trigger:xe}=U(),{observeFormGraph:Ae,setGraph:Le,removeGraph:Be}=J();r(T,Ae);const{lowCodeEventTrigger:Oe}=z(),Re=w({initialValues:de.initialData,effects(e){const o={};D((()=>{Object.assign(o,H(e.values))})),_("*",(t=>{const r=W.getIn(o,t.path);W.setIn(o,t.path,t.value);const s=t.props.name.toString();ye.trigger(e,s),ge.trigger(s),me("formChange",{fieldInstance:t,fieldKey:s,oldValue:r,fieldName:t.title,value:t.value,context:be.getContext(s,t.value)}),Oe(t),we(s),_e(s),Ie.trigger(s,t.value)})),V("*",Le),I("*",Be),de.linebarAutoHidden&&(N("*",xe),D((e=>e.query("*").forEach(xe)))),de.anchor&&N("*",Ce)}}),{lowCodeReactionsHandler:we,triggerAllReactionsHandler:De}=Q(t((()=>de.lowCodeReactions)),Re),{operationalFormHandler:_e,triggerAllOperationalFormHandler:Ve}=Y(t((()=>de.operationalForm)),Re),Ie=Z(Re,be);s(De),s(Ve);const{schemaAdaptor:Ne}=oe(ye,de.lifeCycle);let We=de.fieldList||[];const qe=t((()=>de.schema?de.schema:de.fieldList?(We=te().traverse(H(de.fieldList),de.fieldVisitor),ee(Ne(We,de))):ee({}))),{onKeydown:Ee}=M({formModel:Re,formRenderRef:ce,props:de}),{clearSpan:Ke}=G();a((()=>Ke(je)));const Te=P({formModel:Re,formRenderRef:ce,formItemDepsCollector:ge,getFieldList:()=>We,formUUID:je});return ne({formModel:Re,validate:(e="*",o={})=>Te.validate(e,o),getFormValues:(e=!0)=>Te.getFormValues(e),async setFormValues(e,o={},t=!1,r=!0){var s,a,l,n,m;let d=!0,p=!0,u=!0;x(o)?(p=null==(s=o.needSplitExtendKey)||s,d=null==(a=o.avoidDependKeyConnection)||a,t=null!=(l=o.avoidBusinessConnection)&&l,u=null==(n=o.avoidWordbookSettingConnection)||n,r=null==(m=o.overwrite)||m):A(o)&&(p=o),t&&(ye.triggerLock=!0),d&&(ge.triggerDisabled=!0),u&&Ie.setDisabled(!0),Te.setFormValues(e,p,r),await i(),ye.triggerLock=!1,ge.triggerDisabled=!1,Ie.setDisabled(!1)},setFieldState(e,o){Te.setFieldState(e,o)},resetFields(e="*"){Te.resetFields(e)},queryWidget:async e=>Te.queryWidget(e),getFieldList:()=>We,async reload(){console.error("reload function is abstract,it should be overwrite!")}}),(o,t)=>(l(),n(m(L),{class:d(["form-render",{"form-render--out-border":e.outBordered}]),"require-mark-placement":"left",style:p(m(pe))},{default:u((()=>[e.anchor?(l(),c("section",ie,[f(m(B),{value:m(ke),"onUpdate:value":t[0]||(t[0]=e=>h(ke)?ke.value=e:null),type:"line",ref_key:"anchorBarRef",ref:ve},{default:u((()=>[(l(!0),c(y,null,g(m(Fe),(e=>(l(),n(m(O),{name:e.name,tab:e.title,key:e.name},null,8,["name","tab"])))),128))])),_:1},8,["value"])])):b("v-if",!0),f(m(R),{"theme-overrides":m(ue)},{default:u((()=>[j("section",{class:"form-render__wrapper",style:p({"--column":e.column,"--form-height":m(fe)}),ref_key:"formRenderRef",ref:ce,onScroll:t[1]||(t[1]=(...e)=>m(Se)&&m(Se)(...e)),onKeydownCapture:t[2]||(t[2]=v(((...e)=>m(Ee)&&m(Ee)(...e)),["enter"]))},[f(m(q),{form:m(Re)},{default:u((()=>[f(m(he),{schema:m(qe)},null,8,["schema"]),e.consumer?(l(),n(m(E),{key:0},{default:u((({form:e})=>[j("div",le,k(JSON.stringify(e.values,null,2)),1)])),_:1})):b("v-if",!0),C(o.$slots,"default")])),_:3},8,["form"])],36)])),_:3},8,["theme-overrides"])])),_:3},8,["class","style"]))}});export{ne as default};
|
|
@@ -116,6 +116,10 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
116
116
|
lifeCycle: {
|
|
117
117
|
type: import("vue").PropType<Partial<{
|
|
118
118
|
onSetup(): void;
|
|
119
|
+
beforeSetValue(fieldKey: string, value: unknown, payload: {
|
|
120
|
+
field: import("@formily/core").GeneralField;
|
|
121
|
+
oldValue: unknown;
|
|
122
|
+
}): any;
|
|
119
123
|
beforeRequest(fieldKey: string, params?: import("../../../../es/shared/types").AnyObject | undefined, payload?: import("../../../../es/shared/types").AnyObject | undefined): void | import("../../../../es/shared/types").UndefinedAble<import("../../../../es/shared/types").AnyObject>;
|
|
120
124
|
afterRequest(fieldKey: string, res?: any, payload?: import("../../../../es/shared/types").AnyObject | undefined): import("../../../../es/shared/types").AnyObject[];
|
|
121
125
|
afterOptionInit(fieldKey: string, options: import("../../../../es/shared/types").AnyObject[], payload?: import("../../../../es/shared/types").AnyObject | undefined): void;
|
|
@@ -261,6 +265,10 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
261
265
|
lifeCycle: {
|
|
262
266
|
type: import("vue").PropType<Partial<{
|
|
263
267
|
onSetup(): void;
|
|
268
|
+
beforeSetValue(fieldKey: string, value: unknown, payload: {
|
|
269
|
+
field: import("@formily/core").GeneralField;
|
|
270
|
+
oldValue: unknown;
|
|
271
|
+
}): any;
|
|
264
272
|
beforeRequest(fieldKey: string, params?: import("../../../../es/shared/types").AnyObject | undefined, payload?: import("../../../../es/shared/types").AnyObject | undefined): void | import("../../../../es/shared/types").UndefinedAble<import("../../../../es/shared/types").AnyObject>;
|
|
265
273
|
afterRequest(fieldKey: string, res?: any, payload?: import("../../../../es/shared/types").AnyObject | undefined): import("../../../../es/shared/types").AnyObject[];
|
|
266
274
|
afterOptionInit(fieldKey: string, options: import("../../../../es/shared/types").AnyObject[], payload?: import("../../../../es/shared/types").AnyObject | undefined): void;
|
|
@@ -330,13 +338,21 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
330
338
|
title: string;
|
|
331
339
|
}[]>;
|
|
332
340
|
onScroll: (scrollEvent: Event) => void;
|
|
333
|
-
callLifeCycle: <T extends "onSetup" | "beforeRequest" | "afterRequest" | "afterOptionInit">(lifeCycleName: T, payload?: Parameters<Required<Partial<{
|
|
341
|
+
callLifeCycle: <T extends "onSetup" | "beforeSetValue" | "beforeRequest" | "afterRequest" | "afterOptionInit">(lifeCycleName: T, payload?: Parameters<Required<Partial<{
|
|
334
342
|
onSetup(): void;
|
|
343
|
+
beforeSetValue(fieldKey: string, value: unknown, payload: {
|
|
344
|
+
field: import("@formily/core").GeneralField;
|
|
345
|
+
oldValue: unknown;
|
|
346
|
+
}): any;
|
|
335
347
|
beforeRequest(fieldKey: string, params?: import("../../../../es/shared/types").AnyObject | undefined, payload?: import("../../../../es/shared/types").AnyObject | undefined): void | import("../../../../es/shared/types").UndefinedAble<import("../../../../es/shared/types").AnyObject>;
|
|
336
348
|
afterRequest(fieldKey: string, res?: any, payload?: import("../../../../es/shared/types").AnyObject | undefined): import("../../../../es/shared/types").AnyObject[];
|
|
337
349
|
afterOptionInit(fieldKey: string, options: import("../../../../es/shared/types").AnyObject[], payload?: import("../../../../es/shared/types").AnyObject | undefined): void;
|
|
338
350
|
}>>[T]> | undefined) => import("../../../../es/shared/types").UndefinedAble<ReturnType<Required<Partial<{
|
|
339
351
|
onSetup(): void;
|
|
352
|
+
beforeSetValue(fieldKey: string, value: unknown, payload: {
|
|
353
|
+
field: import("@formily/core").GeneralField;
|
|
354
|
+
oldValue: unknown;
|
|
355
|
+
}): any;
|
|
340
356
|
beforeRequest(fieldKey: string, params?: import("../../../../es/shared/types").AnyObject | undefined, payload?: import("../../../../es/shared/types").AnyObject | undefined): void | import("../../../../es/shared/types").UndefinedAble<import("../../../../es/shared/types").AnyObject>;
|
|
341
357
|
afterRequest(fieldKey: string, res?: any, payload?: import("../../../../es/shared/types").AnyObject | undefined): import("../../../../es/shared/types").AnyObject[];
|
|
342
358
|
afterOptionInit(fieldKey: string, options: import("../../../../es/shared/types").AnyObject[], payload?: import("../../../../es/shared/types").AnyObject | undefined): void;
|
|
@@ -429,6 +445,10 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
429
445
|
uuid: string;
|
|
430
446
|
lifeCycle: Partial<{
|
|
431
447
|
onSetup(): void;
|
|
448
|
+
beforeSetValue(fieldKey: string, value: unknown, payload: {
|
|
449
|
+
field: import("@formily/core").GeneralField;
|
|
450
|
+
oldValue: unknown;
|
|
451
|
+
}): any;
|
|
432
452
|
beforeRequest(fieldKey: string, params?: import("../../../../es/shared/types").AnyObject | undefined, payload?: import("../../../../es/shared/types").AnyObject | undefined): void | import("../../../../es/shared/types").UndefinedAble<import("../../../../es/shared/types").AnyObject>;
|
|
433
453
|
afterRequest(fieldKey: string, res?: any, payload?: import("../../../../es/shared/types").AnyObject | undefined): import("../../../../es/shared/types").AnyObject[];
|
|
434
454
|
afterOptionInit(fieldKey: string, options: import("../../../../es/shared/types").AnyObject[], payload?: import("../../../../es/shared/types").AnyObject | undefined): void;
|
|
@@ -836,6 +856,10 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
836
856
|
lifeCycle: {
|
|
837
857
|
type: import("vue").PropType<Partial<{
|
|
838
858
|
onSetup(): void;
|
|
859
|
+
beforeSetValue(fieldKey: string, value: unknown, payload: {
|
|
860
|
+
field: import("@formily/core").GeneralField;
|
|
861
|
+
oldValue: unknown;
|
|
862
|
+
}): any;
|
|
839
863
|
beforeRequest(fieldKey: string, params?: import("../../../../es/shared/types").AnyObject | undefined, payload?: import("../../../../es/shared/types").AnyObject | undefined): void | import("../../../../es/shared/types").UndefinedAble<import("../../../../es/shared/types").AnyObject>;
|
|
840
864
|
afterRequest(fieldKey: string, res?: any, payload?: import("../../../../es/shared/types").AnyObject | undefined): import("../../../../es/shared/types").AnyObject[];
|
|
841
865
|
afterOptionInit(fieldKey: string, options: import("../../../../es/shared/types").AnyObject[], payload?: import("../../../../es/shared/types").AnyObject | undefined): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as o,computed as t,watch as r,inject as a,onBeforeUnmount as i,createVNode as m}from"vue";import{isObjectField as n}from"@formily/core";import{autorun as l}from"@formily/reactive";import{connect as s,RecursionField as u}from"@formily/vue";import{AddCircleOutline as p,RemoveCircle as c}from"@vicons/ionicons5";import{isNumber as d,isArray as f,isFunction as v,range as b}from"lodash-es";import{NButton as y,NIcon as h}from"naive-ui";import"../../../index.js";import{InjectionBusinessCollector as x}from"../../constants/index.js";import"../../../../../shared/utils/index.js";import"@formily/path";import"@vue/shared";import"@vueuse/core";import"date-fns";import{createObjSchema as
|
|
1
|
+
import{defineComponent as e,ref as o,computed as t,watch as r,inject as a,onBeforeUnmount as i,createVNode as m}from"vue";import{isObjectField as n}from"@formily/core";import{autorun as l}from"@formily/reactive";import{connect as s,RecursionField as u}from"@formily/vue";import{AddCircleOutline as p,RemoveCircle as c}from"@vicons/ionicons5";import{isNumber as d,isArray as f,isFunction as v,range as b}from"lodash-es";import{NButton as y,NIcon as h}from"naive-ui";import"../../../index.js";import{InjectionBusinessCollector as x,InjectionFormGlobalProps as _}from"../../constants/index.js";import"../../../../../shared/utils/index.js";import"@formily/path";import"@vue/shared";import"@vueuse/core";import"date-fns";import{createObjSchema as C}from"../../utils/schema.js";import{useFormField as j}from"../../hooks/useFormField.js";import{useFieldListAdaptor as k}from"../../hooks/useFieldListAdaptor.js";const F=s(e({name:"FormCombination",props:{title:{type:String,default:""},value:{type:Array},maxGroupNum:{type:Number},disabled:{type:Boolean},properties:{type:Array,default:()=>[]},combinationItemDeletable:{type:[Boolean,Function],default:!0},onInput:{},onBlur:{},onChange:{}},emits:["update:value"],setup(e){const{field:s,fieldKey:F}=j(),I=o(1),N=t((()=>d(e.maxGroupNum)?e.maxGroupNum<1?0:~~e.maxGroupNum:1/0));function A(){I.value++}r((()=>e.value),(e=>{f(e)&&(I.value=Math.min(Math.max(e.length,1),N.value))}),{immediate:!0});const D=a(x),G=a(_),{schemaAdaptor:g}=k(D,G.lifeCycle),B=o([]);return i(l((()=>{f(s.value.value)&&(B.value=s.value.value.map(((o,t)=>v(e.combinationItemDeletable)?e.combinationItemDeletable(o||{},t):e.combinationItemDeletable)))}))),()=>m("section",{class:"form-render__combination"},[m("header",{class:"form-render__combinationHeader"},[m("div",{class:"form-render__combinationHeaderText"},[e.title]),m(y,{onClick:A,text:!0,style:{"--n-text-color":"var(--c-primary-color)"},disabled:I.value>=N.value||e.disabled},{icon:()=>m(h,{component:p},null),default:()=>"新增"})]),b(I.value).map(((o,t)=>m("section",{class:"form-render__combinationContent"},[m(u,{schema:C(g(e.properties)),name:t},null),m(y,{text:!0,disabled:!B.value[t],type:"error",class:"form-render__combinationClose",onClick:()=>async function(e){if(I.value>1)I.value--,await s.value.remove(e);else{const o=s.value.query(`${F.value}.${e}`).take();if(!o||!n(o))return;await o.reset()}}(t)},{icon:()=>m(h,{component:c},null)})])))])}}));export{F as COMBINATION};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,inject as
|
|
1
|
+
import{defineComponent as e,inject as o,createVNode as t}from"vue";import a from"../../../../../../shared/components/no-data/NoData.vue.js";import"../../../../../../shared/utils/index.js";import"lodash-es";import"naive-ui";import"@vueuse/core";import"date-fns";import"@vue/shared";import{useLevelSearchCascader as r}from"../../../../../../shared/hooks/useLevelSearchCascader.js";import"@vueuse/shared";import"../../../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{connect as s,mapProps as u}from"@formily/vue";import"../../../../index.js";import{InjectionAsyncQueue as i}from"../../../constants/index.js";import{useCommonInjection as l}from"../../../hooks/useCommonInjection.js";import n from"../../../../../search-cascader/index.js";import{assignUpdateValue as d}from"../../../utils/schema.js";import{useFormField as m}from"../../../hooks/useFormField.js";const p=s(e({name:"FormSearchCascade",props:{options:{type:Array,default:()=>[]},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},autograph:{type:String,required:!0},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},wordbook:{type:Object,required:!0},onChange:{},value:{type:[String,Array]}},emits:["update:value"],setup(e,{emit:s}){const u=o(i),{field:d,fieldKey:p}=m(),{valueRef:c,labelKey:v,valueKey:f,optionsRef:h,showRef:y,fetchData:j,menuWidth:S,searchCascaderRef:g}=r(e,s,{fieldKey:p,asyncQueue:u,getRequestPayload:()=>({field:d.value})});function k(){S.value=150}const{injectValueValidate:C,injectValueBindKey:K}=l();C(c);const x=K(c);return()=>t(n,{ref:g,value:c.value,"onUpdate:value":e=>c.value=e,show:y.value,"onUpdate:show":e=>y.value=e,options:h.value,key:x.value,labelKey:v.value,valueKey:f.value,search:j,onFocus:k,menuWidth:S.value},{empty:()=>t(a,null,null)})}}),u({dataSource:"options"},d));export{p as LEVEL_SEARCH_CASCADER};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as t,computed as a,inject as l,watch as r,createVNode as o,nextTick as n}from"vue";import{connect as u,mapProps as i}from"@formily/vue";import{isEqual as s,isArray as c,isString as p}from"lodash-es";import{NCascader as d}from"naive-ui";import"../../../index.js";import{useCommonInjection as m}from"../../hooks/useCommonInjection.js";import{InjectionAsyncQueue as v,InjectionFormUUID as f}from"../../constants/index.js";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"date-fns";import{assignUpdateValue as y,createVisitedSetter as h,traverseDependKey as k}from"../../utils/schema.js";import{useFormField as j}from"../../hooks/useFormField.js";import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import"../../hooks/useFormValidator.js";import"
|
|
1
|
+
import{defineComponent as e,ref as t,computed as a,inject as l,watch as r,createVNode as o,nextTick as n}from"vue";import{connect as u,mapProps as i}from"@formily/vue";import{isEqual as s,isArray as c,isString as p}from"lodash-es";import{NCascader as d}from"naive-ui";import"../../../index.js";import{useCommonInjection as m}from"../../hooks/useCommonInjection.js";import{InjectionAsyncQueue as v,InjectionFormUUID as f}from"../../constants/index.js";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"date-fns";import{assignUpdateValue as y,createVisitedSetter as h,traverseDependKey as k}from"../../utils/schema.js";import{useFormField as j}from"../../hooks/useFormField.js";import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import"../../hooks/useFormValidator.js";import"@vueuse/shared";import"../../../../../shared/hooks/selectHooks/useSearchContent.js";import"./index.js";const g=u(e({name:"FormCascader",props:{options:{type:Array,default:()=>[]},depth:{type:[Number,String]},urlConfig:{type:Object},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},onFocus:{type:Function},filterable:{type:Boolean,default:!1},checkStrategy:{type:String,default:"child"},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},onChange:{},value:{}},emits:["update:value"],setup(e,{slots:u,emit:i}){const y=t(),{field:g,title:b}=j(),S=t(1),C=t(!0);const w=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.nameKey)?a:e.labelField)?l:"text"})),F=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.valueKey)?a:e.valueField)?l:"value"})),A=a((()=>{try{const t=Array.isArray(e.value)?e.value:JSON.parse(e.value||"");if(!Array.isArray(t)||!t.length)return null;const a=t.map((e=>e[F.value])).slice(-1).join(""),l=t.map((e=>e[w.value])).join(" / ");return a||l}catch(e){return null}}));function H(e,t,a){i("update:value",c(a)?a.map((function(e){return{...e,label:e[w.value],children:void 0,parent:void 0,mergeItemValue:void 0}})):null)}const q=l(v);async function x(t){e.filterable?await async function(){if(!e.urlConfig||y.value&&e.requestCache)return;const t=await q.addAsync({...e.urlConfig,params:{lvlnr:"1"},key:b.value,cache:e.requestCache,payload:{field:g.value,labelKey:w.value,valueKey:F.value}});function a(e,t,r){const o=[...r,...l(e)],n={[w.value]:e[w.value],[F.value]:e[F.value],depth:t+1,isLeaf:!0,keyword:e.keyword,mergeItemValue:o};return c(e.children)&&(n.children=e.children.map((e=>a(e,t+1,o))),n.isLeaf=!e.children.length),S.value=Math.max(S.value,t+1),n}function l(e){let t=[];if(p(e[w.value])&&(t=[...t,e[w.value]]),p(e.keyword)&&e.keyword.length>0){const a=e.keyword.split(",");t=[...t,...a]}return t}y.value=t.map((e=>a(e,0,[])))}():await async function(t){if(r(e,t))return;const a=await q.addAsync(o(s(t),i(e),b.value,t));if(!a.length&&t)return t.isLeaf=!0,H(0,0,n(t)),void(W.value=!1);const l=a.map((e=>u(e,s(t))));function r(e,t){return!i(e)||!t&&y.value&&e.requestCache||s(t)>=s(e)-1}function o(t,a,l,r){const o={lvlnr:t+1+""};return r&&a.dependKey&&k(a.dependKey,((e,t)=>{o[t]=r[e]})),{params:o,...a,key:l,cache:e.requestCache}}function n(e){let t=e;const a=[e];for(;t.parent;)a.unshift(t.parent),t=t.parent;return a}function u(a,l){return{[w.value]:a[w.value],[F.value]:a[F.value],depth:l+1,parent:t,isLeaf:l+2>=s(e)}}function i(e){return e.urlConfig}function s(e){var t;return null!=(t=null==e?void 0:e.depth)?t:-1}t?t.children=l:y.value=l}(t),await B()}const V=`form-render__cascade--menu-${l(f)}`;async function B(){await n();const e=document.querySelector(`.${V} .v-vl`);e&&e.dispatchEvent(new CustomEvent("scroll"))}function K(t,a){if(!t||!a)return!1;const{mergeItemValue:l}=a;return!(e.checkStrategy.includes("child")&&a.depth<S.value)&&(l.length>0&&l.some((e=>e.includes(t.trim()))))}const{injectValueValidate:L,injectValueWatchFromEmpty:I,injectValueBindKey:E}=m();I((()=>e.value),x),L((()=>e.value)),r((()=>e.urlConfig),(async(t,a)=>{s(t,a)||(y.value=null,C.value?e.lazyRequest||(x(),C.value=!C.value):await x())}),{immediate:!0});const W=t(!1);function z(e){W.value=!!e,e&&x()}const N=a((()=>y.value||e.options||[])),O=a((()=>!e.filterable)),P=E(A);return()=>o(d,{key:P.value,remote:O.value,filterable:e.filterable,"menu-props":{class:V,onClick:B},"check-strategy":e.checkStrategy,show:!!W.value,"onUpdate:show":z,value:A.value,filter:K,"onUpdate:value":H,labelField:w.value,valueField:F.value,options:N.value,onLoad:x,onFocus:h(g)},u)}}),i({dataSource:"options"},y));export{g as SEARCH_CASCADER};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FormRequestDefine } from '../../../../../../es/shared/hooks';
|
|
2
2
|
import { AnyObject, ArrayAble } from '../../../../../../es/shared/types';
|
|
3
|
+
import { PropType } from 'vue';
|
|
3
4
|
import { RecommendItem } from '../../../../../../es/components/recommend-search/src/types';
|
|
4
5
|
import { UrlConfig } from '../../types';
|
|
5
|
-
import { PropType } from 'vue';
|
|
6
6
|
export declare const SELECT: import("vue").DefineComponent<{
|
|
7
7
|
value: {
|
|
8
8
|
type: PropType<ArrayAble<string | number> | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as
|
|
1
|
+
import{defineComponent as e,computed as o,inject as t,useAttrs as l,ref as a,createVNode as r,mergeProps as s,toRaw as n}from"vue";import{arrayed as u}from"../../../../../shared/utils/index.js";import{cloneDeep as i,isArray as p,isObject as m,omit as d,xor as c}from"lodash-es";import{NSelect as f}from"naive-ui";import"@vueuse/core";import"date-fns";import"@vue/shared";import{useSelectAllowModify as y}from"../../../../../shared/hooks/selectHooks/useSelectAllowModify.js";import"../../../../../shared/hooks/selectHooks/useSearchContent.js";import{useSelectRenders as v}from"../../../../../shared/hooks/selectHooks/useSelectRenders.js";import{connect as h,mapProps as b}from"@formily/vue";import{useCommonInjection as j,useSelectOptionProps as S}from"../../hooks/useCommonInjection.js";import{useComplexOptions as k,useComplexOptionsSpan as g}from"../../hooks/useComplexOptions.js";import{InjectionChangeContextCollector as C,InjectionFormUUID as B}from"../../constants/index.js";import"../../../index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import{assignUpdateValue as F,assignClearBindVisited as A,createVisitedSetter as w}from"../../utils/schema.js";import{useFormField as H}from"../../hooks/useFormField.js";import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import"../../hooks/useFormValidator.js";import"./index.js";import{useUrlConfigOptions as O,useAutographOptions as K,useRecommendOptions as x}from"../../hooks/useFormRenderOptions.js";const R=h(e({name:"FormSelect",props:{value:{type:[String,Array,Number]},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},onChange:{},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},showField:{type:String},allowCreate:Boolean,shouldSave:Boolean,allowModify:Boolean,showCustomValue:Boolean,cursorPlacement:{type:String,default:"end"},urlConfig:{type:Object},autograph:{type:String},wordbook:{type:Object},recommend:{type:Boolean,default:!1},commonList:{type:Array},recentList:{type:Array},getRecommendInfo:{type:Function},commonNum:{type:Number,default:10},recentNum:{type:Number,default:10},recommendCache:{type:Boolean,default:!1},useLoading:{type:Boolean,default:!0},multiple:{type:Boolean},deletable:{type:Boolean,default:!0},selectAll:{type:Boolean}},emits:["update:value","postRecommend"],setup(e,{slots:h,emit:b}){const F=o({get:()=>e.value,async set(e){b("update:value",e),D(e)}}),{labelKey:A,valueKey:R,showKey:V,fetchData:L,searchContent:P,fullOptions:_,filterOptions:N,remoteOptions:I,loading:W}=e.urlConfig?O(e,F):K(e,F),{modifyEvent:E,modifyAbleRef:q,getOptionsWithCreated:M}=y(e,{searchContent:P,labelKey:A,valueKey:R,valueRef:F,fullOptions:_}),{renderComplexOption:T,hasComplexOption:U}=k(e,F),{getRecommend:z,postRecommend:D,sortedOptions:G}=x(e,N,b,A,R),{field:J,fieldKey:Q}=H();t(C).setContext(Q.value,(e=>({currentOption:i(function(e){const o=M(_.value);return p(e)?function(e){const t=o.reduce(((e,o)=>(e[o[R.value]]=o,e)),{});return e.map((e=>t[e]))}(e):(t=e,o.find((e=>e[R.value]===t)));var t}(e))})));const X=async(e="")=>(P.value=e,Promise.allSettled([L(e),z(e)])),{injectValueValidate:Y,injectValueWatchFromEmpty:Z,injectValueBindKey:$}=j();Z(F,X),Y(F);const ee=$(F),{menuProps:oe,nodeProps:te}=S(),{renderTag:le,renderLabel:ae,renderSelectAll:re,titleRef:se}=v(e,{labelKey:A,showKey:V,searchContent:P}),ne=o((()=>M(q.value?_.value:G.value))),ue=l(),ie=o((()=>{if(e.allowCreate||e.showCustomValue)return F.value;const o=e.multiple&&p(F.value);return _.value.find((e=>o?F.value.includes(e[R.value]):e[R.value]===F.value))?F.value:null})),pe=a(!1);async function me(e){e&&await X(),pe.value=e}async function de(e,o){await E.updateValue(e,o),I.value&&o&&u(o).forEach((e=>{if(!m(e))return;const o=e;o.created&&o.shouldSave&&I.value.push(d(n(o),["created","shouldSave"]))}))}const ce=t(B),{getSpan:fe}=g(),ye=w(J,E.focus);function ve(o){if(!e.multiple)return;const t=o?ne.value.map((e=>e[R.value])):[];c(t,e.value).length&&(F.value=t)}function he(o){let t=h;return e.multiple&&e.selectAll&&(t={action:()=>re(ve),...h}),r(f,s({title:se.value,key:ee.value,multiple:e.multiple,remote:!0,filterable:!0,loading:W.value,value:ie.value,onUpdateValue:de,"menu-props":oe,"node-props":te,labelField:A.value,valueField:R.value,options:ne.value,onSearch:X,show:pe.value,"onUpdate:show":me,onFocus:ye,onBlur:E.blur,renderLabel:ae,renderTag:le},o,ue),t)}return()=>{var e,o;if(!U.value)return he();const t=null!=(o=null==(e=J.value.decoratorProps)?void 0:e.span)?o:6,l=fe(ce,J.value.address);return r("section",{class:"form-render__selectChildField",style:{"--column":l+t}},[he({class:"form-render__selectChildFieldItem",style:{"--form-item-column":t}}),_.value.map((e=>T({option:e,value:F.value,valueKey:R.value,labelKey:A.value,childFieldStrategy:"checked",renderLabel:!1,attrs:{class:"form-render__selectChildFieldItem",style:{"--form-item-column":l}}})))])}}}),b({dataSource:"options"},F,A));export{R as SELECT};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{useFieldListAdaptor}from"./useFieldListAdaptor.js";export{useCommonLog}from"./useCommonLog.js";export{useFormField}from"./useFormField.js";export{useFieldVisitor}from"./useFieldVisitor.js";export{useFieldNormalize}from"./useFieldNormalize.js";export{useFormValidator,validateMessageLocale}from"./useFormValidator.js";export{BusinessCollector,useBusinessBinding}from"./useBusinessBinding.js";export{ContextCollector,useChangeContext}from"./useChangeContext.js";export{FormItemDepsCollector,useFormItemDeps}from"./useFormItemDeps.js";export{useAnchor}from"./useAnchor.js";export{useFormContext}from"./useFormContext.js";export{useCommonInjection,useSelectOptionProps}from"./useCommonInjection.js";export{
|
|
1
|
+
export{useFieldListAdaptor}from"./useFieldListAdaptor.js";export{useCommonLog}from"./useCommonLog.js";export{useFormField}from"./useFormField.js";export{useFieldVisitor}from"./useFieldVisitor.js";export{useFieldNormalize}from"./useFieldNormalize.js";export{useFormValidator,validateMessageLocale}from"./useFormValidator.js";export{BusinessCollector,useBusinessBinding}from"./useBusinessBinding.js";export{ContextCollector,useChangeContext}from"./useChangeContext.js";export{FormItemDepsCollector,useFormItemDeps}from"./useFormItemDeps.js";export{useAnchor}from"./useAnchor.js";export{useFormContext}from"./useFormContext.js";export{useCommonInjection,useSelectOptionProps}from"./useCommonInjection.js";export{useAutographOptions,useRecommendOptions,useUrlConfigOptions}from"./useFormRenderOptions.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { BusinessCollector, FormRenderProps } from '../../../../../es/components/form-render';
|
|
1
|
+
import { BusinessCollector, FormRenderProps, FormRenderLifeCycle } from '../../../../../es/components/form-render';
|
|
2
2
|
import { FieldItem } from '../types';
|
|
3
3
|
/**
|
|
4
4
|
* @description 胶水层, 将低代码平台中的fieldList转换为JSONSchema
|
|
5
5
|
*/
|
|
6
|
-
export declare function useFieldListAdaptor(collector?: BusinessCollector): {
|
|
6
|
+
export declare function useFieldListAdaptor(collector?: BusinessCollector, hooks?: FormRenderLifeCycle): {
|
|
7
7
|
schemaAdaptor: (fieldList: FieldItem[], options?: FormRenderProps) => Record<string, import("@formily/json-schema/esm/types").Stringify<{
|
|
8
8
|
[key: symbol]: any;
|
|
9
9
|
[key: `x-${string}`]: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,pick as n}from"lodash-es";import"../../index.js";import{parseNumberFromMaybeString as i,formRenderLog as r}from"../utils/index.js";import{format as
|
|
1
|
+
import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,pick as n}from"lodash-es";import"../../index.js";import{parseNumberFromMaybeString as i,formRenderLog as r}from"../utils/index.js";import{format as l}from"date-fns";import{useFieldNormalize as s}from"./useFieldNormalize.js";import{fieldKeyEscape as a,createLinebarId as p}from"../utils/schema.js";import{useFormValidator as c}from"./useFormValidator.js";import{transformDateFormat as d}from"../utils/business.js";function m(e,o){Object.assign(e["x-component-props"],{...n(o,["wordbook","autograph"])})}function u(e,o){Object.assign(e["x-component-props"],{...n(o,["urlConfig","wordbook"])})}function f(f,x){const{createValidatorSchema:_}=c(),h=e=>{var o;const t={name:e.val_key,type:null!=(o=e.fieldType)?o:"string",title:e.alias||e.name,"x-component":e.html_type,default:e.default_val,"x-component-props":{placeholder:e.placeholder,clearable:"0"===e.is_empty,...e.componentProps||{}},"x-content":e.slots,"x-display":"0"===e.is_show?"hidden":"visible","x-pattern":"0"===e.is_edit?"disabled":"editable","x-compile-omitted":["title","x-component-props","x-decorator-props"]};e.reactions&&(t["x-reactions"]=e.reactions),e.noDecorator||Object.assign(t,{"x-decorator":"FORM_ITEM","x-decorator-props":{fieldItem:e,beforeSetValue:null==x?void 0:x.beforeSetValue,span:2*(e.elem_width||3),showLabel:"1"!==e.hide_title,remark:e.remark,propertyKey:e.val_key,annotation:e.annotation,...e.decoratorProps||{}}});const n=_(e);return n&&(t["x-validator"]=n),"0"===e.is_null&&(t.required=!0),t},g=e=>{var o,t,r,l,s,a,p;const c=h(e);e.urlConfig?u(c,e):e.autograph&&m(c,e);const d=!!e.__multiple,f="1"===e.allowModify,x=null!=(t=null==(o=e.componentProps)?void 0:o.selectAll)?t:e.selectAll;return Object.assign(c["x-component-props"],{multiple:d,options:(null==(r=e.componentProps)?void 0:r.options)||e.option,allowModify:f,allowCreate:"1"===e.free_entry||!!c["x-component-props"].allowCreate||f,shouldSave:"1"===e.save_free_entry,showField:null!=(s=e.show_key)?s:null==(l=e.componentProps)?void 0:l.showField,maxTagCount:null!=(p=i(e.multi_select_value))?p:null==(a=c["x-component-props"])?void 0:a.maxTagCount,selectAll:"1"===x||!0===x,...n(e,["lazyRequest","requestCache"])}),d&&(c.type="array"),c},y=e=>{var o,t;const n=h(e),i=null!=(t=null==(o=e.componentProps)?void 0:o.selectAll)?t:e.selectAll;return Object.assign(n["x-component-props"],{options:e.option,childFieldStrategy:e.childFieldStrategy,childWidthMode:e.childWidthMode,vertical:e.__vertical,selectAll:"1"===i||!0===i}),e.urlConfig?u(n,e):e.autograph&&m(n,e),n},b=e=>{const t=h(e);return Object.assign(t["x-component-props"],{fieldItem:o(e,["reactions"])}),t},v=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}}),w=new Map([["LINEBAR",v],["LINE_BREAKS",e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINE_BREAKS","x-component-props":{border:e.lineBreaksBorder},"x-display":"0"===e.is_show?"hidden":"visible"})],["INPUT",e=>{const o=h(e);return Object.assign(o["x-component-props"],{...n(e,["prefix","suffix"])}),o}],["TEXTAREA",e=>{const o=h(e);return Object.assign(o["x-component-props"],{rows:e.initialize_high||3}),o}],["INPUT_NUMBER",e=>{const o=h(e),{decimal_length:t,validate:n,allowSlash:i}=e;return!0!==i&&"1"!==i||(o["x-component"]="INPUT_NUMBER_SLASH",o.type="string"),Object.assign(o["x-component-props"],{precision:null!=t?t:null==n?void 0:n.decimal_length,whiteList:e.whiteList,prefix:e.prefix,suffix:e.suffix}),o}],["SELECT",g],["REMOTE_SEARCH",g],["DATE",e=>{const o=h(e);return Object.assign(o["x-component-props"],{valueFormat:e.date_format,type:d(e.date_format),validate:e.validate}),"current"===o.default&&(o.default=l(new Date,e.date_format||"yyyy-MM-dd")),o}],["LEVEL_SEARCH_CASCADER",e=>{const o=h(e);return Object.assign(o["x-component-props"],{...n(e,["wordbook","lazyRequest","autograph"])}),"1"===e.is_allow_check_mid&&e.allow_check_mid_level&&(o["x-component-props"].checkAbleLevel=+e.allow_check_mid_level),o}],["SEARCH_CASCADER",e=>{var o;const t=h(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=h(e);return o.type="array",!1!==e.jsonCombination&&(o["x-component"]="JSON_COMBINATION"),Object.assign(o["x-decorator-props"],{showLabel:!1,showFeedback:!1}),Object.assign(o["x-component-props"],{title:e.alias||e.name,maxGroupNum:e.maxGroupNum,properties:e.children||[],combinationItemDeletable:e.combinationItemDeletable}),o}],["RADIO",y],["CHECKBOX",y],["SWITCH",e=>{const o=h(e);return Object.assign(o["x-component-props"],{openDescription:e.open,closeDescription:e.close}),o}],["SLIDER",e=>{const o=h(e);return Object.assign(o["x-component-props"],{step:i(e.step_length),max:i(e.max_length),min:i(e.min_length),option:e.option}),o}],["COMPLEX",e=>{const o=h(e);Array.isArray(e.properties)&&r("COMPLEX控件的properties属性已经废弃, 请使用children作为替代, 在之后的版本中properties属性将不再支持");const t=Array.isArray(e.properties||e.children)?E(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}]]),C=e=>{if(e.suffixConfig)return A(e);return(w.get(e.html_type)||b)(e)},A=o=>{if(!o.suffixConfig&&!o.prefixConfig)return C(o);const t=o.suffixConfig?e(o.suffixConfig):[],n=[...(o.prefixConfig?e(o.prefixConfig):[]).map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:"1"}))),{...o,is_show:"1",hide_title:"1",suffixConfig:void 0,prefixConfig:void 0},...t.map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:"1"})))],i=h(o),r=n.reduce(((e,o)=>e+2*(o.elem_width||3)),0);return Object.assign(i,{type:"void",name:a(n),title:o.alias||o.name,"x-component":"INPUT_GROUP","x-component-props":{span:r},"x-decorator-props":{...i["x-decorator-props"],showFeedback:!1,suffixFields:n.map((e=>e.val_key))},properties:E(n)}),i},{FieldNormalizeWaterfallHook:O,FieldListNormalizeWaterfallHook:j}=s();function E(o,n={column:9999}){let i=null;return j.call(t(o),n).reduce(((e,o,s)=>{var a;const p=null==(a=(o=O.call(o,n)).validate)?void 0:a.obj_type;return p&&f&&f.collect(p,t(o)),"LINEBAR"===o.html_type?(e[l(o)]=r(v(o),s),i=e[l(o)].properties={}):i?i[l(o)]=r(C(o),s):(i=null,e[l(o)]=r(C(o),s)),e}),{});function r(e,o){return e["x-index"]=o,e}function l(o){return o.suffixConfig?a([o,...e(o.suffixConfig)]):o.val_key}}return{schemaAdaptor:E}}export{f as useFieldListAdaptor};
|
|
@@ -73,6 +73,10 @@ export declare function useFieldNormalize(): {
|
|
|
73
73
|
uuid: string;
|
|
74
74
|
lifeCycle: Partial<{
|
|
75
75
|
onSetup(): void;
|
|
76
|
+
beforeSetValue(fieldKey: string, value: unknown, payload: {
|
|
77
|
+
field: import("@formily/core").GeneralField;
|
|
78
|
+
oldValue: unknown;
|
|
79
|
+
}): any;
|
|
76
80
|
beforeRequest(fieldKey: string, params?: import("../../../../../es/shared/types").AnyObject | undefined, payload?: import("../../../../../es/shared/types").AnyObject | undefined): void | import("../../../../../es/shared/types").UndefinedAble<import("../../../../../es/shared/types").AnyObject>;
|
|
77
81
|
afterRequest(fieldKey: string, res?: any, payload?: import("../../../../../es/shared/types").AnyObject | undefined): import("../../../../../es/shared/types").AnyObject[];
|
|
78
82
|
afterOptionInit(fieldKey: string, options: import("../../../../../es/shared/types").AnyObject[], payload?: import("../../../../../es/shared/types").AnyObject | undefined): void;
|
|
@@ -160,6 +164,10 @@ export declare function useFieldNormalize(): {
|
|
|
160
164
|
uuid: string;
|
|
161
165
|
lifeCycle: Partial<{
|
|
162
166
|
onSetup(): void;
|
|
167
|
+
beforeSetValue(fieldKey: string, value: unknown, payload: {
|
|
168
|
+
field: import("@formily/core").GeneralField;
|
|
169
|
+
oldValue: unknown;
|
|
170
|
+
}): any;
|
|
163
171
|
beforeRequest(fieldKey: string, params?: import("../../../../../es/shared/types").AnyObject | undefined, payload?: import("../../../../../es/shared/types").AnyObject | undefined): void | import("../../../../../es/shared/types").UndefinedAble<import("../../../../../es/shared/types").AnyObject>;
|
|
164
172
|
afterRequest(fieldKey: string, res?: any, payload?: import("../../../../../es/shared/types").AnyObject | undefined): import("../../../../../es/shared/types").AnyObject[];
|
|
165
173
|
afterOptionInit(fieldKey: string, options: import("../../../../../es/shared/types").AnyObject[], payload?: import("../../../../../es/shared/types").AnyObject | undefined): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{uuidGenerator as e}from"../../../../shared/utils/index.js";import"lodash-es";import"naive-ui";import{computed as o,provide as t,readonly as r}from"vue";import"@vueuse/core";import"date-fns";import{useFormAsyncQueue as s,presetRequestHandler as n}from"../../../../shared/hooks/useFormRequest/index.js";import{createSchemaField as i}from"@formily/vue";import{isObject as a}from"@vue/shared";import"../../index.js";import m from"../components/renderer/index.js";import{InjectionAsyncQueue as u,InjectionSchemaField as c,InjectionBusinessCollector as p,InjectionChangeContextCollector as l,InjectionFormItemDepsCollector as f,InjectionFormUUID as d,InjectionAnnotation as h,InjectionFormGlobalProps as j}from"../constants/index.js";import{useFormRenderLifeCycle as C}from"./useFormRenderLifeCycle.js";import{usePresetScope as v}from"./usePresetScope.js";import{useBusinessBinding as x}from"./useBusinessBinding.js";import{useChangeContext as y}from"./useChangeContext.js";import{useFormItemDeps as q}from"./useFormItemDeps.js";function g(g,F){const{callLifeCycle:R}=C(g),b=s(o((()=>g.requestInstance)),o((()=>!!g.uniqueCacheData))).create(g.parallelism,{beforeRequest:(...e)=>R("beforeRequest",e)||e[1],afterRequest:(...e)=>R("afterRequest",e)||n(e[1])});t(u,b);const D=i({components:{...m,...g.components},scope:Object.assign({},v(),g.scope)}).SchemaField;t(c,D);const I=x().create(g.businessFormatter);t(p,I);const S=y().create();t(l,S);const
|
|
1
|
+
import{uuidGenerator as e}from"../../../../shared/utils/index.js";import"lodash-es";import"naive-ui";import{computed as o,provide as t,readonly as r}from"vue";import"@vueuse/core";import"date-fns";import{useFormAsyncQueue as s,presetRequestHandler as n}from"../../../../shared/hooks/useFormRequest/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{createSchemaField as i}from"@formily/vue";import{isObject as a}from"@vue/shared";import"../../index.js";import m from"../components/renderer/index.js";import{InjectionAsyncQueue as u,InjectionSchemaField as c,InjectionBusinessCollector as p,InjectionChangeContextCollector as l,InjectionFormItemDepsCollector as f,InjectionFormUUID as d,InjectionAnnotation as h,InjectionFormGlobalProps as j}from"../constants/index.js";import{useFormRenderLifeCycle as C}from"./useFormRenderLifeCycle.js";import{usePresetScope as v}from"./usePresetScope.js";import{useBusinessBinding as x}from"./useBusinessBinding.js";import{useChangeContext as y}from"./useChangeContext.js";import{useFormItemDeps as q}from"./useFormItemDeps.js";function g(g,F){const{callLifeCycle:R}=C(g),b=s(o((()=>g.requestInstance)),o((()=>!!g.uniqueCacheData))).create(g.parallelism,{beforeRequest:(...e)=>R("beforeRequest",e)||e[1],afterRequest:(...e)=>R("afterRequest",e)||n(e[1])});t(u,b);const D=i({components:{...m,...g.components},scope:Object.assign({},v(),g.scope)}).SchemaField;t(c,D);const I=x().create(g.businessFormatter);t(p,I);const S=y().create();t(l,S);const k=q().create();t(f,k);const B=g.uuid||e();return t(d,B),t(h,o({get:()=>g.annotation?r(g.annotation):null,set(e){if(!a(g.annotation)||!a(e))return;const o=g.annotation[e.property];g.annotation[e.property]=e.value,F("annotationChange",{fieldKey:e.property,value:e.value,oldValue:o})}})),t(j,g),{asyncQueue:b,SchemaField:D,businessCollector:I,changeContextCollector:S,formItemDepsCollector:k,formUUID:B}}export{g as useFormContext};
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
import { UndefinedAble } from '../../../../../es/shared/types';
|
|
2
2
|
import { FormRenderLifeCycle, FormRenderProps } from '../../../../../es/components/form-render';
|
|
3
3
|
export declare function useFormRenderLifeCycle(props: FormRenderProps): {
|
|
4
|
-
callLifeCycle: <T extends "onSetup" | "beforeRequest" | "afterRequest" | "afterOptionInit">(lifeCycleName: T, payload?: Parameters<Required<Partial<{
|
|
4
|
+
callLifeCycle: <T extends "onSetup" | "beforeSetValue" | "beforeRequest" | "afterRequest" | "afterOptionInit">(lifeCycleName: T, payload?: Parameters<Required<Partial<{
|
|
5
5
|
onSetup(): void;
|
|
6
|
+
beforeSetValue(fieldKey: string, value: unknown, payload: {
|
|
7
|
+
field: import("@formily/core").GeneralField;
|
|
8
|
+
oldValue: unknown;
|
|
9
|
+
}): any;
|
|
6
10
|
beforeRequest(fieldKey: string, params?: import("../../../../../es/shared/types").AnyObject | undefined, payload?: import("../../../../../es/shared/types").AnyObject | undefined): void | UndefinedAble<import("../../../../../es/shared/types").AnyObject>;
|
|
7
11
|
afterRequest(fieldKey: string, res?: any, payload?: import("../../../../../es/shared/types").AnyObject | undefined): import("../../../../../es/shared/types").AnyObject[];
|
|
8
12
|
afterOptionInit(fieldKey: string, options: import("../../../../../es/shared/types").AnyObject[], payload?: import("../../../../../es/shared/types").AnyObject | undefined): void;
|
|
9
13
|
}>>[T]> | undefined) => UndefinedAble<ReturnType<Required<Partial<{
|
|
10
14
|
onSetup(): void;
|
|
15
|
+
beforeSetValue(fieldKey: string, value: unknown, payload: {
|
|
16
|
+
field: import("@formily/core").GeneralField;
|
|
17
|
+
oldValue: unknown;
|
|
18
|
+
}): any;
|
|
11
19
|
beforeRequest(fieldKey: string, params?: import("../../../../../es/shared/types").AnyObject | undefined, payload?: import("../../../../../es/shared/types").AnyObject | undefined): void | UndefinedAble<import("../../../../../es/shared/types").AnyObject>;
|
|
12
20
|
afterRequest(fieldKey: string, res?: any, payload?: import("../../../../../es/shared/types").AnyObject | undefined): import("../../../../../es/shared/types").AnyObject[];
|
|
13
21
|
afterOptionInit(fieldKey: string, options: import("../../../../../es/shared/types").AnyObject[], payload?: import("../../../../../es/shared/types").AnyObject | undefined): void;
|
|
@@ -8,7 +8,6 @@ declare type UseOptionHooks = Partial<Record<'onRequestConfigChange' | 'onDepsCh
|
|
|
8
8
|
labelKey: string;
|
|
9
9
|
valueKey: string;
|
|
10
10
|
}) => any>>;
|
|
11
|
-
export declare const searchContentMatcher: (searchContent: string, label: string) => RegExpMatchArray | null;
|
|
12
11
|
export declare function useRecommendOptions(props: {
|
|
13
12
|
recommend: boolean;
|
|
14
13
|
commonList?: RecommendItem[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{checkInSetupEnv as e,arrayed as l,jsonParse as n
|
|
1
|
+
import{checkInSetupEnv as e,arrayed as l,jsonParse as n}from"../../../../shared/utils/index.js";import{uniqBy as o,isEqual as t,isString as u,omit as a,isFunction as r}from"lodash-es";import"naive-ui";import{computed as i,inject as s,ref as v,watch as c,toRaw as m}from"vue";import"@vueuse/core";import"date-fns";import{useFormRequest as d}from"../../../../shared/hooks/useFormRequest/index.js";import"@vueuse/shared";import{useOptionFiltered as f}from"../../../../shared/hooks/selectHooks/useOptionFiltered.js";import{useSearchContent as y}from"../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{useForm as p}from"@formily/vue";import"../../index.js";import{InjectionAsyncQueue as h,InjectionFormLifeCycleCaller as g,InjectionFormItemDepsCollector as k}from"../constants/index.js";import{createUrlConfigParams as K,formRenderLog as w}from"../utils/index.js";import{useFormField as C}from"./useFormField.js";function b(e,l){const n=v();return i({get:()=>n.value?n.value:e[l],set(e){n.value=e}})}function O(e,l,t,u,v){const c=b(e,"commonList"),m=b(e,"recentList"),{searchContent:f,optionSearchFilter:p}=y();function g(e){return n(e.itemObj)}const k=i((()=>{var e,l;return null!=(l=null==(e=c.value)?void 0:e.map(g))?l:[]})),K=i((()=>{var e,l;return null!=(l=null==(e=m.value)?void 0:e.map(g))?l:[]})),w=i((()=>{if(!e.recommend||!k.value.length&&!K.value.length)return l.value;const n=o(k.value.concat(K.value),(e=>e[v.value])),t=l.value.filter((e=>n.every((function(l){return l[v.value]!==e[v.value]}))));return[...p(n,u.value),...t]})),{getRecommendRequestInfo:O,getHttpInstance:R}=d();function q(l){const{url:n,getRecommendIds:o}=O(),t=r(o)?o():{},u=r(e.getRecommendInfo)?e.getRecommendInfo():{};return{url:n[l],info:Object.assign({},t,u)}}const{fieldKey:F,field:j}=C(),I=s(h);return{postRecommend:async function(l){if(!e.recommend)return;const n=R();if(!n)return;const{url:o,info:u}=q("post"),a=w.value.find((e=>e[v.value]===l));a&&t("postRecommend",await n.post(o,{...u,keyword:"",itemId:v.value,itemObj:JSON.stringify(a)}))},getRecommend:async function(l){if(!e.recommend)return;if(f.value=l,c.value&&m.value&&e.recommendCache)return;const n=await I.addAsync(function(l,n){const{url:o,info:t}=q("get");return{url:o,method:"get",key:l,cache:n,params:{...t,recNum:Math.max(e.commonNum,e.recentNum),keyword:""},payload:{field:j.value,labelKey:u.value,valueKey:v.value}}}(F.value,e.recommendCache)),{commonly:o,recently:t}=n.reduce(((e,l)=>("commonly"===l.type?e.commonly.push(a(l,["type"])):"recently"===l.type&&e.recently.push(a(l,["type"])),e)),{commonly:[],recently:[]});c.value=o.slice(0,e.commonNum),m.value=t.slice(0,e.recentNum)},sortedOptions:w}}function R(l,n,o){e();const a=s(h),r=s(g),d=i((()=>{var e,n,o;return null!=(o=null!=(n=null==(e=l.urlConfig)?void 0:e.nameKey)?n:l.labelField)?o:"text"})),y=i((()=>{var e,n,o;return null!=(o=null!=(n=null==(e=l.urlConfig)?void 0:e.valueKey)?n:l.valueField)?o:"value"})),p=i((()=>{var e,n;return null!=(n=null==(e=l.urlConfig)?void 0:e.showKey)?n:l.showField})),{remoteOptions:b,filterOptions:O,fullOptions:R,searchContent:q}=f(l,d),{field:F,fieldKey:j}=C(),I=v(!1),x=async function(e,n){if(q.value=e||"",!l.urlConfig)return b.value=null;try{I.value=!0;const e={field:F.value,labelKey:d.value,valueKey:y.value},o=await a.addAsync(await K({config:{...l.urlConfig,payload:e,params:{...l.urlConfig.params,...n}},cache:l.requestCache,field:F.value}));m(b.value)!==o&&(b.value=o,r("afterOptionInit",[j.value,b.value,e]))}catch(e){u(e)&&w(e)}finally{I.value=!1}},D=s(k);return c((()=>l.urlConfig),((e,u)=>{if(t(e,u))return;if(b.value=null,!e)return b.value=null;const a={fetchData:x,labelKey:d.value,valueKey:y.value},{onRequestConfigChange:r,onDepsChange:i}=o||{};D.setDeps(j.value,e.dependKey||[],(async()=>{b.value=null,n.value=null,l.lazyRequest||(i?i(a):x())})),!n.value&&l.lazyRequest||(r?r(a):x())}),{immediate:!0}),{labelKey:d,loading:I,showKey:p,valueKey:y,remoteOptions:b,filterOptions:O,fullOptions:R,fetchData:x,searchContent:q}}function q(n,o,a){e();const r=s(h),y=s(g),K=p(),b=i((()=>{var e;const o=l(null==(e=n.wordbook)?void 0:e.show_key)[0];return u(o)?o:null})),O=i((()=>{var e,l,o,t;const a=null==(l=null==(e=n.wordbook)?void 0:e.render_key)?void 0:l[0];return u(a)?a:null!=(t=null!=(o=b.value)?o:n.labelField)?t:"text"})),R=i((()=>{var e,l,o;return null!=(o=null!=(l=null==(e=n.wordbook)?void 0:e.value_key)?l:n.valueField)?o:"value"})),q=i((()=>{var e;return(null==(e=n.wordbook)?void 0:e.search_key)||[]})),F=i((()=>{var e;return null!=(e=b.value)?e:n.showField})),{fieldKey:j,field:I}=C(),{getSearchRequestInfo:x}=d(),{searchContent:D,remoteOptions:N,filterOptions:S,fullOptions:_}=f(n,O,q),z=v(!1),A=async function(e,l){if(D.value=e||"",!n.autograph||!n.wordbook)return N.value=null;try{z.value=!0;const e={field:I.value,labelKey:O.value,valueKey:R.value},o=await r.addAsync(function(e,l,o,t,u){var a,r,i;const s={autograph:l,wordbookId:e.id,wordbookType:e.type,fieldKeys:e.search_key,keyword:"",page:1,...u};if(null==(a=e.queryParams)?void 0:a.length){const l=null!=(i=null==(r=K.value)?void 0:r.getFormState().values)?i:{};e.queryParams.forEach((e=>{s[e]=l[e]}))}return{...x(),params:s,key:o,cache:n.requestCache,payload:t}}(n.wordbook,n.autograph,j.value,e,l));m(N.value)!==o&&(N.value=o,y("afterOptionInit",[j.value,N.value,e]))}catch(e){u(e)&&w(e)}finally{z.value=!1}},H=s(k);return c((()=>n.wordbook),((e,l)=>{if(t(e,l))return;if(N.value=null,!e)return N.value=null;const u={fetchData:A,labelKey:O.value,valueKey:R.value},{onRequestConfigChange:r,onDepsChange:i}=a||{};H.setDeps(j.value,e.queryParams||[],(async()=>{N.value=null,i?i(u):A()})),!o.value&&n.lazyRequest||(r?r(u):A())}),{immediate:!0}),{labelKey:O,showKey:F,loading:z,remoteOptions:N,valueKey:R,filterOptions:S,fullOptions:_,fetchData:A,searchContent:D}}export{q as useAutographOptions,O as useRecommendOptions,R as useUrlConfigOptions};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FormRequestDefine } from '../../../../../es/shared/hooks';
|
|
2
2
|
import { AnyObject, FormLowCodeReactions, FormOperationalConfig, UndefinedAble } from '../../../../../es/shared/types';
|
|
3
|
-
import { DataField, Field, Form } from '@formily/core';
|
|
3
|
+
import { DataField, Field, Form, GeneralField } from '@formily/core';
|
|
4
4
|
import { ISchema } from '@formily/json-schema/esm/types';
|
|
5
5
|
import { Component, FunctionalComponent } from 'vue';
|
|
6
6
|
import { FIELD_BUSINESS_TYPE } from '../../../../../es/components/form-render/src/constants';
|
|
@@ -110,6 +110,10 @@ export declare type DependKeyType = string | Record<string, string> | Array<{
|
|
|
110
110
|
} | string>;
|
|
111
111
|
export declare type FormRenderLifeCycle = Partial<{
|
|
112
112
|
onSetup(): void;
|
|
113
|
+
beforeSetValue(fieldKey: string, value: unknown, payload: {
|
|
114
|
+
field: GeneralField;
|
|
115
|
+
oldValue: unknown;
|
|
116
|
+
}): any;
|
|
113
117
|
beforeRequest(fieldKey: string, params?: AnyObject, payload?: AnyObject): UndefinedAble<AnyObject> | void;
|
|
114
118
|
afterRequest(fieldKey: string, res?: any, payload?: AnyObject): AnyObject[];
|
|
115
119
|
afterOptionInit(fieldKey: string, options: AnyObject[], payload?: AnyObject): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isField as e}from"@formily/core";import{isObject as r}from"@vue/shared";import{isString as
|
|
1
|
+
import{isField as e}from"@formily/core";import{isObject as r,isPromise as t}from"@vue/shared";import{isString as n,isArray as o,isFunction as u,noop as a}from"lodash-es";function i(e,t){t(e),r(e.properties)&&Object.values(e.properties).forEach((e=>{i(e,t)}))}function c(e){return l(e.map((e=>e.val_key)).join("-"))}function l(e){return e.replace(/[.]/g,"-")}function f(e){return l(`id-${e}`)}function s(e,t){e&&function(){const t=new Map;o(e)?e.forEach((e=>{var n;r(e)?t.set(e.paramName,{key:null!=(n=e.paramValue)?n:e.paramName,required:e.required}):t.set(e,e)})):r(e)?Object.entries(e).forEach((([e,r])=>{t.set(e,r)})):n(e)&&t.set(e,e);return t}().forEach(((e,r)=>{if(n(e))return t(r,e);t(r,e.key,e.required)}))}function p(e,r){let t=null;for(const o of r){if(o.val_key===e){n(o)&&(t=null);break}n(o)&&(t=o.val_key)}return t;function n(e){return"LINEBAR"===e.html_type}}function v(r,n){const o={...r};return e(n)&&Object.assign(o,{"onUpdate:value"(e){var r;const o=null==(r=n.decoratorProps)?void 0:r.beforeSetValue;if(u(o)){const r=o(n.path.toString(),e,{field:n,oldValue:n.value});return t(r)?r.then((e=>n.setValue(e)),a):n.setValue(r)}n.setValue(e)}}),o}function d(r,t){const n={...r};return e(t)&&(n.key=void 0===n.value?0:1),n}function m(r,t){const n={...r};return e(t)&&(n.onClear=()=>t.visited=!0),n}function h(e){return{type:"object",properties:e}}function y(r,t){return(...n)=>(e(r.value)&&(r.value.visited=!0),u(t)?t(...n):void 0)}export{m as assignClearBindVisited,v as assignUpdateValue,d as assignValueBindKey,f as createLinebarId,h as createObjSchema,y as createVisitedSetter,l as dotEscape,c as fieldKeyEscape,p as getParentLinebar,s as traverseDependKey,i as traverseSchema};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,provide as t,createVNode as
|
|
1
|
+
import{defineComponent as e,provide as t,createVNode as s}from"vue";import{useTheme as r}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isFunction as o,range as n}from"lodash-es";import"@vue/shared";import{widthAppend as i}from"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{NSpace as u,NButton as l}from"naive-ui";const d=e({props:{config:{type:Object,required:!0,default:()=>({})},index:{type:Number,required:!0},length:{type:Number,required:!0}},emits:["cancel","next","toNext"],setup(e,{emit:t,slots:d}){const p=r();function a(e,{skippable:r=!0,skipText:i="跳过",nextText:d="下一步",endText:p="结束引导"},a,c){var f;return s("footer",{class:"guide__stepFooter"},[null!=(f=o(e)?e():null)?f:s(u,{justify:"end",wrapItem:!1},{default:()=>[m(),r?s(l,{ghost:!0,bordered:!1,class:"guide__stepSkipBtn",textColor:"#c5c5c5",onClick:()=>t("cancel")},{default:()=>i}):null,s(l,{type:"primary",class:"guide__stepNextBtn",onClick:()=>t("next")},{default:()=>a===c-1?p:d})]})]);function m(){return s(u,{justify:"start",style:"flex:1"},{default:function(){return n(c).map((e=>s(l,{class:"guide__stepToBtn",bordered:!1,onClick:()=>t("toNext",e)},{default:()=>s("i",{class:["guide__stepToBtnContent",{guide__stepActiveBtn:e===a}]},null)})))}})}}return()=>{const{minWidth:t=240,maxWidth:r=300,pointer:n=!0}=e.config;return s("section",{class:"guide__stepContentWrapper",style:{minWidth:i(t),maxWidth:i(r),...p.value}},[n?s("div",{class:"guide__stepPointerWrapper"},[s("div",{class:"guide__stepPointer"},null),s("div",{class:"guide__stepPointerLine"},null)]):null,(l=d.header,s("header",{class:"guide__stepHeader"},[o(l)?l():null])),(u=d.body,s("section",{class:"guide__stepBody"},[o(u)?u():null])),a(d.footer,e.config,e.index,e.length)]);var u,l}}});function p(r){return r?e({setup(e,{attrs:o,slots:n}){const i=[];let u=(null==r?void 0:r.parent)&&Reflect.get(r.parent,"provides");for(;u;)Object.entries(u).forEach((([e,s])=>{i.includes(e)||(i.push(e),t(e,s))})),u=Object.getPrototypeOf(u);return()=>s(d,o,n)}}):d}export{p as createGuideStep};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as t,provide as a,ref as o,toRaw as l,watch as n,resolveComponent as s,openBlock as r,createElementBlock as i,unref as u,normalizeStyle as
|
|
1
|
+
import{defineComponent as e,computed as t,provide as a,ref as o,toRaw as l,watch as n,resolveComponent as s,openBlock as r,createElementBlock as i,unref as u,normalizeStyle as c,createBlock as d,resolveDynamicComponent as f,createElementVNode as m,createVNode as v,mergeProps as p,createSlots as b,renderList as h,withCtx as g,createCommentVNode as x,renderSlot as k,normalizeProps as y,guardReactiveProps as D}from"vue";import{useTheme as C}from"../../../shared/hooks/useTheme.js";import{useDebounceFn as j}from"@vueuse/core";import"date-fns";import{isString as $,isEqualWith as I,isFunction as w,pick as q}from"lodash-es";import{useFormAsyncQueue as R,presetRequestHandler as H}from"../../../shared/hooks/useFormRequest/index.js";import{promiseTimeout as T}from"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import"naive-ui";import{widthAppend as _,uuidGenerator as A}from"../../../shared/utils/index.js";import{VxeTableEventNameList as L,InjectionIhoTableEmits as S,InjectionTableAsyncQueue as F,InjectionIhoTableAnnotation as O,InjectionIhoTableUUID as B,InjectionIhoTableInstance as E,InjectionIhoTableConfig as N,InjectionIhoTableFieldList as W,InjectionIhoTableHandler as z}from"./constants/index.js";import{createTableHooks as G,applyTableConfigHooks as J,applyTableFieldHooks as K,createTableEventHandlers as M,createDomInsertComponent as P,createDataTransfer as Q}from"./hooks/tapHooks/index.js";import{provideIhoTableEventListener as U}from"./hooks/tapHooks/useEventHooks.js";import{eventName2EventListener as V}from"./utils/index.js";const X=["id"];var Y=e({__name:"IhoTable",props:{tableConfig:{type:Object,default:()=>({})},fieldList:{type:Array,default:()=>[]},tableData:{type:Array,default:()=>[]},annotation:{type:Object},requestInstance:{type:Object},uniqueCacheData:{type:Boolean,default:!1},parallelism:{type:Number,default:3}},emits:["formChange","settingClick","formClick","keyboard","rowDrag",...L],setup(e,{expose:L,emit:Y}){var Z,ee;const te=e,ae=C({"--c-border-color":"#d0d0d0","--c-head-bg-color":"#f2f2f2","--c-hover-color":"#e6e6e6","--c-stripe-color":"#f6f6f6"}),oe=t((()=>{var e,t;const a=null!=(t=null==(e=te.tableConfig)?void 0:e.height)?t:"100%";return{height:"auto"===a?"100%":$(a)&&(a.includes("calc")||a.endsWith("%"))?a:_(a)}})),le=U(),ne=function(e,...t){Y(e,...t);const a=u(ce)[V(e)];w(a)&&a(...t),le.trigger(e,...t)};a(S,ne);const se=R(t((()=>te.requestInstance)),t((()=>!!te.uniqueCacheData))).create(te.parallelism,{beforeRequest:(e,t)=>t,afterRequest:(e,t)=>H(t)});a(F,se);const re=G();a(O,t((()=>te.annotation)));const ie=A();a(B,ie);const ue=o();a(E,ue);const ce=o({uuid:null!=(ee=null==(Z=te.tableConfig)?void 0:Z.uuid)?ee:ie});a(N,ce);const de=j(fe,10);function fe(){ce.value=J(re,te.tableConfig,{$table:ue,emits:ne}),ce.value.uuid=ie}const me=o([]);a(W,me);const ve=j(pe,10);function pe(){const e=K(re,te.fieldList,ce.value,{$table:ue,emits:ne});I(e,l(me.value),((e,t)=>{if(w(e)&&w(t))return e.toString()===t.toString()}))||(me.value=e)}const be=Q(re,ce,ue),he=o([]);async function ge(){var e,t;const a=await be(te.tableData),o=null==(e=ue.value)?void 0:e.getTableData().fullData;if(o){let e=0;if(!(o.some((t=>{var o;if(!(null==(o=ue.value)?void 0:o.isInsertByRow(t))){if(t!==a[e])return!0;e++}}))||e!==a.length))return}he.value=a,null==(t=ue.value)||t.recalculate(!0)}const xe={updateTableDataRef:j(ge,10),updateConfigRef:de,updateFieldListRef:ve};a(z,xe);const ke=M({hooks:re,config:ce,$table:ue,context:xe,emits:ne}),ye=t((()=>({...ce.value,...ke})));let De=!1,Ce=!1,je=!1;const $e=j((()=>{De&&fe(),Ce&&pe(),je&&ge(),De=!1,Ce=!1,je=!1}),10);n((()=>te.tableConfig),(()=>{De=!0,Ce=!0,je=!0,$e()}),{deep:!0}),n((()=>te.fieldList),(()=>{Ce=!0,je=!0,$e()}),{deep:!0}),n([()=>[...te.tableData],()=>{var e;return null==(e=te.tableData)?void 0:e.length}],(()=>{je=!0,$e()})),n([()=>te.tableData,()=>{var e;return null==(e=te.tableData)?void 0:e.length}],(async()=>{var e,t;(null==(e=ce.value.treeConfig)?void 0:e.expandAll)&&(await T(11),null==(t=ue.value)||t.setAllTreeExpand(!0))})),fe(),pe(),ge();const{header:Ie,footer:we}=P(re);function qe(e){return q(e,["row","rowIndex","$rowIndex","column","columnIndex","$columnIndex","_columnIndex","checked","disabled","indeterminate"])}return L({$table:ue,async loadData(e){var t;null==(t=ue.value)||t.loadData(await be(e))},setSort:(e,t)=>({field:e,value:t}),setFilter:(e,t)=>({field:e,value:t}),reload(){var e,t;null==(e=ue.value)||e.loadColumn([]),null==(t=ue.value)||t.loadData([]),fe(),pe(),ge()},...re.exposeHooks.expose.call({},ce,{$table:ue,emits:ne})}),re.setupHooks.setup.call(ce,me,{$table:ue,emits:ne}),(e,t)=>{const a=s("vxe-grid");return r(),i("section",{class:"iho-table",id:u(ie),style:c(u(ae))},[(r(),d(f(u(Ie)))),m("section",{style:c(u(oe))},[v(a,p({ref_key:"$table",ref:ue},u(ye),{columns:me.value,data:he.value}),b({_:2},[h(e.$slots,((t,a)=>({name:a,fn:g((t=>[x(" 实际上所有的vxe-grid插槽都支持 "),k(e.$slots,a,y(D(qe(t))))]))})))]),1040,["columns","data"])],4),(r(),d(f(u(we))))],12,X)}}});export{Y as default};
|