cnhis-design-vue 3.1.57 → 3.2.1-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/button-print/index.d.ts +1 -0
- package/es/components/button-print/src/ButtonPrint.vue.d.ts +1 -0
- package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
- package/es/components/button-print/src/utils/print.d.ts +15 -3
- package/es/components/button-print/src/utils/print.js +1 -1
- package/es/components/calendar/index.d.ts +24 -13
- package/es/components/calendar/src/Calendar.vue.d.ts +24 -13
- package/es/components/calendar/src/Calendar.vue2.js +1 -1
- package/es/components/callback/src/components/render/popupMaps.d.ts +292 -2
- package/es/components/drag-scroll/index.d.ts +2 -0
- package/es/components/drag-scroll/index.js +1 -0
- package/es/components/drag-scroll/src/index.d.ts +4 -0
- package/es/components/drag-scroll/src/index.js +1 -0
- package/es/components/drag-scroll/src/types.d.ts +24 -0
- package/es/components/drag-scroll/src/types.js +1 -0
- package/es/components/fabric-chart/src/constants/index.d.ts +2 -1
- package/es/components/fabric-chart/src/constants/index.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogram.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
- package/es/components/fabric-chart/src/interface.d.ts +1 -1
- package/es/components/fabric-chart/src/utils/index.js +1 -1
- package/es/components/field-set/index.d.ts +1 -1
- package/es/components/field-set/src/FieldColor.vue.d.ts +1 -0
- package/es/components/field-set/src/FieldSet.vue.d.ts +1 -0
- package/es/components/field-set/src/Index.vue.d.ts +1 -1
- package/es/components/field-set/src/Index.vue2.js +1 -1
- package/es/components/field-set/src/TableStyle.vue.d.ts +71 -0
- package/es/components/field-set/src/TableStyle.vue.js +1 -0
- package/es/components/field-set/src/TableStyle.vue2.js +1 -0
- package/es/components/field-set/src/components/Row.vue.d.ts +1 -0
- package/es/components/field-set/src/components/Row.vue2.js +1 -1
- package/es/components/field-set/src/types/index.d.ts +1 -1
- package/es/components/field-set/style/index.css +1 -1
- package/es/components/form-config/index.d.ts +45 -4
- package/es/components/form-config/src/FormConfig.vue.d.ts +45 -4
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +16 -2
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +22 -2
- package/es/components/form-render/index.d.ts +16 -2
- package/es/components/form-render/index.js +1 -1
- package/es/components/form-render/src/FormRender.vue.d.ts +15 -1
- package/es/components/form-render/src/FormRender.vue2.js +1 -1
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +16 -2
- package/es/components/form-render/src/FormRenderWrapper.vue2.js +1 -1
- package/es/components/form-render/src/components/renderer/formItem.js +1 -1
- package/es/components/form-render/src/components/renderer/index.js +1 -1
- package/es/components/form-render/src/components/renderer/select.d.ts +2 -0
- package/es/components/form-render/src/components/renderer/select.js +1 -1
- package/es/components/form-render/src/components/renderer/simpleComponent.js +1 -1
- package/es/components/form-render/src/components/renderer/time.d.ts +7 -0
- package/es/components/form-render/src/components/renderer/time.js +1 -0
- package/es/components/form-render/src/hooks/index.d.ts +1 -0
- package/es/components/form-render/src/hooks/index.js +1 -1
- package/es/components/form-render/src/hooks/useAutoHidden.d.ts +1 -1
- package/es/components/form-render/src/hooks/useAutoHidden.js +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/form-render/src/hooks/useFieldNormalize.d.ts +6 -4
- package/es/components/form-render/src/hooks/useFieldNormalize.js +1 -1
- package/es/components/form-render/src/hooks/useFormEvent.js +1 -1
- package/es/components/form-render/src/hooks/useFormRenderOptions.js +1 -1
- package/es/components/form-render/src/hooks/useSelectedSetting.d.ts +5 -0
- package/es/components/form-render/src/hooks/useSelectedSetting.js +1 -0
- package/es/components/form-render/src/types/fieldItem.d.ts +1 -0
- package/es/components/form-render/src/types/index.d.ts +2 -0
- package/es/components/form-render/src/utils/business.d.ts +1 -1
- package/es/components/form-render/src/utils/business.js +1 -1
- package/es/components/form-render/src/utils/index.d.ts +1 -0
- package/es/components/form-render/src/utils/index.js +1 -1
- package/es/components/iho-table/index.d.ts +276 -0
- package/es/components/iho-table/src/IhoTable.vue.d.ts +276 -0
- package/es/components/iho-table/src/IhoTable.vue2.js +1 -1
- package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +1 -5
- package/es/components/iho-table/src/hooks/tapHooks/index.js +1 -1
- package/es/components/iho-table/src/hooks/tapHooks/useDataHooks.d.ts +2 -1
- package/es/components/iho-table/src/hooks/tapHooks/useDataHooks.js +1 -1
- package/es/components/iho-table/src/plugins/dragScrollPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue.d.ts +1 -1
- package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/headerPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/index.js +1 -1
- package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/levelSearchCascadePlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/levelSearchCascadePlugin/levelSearchCascade.vue.d.ts +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/numberRendererPlugin.js +1 -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/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.d.ts +15 -12
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/varialbleHeightPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/verticalTablePlugin/constants.d.ts +1 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/constants.js +1 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/index.d.ts +1 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/index.js +1 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/renderer.d.ts +6 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/renderer.js +1 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/types.d.ts +12 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/types.js +1 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/utils.d.ts +28 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/utils.js +1 -0
- package/es/components/iho-table/src/types/index.d.ts +10 -1
- package/es/components/iho-table/src/types/pluginType.d.ts +3 -1
- package/es/components/iho-table/src/utils/index.d.ts +5 -7
- package/es/components/iho-table/src/utils/index.js +1 -1
- package/es/components/index.css +1 -1
- package/es/components/index.d.ts +2 -2
- package/es/components/index.js +1 -1
- package/es/components/info-header/index.d.ts +37 -4
- package/es/components/info-header/src/InfoHeader.vue.d.ts +37 -4
- package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +1 -0
- package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +1 -0
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +17 -2
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +16 -2
- package/es/components/search-cascader/index.d.ts +1 -1
- package/es/components/search-cascader/src/SearchCascader.vue.d.ts +1 -1
- package/es/components/search-cascader/src/components/SearchMenu.d.ts +1 -1
- package/es/components/shortcut-setter/index.d.ts +17 -2
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +17 -2
- package/es/components/steps-wheel/src/StepsWheel.vue2.js +1 -1
- package/es/components/table-export-field/src/components/ExportModal.vue.d.ts +0 -3
- package/es/components/table-export-field/src/components/ExportModal.vue2.js +1 -1
- package/es/components/table-export-field/style/index.css +1 -1
- package/es/components/table-export-field/style/table-export-field-iconfont.ttf +0 -0
- package/es/shared/assets/img/table_style_1.png.js +1 -0
- package/es/shared/assets/img/table_style_2.png.js +1 -0
- package/es/shared/assets/img/table_style_3.png.js +1 -0
- package/es/shared/assets/img/table_style_4.png.js +1 -0
- package/es/shared/components/InputNumberSlash/InputNumberSlash.js +1 -1
- package/es/shared/hooks/selectHooks/useOptionFiltered.d.ts +3 -1
- package/es/shared/hooks/selectHooks/useOptionFiltered.js +1 -1
- package/es/shared/hooks/selectHooks/useSearchContent.d.ts +1 -1
- package/es/shared/hooks/selectHooks/useSearchContent.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/es/shared/types/business.d.ts +15 -6
- package/es/shared/utils/business.d.ts +1 -1
- package/es/shared/utils/index.d.ts +2 -1
- package/es/shared/utils/index.js +1 -1
- package/package.json +8 -7
|
@@ -4,7 +4,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
4
4
|
formRenderRef: import("vue").Ref<FormRenderExpose | undefined>;
|
|
5
5
|
key: import("vue").Ref<number>;
|
|
6
6
|
reload: () => Promise<void>;
|
|
7
|
-
formRenderExposeKeyList: readonly ["validate", "getFormValues", "setFormValues", "setFieldState", "resetFields", "queryWidget", "getFieldList"];
|
|
7
|
+
formRenderExposeKeyList: readonly ["validate", "getFormValues", "setFormValues", "setFieldState", "resetFields", "queryWidget", "getFieldList", "applySelectedSetting"];
|
|
8
8
|
exposed: Partial<FormRenderExpose>;
|
|
9
9
|
FormRender: import("vue").DefineComponent<{
|
|
10
10
|
fieldList: {
|
|
@@ -170,6 +170,10 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
170
170
|
default: boolean;
|
|
171
171
|
};
|
|
172
172
|
forceClearable: BooleanConstructor;
|
|
173
|
+
wordSplitFilter: {
|
|
174
|
+
type: BooleanConstructor;
|
|
175
|
+
default: boolean;
|
|
176
|
+
};
|
|
173
177
|
}, {
|
|
174
178
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
175
179
|
fieldList: {
|
|
@@ -335,6 +339,10 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
335
339
|
default: boolean;
|
|
336
340
|
};
|
|
337
341
|
forceClearable: BooleanConstructor;
|
|
342
|
+
wordSplitFilter: {
|
|
343
|
+
type: BooleanConstructor;
|
|
344
|
+
default: boolean;
|
|
345
|
+
};
|
|
338
346
|
}>> & {
|
|
339
347
|
onFormChange?: ((...args: any[]) => any) | undefined;
|
|
340
348
|
onScroll?: ((...args: any[]) => any) | undefined;
|
|
@@ -389,7 +397,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
389
397
|
afterRequest(fieldKey: string, res?: any, payload?: import("../../../shared/types").AnyObject | undefined): import("../../../shared/types").AnyObject[];
|
|
390
398
|
afterOptionInit(fieldKey: string, options: import("../../../shared/types").AnyObject[], payload?: import("../../../shared/types").AnyObject | undefined): void;
|
|
391
399
|
}>>[T]>>;
|
|
392
|
-
triggerAutoHidden: (field: import("@formily/core").GeneralField) => Promise<void>;
|
|
400
|
+
triggerAutoHidden: (field: import("@formily/core").GeneralField, includeLinebar?: boolean) => Promise<void>;
|
|
393
401
|
observeFormGraph: Record<string, import("@formily/core").GeneralField>;
|
|
394
402
|
setGraph: (field: import("@formily/core").GeneralField) => void;
|
|
395
403
|
removeGraph: (field: import("@formily/core").GeneralField) => void;
|
|
@@ -499,6 +507,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
499
507
|
operationalForm: import("../../../shared/types").LowCodeTypes.operationalConfig[];
|
|
500
508
|
outBordered: boolean;
|
|
501
509
|
forceClearable: boolean;
|
|
510
|
+
wordSplitFilter: boolean;
|
|
502
511
|
}>) => Record<string, import("@formily/json-schema").Stringify<{
|
|
503
512
|
[key: symbol]: any;
|
|
504
513
|
[key: `x-${string}`]: any;
|
|
@@ -840,6 +849,10 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
840
849
|
default: boolean;
|
|
841
850
|
};
|
|
842
851
|
forceClearable: BooleanConstructor;
|
|
852
|
+
wordSplitFilter: {
|
|
853
|
+
type: BooleanConstructor;
|
|
854
|
+
default: boolean;
|
|
855
|
+
};
|
|
843
856
|
}>> & {
|
|
844
857
|
onFormChange?: ((...args: any[]) => any) | undefined;
|
|
845
858
|
onScroll?: ((...args: any[]) => any) | undefined;
|
|
@@ -859,6 +872,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
859
872
|
uniqueCacheData: boolean;
|
|
860
873
|
outBordered: boolean;
|
|
861
874
|
forceClearable: boolean;
|
|
875
|
+
wordSplitFilter: boolean;
|
|
862
876
|
operationalFormInit: boolean;
|
|
863
877
|
}>;
|
|
864
878
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as r,computed as t,openBlock as
|
|
1
|
+
import{defineComponent as e,ref as r,computed as t,openBlock as l,createBlock as a,withCtx as o,renderSlot as u,nextTick as d}from"vue";import s from"./FormRender.vue.js";var n=e({__name:"FormRenderWrapper",setup(e,{expose:n}){const i=r(),f=r(0);return n({...["validate","getFormValues","setFormValues","setFieldState","resetFields","queryWidget","getFieldList","applySelectedSetting"].reduce(((e,r)=>(e[r]=(...e)=>{var t;return(null==(t=i.value)?void 0:t[r]).call(t,...e)},e)),{}),formModel:t((()=>{var e;return null==(e=i.value)?void 0:e.formModel})),reload:async function(){f.value++,await d()}}),(e,r)=>(l(),a(s,{key:f.value,ref_key:"formRenderRef",ref:i},{default:o((()=>[u(e.$slots,"default")])),_:3}))}});export{n as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,inject as r,computed as l,ref as o,onUnmounted as t,createVNode as n,mergeProps as i,unref as a}from"vue";import{arrayed as s,widthAppend as
|
|
1
|
+
import{defineComponent as e,inject as r,computed as l,ref as o,onUnmounted as t,createVNode as n,mergeProps as i,unref as a}from"vue";import{arrayed as s,widthAppend as u}from"../../../../../shared/utils/index.js";import{isVoidField as d}from"@formily/core";import{observe as m,autorun as f}from"@formily/reactive";import{connect as p,mapProps as v}from"@formily/vue";import{useDebounceFn as c}from"@vueuse/core";import{isString as y,isArray as b,isFunction as _}from"lodash-es";import{NFormItem as g}from"naive-ui";import x from"../../../../annotation-edit/index.js";import"../../../index.js";import I from"../tooltipMessage.vue.js";import{InjectionFormUUID as j,InjectionFormGraph as h,InjectionAnnotation as k,InjectionAnnotationShortcuts as F,InjectionFormGlobalProps as R}from"../../constants/index.js";import{useComplexOptionsSpan as L}from"../../hooks/useComplexOptions.js";import{validateMessageParser as q,editorUnescape as K}from"../../utils/index.js";import{dotEscape as S}from"../../utils/schema.js";import{useFormField as M}from"../../hooks/useFormField.js";const A=p(e({name:"FormRenderItem",props:{label:String,propertyKey:String,remark:String,span:{type:Number,default:6},suffixFields:{type:Array},labelRender:Function,annotation:{},fieldItem:{type:Object}},setup(e,{slots:s}){const{field:p,fieldKey:v,fieldAddress:q}=M(),A=r(j),E=l((()=>S(`${A}-${q.value}`))),O=o(!1);if(d(p.value)&&b(e.suffixFields)){const l=r(h);t(m(l,c((()=>{d(p.value)&&b(e.suffixFields)&&(O.value=e.suffixFields.some((e=>{const r=p.value.form.query(e).take();return r&&Reflect.get(r,"required")})))}),100)))}else t(f((()=>{O.value=Reflect.get(p.value,"required")})));const T=r(k),V=l({get(){var r,l;return null!=(l=null==(r=T.value)?void 0:r[e.propertyKey])?l:""},set(r){T.value={property:e.propertyKey,value:r}}}),$=r(F);const w=l((()=>T.value&&!1!==e.annotation)),C=l((()=>e.label&&" "!==e.label)),H=l((()=>{let r=0;return w.value&&(r+=18),e.remark&&(r+=18),r})),N=r(R,{}),U=l((()=>{var r;const l=null==(r=e.fieldItem)?void 0:r.bordered;return null==l?N.bordered:l}));function W(){return C.value?n("section",{class:"form-render__formItemLabel"},[n("span",{class:"form-render__formItemLabel--text",style:{marginRight:u(H.value)}},[_(e.labelRender)?e.labelRender(e.label):e.label]),H.value?n("section",{class:"form-render__formItemLabel--operation"},[e.remark?n("div",{class:"form-render__formItemLabel--tooltip"},[n(I,{message:e.remark},null)]):null,w.value?n(x,{class:"form-render__formItemLabel--annotation",modelValue:V.value,"onUpdate:modelValue":e=>V.value=e,shortcuts:a($)},null):null]):null]):null}const{getSpan:z}=L();function B(){var r,l,o;const t=null==(r=e.fieldItem)?void 0:r.editor_title;return y(t)&&t?n("section",{style:"display:flex;flex-direction:column;gap:4px"},[null==(o=s.default)?void 0:o.call(s),n("div",{innerHTML:K(t)},null)]):null==(l=s.default)?void 0:l.call(s)}return()=>{return n(g,i({class:["form-render__formItem",{"form-render--no-border":!U.value,"form-render--underline":"underline"===U.value}],style:{"--form-item-column":"inner"===(null==(r=e.fieldItem)?void 0:r.childWidthMode)?e.span:z(A,p.value.address,!1)+e.span}},{id:E.value,uuid:A,"widget-type":p.value.componentType,"field-key":S(v.value),"field-address":S(q.value),required:O.value}),{...s,default:B,label:W});var r}}}),v({title:"label"},((e,r)=>{const l=d(r)?void 0:s(r.selfErrors).length?function(e,r){if(!y(r.defined_error_msg)||!r.defined_error_msg)return e.map((e=>q(e,r))).join(",");return q(r.defined_error_msg,r)}(s(r.selfErrors),e.fieldItem):void 0;return{...e,fieldItem:void 0,feedback:l,"validation-status":l?"error":void 0}})));export{A as FORM_ITEM};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as s from"./combination/index.js";import*as
|
|
1
|
+
import*as s from"./combination/index.js";import*as t from"./complex.js";import*as r from"./date.js";import*as o from"./formItem.js";import*as e from"./input.js";import*as m from"./inputGroup.js";import*as i from"./inputNumber.js";import*as a from"./levelSearchCascader/index.js";import*as p from"./lineBar/index.js";import*as x from"./radio_checkbox.js";import*as n from"./remoteSearch.js";import*as c from"./searchCascade.js";import*as f from"./select.js";import*as j from"./simpleComponent.js";import*as d from"./slider.js";import*as l from"./switch.js";import*as u from"./textarea.js";import*as h from"./time.js";import{separateMetaModule as b}from"../../../../../shared/utils/index.js";var C=b(Object.assign({"./combination/index.ts":s,"./complex.tsx":t,"./date.tsx":r,"./formItem.tsx":o,"./input.tsx":e,"./inputGroup.ts":m,"./inputNumber.tsx":i,"./levelSearchCascader/index.tsx":a,"./lineBar/index.ts":p,"./radio&checkbox.tsx":x,"./remoteSearch.tsx":n,"./searchCascade.tsx":c,"./select.tsx":f,"./simpleComponent.tsx":j,"./slider.tsx":d,"./switch.tsx":l,"./textarea.tsx":u,"./time.tsx":h}));export{C as default};
|
|
@@ -112,6 +112,7 @@ export declare const SELECT: import("vue").DefineComponent<{
|
|
|
112
112
|
searchByValue: {
|
|
113
113
|
type: BooleanConstructor;
|
|
114
114
|
};
|
|
115
|
+
wordSplitFilter: {};
|
|
115
116
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:value" | "postRecommend")[], "update:value" | "postRecommend", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
116
117
|
value: {
|
|
117
118
|
type: PropType<ArrayAble<string | number> | null>;
|
|
@@ -221,6 +222,7 @@ export declare const SELECT: import("vue").DefineComponent<{
|
|
|
221
222
|
searchByValue: {
|
|
222
223
|
type: BooleanConstructor;
|
|
223
224
|
};
|
|
225
|
+
wordSplitFilter: {};
|
|
224
226
|
}>> & {
|
|
225
227
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
226
228
|
onPostRecommend?: ((...args: any[]) => any) | undefined;
|
|
@@ -1 +1 @@
|
|
|
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 y}from"naive-ui";import"@vueuse/core";import"date-fns";import"@vue/shared";import{useSelectAllowModify as f}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"@formily/path";import"@formily/core";import"@vicons/ionicons5";import{assignUpdateValue as F,assignClearBindVisited 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 y}from"naive-ui";import"@vueuse/core";import"date-fns";import"@vue/shared";import{useSelectAllowModify as f}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"@formily/path";import"@formily/core";import"@vicons/ionicons5";import{assignUpdateValue as F,assignClearBindVisited as w,createVisitedSetter as A}from"../../utils/schema.js";import"@formily/reactive";import"../../../index.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"./index.js";import"@vueuse/shared";import{useFormField as H}from"../../hooks/useFormField.js";import{useUrlConfigOptions as O,useAutographOptions as K,useRecommendOptions as R}from"../../hooks/useFormRenderOptions.js";import"../../hooks/useFormValidator.js";const x=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},searchByValue:{type:Boolean},wordSplitFilter:{}},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:w,valueKey:x,showKey:V,fetchData:L,searchContent:P,fullOptions:_,filterOptions:N,remoteOptions:I,loading:W}=e.urlConfig?O(e,F):K(e,F),{modifyEvent:q,modifyAbleRef:E,getOptionsWithCreated:z}=f(e,{searchContent:P,labelKey:w,valueKey:x,valueRef:F,fullOptions:_}),{renderComplexOption:M,hasComplexOption:T}=k(e,F),{getRecommend:U,postRecommend:D,sortedOptions:G}=R(e,N,b,w,x),{field:J,fieldKey:Q}=H();t(C).setContext(Q.value,(e=>({currentOption:i(function(e){const o=z(_.value);return p(e)?function(e){const t=o.reduce(((e,o)=>(e[o[x.value]]=o,e)),{});return e.map((e=>t[e]))}(e):(t=e,o.find((e=>e[x.value]===t)));var t}(e))})));const X=async e=>(P.value=e,Promise.allSettled([L(e),U(e)])),{injectValueValidate:Y,injectValueWatchFromEmpty:Z,injectValueBindKey:$}=j();Z(F,(()=>e.lazyRequest&&X())),Y(F);const ee=$(F),{menuProps:oe,nodeProps:te}=S(),{renderTag:le,renderLabel:ae,renderSelectAll:re,titleRef:se}=v(e,{labelKey:w,valueKey:x,valueRef:F,showKey:V,searchContent:P}),ne=o((()=>z(E.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[x.value]):e[x.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 q.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:ye}=g(),fe=A(J,q.focus);function ve(o){if(!e.multiple)return;const t=o?ne.value.map((e=>e[x.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(y,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:w.value,valueField:x.value,options:ne.value,onSearch:X,show:pe.value,"onUpdate:show":me,onFocus:fe,onBlur:q.blur,renderLabel:ae,renderTag:le},o,ue),t)}return()=>{var e,o;if(!T.value)return he();const t=null!=(o=null==(e=J.value.decoratorProps)?void 0:e.span)?o:6,l=ye(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=>M({option:e,value:F.value,valueKey:x.value,labelKey:w.value,childFieldStrategy:"checked",renderLabel:!1,attrs:{class:"form-render__selectChildFieldItem",style:{"--form-item-column":l}}})))])}}}),b({dataSource:"options"},F,w));export{x as SELECT};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createVNode as n}from"vue";import{connect as
|
|
1
|
+
import{createVNode as n}from"vue";import{connect as l,mapProps as t}from"@formily/vue";import{isString as e,isFunction as o}from"lodash-es";import{NButton as r}from"naive-ui";import{createSlot as i}from"../../utils/index.js";const u=l=>{var t,o,r;return n("div",null,[null==(r=(o=i(null!=(t=l.content)?t:l.value,l,(l=>e(l)?l.replaceAll("\n","<br>").split("<br>").map(((l,t,e)=>[l,t<e.length-1?n("br",null,null):null])):[l]))).default)?void 0:r.call(o)])};u.props={content:{},fieldItem:{},value:{}};const c=l(u,t((n=>{var l;return{...n,content:null==(l=n.fieldItem)?void 0:l.content}}))),m=l=>{const t=function(n){return l=>{var t;return null==(t=n.fieldItem)?void 0:t[l]}}(l);return n(r,{onClick:function(){var n;const e=t("onClick")||(null==(n=t("componentProps"))?void 0:n.onClick);return()=>o(e)&&e(l.fieldItem)}()},i(l.content,l))};m.props={onClick:{},fieldItem:{},content:{}};const d=l(m,t((n=>{var l,t,e;return{...n,content:null!=(e=null==(l=n.fieldItem)?void 0:l.content)?e:null==(t=n.fieldItem)?void 0:t.alias}}))),s=l((l=>{const t=l.border?{background:"rgb(31,34,37)",margin:"0 -8px"}:null;return n("section",{class:"form-render__linebreaks",style:{"--form-item-column":999,height:"1px",...t}},null)}));export{d as BUTTON,s as LINE_BREAKS,c as TEXT};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const TIME: import("vue").DefineComponent<{
|
|
2
|
+
value: {};
|
|
3
|
+
onChange: {};
|
|
4
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
5
|
+
value: {};
|
|
6
|
+
onChange: {};
|
|
7
|
+
}>>, {}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineComponent as e,createVNode as r}from"vue";import{connect as o,mapProps as t}from"@formily/vue";import{useVModel as i}from"@vueuse/core";import"../../../index.js";import m from"../../../../iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.js";import{assignUpdateValue as u,assignClearBindVisited as l}from"../../utils/schema.js";const n=o(e({name:"FORM_TIME",props:{value:{},onChange:{}},setup(e){const o=i(e,"value");return()=>r(m,{formattedValue:o.value,"onUpdate:formattedValue":e=>o.value=e,ignoreGlobEmit:!0},null)}}),t(u,l));export{n as TIME};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{useAnchor}from"./useAnchor.js";export{useAutoHidden}from"./useAutoHidden.js";export{BusinessCollector,useBusinessBinding}from"./useBusinessBinding.js";export{ContextCollector,useChangeContext}from"./useChangeContext.js";export{useCommonInjection,useSelectOptionProps}from"./useCommonInjection.js";export{useCommonLog}from"./useCommonLog.js";export{useComplexOptions,useComplexOptionsSpan}from"./useComplexOptions.js";export{useFieldListAdaptor}from"./useFieldListAdaptor.js";export{useFieldNormalize}from"./useFieldNormalize.js";export{useFieldVisitor}from"./useFieldVisitor.js";export{useFormContext}from"./useFormContext.js";export{useFormDomEvent,useFormExposeEvent}from"./useFormEvent.js";export{useFormField}from"./useFormField.js";export{useFormGraph}from"./useFormGraph.js";export{FormItemDepsCollector,useFormItemDeps}from"./useFormItemDeps.js";export{useFormRenderLifeCycle}from"./useFormRenderLifeCycle.js";export{useAutographOptions,useRecommendOptions,useUrlConfigOptions}from"./useFormRenderOptions.js";export{useFormValidator,validateMessageLocale}from"./useFormValidator.js";export{useLowCodeEvent}from"./useLowCodeEvent.js";export{useLowCodeReactions}from"./useLowCodeReactions.js";export{useNuiThemeOverrides}from"./useNuiThemeOverrides.js";export{useOperationalForm}from"./useOperationalForm.js";export{usePresetScope}from"./usePresetScope.js";export{useWordbookSetting,wordbookSettingHandler}from"./useWordbookSetting.js";export{useNewLowCodeReactions}from"./useNewLowCodeReactions.js";
|
|
1
|
+
export{useAnchor}from"./useAnchor.js";export{useAutoHidden}from"./useAutoHidden.js";export{BusinessCollector,useBusinessBinding}from"./useBusinessBinding.js";export{ContextCollector,useChangeContext}from"./useChangeContext.js";export{useCommonInjection,useSelectOptionProps}from"./useCommonInjection.js";export{useCommonLog}from"./useCommonLog.js";export{useComplexOptions,useComplexOptionsSpan}from"./useComplexOptions.js";export{useFieldListAdaptor}from"./useFieldListAdaptor.js";export{useFieldNormalize}from"./useFieldNormalize.js";export{useFieldVisitor}from"./useFieldVisitor.js";export{useFormContext}from"./useFormContext.js";export{useFormDomEvent,useFormExposeEvent}from"./useFormEvent.js";export{useFormField}from"./useFormField.js";export{useFormGraph}from"./useFormGraph.js";export{FormItemDepsCollector,useFormItemDeps}from"./useFormItemDeps.js";export{useFormRenderLifeCycle}from"./useFormRenderLifeCycle.js";export{useAutographOptions,useRecommendOptions,useUrlConfigOptions}from"./useFormRenderOptions.js";export{useFormValidator,validateMessageLocale}from"./useFormValidator.js";export{useLowCodeEvent}from"./useLowCodeEvent.js";export{useLowCodeReactions}from"./useLowCodeReactions.js";export{useNuiThemeOverrides}from"./useNuiThemeOverrides.js";export{useOperationalForm}from"./useOperationalForm.js";export{usePresetScope}from"./usePresetScope.js";export{useWordbookSetting,wordbookSettingHandler}from"./useWordbookSetting.js";export{useNewLowCodeReactions}from"./useNewLowCodeReactions.js";export{useSelectedSetting}from"./useSelectedSetting.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{untracked as e}from"@formily/reactive";import{nextTick as
|
|
1
|
+
import{untracked as e}from"@formily/reactive";import{nextTick as n}from"vue";function t(){const t=["INPUT_GROUP"];function i(e,n=!1){return t.includes(e.componentType)||n&&"LINEBAR"===e.componentType}return{trigger:async function(t,s=!1){const o=t.selfDisplay;e((async()=>{if(i(t,s))return await n(),r(t);{const e=t.parent;if(!e||!i(e,s))return;if("visible"!==o)return r(e);e.setDisplay("visible")}}))}}}async function r(e){if("hidden"===e.selfDisplay)return;const n=function(e){const n=e.address.toString();return Reflect.get(e.form.query(n+".*"),"addresses").filter((t=>{const r=e.form.fields[t];return r&&r.address.parent().toString()===n}))}(e).some((n=>{const t=e.form.fields[n];return t&&"visible"===t.selfDisplay}));e.setDisplay(n?"visible":"hidden")}export{t as useAutoHidden};
|
|
@@ -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 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(e){return"1"===e||!0===e}function _(_,
|
|
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(e){return"1"===e||!0===e}function _(_,x){const{createValidatorSchema:h}=c(),g=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=h(e);return n&&(t["x-validator"]=n),"0"===e.is_null&&(t.required=!0),t},v=e=>{var o,t,r,l,s,a,p,c,d,_,x,h,v,y;const b=g(e);e.urlConfig?u(b,e):e.autograph&&m(b,e);const w=!!e.__multiple,C=f(null!=(t=null==(o=e.componentProps)?void 0:o.allowModify)?t:e.allowModify),O=f(null!=(l=null==(r=e.componentProps)?void 0:r.selectAll)?l:e.selectAll),A=f(null!=(a=null==(s=e.componentProps)?void 0:s.shouldSave)?a:e.save_free_entry),E=f(null!=(c=null==(p=e.componentProps)?void 0:p.allowCreate)?c:e.free_entry),j=null!=(_=null==(d=e.componentProps)?void 0:d.showField)?_:e.show_key,k=null!=(h=null==(x=e.componentProps)?void 0:x.options)?h:e.option,N=null!=(y=i(e.multi_select_value))?y:null==(v=e.componentProps)?void 0:v.maxTagCount;return Object.assign(b["x-component-props"],{multiple:w,options:k,allowModify:C,allowCreate:E||C,shouldSave:A,showField:j,maxTagCount:N,selectAll:O,...n(e,["lazyRequest","requestCache"])}),w&&(b.type="array"),b},y=e=>{var o,t;const n=g(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=g(e);return Object.assign(t["x-component-props"],{fieldItem:o(e,["reactions"])}),t},w=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}}),C=new Map([["LINEBAR",w],["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=g(e);return Object.assign(o["x-component-props"],{...n(e,["prefix","suffix"])}),o}],["TEXTAREA",e=>{const o=g(e);return Object.assign(o["x-component-props"],{rows:e.initialize_high||3}),o}],["INPUT_NUMBER",e=>{const o=g(e),{decimal_length:t,validate:n,allowSlash:r}=e;return!0!==r&&"1"!==r||(o["x-component"]="INPUT_NUMBER_SLASH",o.type="string"),Object.assign(o["x-component-props"],{precision:i(null!=t?t:null==n?void 0:n.decimal_length),whiteList:e.whiteList,prefix:e.prefix,suffix:e.suffix}),o}],["SELECT",v],["REMOTE_SEARCH",v],["DATE",e=>{const o=g(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}],["TIME",e=>{const o=g(e);return Object.assign(o["x-component-props"],{format:e.date_format,type:d(e.date_format),validate:e.validate}),"current"===o.default&&(o.default=l(new Date,e.date_format||"HH:mm:ss")),o}],["LEVEL_SEARCH_CASCADER",e=>{const o=g(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=g(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=g(e);return o.type="array","table"===e.displayMode?o["x-component"]="TABLE_COMBINATION":!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,minGroupNum:e.minGroupNum,showLabel:"1"!==e.hide_title,properties:e.children||[],combinationItemDeletable:e.combinationItemDeletable}),o}],["RADIO",y],["CHECKBOX",y],["SWITCH",e=>{const o=g(e);return Object.assign(o["x-component-props"],{openDescription:e.open,closeDescription:e.close,showMode:e.show_mode}),o}],["SLIDER",e=>{const o=g(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=g(e);Array.isArray(e.properties)&&r("COMPLEX控件的properties属性已经废弃, 请使用children作为替代, 在之后的版本中properties属性将不再支持");const t=Array.isArray(e.properties||e.children)?k(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}]]),O=e=>{if(e.suffixConfig)return A(e);return(C.get(e.html_type)||b)(e)},A=o=>{if(!o.suffixConfig&&!o.prefixConfig)return O(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=g(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:k(n)}),i},{FieldNormalizeWaterfallHook:E,FieldListNormalizeWaterfallHook:j}=s();function k(o,n={column:9999}){let i=null;return j.call(t(o),n).reduce(((e,o,s)=>{var a;const p=null==(a=(o=E.call(o,n)).validate)?void 0:a.obj_type;return p&&_&&_.collect(p,t(o)),"LINEBAR"===o.html_type?(e[l(o)]=r(w(o),s),i=e[l(o)].properties={}):i?i[l(o)]=r(O(o),s):(i=null,e[l(o)]=r(O(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:k}}export{_ as useFieldListAdaptor};
|
|
@@ -4,7 +4,7 @@ export declare function useFieldNormalize(): {
|
|
|
4
4
|
FieldNormalizeWaterfallHook: SyncWaterfallHook<[FieldItem, Partial<{
|
|
5
5
|
fieldList: FieldItem[];
|
|
6
6
|
initialData: import("../../../../shared/types").AnyObject;
|
|
7
|
-
fieldVisitor: import("
|
|
7
|
+
fieldVisitor: import("../../../../components/form-render").FieldVisitor;
|
|
8
8
|
column: number;
|
|
9
9
|
maxHeight: string | number;
|
|
10
10
|
anchor: boolean;
|
|
@@ -85,7 +85,7 @@ export declare function useFieldNormalize(): {
|
|
|
85
85
|
afterRequest(fieldKey: string, res?: any, payload?: import("../../../../shared/types").AnyObject | undefined): import("../../../../shared/types").AnyObject[];
|
|
86
86
|
afterOptionInit(fieldKey: string, options: import("../../../../shared/types").AnyObject[], payload?: import("../../../../shared/types").AnyObject | undefined): void;
|
|
87
87
|
}>;
|
|
88
|
-
businessFormatter: import("
|
|
88
|
+
businessFormatter: import("../../../../components/form-render").FormBusinessFormatter;
|
|
89
89
|
requestInstance: import("../../..").FormRequestDefine.RequestInstance;
|
|
90
90
|
enterToNextWidget: boolean | ((fieldItem: FieldItem) => boolean | void);
|
|
91
91
|
lowCodeReactions: import("../../../../shared/types").LowCodeTypes.reactionConfig[];
|
|
@@ -95,11 +95,12 @@ export declare function useFieldNormalize(): {
|
|
|
95
95
|
operationalForm: import("../../../../shared/types").LowCodeTypes.operationalConfig[];
|
|
96
96
|
outBordered: boolean;
|
|
97
97
|
forceClearable: boolean;
|
|
98
|
+
wordSplitFilter: boolean;
|
|
98
99
|
}>], import("../../../../shared/utils/tapable").UnsetAdditionalOptions>;
|
|
99
100
|
FieldListNormalizeWaterfallHook: SyncWaterfallHook<[FieldItem[], Partial<{
|
|
100
101
|
fieldList: FieldItem[];
|
|
101
102
|
initialData: import("../../../../shared/types").AnyObject;
|
|
102
|
-
fieldVisitor: import("
|
|
103
|
+
fieldVisitor: import("../../../../components/form-render").FieldVisitor;
|
|
103
104
|
column: number;
|
|
104
105
|
maxHeight: string | number;
|
|
105
106
|
anchor: boolean;
|
|
@@ -180,7 +181,7 @@ export declare function useFieldNormalize(): {
|
|
|
180
181
|
afterRequest(fieldKey: string, res?: any, payload?: import("../../../../shared/types").AnyObject | undefined): import("../../../../shared/types").AnyObject[];
|
|
181
182
|
afterOptionInit(fieldKey: string, options: import("../../../../shared/types").AnyObject[], payload?: import("../../../../shared/types").AnyObject | undefined): void;
|
|
182
183
|
}>;
|
|
183
|
-
businessFormatter: import("
|
|
184
|
+
businessFormatter: import("../../../../components/form-render").FormBusinessFormatter;
|
|
184
185
|
requestInstance: import("../../..").FormRequestDefine.RequestInstance;
|
|
185
186
|
enterToNextWidget: boolean | ((fieldItem: FieldItem) => boolean | void);
|
|
186
187
|
lowCodeReactions: import("../../../../shared/types").LowCodeTypes.reactionConfig[];
|
|
@@ -190,5 +191,6 @@ export declare function useFieldNormalize(): {
|
|
|
190
191
|
operationalForm: import("../../../../shared/types").LowCodeTypes.operationalConfig[];
|
|
191
192
|
outBordered: boolean;
|
|
192
193
|
forceClearable: boolean;
|
|
194
|
+
wordSplitFilter: boolean;
|
|
193
195
|
}>], import("../../../../shared/utils/tapable").UnsetAdditionalOptions>;
|
|
194
196
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{arrayed as e,uuidGenerator as t,traverse as r}from"../../../../shared/utils/index.js";import"../../../../shared/utils/tapable/SyncHook.js";import"../../../../shared/utils/tapable/SyncBailHook.js";import l from"../../../../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{last as o,isString as s}from"lodash-es";import{FIELD_BUSINESS_TYPE as i}from"../constants/index.js";function
|
|
1
|
+
import{arrayed as e,uuidGenerator as t,traverse as r}from"../../../../shared/utils/index.js";import"../../../../shared/utils/tapable/SyncHook.js";import"../../../../shared/utils/tapable/SyncBailHook.js";import l from"../../../../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{last as o,isString as s}from"lodash-es";import"../../index.js";import{FIELD_BUSINESS_TYPE as i}from"../constants/index.js";import{transformDateFormat as a}from"../utils/business.js";function p(){const p=new l(["fieldList","props"]),_=new l(["fieldItem","props"]);_.tap("__forceClearable",((e,t)=>(t.forceClearable&&(e.componentProps={...e.componentProps,clearable:!0}),e))),_.tap("__time",(e=>("DATE"===e.html_type&&"time"===a(e.date_format)&&(e.html_type="TIME"),e))),_.tap("__block",(e=>(["CHECKBOX_BLOCK","RADIO_BLOCK"].includes(e.html_type)&&(e.__vertical=!0),e))),_.tap("__age",(t=>("AGE"===t.html_type&&(t.html_type="INPUT_NUMBER",t.reactions=t.reactions?e(t.reactions):[],t.reactions.push({target:t.val_key_unit,fulfill:{state:{disabled:"{{$self.disabled}}"}}}),t.suffixConfig=[{validate:{obj_type:i.AGE_UNIT},val_key:t.val_key_unit,html_type:"SELECT",option:t.option,urlConfig:t.urlConfig}]),t))),_.tap("__multiple_select",(e=>{const{html_type:t,multi_select:r,__multiple:l}=e;return e.__multiple="SEARCH"!==t&&("SEARCH_MORE"===t||("SELECT"===t?"0"===r:l)),e}));const n=[[["SEARCH","PHONE_TYPE","IDCARD_TYPE","SEARCH_MORE"],"SELECT"],["DIGITAL","INPUT_NUMBER"],["CHECKBOX_BLOCK","CHECKBOX"],["RADIO_BLOCK","RADIO"],[["DATE-INPUT","DATETIME-INPUT"],"DATE"],["SWITCH_COMPONENT","SWITCH"],["SLIDER_COMPONENT","SLIDER"],["LEVEL_SEARCH_CASCADE","LEVEL_SEARCH_CASCADER"],["SEARCH_CASCADE","SEARCH_CASCADER"]];_.tap("__normalize",(e=>(n.some((([t,r])=>(Array.isArray(t)?t.includes(e.html_type):t===e.html_type)&&(e.html_type=r))),e)));const m=new Map([[["SELECT","SEARCH","SEARCH_MORE"],new Map([["H_TILE",e=>e.html_type=e.__multiple?"CHECKBOX":"RADIO"],["V_TILE",e=>{e.html_type=e.__multiple?"CHECKBOX":"RADIO",e.__vertical=!0}]])],["RADIO",new Map([["DROPDOWN",e=>e.html_type="SELECT"]])],["CHECKBOX",new Map([["DROPDOWN",e=>{e.__multiple=!0,e.html_type="SELECT"}]])]]);return _.tap({stage:9999,name:"__show_mode"},(t=>t.show_mode?([...m].some((([r,l])=>{if(!e(r).includes(t.html_type))return;const o=l.get(t.show_mode);return o&&o(t),!0})),t):t)),p.tap("__out_bordered",((e,{column:r,outBordered:l})=>{if(!l)return e;let s=0;return e.reduce(((l,i,a)=>{const p=2*(i.elem_width||3);return s+=p,s===r&&a<e.length-1?(s=0,l.push(i),l.push({val_key:`${t()}`,html_type:"LINE_BREAKS",lineBreaksBorder:!0})):s>r?(s=p,l.push({val_key:`${t()}`,html_type:"LINE_BREAKS",lineBreaksBorder:!0}),l.push(i)):(o(l)&&(o(l).fieldItemBorder=!0),l.push(i)),l}),[])})),p.tap("__prefix/suffix",(e=>{const t=[];return r(e,(l=>{["prefix","suffix"].forEach((o=>{const i=l[o];if(!s(i))return;const a=i.match("#{(.+)}");if(!a)return;const p=s(a[1])&&function(t){let l=null;return r(e,((e,r)=>{e.val_key===t&&(l=e,r())}),["children","properties"]),l}(a[1].trim());p&&(Reflect.deleteProperty(l,o),l[`${o}Config`]=l[`${o}Config`]||[],l[`${o}Config`].push(p),t.push(p))}))}),["children","properties"]),t.length?function e(r){return r.reduce(((r,l)=>(t.includes(l)||(r.push(l),l.properties&&(l.properties=e(l.properties)),l.children&&(l.children=e(l.children))),r)),[])}(e):e})),{FieldNormalizeWaterfallHook:_,FieldListNormalizeWaterfallHook:p}}export{p as useFieldNormalize};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{arrayed as e,findAncestor as t}from"../../../../shared/utils/index.js";import{isField as r}from"@formily/core";import{Path as o}from"@formily/path";import{isObject as i}from"@vue/shared";import{promiseTimeout as n}from"@vueuse/shared";import{isFunction as a,isArray as s,isString as d}from"lodash-es";import{nextTick as l}from"vue";import"../../index.js";import{NESTED_FORM_ITEM_TYPE as u}from"../constants/index.js";import{queryDecoratorByAddress as m,queryInput as f,queryDecoratorByFieldKey as c,findNextWidget as p}from"../utils/dom.js";import{validateMessageParser as g,combineExtendKey as v,splitExtendKey as y}from"../utils/index.js";import{getParentLinebar as h}from"../utils/schema.js";function
|
|
1
|
+
import{arrayed as e,findAncestor as t}from"../../../../shared/utils/index.js";import{isField as r}from"@formily/core";import{Path as o}from"@formily/path";import{isObject as i}from"@vue/shared";import{promiseTimeout as n}from"@vueuse/shared";import{isFunction as a,isArray as s,isString as d}from"lodash-es";import{nextTick as l}from"vue";import"../../index.js";import{NESTED_FORM_ITEM_TYPE as u}from"../constants/index.js";import{queryDecoratorByAddress as m,queryInput as f,queryDecoratorByFieldKey as c,findNextWidget as p}from"../utils/dom.js";import{validateMessageParser as g,combineExtendKey as v,splitExtendKey as y}from"../utils/index.js";import{getParentLinebar as h}from"../utils/schema.js";import{useSelectedSetting as b}from"./useSelectedSetting.js";function S({formModel:t,formRenderRef:n,formUUID:u,getFieldList:p,formItemDepsCollector:S,businessCollector:x,wordbookSettingHandler:D,operationalFormHandler:j}){const{applySelectedSetting:F}=b(t);return{validate(o,{force:l}={}){if(null==o&&(o="*"),a(o)){const e=Object.entries(t.fields).reduce(((e,[t,r])=>(o(r)&&e.push(t),e)),[]);if(!e.length)return Promise.resolve();o=e.length?`*(${e.join(",")})`:"*"}const c=[];l&&t.setFieldState(o,(e=>{"visible"===e.display&&"editable"!==e.pattern&&r(e)&&(c.push({pattern:e.pattern,state:e}),e.pattern="editable")}));const p=t.validate(o).catch((e=>Promise.reject(Array.isArray(e)?e.reduce(v,[]):e)));return l&&c.forEach((({pattern:e,state:t})=>t.pattern=e)),p;function v(t,r){if(!i(r))return t;let o=!1;return s(r.messages)&&r.messages.forEach((r=>{i(r)&&(t.push(...e(r).map(y)),o=!0)})),!o&&t.push(y(r)),t}function y(e){if(e.decoratorElement)return e;const r=t.query(e.path),o=r.get("title"),a=e.messages.map((e=>function(e,t){if(!t||!i(t.fieldItem))return e;const r=t.fieldItem.defined_error_msg;return g(r&&d(r)?r:e,t.fieldItem)}(e,r.get("decoratorProps")))),s=m(e.address,n.value,u);return{...e,messages:a,title:o,decoratorElement:s,...f(s)}}},getFormValues(e=!0){let r=t.getFormState().values;return e&&(r=v(p(),r)),r},async setFormValues(e,i){i=Object.assign({avoidDependKeyConnection:!0,needSplitExtendKey:!0,avoidWordbookSettingConnection:!0,avoidOperationalFormConnection:!0,dependKeyKeepValue:!1,avoidBusinessConnection:!1,overwrite:!0},i),x.triggerDisabled=i.avoidBusinessConnection,S.triggerDisabled=i.avoidDependKeyConnection,S.keepValue=i.dependKeyKeepValue,D.triggerDisabled=i.avoidWordbookSettingConnection,j.triggerDisabled=i.avoidOperationalFormConnection,i.needSplitExtendKey&&(e=y(p(),e)),t.setFieldState("*",(t=>{r(t)&&(i.overwrite||o.existIn(e,t.path))&&(t.value=o.getIn(e,t.path))})),await l(),x.triggerDisabled=!1,S.triggerDisabled=!1,D.triggerDisabled=!1,j.triggerDisabled=!1,S.keepValue=!1},setFieldState(e,r){t.setFieldState(e,r)},resetFields:(e="*")=>t.reset(e),queryWidget:e=>async function(e,t,r){if(!n.value)return s();const i=c(e,t,u);if(i)return s(i);const a=h(e,r);return a?(S.trigger(o.parse(a),!0),await l(),s(c(e,t,u))):s();function s(e){return{decoratorElement:e,...f(e)}}}(e,n.value,p()),applySelectedSetting:F}}function x({props:e,formRenderRef:r,formModel:o}){return{onKeydown:async function i(s){var d;if(e.enterToNextWidget&&s.target){if("TEXTAREA"===s.target.tagName&&!s.ctrlKey)return;s.preventDefault()}if(await n(0),Reflect.get(s,"stopCapture")||!e.enterToNextWidget||!r.value)return;const l=t(s.target,(e=>e.classList.contains("form-render__formItem")));if(!l)return;const m=`.form-render__formItem${u.map((e=>`:not([widget-type=${e}])`)).join("")}`,f=Array.from(r.value.querySelectorAll(m)),c=f.findIndex((e=>e.id===l.id));if(!~c)return;const{widget:g,field:v}=p(f,c,s.target);if(g)if(a(e.enterToNextWidget)){const t=v&&o.query(v).take();!t||e.enterToNextWidget(null==(d=t.decoratorProps)?void 0:d.fieldItem)?y():i({target:g})}else y();async function y(){await n(0),g.focus()}}}}export{x as useFormDomEvent,S as useFormExposeEvent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{arrayed as e,checkInSetupEnv as l,jsonParse as n}from"../../../../shared/utils/index.js";import{uniqBy as o,isString as r,isEqual as t,omit as u,isFunction as a}from"lodash-es";import"naive-ui";import{computed as
|
|
1
|
+
import{arrayed as e,checkInSetupEnv as l,jsonParse as n}from"../../../../shared/utils/index.js";import{uniqBy as o,isString as r,isEqual as t,omit as u,isFunction as a}from"lodash-es";import"naive-ui";import{computed as i,inject as s,ref as c,watch as v,toRaw as d}from"vue";import"@vueuse/core";import"date-fns";import{useFormRequest as m}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"../../index.js";import{InjectionAsyncQueue as p,InjectionFormLifeCycleCaller as h,InjectionFormGlobalProps as g,InjectionFormItemDepsCollector as K}from"../constants/index.js";import{useFormField as k}from"./useFormField.js";import{traverseDependKey as w}from"../utils/schema.js";import{getAbsoluteKey as C,formRenderLog as b}from"../utils/index.js";function R(e,l){const n=c();return i({get:()=>n.value?n.value:e[l],set(e){n.value=e}})}function F(e,l,r,t,c){const v=R(e,"commonList"),d=R(e,"recentList"),{searchContent:f,optionSearchFilter:h}=y();function g(e){return n(e.itemObj)}const K=i((()=>{var e,l;return null!=(l=null==(e=v.value)?void 0:e.map(g))?l:[]})),w=i((()=>{var e,l;return null!=(l=null==(e=d.value)?void 0:e.map(g))?l:[]})),C=i((()=>{if(!e.recommend||!K.value.length&&!w.value.length)return l.value;const n=o(K.value.concat(w.value),(e=>e[c.value])),r=l.value.filter((e=>n.every((function(l){return l[c.value]!==e[c.value]}))));return[...h(n,t.value),...r]})),{getRecommendRequestInfo:b,getHttpInstance:F}=m();function O(l){const{url:n,getRecommendIds:o}=b(),r=a(o)?o():{},t=a(e.getRecommendInfo)?e.getRecommendInfo():{};return{url:n[l],info:Object.assign({},r,t)}}const{fieldKey:j,field:q}=k(),I=s(p);return{postRecommend:async function(l){if(!e.recommend)return;const n=F();if(!n)return;const{url:o,info:t}=O("post"),u=C.value.find((e=>e[c.value]===l));u&&r("postRecommend",await n.post(o,{...t,keyword:"",itemId:c.value,itemObj:JSON.stringify(u)}))},getRecommend:async function(l){if(!e.recommend)return;if(f.value=l,v.value&&d.value&&e.recommendCache)return;const n=await I.addAsync(function(l,n){const{url:o,info:r}=O("get");return{url:o,method:"get",key:l,cache:n,params:{...r,recNum:Math.max(e.commonNum,e.recentNum),keyword:""},payload:{field:q.value,labelKey:t.value,valueKey:c.value}}}(j.value,e.recommendCache)),{commonly:o,recently:r}=n.reduce(((e,l)=>("commonly"===l.type?e.commonly.push(u(l,["type"])):"recently"===l.type&&e.recently.push(u(l,["type"])),e)),{commonly:[],recently:[]});v.value=o.slice(0,e.commonNum),d.value=r.slice(0,e.recentNum)},sortedOptions:C}}function O(e,l,n){const o=i((()=>{var l,n,o;return null!=(o=null!=(n=null==(l=e.urlConfig)?void 0:l.nameKey)?n:e.labelField)?o:"text"})),r=i((()=>{var l,n,o;return null!=(o=null!=(n=null==(l=e.urlConfig)?void 0:l.valueKey)?n:e.valueField)?o:"value"})),t=i((()=>{var l,n;return null!=(n=null==(l=e.urlConfig)?void 0:l.showKey)?n:e.showField})),u=i((()=>{var l,n;return null!=(n=null==(l=e.urlConfig)?void 0:l.searchKey)?n:e.searchField})),{field:a}=k();return I({props:e,labelKey:o,valueKey:r,searchKey:u,showKey:t,hooks:n,valueRef:l,getConfig:()=>e.urlConfig,getParams:()=>{var l,n;const o=q(a.value,null==(l=e.urlConfig)?void 0:l.params,null==(n=e.urlConfig)?void 0:n.dependKey);return{...e.urlConfig,params:o}},getDependKeys:()=>{var l;return null==(l=e.urlConfig)?void 0:l.dependKey}})}function j(l,n,o){const t=i((()=>{var n;const o=e(null==(n=l.wordbook)?void 0:n.show_key)[0];return r(o)?o:null})),u=i((()=>{var e,n,o,u;const a=null==(n=null==(e=l.wordbook)?void 0:e.render_key)?void 0:n[0];return r(a)?a:null!=(u=null!=(o=t.value)?o:l.labelField)?u:"text"})),a=i((()=>{var e,n,o;return null!=(o=null!=(n=null==(e=l.wordbook)?void 0:e.value_key)?n:l.valueField)?o:"value"})),s=i((()=>{var e;return(null==(e=l.wordbook)?void 0:e.search_key)||[]})),c=i((()=>{var e;return null!=(e=t.value)?e:l.showField})),{field:v}=k(),{getSearchRequestInfo:d}=m();return I({props:l,labelKey:u,valueKey:a,searchKey:s,showKey:c,hooks:o,valueRef:n,getConfig:()=>l.wordbook,getParams:()=>{const{wordbook:e,autograph:n}=l,o=q(v.value,{autograph:n,wordbookId:e.id,wordbookType:e.type,fieldKeys:e.search_key,keyword:"",page:1},e.queryParams);return{...d(),params:o}},getDependKeys:()=>{var e;return null==(e=l.wordbook)?void 0:e.queryParams}})}function q(e,l,n){const o={...l};return n&&w(n,((l,n,r)=>{const t=C(l,e.path),u=e.form.getValuesIn(t);if((null==r?void 0:r.required)&&null==u)throw`缺少必须的参数=>${t}`;o[n]=u})),o}function I({labelKey:e,valueKey:n,searchKey:o,showKey:u,props:a,getConfig:m,getParams:y,getDependKeys:w,hooks:C,valueRef:R}){l();const F=s(p),O=s(h),j=s(g),{remoteOptions:q,filterOptions:I,fullOptions:x,searchContent:S}=f(a,{labelKey:e,valueKey:n,searchKey:o,wordSplitFilter:i((()=>{var e;return null!=(e=a.wordSplitFilter)?e:j.wordSplitFilter}))}),{field:D,fieldKey:N}=k(),P=c(!1),_=async function(l,o,t={avoidSearchContent:!0}){if(S.value=l,!m())return q.value=null;if(!t.avoidSearchContent||null==S.value)try{P.value=!0;const l={field:D.value,labelKey:e.value,valueKey:n.value},r={params:{...y().params,...o},key:N.value,cache:a.requestCache,payload:l},t=await F.addAsync(Object.assign({},y(),r));d(q.value)!==t&&(q.value=t,O("afterOptionInit",[N.value,q.value,l]))}catch(e){r(e)&&b(e)}finally{P.value=!1}},H=s(K);return v(m,((l,o)=>{if(t(l,o))return;if(q.value=null,!l)return q.value=null;const r={fetchData:_,labelKey:e.value,valueKey:n.value},{onRequestConfigChange:u,onDepsChange:i}=C||{};H.setDeps(D.value.path,w()||[],(async e=>{q.value=null,(null==e?void 0:e.keepValue)||(R.value=null),a.lazyRequest||(i?i(r):_())})),!R.value&&a.lazyRequest||(u?u(r):_())}),{immediate:!0}),{labelKey:e,loading:P,showKey:u,valueKey:n,remoteOptions:q,filterOptions:I,fullOptions:x,fetchData:_,searchContent:S}}export{j as useAutographOptions,F as useRecommendOptions,O as useUrlConfigOptions};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../../../../shared/utils/index.js";import{isField as e}from"@formily/core";import{isEmpty as t}from"lodash-es";import{isMatchNewLowCodeConditionsWithSqlExpression as r}from"../../../../shared/utils/business.js";function i(i){return{applySelectedSetting:function(o){const s=i.getFormState().values;o.forEach((o=>{if(t(o.children))return;const l=o.children.find((e=>r(s,e)));l&&i.setFieldState(o.selectedField,(t=>{e(t)&&t.setValue(l.value)}))}))}}}export{i as useSelectedSetting};
|
|
@@ -128,6 +128,7 @@ export declare type FieldItem = {
|
|
|
128
128
|
whiteList: string[];
|
|
129
129
|
bordered: boolean | string;
|
|
130
130
|
displayMode: 'table' | 'form';
|
|
131
|
+
editor_title: string;
|
|
131
132
|
fieldType: SchemaTypes;
|
|
132
133
|
content: string | FormRenderer | Record<string, FormRenderer>;
|
|
133
134
|
lazyRequest: boolean;
|
|
@@ -95,6 +95,7 @@ export declare type FormRenderExpose = {
|
|
|
95
95
|
* @desc 完全重置表单
|
|
96
96
|
*/
|
|
97
97
|
reload(): Promise<any>;
|
|
98
|
+
applySelectedSetting(settings: LowCodeTypes.selectedSettingConfig[]): void;
|
|
98
99
|
};
|
|
99
100
|
export declare type FormChangeContext = Partial<{
|
|
100
101
|
currentOption: AnyObject;
|
|
@@ -150,6 +151,7 @@ export declare type FormRenderProps = Partial<{
|
|
|
150
151
|
operationalForm: LowCodeTypes.operationalConfig[];
|
|
151
152
|
outBordered: boolean;
|
|
152
153
|
forceClearable: boolean;
|
|
154
|
+
wordSplitFilter: boolean;
|
|
153
155
|
}>;
|
|
154
156
|
export declare type FormBusinessFormatter = (payload: {
|
|
155
157
|
fieldKey: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AgeContext, IdCardParseInfo } from '../../../../components/form-render';
|
|
2
2
|
import { FIELD_AGE_UNIT } from '../../../../components/form-render/src/constants';
|
|
3
3
|
export declare function parseIdCard(idCardNo: string): IdCardParseInfo;
|
|
4
|
-
export declare function transformDateFormat(format?: string): "month" | "date" | "datetime";
|
|
4
|
+
export declare function transformDateFormat(format?: string): "year" | "month" | "date" | "datetime" | "time";
|
|
5
5
|
export declare function isIdCard(idCardNo: string): boolean;
|
|
6
6
|
export declare function isMobile(mobile: string): boolean;
|
|
7
7
|
export declare function parseBirthday(birthday: string): AgeContext;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{differenceInDays as t,differenceInMonths as e,differenceInYears as n,differenceInHours as a,format as r}from"date-fns";import{isString as s}from"lodash-es";import{FIELD_AGE_UNIT as o,FIELD_SEX_VALUE as u}from"../constants/index.js";function d(t){return((t,e,n)=>{const a={},r=1-t.substr(e,1)%2;a.sex=1===r?u.FEMALE:u.MALE;const s=(2==n?"19":"")+t.substr(6,n),o=t.substr(6+n,2),d=t.substr(8+n,2);a.birthday=s+"-"+o+"-"+d+" 00:00";const c=new Date,i=c.getMonth()+1<parseInt(o,10)||c.getMonth()+1==parseInt(o,10)&&c.getDate()<parseInt(d,10)?1:0;return Object.assign(a,
|
|
1
|
+
import{differenceInDays as t,differenceInMonths as e,differenceInYears as n,differenceInHours as a,format as r}from"date-fns";import{isString as s}from"lodash-es";import{FIELD_AGE_UNIT as o,FIELD_SEX_VALUE as u}from"../constants/index.js";function d(t){return((t,e,n)=>{const a={},r=1-t.substr(e,1)%2;a.sex=1===r?u.FEMALE:u.MALE;const s=(2==n?"19":"")+t.substr(6,n),o=t.substr(6+n,2),d=t.substr(8+n,2);a.birthday=s+"-"+o+"-"+d+" 00:00";const c=new Date,i=c.getMonth()+1<parseInt(o,10)||c.getMonth()+1==parseInt(o,10)&&c.getDate()<parseInt(d,10)?1:0;return Object.assign(a,g(a.birthday)),a.age=a.year=c.getFullYear()-parseInt(s,10)-i,a})(t,15==t.length?14:16,15==t.length?2:4)}function c(t=""){if(!s(t)||!t)return"date";const e=t.includes("y"),n=t.includes("M"),a=t.includes("d"),r=t.includes("H"),o=t.includes("m"),u=t.includes("s");return e||n||a||!(r||o||u)?r||o||u?"datetime":!e||n||a?!e&&n&&a?"month":"date":"year":"time"}const i=/^\d{6}(((19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2]\d|3[0-1])\d{3}(\d|x|X))|(\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2]\d|3[0-1])\d{3}))$/,h=/^[1-9]\d{5}\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2]\d|3[0-1])\d{3}$/;function f(t){return i.test(t)&&function(t){if(!t||18!==t.length)return!1;const e=[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2];let n=0;for(let a=0;a<17;a++)n+=+t[a]*e[a];return t.charAt(17).toUpperCase()===["1","0","X","9","8","7","6","5","4","3","2"][n%11]}(t)||h.test(t)}function l(t){return/^1(3\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\d|9[0-35-9])\d{8}$/.test(t)}function g(r){const s={},o=new Date,u=new Date(r);return s.day=t(o,u),s.month=e(o,u),s.age=s.year=n(o,u),s.hours=a(o,u),s}function m(t,e,n="yyyy-MM-dd HH:mm"){var a;const s=new Date,u={[o.MINUTE]:()=>d(s,"Minutes",t),[o.HOUR]:()=>d(s,"Hours",t),[o.DAY]:()=>d(s,"Date",t),[o.WEEK]:()=>d(s,"Date",7*t),[o.MONTH]:()=>d(s,"Month",t),[o.YEAR]:()=>d(s,"FullYear",t)};return null==(a=u[e])||a.call(u),r(function(t,e){const n=[{[o.DAY]:"Date",[o.WEEK]:"Date",[o.MONTH]:"Date",[o.YEAR]:"Date"},{[o.HOUR]:"Hours"},{[o.MINUTE]:"Minutes"}],a=n.findIndex((t=>Reflect.has(t,e)));~a&&n.slice(a+1).forEach((e=>{Object.values(e).forEach((e=>{t[`set${e}`]("Date"===e?1:0)}))}));return t.setSeconds(0),t}(s,e),n);function d(t,e,n){t[`set${e}`](t[`get${e}`]()-n)}}function M(t){const e=t.hours<24?{ageUnit:o.HOUR,age:Math.max(t.hours,1)}:t.day<30?{ageUnit:o.DAY,age:Math.max(t.day,1)}:t.day<365?{ageUnit:o.MONTH,age:Math.max(t.month,1)}:{ageUnit:o.YEAR,age:Math.max(t.year,1)};return e.age=Math.max(e.age,1),e}const D=/^(\d{4})-?(\d{2})-?(\d{2})?\s?(\d{2})?:?(\d{2})?:?(\d{2})?$/;function y(t){if(!s(t))return;const e=t.match(D);if(!e)return;const[,n,a,r,o,u,d]=e;return new Date(`${n}-${a}-${r||"01"} ${o||"00"}:${u||"00"}:${d||"00"}`)}export{y as businessDateParser,f as isIdCard,l as isMobile,m as parseAge2Birthday,M as parseAgeFromContext,g as parseBirthday,d as parseIdCard,c as transformDateFormat};
|
|
@@ -21,3 +21,4 @@ export declare function isNestedType(type?: string): boolean | "" | undefined;
|
|
|
21
21
|
export declare function isNestedFieldType(field: FieldItem | GeneralField): boolean | "" | undefined;
|
|
22
22
|
export declare function renderDescOption(labelNode: any, option: AnyObject): JSX.Element;
|
|
23
23
|
export declare function getAbsoluteKey(fieldKey: string, field: Pattern): string;
|
|
24
|
+
export declare function editorUnescape(content: string): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{inject as n,provide as t,computed as e,createVNode as r,Fragment as o}from"vue";import{arrayed as i}from"../../../../shared/utils/index.js";import{isGeneralField as u}from"@formily/core";import{Path as f}from"@formily/path";import{HelpCircleSharp as c}from"@vicons/ionicons5";import{isObject as s}from"@vue/shared";import{useMemoize as l}from"@vueuse/core";import{isString as a,isFunction as p,omit as m}from"lodash-es";import{NTooltip as d,NIcon as h}from"naive-ui";import{NESTED_FORM_ITEM_TYPE as x}from"../constants/index.js";import"date-fns";function y(n){console.warn(`[FormRender]: ${n}`)}function g(n,t,e=["children","properties","suffixConfig"],r="val_key",o="default_val"){return function n(t,r){r.forEach((r=>{s(r)&&(null!=c(r)&&null==t[u(r)]&&f.setIn(t,u(r),c(r)),e.forEach((e=>{r[e]&&(t[u(r)]||(t[u(r)]={}),n(t[u(r)],i(r[e])))})))}))}(n,t),n;function u(n){return n[r]}function c(n){return n[o]}}function v(e,r){let o=n(e,null);return o||(o=r(),t(e,o)),o}function E(n){return n&&a(n)?+n:n}function _(n,t,e){if(s(n)&&!p(n)){const e={};return Object.entries(n).forEach((([n,r])=>{p(r)&&(e[n]=()=>r(t))})),e}return{default:()=>p(n)?n(t):e?e(n):[n]}}function K(n,t){return e((()=>{const e={};return n.prefix&&(e.prefix=()=>r(o,null,[_(n.prefix,n,t).default()])),n.suffix&&(e.suffix=()=>r(o,null,[_(n.suffix,n,t).default()])),e}))}function j(n,t){return a(n)&&n?n.replace(/\$\{([^}]*)}/g,(function(n,e){const r=e.split("||");for(const n of r){const e=t[n.trim()];if(e)return e}return""})):""}function k(n){return n.reduce(((n,t)=>(a(t.extendKey)&&t.extendKey&&n.push(t),b(t)&&n.push(...k(t.children||[])),n)),[])}function O(n,t){const e=k(n);if(!e.length)return t;const r={},o=new Map;return Object.entries(t).forEach((([n,i])=>{const u=e.find((t=>t.val_key===n));if(!u)return r[n]=i;const{val_key:f,extendKey:c}=u,s=o.get(c)||{};o.set(c,s),s[f]=t[f]})),[...o.entries()].forEach((([n,t])=>{r[n]=JSON.stringify(t)})),r}function S(n,t){const e=k(n);if(!e.length)return t;const r=l((n=>{try{return s(t[n])?t[n]:JSON.parse(t[n])||{}}catch(n){return{}}})),o=m(t,e.map((n=>n.extendKey)));return e.forEach((({val_key:n,extendKey:t})=>{Reflect.has(o,n)||(o[n]=r(t)[n])})),o}function $(n){return n&&x.includes(n)}function b(n){return $(u(n)?n.componentType:n.html_type)}function w(n,t){return r("section",{style:{display:"flex",alignItems:"center",gap:"4px"}},[n,t.desc?r(d,null,{trigger:()=>r(h,{component:c},null),default:()=>t.desc}):null])}function I(n,t){return f.parse(n.startsWith(".")?n:`.${n}`,t).toString()}export{O as combineExtendKey,K as createInputSlot,_ as createSlot,y as formRenderLog,I as getAbsoluteKey,v as injectOrProvide,b as isNestedFieldType,$ as isNestedType,g as mergeDeepProperties,E as parseNumberFromMaybeString,w as renderDescOption,S as splitExtendKey,j as validateMessageParser};
|
|
1
|
+
import{inject as n,provide as t,computed as e,createVNode as r,Fragment as o}from"vue";import{arrayed as i}from"../../../../shared/utils/index.js";import{isGeneralField as u}from"@formily/core";import{Path as f}from"@formily/path";import{HelpCircleSharp as c}from"@vicons/ionicons5";import{isObject as s}from"@vue/shared";import{useMemoize as l}from"@vueuse/core";import{isString as a,isFunction as p,omit as m}from"lodash-es";import{NTooltip as d,NIcon as h}from"naive-ui";import{NESTED_FORM_ITEM_TYPE as x}from"../constants/index.js";import"date-fns";function y(n){console.warn(`[FormRender]: ${n}`)}function g(n,t,e=["children","properties","suffixConfig"],r="val_key",o="default_val"){return function n(t,r){r.forEach((r=>{s(r)&&(null!=c(r)&&null==t[u(r)]&&f.setIn(t,u(r),c(r)),e.forEach((e=>{r[e]&&(t[u(r)]||(t[u(r)]={}),n(t[u(r)],i(r[e])))})))}))}(n,t),n;function u(n){return n[r]}function c(n){return n[o]}}function v(e,r){let o=n(e,null);return o||(o=r(),t(e,o)),o}function E(n){return n&&a(n)?+n:n}function _(n,t,e){if(s(n)&&!p(n)){const e={};return Object.entries(n).forEach((([n,r])=>{p(r)&&(e[n]=()=>r(t))})),e}return{default:()=>p(n)?n(t):e?e(n):[n]}}function K(n,t){return e((()=>{const e={};return n.prefix&&(e.prefix=()=>r(o,null,[_(n.prefix,n,t).default()])),n.suffix&&(e.suffix=()=>r(o,null,[_(n.suffix,n,t).default()])),e}))}function j(n,t){return a(n)&&n?n.replace(/\$\{([^}]*)}/g,(function(n,e){const r=e.split("||");for(const n of r){const e=t[n.trim()];if(e)return e}return""})):""}function k(n){return n.reduce(((n,t)=>(a(t.extendKey)&&t.extendKey&&n.push(t),b(t)&&n.push(...k(t.children||[])),n)),[])}function O(n,t){const e=k(n);if(!e.length)return t;const r={},o=new Map;return Object.entries(t).forEach((([n,i])=>{const u=e.find((t=>t.val_key===n));if(!u)return r[n]=i;const{val_key:f,extendKey:c}=u,s=o.get(c)||{};o.set(c,s),s[f]=t[f]})),[...o.entries()].forEach((([n,t])=>{r[n]=JSON.stringify(t)})),r}function S(n,t){const e=k(n);if(!e.length)return t;const r=l((n=>{try{return s(t[n])?t[n]:JSON.parse(t[n])||{}}catch(n){return{}}})),o=m(t,e.map((n=>n.extendKey)));return e.forEach((({val_key:n,extendKey:t})=>{Reflect.has(o,n)||(o[n]=r(t)[n])})),o}function $(n){return n&&x.includes(n)}function b(n){return $(u(n)?n.componentType:n.html_type)}function w(n,t){return r("section",{style:{display:"flex",alignItems:"center",gap:"4px"}},[n,t.desc?r(d,null,{trigger:()=>r(h,{component:c},null),default:()=>t.desc}):null])}function I(n,t){return f.parse(n.startsWith(".")?n:`.${n}`,t).toString()}function J(n){return n.replace(/</g,"<").replace(/>/g,">")}export{O as combineExtendKey,K as createInputSlot,_ as createSlot,J as editorUnescape,y as formRenderLog,I as getAbsoluteKey,v as injectOrProvide,b as isNestedFieldType,$ as isNestedType,g as mergeDeepProperties,E as parseNumberFromMaybeString,w as renderDescOption,S as splitExtendKey,j as validateMessageParser};
|