cnhis-design-vue 3.1.42-release.5 → 3.1.42-release.7
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/README.md +87 -87
- package/es/components/button-print/src/utils/print.js +1 -1
- package/es/components/classification/index.d.ts +12 -12
- package/es/components/classification/src/components/set-classification/index.vue.d.ts +9 -9
- package/es/components/classification/src/components/set-classification/index.vue.js +1 -1
- package/es/components/classification/src/components/table-modal/index.vue.d.ts +9 -9
- package/es/components/classification/src/components/table-modal/index.vue.js +1 -1
- package/es/components/classification/src/index.vue.d.ts +12 -12
- package/es/components/classification/src/index.vue.js +1 -1
- package/es/components/fabric-chart/index.d.ts +2 -2
- package/es/components/fabric-chart/src/FabricChart.vue.d.ts +2 -2
- package/es/components/form-config/index.d.ts +22 -17
- package/es/components/form-config/src/FormConfig.vue.d.ts +22 -17
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +6 -6
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +12 -9
- package/es/components/form-config/src/constants/index.d.ts +8 -1
- package/es/components/form-config/src/constants/index.js +1 -1
- package/es/components/form-config/src/hooks/useConfigurationField.js +1 -1
- package/es/components/form-render/index.d.ts +6 -6
- package/es/components/form-render/src/FormRender.vue.d.ts +6 -6
- package/es/components/form-render/src/FormRender.vue.js +1 -1
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +6 -6
- package/es/components/form-render/src/components/renderer/radio&checkbox.d.ts +2 -2
- package/es/components/form-render/src/components/renderer/searchCascade.d.ts +18 -0
- package/es/components/form-render/src/components/renderer/searchCascade.js +1 -1
- package/es/components/form-render/src/hooks/useBusinessBinding.d.ts +1 -0
- package/es/components/form-render/src/hooks/useBusinessBinding.js +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/form-render/src/hooks/useFormEvent.d.ts +1 -1
- package/es/components/form-render/src/hooks/useFormEvent.js +1 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +5 -1
- package/es/components/form-render/src/types/index.d.ts +1 -1
- package/es/components/iho-table/index.d.ts +2 -0
- package/es/components/iho-table/src/IhoTable.vue.d.ts +2 -0
- package/es/components/iho-table/src/hooks/tapHooks/useConfigHooks.d.ts +3 -1
- package/es/components/iho-table/src/plugins/defaultConfigPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue.d.ts +48 -0
- package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue.js +1 -0
- package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/index.d.ts +1 -0
- package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/index.js +1 -0
- package/es/components/iho-table/src/plugins/index.js +1 -1
- package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useTriggerEvent.js +1 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.d.ts +1 -1
- package/es/components/iho-table/src/plugins/rowClickPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rowDragPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/varialbleHeightPlugin/index.js +1 -1
- package/es/components/iho-table/src/types/index.d.ts +8 -0
- package/es/components/iho-table/src/types/pluginType.d.ts +7 -2
- package/es/components/iho-table/src/utils/index.d.ts +1 -0
- package/es/components/iho-table/src/utils/index.js +1 -1
- package/es/components/index.css +1 -1
- package/es/components/info-header/index.d.ts +15 -15
- package/es/components/info-header/src/InfoHeader.vue.d.ts +15 -15
- package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +3 -3
- package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +3 -3
- package/es/components/info-header/src/components/infoDescription/HiddenContent.vue.d.ts +2 -2
- package/es/components/info-header/src/components/infoDescription/InfoEllipsis.vue.d.ts +1 -1
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +9 -9
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +6 -6
- package/es/components/scale-view/src/ScaleView.vue.js +1 -1
- package/es/components/scale-view/src/hooks/use-component.d.ts +1 -1
- package/es/components/search-cascader/src/constants/index.d.ts +1 -1
- package/es/components/select-label/index.d.ts +1 -1
- package/es/components/select-label/src/LabelFormContent.vue.js +1 -1
- package/es/components/select-label/src/SelectLabel.vue.d.ts +1 -1
- package/es/components/select-person/index.d.ts +183 -2
- package/es/components/select-person/src/SearchMultiple.vue.d.ts +131 -0
- package/es/components/select-person/src/SearchMultiple.vue.js +1 -0
- package/es/components/select-person/src/SearchMultiple.vue2.js +1 -0
- package/es/components/select-person/src/SelectPerson.vue.d.ts +176 -3
- package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
- package/es/components/select-person/src/utils/index.js +1 -1
- package/es/components/select-person/style/index.css +1 -1
- package/es/components/shortcut-setter/index.d.ts +8 -7
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +8 -7
- package/es/components/table-filter/src/components/render-widget/components/CheckboxGroup.vue.d.ts +3 -3
- package/es/components/table-filter/src/components/render-widget/components/CheckboxGroup.vue.js +1 -1
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +4 -4
- package/es/env.d.ts +25 -25
- package/es/shared/package.json.js +1 -0
- package/es/shared/utils/index.js +1 -1
- package/package.json +2 -2
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
- package/es/components/fabric-chart/src/utils/index.d.ts +0 -6823
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
- package/es/shared/utils/tapable/index.d.ts +0 -139
- /package/es/components/{bpmn-workflow/src/BpmnWorkflow.d.ts → iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useTriggerEvent.d.ts} +0 -0
|
@@ -25,7 +25,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
25
25
|
fieldList: import("vue").Ref<{
|
|
26
26
|
[x: string]: any;
|
|
27
27
|
val_key: string;
|
|
28
|
-
html_type: "LINEBAR" | ({} & string) | "INPUT" | "SELECT" | "LINE_BREAKS" | "INPUT_NUMBER" | "REMOTE_SEARCH" | "DATE" | "LEVEL_SEARCH_CASCADER" | "SEARCH_CASCADER" | "COMBINATION" | "RADIO" | "CHECKBOX" | "SWITCH" | "SLIDER" | "COMPLEX" | "SEARCH" | "PHONE_TYPE" | "IDCARD_TYPE" | "SEARCH_MORE" | "DIGITAL" | "CHECKBOX_BLOCK" | "RADIO_BLOCK" | "DATE-INPUT" | "DATETIME-INPUT" | "SWITCH_COMPONENT" | "SLIDER_COMPONENT" | "LEVEL_SEARCH_CASCADE" | "SEARCH_CASCADE";
|
|
28
|
+
html_type: "LINEBAR" | ({} & string) | "INPUT" | "TEXTAREA" | "SELECT" | "LINE_BREAKS" | "INPUT_NUMBER" | "REMOTE_SEARCH" | "DATE" | "LEVEL_SEARCH_CASCADER" | "SEARCH_CASCADER" | "COMBINATION" | "RADIO" | "CHECKBOX" | "SWITCH" | "SLIDER" | "COMPLEX" | "SEARCH" | "PHONE_TYPE" | "IDCARD_TYPE" | "SEARCH_MORE" | "DIGITAL" | "CHECKBOX_BLOCK" | "RADIO_BLOCK" | "DATE-INPUT" | "DATETIME-INPUT" | "SWITCH_COMPONENT" | "SLIDER_COMPONENT" | "LEVEL_SEARCH_CASCADE" | "SEARCH_CASCADE";
|
|
29
29
|
annotation?: boolean | undefined;
|
|
30
30
|
val_key_unit?: string | undefined;
|
|
31
31
|
is_edit?: import("../../../../../es/components/form-render").FormCommonState | undefined;
|
|
@@ -128,6 +128,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
128
128
|
is_not_fold?: string | undefined;
|
|
129
129
|
remark?: string | undefined;
|
|
130
130
|
free_entry?: import("../../../../../es/components/form-render").FormCommonState | undefined;
|
|
131
|
+
initialize_high?: number | undefined;
|
|
131
132
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
132
133
|
content?: string | import("../../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../../es/components/form-render").FormRenderer> | undefined;
|
|
133
134
|
lazyRequest?: boolean | undefined;
|
|
@@ -1732,7 +1733,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1732
1733
|
originalSetting?: {
|
|
1733
1734
|
[x: string]: any;
|
|
1734
1735
|
val_key: string;
|
|
1735
|
-
html_type: "LINEBAR" | ({} & string) | "INPUT" | "SELECT" | "LINE_BREAKS" | "INPUT_NUMBER" | "REMOTE_SEARCH" | "DATE" | "LEVEL_SEARCH_CASCADER" | "SEARCH_CASCADER" | "COMBINATION" | "RADIO" | "CHECKBOX" | "SWITCH" | "SLIDER" | "COMPLEX" | "SEARCH" | "PHONE_TYPE" | "IDCARD_TYPE" | "SEARCH_MORE" | "DIGITAL" | "CHECKBOX_BLOCK" | "RADIO_BLOCK" | "DATE-INPUT" | "DATETIME-INPUT" | "SWITCH_COMPONENT" | "SLIDER_COMPONENT" | "LEVEL_SEARCH_CASCADE" | "SEARCH_CASCADE";
|
|
1736
|
+
html_type: "LINEBAR" | ({} & string) | "INPUT" | "TEXTAREA" | "SELECT" | "LINE_BREAKS" | "INPUT_NUMBER" | "REMOTE_SEARCH" | "DATE" | "LEVEL_SEARCH_CASCADER" | "SEARCH_CASCADER" | "COMBINATION" | "RADIO" | "CHECKBOX" | "SWITCH" | "SLIDER" | "COMPLEX" | "SEARCH" | "PHONE_TYPE" | "IDCARD_TYPE" | "SEARCH_MORE" | "DIGITAL" | "CHECKBOX_BLOCK" | "RADIO_BLOCK" | "DATE-INPUT" | "DATETIME-INPUT" | "SWITCH_COMPONENT" | "SLIDER_COMPONENT" | "LEVEL_SEARCH_CASCADE" | "SEARCH_CASCADE";
|
|
1736
1737
|
annotation?: boolean | undefined;
|
|
1737
1738
|
val_key_unit?: string | undefined;
|
|
1738
1739
|
is_edit?: import("../../../../../es/components/form-render").FormCommonState | undefined;
|
|
@@ -1835,6 +1836,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1835
1836
|
is_not_fold?: string | undefined;
|
|
1836
1837
|
remark?: string | undefined;
|
|
1837
1838
|
free_entry?: import("../../../../../es/components/form-render").FormCommonState | undefined;
|
|
1839
|
+
initialize_high?: number | undefined;
|
|
1838
1840
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
1839
1841
|
content?: string | import("../../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../../es/components/form-render").FormRenderer> | undefined;
|
|
1840
1842
|
lazyRequest?: boolean | undefined;
|
|
@@ -3411,7 +3413,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3411
3413
|
originalSetting?: {
|
|
3412
3414
|
[x: string]: any;
|
|
3413
3415
|
val_key: string;
|
|
3414
|
-
html_type: "LINEBAR" | ({} & string) | "INPUT" | "SELECT" | "LINE_BREAKS" | "INPUT_NUMBER" | "REMOTE_SEARCH" | "DATE" | "LEVEL_SEARCH_CASCADER" | "SEARCH_CASCADER" | "COMBINATION" | "RADIO" | "CHECKBOX" | "SWITCH" | "SLIDER" | "COMPLEX" | "SEARCH" | "PHONE_TYPE" | "IDCARD_TYPE" | "SEARCH_MORE" | "DIGITAL" | "CHECKBOX_BLOCK" | "RADIO_BLOCK" | "DATE-INPUT" | "DATETIME-INPUT" | "SWITCH_COMPONENT" | "SLIDER_COMPONENT" | "LEVEL_SEARCH_CASCADE" | "SEARCH_CASCADE";
|
|
3416
|
+
html_type: "LINEBAR" | ({} & string) | "INPUT" | "TEXTAREA" | "SELECT" | "LINE_BREAKS" | "INPUT_NUMBER" | "REMOTE_SEARCH" | "DATE" | "LEVEL_SEARCH_CASCADER" | "SEARCH_CASCADER" | "COMBINATION" | "RADIO" | "CHECKBOX" | "SWITCH" | "SLIDER" | "COMPLEX" | "SEARCH" | "PHONE_TYPE" | "IDCARD_TYPE" | "SEARCH_MORE" | "DIGITAL" | "CHECKBOX_BLOCK" | "RADIO_BLOCK" | "DATE-INPUT" | "DATETIME-INPUT" | "SWITCH_COMPONENT" | "SLIDER_COMPONENT" | "LEVEL_SEARCH_CASCADE" | "SEARCH_CASCADE";
|
|
3415
3417
|
annotation?: boolean | undefined;
|
|
3416
3418
|
val_key_unit?: string | undefined;
|
|
3417
3419
|
is_edit?: import("../../../../../es/components/form-render").FormCommonState | undefined;
|
|
@@ -3514,6 +3516,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3514
3516
|
is_not_fold?: string | undefined;
|
|
3515
3517
|
remark?: string | undefined;
|
|
3516
3518
|
free_entry?: import("../../../../../es/components/form-render").FormCommonState | undefined;
|
|
3519
|
+
initialize_high?: number | undefined;
|
|
3517
3520
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
3518
3521
|
content?: string | import("../../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../../es/components/form-render").FormRenderer> | undefined;
|
|
3519
3522
|
lazyRequest?: boolean | undefined;
|
|
@@ -5367,7 +5370,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
5367
5370
|
onScroll?: ((...args: any[]) => any) | undefined;
|
|
5368
5371
|
onAnnotationChange?: ((...args: any[]) => any) | undefined;
|
|
5369
5372
|
}>>;
|
|
5370
|
-
emit: (event: "
|
|
5373
|
+
emit: (event: "scroll" | "formChange" | "annotationChange", ...args: any[]) => void;
|
|
5371
5374
|
cssVars: import("vue").ComputedRef<import("vue").CSSProperties>;
|
|
5372
5375
|
nuiThemeOverrides: import("naive-ui").GlobalThemeOverrides;
|
|
5373
5376
|
formRenderRef: import("vue").Ref<HTMLElement | undefined>;
|
|
@@ -5517,7 +5520,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
5517
5520
|
exposeEvent: {
|
|
5518
5521
|
validate(path?: string): Promise<void>;
|
|
5519
5522
|
getFormValues(needCombineExtendKey?: boolean): any;
|
|
5520
|
-
setFormValues(values: import("../../../../../es/shared/types").AnyObject, needSplitExtendKey?: boolean): void;
|
|
5523
|
+
setFormValues(values: import("../../../../../es/shared/types").AnyObject, needSplitExtendKey?: boolean, overwrite?: boolean): void;
|
|
5521
5524
|
setFieldState(path: string, handler: (field: Partial<Pick<import("../../../../../es/components/form-render").Field<any, any, any, any>, import("../../../../../es/components/form-render").NonFunctionPropertyNames<{
|
|
5522
5525
|
match: (pattern: import("@formily/path").Pattern) => boolean;
|
|
5523
5526
|
validate: (triggerType?: import("@formily/validator").ValidatorTriggerType | undefined) => any;
|
|
@@ -5537,14 +5540,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
5537
5540
|
submit: <T>(onSubmit?: ((values: any) => void | Promise<T>) | undefined) => Promise<T>;
|
|
5538
5541
|
validator: import("../../../../../es/components/form-render").FieldValidator;
|
|
5539
5542
|
pattern: import("../../../../../es/components/form-render").FieldPatternTypes;
|
|
5540
|
-
form: import("../../../../../es/components/form-render").Form<any>;
|
|
5541
5543
|
content: any;
|
|
5544
|
+
display: import("../../../../../es/components/form-render").FieldDisplayTypes;
|
|
5545
|
+
hidden: boolean;
|
|
5546
|
+
form: import("../../../../../es/components/form-render").Form<any>;
|
|
5542
5547
|
componentProps: Record<string, any>;
|
|
5543
5548
|
decoratorProps: Record<string, any>;
|
|
5544
|
-
display: import("../../../../../es/components/form-render").FieldDisplayTypes;
|
|
5545
5549
|
description: string;
|
|
5546
5550
|
readOnly: boolean;
|
|
5547
|
-
hidden: boolean;
|
|
5548
5551
|
component: import("../../../../../es/components/form-render").FieldComponent<any, any>;
|
|
5549
5552
|
decorator: import("../../../../../es/components/form-render").FieldDecorator<any, any>;
|
|
5550
5553
|
validating: boolean;
|
|
@@ -5678,7 +5681,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
5678
5681
|
readonly displayDirective: "if" | "show" | "show:lazy";
|
|
5679
5682
|
}>;
|
|
5680
5683
|
NTabs: any;
|
|
5681
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("
|
|
5684
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("scroll" | "formChange" | "annotationChange")[], "scroll" | "formChange" | "annotationChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
5682
5685
|
fieldList: {
|
|
5683
5686
|
type: PropType<FieldItem[]>;
|
|
5684
5687
|
};
|
|
@@ -12,7 +12,8 @@ export declare enum EditAbleField {
|
|
|
12
12
|
FOLD = "fold",
|
|
13
13
|
REQUIRED = "required",
|
|
14
14
|
EDITABLE = "editable",
|
|
15
|
-
SHOW = "show"
|
|
15
|
+
SHOW = "show",
|
|
16
|
+
ROWS = "initialize_high"
|
|
16
17
|
}
|
|
17
18
|
export declare function widgetWidthOptionConfig(): {
|
|
18
19
|
option: {
|
|
@@ -20,6 +21,12 @@ export declare function widgetWidthOptionConfig(): {
|
|
|
20
21
|
value: string;
|
|
21
22
|
}[];
|
|
22
23
|
};
|
|
24
|
+
export declare function rowsOptionConfig(): {
|
|
25
|
+
option: {
|
|
26
|
+
text: string;
|
|
27
|
+
value: number;
|
|
28
|
+
}[];
|
|
29
|
+
};
|
|
23
30
|
export declare function isShowOptionConfig(): {
|
|
24
31
|
open: {
|
|
25
32
|
describe: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
import{range as e}from"lodash-es";const t=new Map([["LINE_BAR","分线栏"],["NEWLINE","分行符"]]);var n=(e=>(e.NAME="name",e.NOTES="notes",e.DEFAULT_VALUE="defaultValue",e.LAYOUT_WIDTH_ENUM="layoutWidthEnum",e.DESC="desc",e.DEFAULT_EXPAND="defaultExpand",e.FOLD="fold",e.REQUIRED="required",e.EDITABLE="editable",e.SHOW="show",e.ROWS="initialize_high",e))(n||{});function l(){return{option:[{text:"整行",value:"ALL_LINE"},{text:"半行",value:"HALF_LINE"},{text:"5/6",value:"FIVE_SIX"},{text:"2/3",value:"TWO_THREE"},{text:"1/3",value:"ONE_THREE"},{text:"3/4",value:"THREE_FOUR"},{text:"1/4",value:"ONE_FOUR"},{text:"1/6",value:"ONE_SIX"},{text:"1/8",value:"ONE_EIGHT"}]}}function u(){return{option:e(1,11).map((e=>({text:`${e}行`,value:e})))}}function i(){return{open:{describe:"默认展开",value:!0},close:{describe:"默认收起",value:!1}}}function o(){return{open:{describe:"可折叠",value:!0},close:{describe:"不可折叠",value:!1}}}function a(){return{open:{describe:"可编辑",value:!0},close:{describe:"不可编辑",value:!1}}}function r(){return{open:{describe:"必填",value:!0},close:{describe:"不必填",value:!1}}}function E(){return{open:{describe:"显示",value:!0},close:{describe:"隐藏",value:!1}}}const c="__display",s=Symbol("InjectionFieldList"),d=Symbol("InjectionMaterialList"),v=Symbol("InjectionActiveFieldItem");export{n as EditAbleField,c as FORM_CONFIG_GROUP,v as InjectionActiveFieldItem,s as InjectionFieldList,d as InjectionMaterialList,t as WidgetTextMap,a as isEditOptionConfig,o as isNotFoldOptionConfig,r as isNullOptionConfig,i as isShowOptionConfig,E as isVisibleOptionConfig,u as rowsOptionConfig,l as widgetWidthOptionConfig};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{omit as e,pick as t}from"lodash-es";import{EditAbleField as l,widgetWidthOptionConfig as i,isShowOptionConfig as a,isNotFoldOptionConfig as
|
|
1
|
+
import{omit as e,pick as t}from"lodash-es";import{EditAbleField as l,widgetWidthOptionConfig as i,isShowOptionConfig as a,isNotFoldOptionConfig as _,isEditOptionConfig as o,isNullOptionConfig as s,isVisibleOptionConfig as m,rowsOptionConfig as n}from"../constants/index.js";import"../../../form-render/index.js";import{useFieldNormalize as r}from"../../../form-render/src/hooks/useFieldNormalize.js";const{FieldNormalizeWaterfallHook:d}=r();function E(){const r=new Map([[l.NAME,()=>({alias:"名称",elem_width:6,is_null:"0",html_type:"INPUT"})],[l.NOTES,()=>({alias:"问号提示",elem_width:6,html_type:"INPUT",is_empty:"0"})],[l.DEFAULT_VALUE,(l,i)=>{const a=d.call(Object.assign({},null==l?void 0:l.originalSetting,i));return{alias:"默认值",elem_width:6,html_type:"INPUT",is_empty:"0",componentProps:e(a.componentProps,["class","style","disabled"]),...t(a,["html_type","validate","option","multi_select","multi_select_value","wordbook","open","close","date_format","step_length","urlConfig","autograph","defined_error_msg","free_entry","validator"])}}],[l.LAYOUT_WIDTH_ENUM,()=>({alias:"宽度",fieldType:"number",html_type:"SELECT",elem_width:6,...i()})],[l.DESC,()=>({alias:"说明文本",elem_width:6,html_type:"INPUT",is_empty:"0",validate:{max_length:30}})],[l.DEFAULT_EXPAND,()=>({alias:"是否默认展开",html_type:"SWITCH",elem_width:6,...a()})],[l.FOLD,()=>({alias:"是否可折叠",html_type:"SWITCH",elem_width:6,..._()})],[l.EDITABLE,e=>({alias:"是否可编辑",html_type:"SWITCH",elem_width:6,is_edit:(null==e?void 0:e.editableDisabled)?"0":"1",...o()})],[l.REQUIRED,e=>({alias:"是否必填",html_type:"SWITCH",elem_width:6,is_edit:(null==e?void 0:e.requiredDisabled)?"0":"1",...s()})],[l.SHOW,e=>({alias:"是否显示",html_type:"SWITCH",elem_width:6,is_show:(null==e?void 0:e.__isCombinationChild)?"1":"0",...m()})],[l.ROWS,()=>({alias:"高度",elem_width:6,remark:"默认为3行高度,可调整为1-10行高度",default_val:3,is_empty:"0",html_type:"SELECT",...n()})]]);function E(e,t,l){return e.map((e=>{var i,a;return{...null!=(a=null==(i=r.get(e))?void 0:i(t,l))?a:{},val_key:e}}))}const p=new Map([["LINE_BAR",[l.NAME,l.LAYOUT_WIDTH_ENUM,l.NOTES,l.DEFAULT_EXPAND,l.FOLD]],...["NEWLINE","COMPLEX","COMBINATION"].map((e=>[e,[l.NAME,l.LAYOUT_WIDTH_ENUM]]))]),h=[l.NAME,l.DEFAULT_VALUE,l.LAYOUT_WIDTH_ENUM,l.DESC,l.NOTES,l.EDITABLE,l.REQUIRED,l.SHOW];return{generateFieldListByKeys:E,generateFieldListByFormConfigItem:function(e,t){var i;const a=p.get(e.type)||h;return"TEXTAREA"===(t?t.html_type:null==(i=e.originalSetting)?void 0:i.html_type)&&a.splice(3,0,l.ROWS),E(a,e,t)}}}export{E as useConfigurationField};
|
|
@@ -276,7 +276,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
|
276
276
|
onScroll?: ((...args: any[]) => any) | undefined;
|
|
277
277
|
onAnnotationChange?: ((...args: any[]) => any) | undefined;
|
|
278
278
|
}>>;
|
|
279
|
-
emit: (event: "
|
|
279
|
+
emit: (event: "scroll" | "formChange" | "annotationChange", ...args: any[]) => void;
|
|
280
280
|
cssVars: import("vue").ComputedRef<import("vue").CSSProperties>;
|
|
281
281
|
nuiThemeOverrides: import("naive-ui").GlobalThemeOverrides;
|
|
282
282
|
formRenderRef: import("vue").Ref<HTMLElement | undefined>;
|
|
@@ -426,7 +426,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
|
426
426
|
exposeEvent: {
|
|
427
427
|
validate(path?: string): Promise<void>;
|
|
428
428
|
getFormValues(needCombineExtendKey?: boolean): any;
|
|
429
|
-
setFormValues(values: import("../../../es/shared/types").AnyObject, needSplitExtendKey?: boolean): void;
|
|
429
|
+
setFormValues(values: import("../../../es/shared/types").AnyObject, needSplitExtendKey?: boolean, overwrite?: boolean): void;
|
|
430
430
|
setFieldState(path: string, handler: (field: Partial<Pick<import("@formily/core/esm/models/Field").Field<any, any, any, any>, import("@formily/core/esm/types").NonFunctionPropertyNames<{
|
|
431
431
|
match: (pattern: import("@formily/path").Pattern) => boolean;
|
|
432
432
|
validate: (triggerType?: import("@formily/validator").ValidatorTriggerType | undefined) => any;
|
|
@@ -446,14 +446,14 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
|
446
446
|
submit: <T>(onSubmit?: ((values: any) => void | Promise<T>) | undefined) => Promise<T>;
|
|
447
447
|
validator: import("@formily/core/esm/types").FieldValidator;
|
|
448
448
|
pattern: import("@formily/core/esm/types").FieldPatternTypes;
|
|
449
|
-
form: import("@formily/core/esm/models/Form").Form<any>;
|
|
450
449
|
content: any;
|
|
450
|
+
display: import("@formily/core/esm/types").FieldDisplayTypes;
|
|
451
|
+
hidden: boolean;
|
|
452
|
+
form: import("@formily/core/esm/models/Form").Form<any>;
|
|
451
453
|
componentProps: Record<string, any>;
|
|
452
454
|
decoratorProps: Record<string, any>;
|
|
453
|
-
display: import("@formily/core/esm/types").FieldDisplayTypes;
|
|
454
455
|
description: string;
|
|
455
456
|
readOnly: boolean;
|
|
456
|
-
hidden: boolean;
|
|
457
457
|
component: import("@formily/core/esm/types").FieldComponent<any, any>;
|
|
458
458
|
decorator: import("@formily/core/esm/types").FieldDecorator<any, any>;
|
|
459
459
|
validating: boolean;
|
|
@@ -587,7 +587,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
|
587
587
|
readonly displayDirective: "if" | "show" | "show:lazy";
|
|
588
588
|
}>;
|
|
589
589
|
NTabs: any;
|
|
590
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("
|
|
590
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("scroll" | "formChange" | "annotationChange")[], "scroll" | "formChange" | "annotationChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
591
591
|
fieldList: {
|
|
592
592
|
type: import("vue").PropType<import("./src/types").FieldItem[]>;
|
|
593
593
|
};
|
|
@@ -270,7 +270,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
270
270
|
onScroll?: ((...args: any[]) => any) | undefined;
|
|
271
271
|
onAnnotationChange?: ((...args: any[]) => any) | undefined;
|
|
272
272
|
}>>;
|
|
273
|
-
emit: (event: "
|
|
273
|
+
emit: (event: "scroll" | "formChange" | "annotationChange", ...args: any[]) => void;
|
|
274
274
|
cssVars: import("vue").ComputedRef<import("vue").CSSProperties>;
|
|
275
275
|
nuiThemeOverrides: import("naive-ui").GlobalThemeOverrides;
|
|
276
276
|
formRenderRef: import("vue").Ref<HTMLElement | undefined>;
|
|
@@ -420,7 +420,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
420
420
|
exposeEvent: {
|
|
421
421
|
validate(path?: string): Promise<void>;
|
|
422
422
|
getFormValues(needCombineExtendKey?: boolean): any;
|
|
423
|
-
setFormValues(values: AnyObject, needSplitExtendKey?: boolean): void;
|
|
423
|
+
setFormValues(values: AnyObject, needSplitExtendKey?: boolean, overwrite?: boolean): void;
|
|
424
424
|
setFieldState(path: string, handler: (field: Partial<Pick<import("@formily/core").Field<any, any, any, any>, import("@formily/core").NonFunctionPropertyNames<{
|
|
425
425
|
match: (pattern: import("@formily/path").Pattern) => boolean;
|
|
426
426
|
validate: (triggerType?: import("@formily/validator").ValidatorTriggerType | undefined) => any;
|
|
@@ -440,14 +440,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
440
440
|
submit: <T>(onSubmit?: ((values: any) => void | Promise<T>) | undefined) => Promise<T>;
|
|
441
441
|
validator: import("@formily/core").FieldValidator;
|
|
442
442
|
pattern: import("@formily/core").FieldPatternTypes;
|
|
443
|
-
form: import("@formily/core").Form<any>;
|
|
444
443
|
content: any;
|
|
444
|
+
display: import("@formily/core").FieldDisplayTypes;
|
|
445
|
+
hidden: boolean;
|
|
446
|
+
form: import("@formily/core").Form<any>;
|
|
445
447
|
componentProps: Record<string, any>;
|
|
446
448
|
decoratorProps: Record<string, any>;
|
|
447
|
-
display: import("@formily/core").FieldDisplayTypes;
|
|
448
449
|
description: string;
|
|
449
450
|
readOnly: boolean;
|
|
450
|
-
hidden: boolean;
|
|
451
451
|
component: import("@formily/core").FieldComponent<any, any>;
|
|
452
452
|
decorator: import("@formily/core").FieldDecorator<any, any>;
|
|
453
453
|
validating: boolean;
|
|
@@ -581,7 +581,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
581
581
|
readonly displayDirective: "if" | "show" | "show:lazy";
|
|
582
582
|
}>;
|
|
583
583
|
NTabs: any;
|
|
584
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("
|
|
584
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("scroll" | "formChange" | "annotationChange")[], "scroll" | "formChange" | "annotationChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
585
585
|
fieldList: {
|
|
586
586
|
type: PropType<FieldItem[]>;
|
|
587
587
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as o,computed as t,provide as r,onMounted as s,onUnmounted as a,openBlock as i,createBlock as l,unref as n,normalizeClass as m,normalizeStyle as p,withCtx as d,createElementBlock as u,createVNode as c,isRef as f,Fragment as h,renderList as y,createCommentVNode as j,createElementVNode as
|
|
1
|
+
import{defineComponent as e,ref as o,computed as t,provide as r,onMounted as s,onUnmounted as a,openBlock as i,createBlock as l,unref as n,normalizeClass as m,normalizeStyle as p,withCtx as d,createElementBlock as u,createVNode as c,isRef as f,Fragment as h,renderList as y,createCommentVNode as j,createElementVNode as g,withKeys as b,withModifiers as k,toDisplayString as v,renderSlot as F}from"vue";import{useTheme as x}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isNumber as C,cloneDeep as H}from"lodash-es";import{createForm as S,onFieldValueChange as A,onFieldMount as L,onFieldUnmount as R,onFieldReact as _,onFormMount as O}from"@formily/core";import{FormProvider as B,FormConsumer as w}from"@formily/vue";import{NForm as V,NTabs as I,NTabPane as N,NConfigProvider as D}from"naive-ui";import{InjectionFormGraph as q}from"./constants/index.js";import{useAutoHidden as U}from"./hooks/useAutoHidden.js";import{useComplexOptionsSpan as W}from"./hooks/useComplexOptions.js";import{useFormDomEvent as G,useFormExposeEvent as T}from"./hooks/useFormEvent.js";import{useFormGraph as K}from"./hooks/useFormGraph.js";import{useFormRenderLifeCycle as M}from"./hooks/useFormRenderLifeCycle.js";import{useLowCodeReactions as E}from"./hooks/useLowCodeReactions.js";import{useNuiThemeOverrides as P}from"./hooks/useNuiThemeOverrides.js";import"./utils/index.js";import{useFieldListAdaptor as J}from"./hooks/useFieldListAdaptor.js";import"../../../shared/utils/index.js";import"../index.js";import{useFieldVisitor as $}from"./hooks/useFieldVisitor.js";import"../../../shared/utils/tapable/SyncHook.js";import"../../../shared/utils/tapable/SyncBailHook.js";import"../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../shared/utils/tapable/SyncLoopHook.js";import"../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{validateMessageLocale as z}from"./hooks/useFormValidator.js";import{useAnchor as Q}from"./hooks/useAnchor.js";import{useFormContext as X}from"./hooks/useFormContext.js";import"./hooks/useFormRenderOptions.js";import Y from"../../../_virtual/plugin-vue_export-helper.js";import{createObjSchema as Z}from"./utils/schema.js";const ee={key:0,style:{height:"54px"}},oe={style:{"white-space":"pre"}};var te=Y(e({__name:"FormRender",props:{fieldList:{type:Array},initialData:{type:Object,default:()=>({})},fieldVisitor:{type:Object},column:{type:Number,default:24},maxHeight:{type:[Number,String],default:""},anchor:{type:Boolean,default:!1},parallelism:{type:Number,default:3},businessFormatter:{type:Function},schema:{type:Object},components:{type:Object,default:()=>({})},scope:{type:Object,default:()=>({})},annotation:{type:Object},consumer:{type:Boolean,default:!1},uuid:{type:String},lifeCycle:{type:Object},requestInstance:{type:Object},enterToNextWidget:{type:[Boolean,Function],default:!0},lowCodeReactions:{type:Array},linebarAutoHidden:{type:Boolean},bordered:{type:Boolean,default:!0}},emits:["formChange","annotationChange","scroll"],setup(e,{expose:Y,emit:te}){const re=e,se=x(),{nuiThemeOverrides:ae}=P();z();const ie=o(),le=t((()=>C(re.maxHeight)?re.maxHeight+"px":re.maxHeight)),{SchemaField:ne,businessCollector:me,formItemDepsCollector:pe,changeContextCollector:de,formUUID:ue}=X(re,te),{anchorBarRef:ce,currentAnchor:fe,generateAnchorList:he,updateAnchorList:ye,anchorIdList:je,onScroll:ge}=Q(re,te,ie,pe);M(re).callLifeCycle("onSetup");const{trigger:be}=U(),{observeFormGraph:ke,setGraph:ve,removeGraph:Fe}=K();r(q,ke);const xe=S({initialValues:re.initialData,effects(e){A("*",(o=>{const t=o.props.name.toString();me.trigger(e,t),pe.trigger(t),te("formChange",{fieldInstance:o,fieldKey:t,fieldName:o.title,value:o.value,context:de.getContext(t,o.value)}),Ce(t,o.value)})),L("*",ve),R("*",Fe),re.linebarAutoHidden&&(_("*",be),O((e=>e.query("*").forEach(be)))),re.anchor&&(_("*",ye),O(he))}}),{lowCodeReactionsHandler:Ce,triggerAllReactionsHandler:He}=E(t((()=>re.lowCodeReactions)),xe);s(He);const{schemaAdaptor:Se}=J(me);let Ae=re.fieldList||[];const Le=t((()=>re.schema?re.schema:re.fieldList?(Ae=$().traverse(H(re.fieldList),re.fieldVisitor),Z(Se(Ae))):Z({}))),{onKeydown:Re}=G({formModel:xe,formRenderRef:ie,props:re}),{clearSpan:_e}=W();a((()=>_e(ue)));const Oe=T({formModel:xe,formRenderRef:ie,formItemDepsCollector:pe,getFieldList:()=>Ae,formUUID:ue});return Y({formModel:xe,validate:(e="*")=>Oe.validate(e),getFormValues:(e=!0)=>Oe.getFormValues(e),setFormValues(e,o=!0,t=!1,r=!0){t&&(me.triggerLock=!0),Oe.setFormValues(e,o,r),me.triggerLock=!1},setFieldState(e,o){Oe.setFieldState(e,o)},resetFields(e="*"){Oe.resetFields(e)},queryWidget:async e=>Oe.queryWidget(e),getFieldList:()=>Ae,async reload(){console.error("reload function is abstract,it should be overwrite!")}}),(o,t)=>(i(),l(n(V),{class:m(["form-render",{"form-render--no-border":!e.bordered}]),"require-mark-placement":"left",style:p(n(se))},{default:d((()=>[e.anchor?(i(),u("section",ee,[c(n(I),{value:n(fe),"onUpdate:value":t[0]||(t[0]=e=>f(fe)?fe.value=e:null),type:"line",ref_key:"anchorBarRef",ref:ce},{default:d((()=>[(i(!0),u(h,null,y(n(je),(e=>(i(),l(n(N),{name:e.name,tab:e.title,key:e.name},null,8,["name","tab"])))),128))])),_:1},8,["value"])])):j("v-if",!0),c(n(D),{"theme-overrides":n(ae)},{default:d((()=>[g("section",{class:"form-render__wrapper",style:p({"--column":e.column,"--form-height":n(le)}),ref_key:"formRenderRef",ref:ie,onScroll:t[1]||(t[1]=(...e)=>n(ge)&&n(ge)(...e)),onKeydownCapture:t[2]||(t[2]=b(k(((...e)=>n(Re)&&n(Re)(...e)),["prevent"]),["enter"]))},[c(n(B),{form:n(xe)},{default:d((()=>[c(n(ne),{schema:n(Le)},null,8,["schema"]),e.consumer?(i(),l(n(w),{key:0},{default:d((({form:e})=>[g("div",oe,v(JSON.stringify(e.values,null,2)),1)])),_:1})):j("v-if",!0),F(o.$slots,"default")])),_:3},8,["form"])],36)])),_:3},8,["theme-overrides"])])),_:3},8,["class","style"]))}}),[["__file","FormRender.vue"]]);export{te as default};
|
|
@@ -274,7 +274,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
274
274
|
onScroll?: ((...args: any[]) => any) | undefined;
|
|
275
275
|
onAnnotationChange?: ((...args: any[]) => any) | undefined;
|
|
276
276
|
}>>;
|
|
277
|
-
emit: (event: "
|
|
277
|
+
emit: (event: "scroll" | "formChange" | "annotationChange", ...args: any[]) => void;
|
|
278
278
|
cssVars: import("vue").ComputedRef<import("vue").CSSProperties>;
|
|
279
279
|
nuiThemeOverrides: import("naive-ui").GlobalThemeOverrides;
|
|
280
280
|
formRenderRef: import("vue").Ref<HTMLElement | undefined>;
|
|
@@ -424,7 +424,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
424
424
|
exposeEvent: {
|
|
425
425
|
validate(path?: string): Promise<void>;
|
|
426
426
|
getFormValues(needCombineExtendKey?: boolean): any;
|
|
427
|
-
setFormValues(values: import("../../../../es/shared/types").AnyObject, needSplitExtendKey?: boolean): void;
|
|
427
|
+
setFormValues(values: import("../../../../es/shared/types").AnyObject, needSplitExtendKey?: boolean, overwrite?: boolean): void;
|
|
428
428
|
setFieldState(path: string, handler: (field: Partial<Pick<import("../../../../es/components/form-render").Field<any, any, any, any>, import("../../../../es/components/form-render").NonFunctionPropertyNames<{
|
|
429
429
|
match: (pattern: import("@formily/path").Pattern) => boolean;
|
|
430
430
|
validate: (triggerType?: import("@formily/validator").ValidatorTriggerType | undefined) => any;
|
|
@@ -444,14 +444,14 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
444
444
|
submit: <T>(onSubmit?: ((values: any) => void | Promise<T>) | undefined) => Promise<T>;
|
|
445
445
|
validator: import("../../../../es/components/form-render").FieldValidator;
|
|
446
446
|
pattern: import("../../../../es/components/form-render").FieldPatternTypes;
|
|
447
|
-
form: import("../../../../es/components/form-render").Form<any>;
|
|
448
447
|
content: any;
|
|
448
|
+
display: import("../../../../es/components/form-render").FieldDisplayTypes;
|
|
449
|
+
hidden: boolean;
|
|
450
|
+
form: import("../../../../es/components/form-render").Form<any>;
|
|
449
451
|
componentProps: Record<string, any>;
|
|
450
452
|
decoratorProps: Record<string, any>;
|
|
451
|
-
display: import("../../../../es/components/form-render").FieldDisplayTypes;
|
|
452
453
|
description: string;
|
|
453
454
|
readOnly: boolean;
|
|
454
|
-
hidden: boolean;
|
|
455
455
|
component: import("../../../../es/components/form-render").FieldComponent<any, any>;
|
|
456
456
|
decorator: import("../../../../es/components/form-render").FieldDecorator<any, any>;
|
|
457
457
|
validating: boolean;
|
|
@@ -585,7 +585,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
585
585
|
readonly displayDirective: "if" | "show" | "show:lazy";
|
|
586
586
|
}>;
|
|
587
587
|
NTabs: any;
|
|
588
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("
|
|
588
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("scroll" | "formChange" | "annotationChange")[], "scroll" | "formChange" | "annotationChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
589
589
|
fieldList: {
|
|
590
590
|
type: import("vue").PropType<import("../../../../es/components/form-render").FieldItem[]>;
|
|
591
591
|
};
|
|
@@ -104,11 +104,11 @@ export declare const RADIO: import("vue").DefineComponent<{
|
|
|
104
104
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
105
105
|
}, {
|
|
106
106
|
options: AnyObject[];
|
|
107
|
+
vertical: boolean;
|
|
107
108
|
labelField: string;
|
|
108
109
|
valueField: string;
|
|
109
110
|
lazyRequest: boolean;
|
|
110
111
|
requestCache: boolean;
|
|
111
|
-
vertical: boolean;
|
|
112
112
|
}>;
|
|
113
113
|
export declare const CHECKBOX: import("vue").DefineComponent<{
|
|
114
114
|
value: {
|
|
@@ -214,9 +214,9 @@ export declare const CHECKBOX: import("vue").DefineComponent<{
|
|
|
214
214
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
215
215
|
}, {
|
|
216
216
|
options: AnyObject[];
|
|
217
|
+
vertical: boolean;
|
|
217
218
|
labelField: string;
|
|
218
219
|
valueField: string;
|
|
219
220
|
lazyRequest: boolean;
|
|
220
221
|
requestCache: boolean;
|
|
221
|
-
vertical: boolean;
|
|
222
222
|
}>;
|
|
@@ -12,6 +12,10 @@ export declare const SEARCH_CASCADER: import("vue").DefineComponent<{
|
|
|
12
12
|
urlConfig: {
|
|
13
13
|
type: PropType<UrlConfig>;
|
|
14
14
|
};
|
|
15
|
+
lazyRequest: {
|
|
16
|
+
type: BooleanConstructor;
|
|
17
|
+
default: boolean;
|
|
18
|
+
};
|
|
15
19
|
requestCache: {
|
|
16
20
|
type: BooleanConstructor;
|
|
17
21
|
default: boolean;
|
|
@@ -23,6 +27,10 @@ export declare const SEARCH_CASCADER: import("vue").DefineComponent<{
|
|
|
23
27
|
type: BooleanConstructor;
|
|
24
28
|
default: boolean;
|
|
25
29
|
};
|
|
30
|
+
checkStrategy: {
|
|
31
|
+
type: StringConstructor;
|
|
32
|
+
default: string;
|
|
33
|
+
};
|
|
26
34
|
labelField: {
|
|
27
35
|
type: StringConstructor;
|
|
28
36
|
default: string;
|
|
@@ -44,6 +52,10 @@ export declare const SEARCH_CASCADER: import("vue").DefineComponent<{
|
|
|
44
52
|
urlConfig: {
|
|
45
53
|
type: PropType<UrlConfig>;
|
|
46
54
|
};
|
|
55
|
+
lazyRequest: {
|
|
56
|
+
type: BooleanConstructor;
|
|
57
|
+
default: boolean;
|
|
58
|
+
};
|
|
47
59
|
requestCache: {
|
|
48
60
|
type: BooleanConstructor;
|
|
49
61
|
default: boolean;
|
|
@@ -55,6 +67,10 @@ export declare const SEARCH_CASCADER: import("vue").DefineComponent<{
|
|
|
55
67
|
type: BooleanConstructor;
|
|
56
68
|
default: boolean;
|
|
57
69
|
};
|
|
70
|
+
checkStrategy: {
|
|
71
|
+
type: StringConstructor;
|
|
72
|
+
default: string;
|
|
73
|
+
};
|
|
58
74
|
labelField: {
|
|
59
75
|
type: StringConstructor;
|
|
60
76
|
default: string;
|
|
@@ -69,8 +85,10 @@ export declare const SEARCH_CASCADER: import("vue").DefineComponent<{
|
|
|
69
85
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
70
86
|
}, {
|
|
71
87
|
options: AnyObject[];
|
|
88
|
+
checkStrategy: string;
|
|
72
89
|
labelField: string;
|
|
73
90
|
valueField: string;
|
|
91
|
+
lazyRequest: boolean;
|
|
74
92
|
requestCache: boolean;
|
|
75
93
|
filterable: boolean;
|
|
76
94
|
}>;
|
|
@@ -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{isEqual as
|
|
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{isEqual as u,isArray as i,isString as s}from"lodash-es";import"../../../index.js";import{useCommonInjection as c}from"../../hooks/useCommonInjection.js";import{InjectionAsyncQueue as p,InjectionFormUUID as d}from"../../constants/index.js";import"../../../../../shared/utils/index.js";import"../../utils/index.js";import{useFormField as m}from"../../hooks/useFormField.js";import{NCascader as v}from"naive-ui";import"@vueuse/core";import"date-fns";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"@formily/core";import"@formily/reactive";import{connect as f,mapProps as y}from"@formily/vue";import"@vue/shared";import"./index.js";import"../../hooks/useFormRenderOptions.js";import{createVisitedSetter as h,assignUpdateValue as k,traverseDependKey as j}from"../../utils/schema.js";const g=f(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:f,emit:y}){const k=t(),{field:g,title:b}=m(),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||"");return Array.isArray(t)&&t.length?t.map((e=>e[F.value])).slice(-1).join(""):null}catch(e){return null}}));function H(e,t,a){y("update:value",i(a)?a.map((function(e){return{...e,label:e[w.value],children:void 0,parent:void 0,mergeItemValue:void 0}})):null)}const x=l(p);async function q(t){e.filterable?await async function(){if(!e.urlConfig||k.value&&e.requestCache)return;const t=await x.addAsync({...e.urlConfig,params:{lvlnr:"1"},key:b.value,cache:e.requestCache});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 i(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(s(e[w.value])&&(t=[...t,e[w.value]]),s(e.keyword)&&e.keyword.length>0){const a=e.keyword.split(",");t=[...t,...a]}return t}k.value=t.map((e=>a(e,0,[])))}():await async function(t){if(r(e,t))return;const a=await x.addAsync(o(s(t),i(e),b.value,t));if(!a.length&&t)return t.isLeaf=!0,H(0,0,n(t)),void(O.value=!1);const l=a.map((e=>u(e,s(t))));function r(e,t){return!i(e)||!t&&k.value&&e.requestCache||s(t)>=s(e)-1}function o(t,a,l,r){const o={lvlnr:t+1+""};return r&&a.dependKey&&j(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:k.value=l}(t),await B()}const V=`form-render__cascade--menu-${l(d)}`;async function B(){await n();const e=document.querySelector(`.${V} .v-vl`);e&&e.dispatchEvent(new CustomEvent("scroll"))}function L(t,a){if(!t||!a)return!1;const{mergeItemValue:l}=a;if(e.checkStrategy.includes("child")&&a.depth<S.value)return!1;return l.length>0&&l.some((e=>e.includes(t.trim())))}const{injectValueValidate:K,injectValueWatchFromEmpty:I,injectValueBindKey:E}=c();I((()=>e.value),q),K((()=>e.value)),r((()=>e.urlConfig),(async(t,a)=>{u(t,a)||(k.value=null,C.value?e.lazyRequest||(q(),C.value=!C.value):await q())}),{immediate:!0});const O=t(!1);function R(e){O.value=!!e,e&&q()}const W=a((()=>k.value||e.options||[])),z=a((()=>!e.filterable)),N=E(A);return()=>o(v,{key:N.value,remote:z.value,filterable:e.filterable,"menu-props":{class:V,onClick:B},"check-strategy":e.checkStrategy,show:!!O.value,"onUpdate:show":R,value:A.value,filter:L,"onUpdate:value":H,labelField:w.value,valueField:F.value,options:W.value,onLoad:q,onFocus:h(g)},f)}}),y({dataSource:"options"},k));export{g as SEARCH_CASCADER};
|
|
@@ -3,6 +3,7 @@ import { FieldItem, FormBusinessFormatter } from '../../../../../es/components/f
|
|
|
3
3
|
import { FIELD_BUSINESS_TYPE } from '../constants';
|
|
4
4
|
export declare class BusinessCollector {
|
|
5
5
|
private businessFormatter?;
|
|
6
|
+
triggerLock: boolean;
|
|
6
7
|
private readonly typeLockMap;
|
|
7
8
|
private readonly typeCollector;
|
|
8
9
|
private readonly fieldNameCollector;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isField as e}from"@formily/core";import{isString as t}from"@vueuse/core";import{format as s}from"date-fns";import{isFunction as i,isNumber as r}from"lodash-es";import{FIELD_BUSINESS_TYPE as n}from"../constants/index.js";import"../utils/index.js";import{isIdCard as a,parseIdCard as l,parseAgeFromContext as o,parseBirthday as u,parseAge2Birthday as y}from"../utils/business.js";class h{constructor(e){this.businessFormatter=e,this.typeLockMap=new Map,this.typeCollector=new Map,this.fieldNameCollector=new Map,this.changeHandlerMap=new Map([])}formatter(...e){return i(this.businessFormatter)?this.businessFormatter(...e):e[0].value}collect(e,t){this.typeCollector.set(e,t),this.fieldNameCollector.set(t.val_key,e)}getField(e){return this.typeCollector.get(e)}getFieldInstanceByType(e,t){const s=this.getField(t);return s?e.query(s.val_key).take():null}getType(e){return this.fieldNameCollector.get(e)}getValueByField(t,s){const i=t.query(s).take();return e(i)?i.value:null}getValueByType(e,t){const s=this.getField(t);return s?this.getValueByField(e,s.val_key):null}setValueByType(e,t,s){const i=this.getField(t);i&&e.setFieldState(i.val_key,(e=>{if(e.value===s)return;const n=this.typeLockMap.get(t);this.typeLockMap.set(t,r(n)?n+1:1),e.value=this.formatter({value:s,type:t,fieldKey:i.val_key})}))}registerChangeBusiness(e,t){return this.changeHandlerMap.set(e,t),this}trigger(e,t,s="change"){var i;const r=this.getType(t);if(!r)return;if("change"===s&&this.typeLockMap.get(r)>0)return this.typeLockMap.set(r,this.typeLockMap.get(r)-1);const n="change"===s?this.changeHandlerMap:null;n&&(null==(i=n.get(r))||i.call(this,e))}}function c(){function e(){var e;const t=this.getField(n.BIRTHDAY);return null!=(e=null==t?void 0:t.date_format)?e:"yyyy-MM-dd HH:mm"}function i(i){const r=this.getValueByType(i,n.ID_CARD);if(!r||!t(r)||!a(r))return;const u=l(r),{age:y,ageUnit:h}=o(u);this.setValueByType(i,n.AGE_UNIT,h),this.setValueByType(i,n.AGE,y),this.setValueByType(i,n.SEX,u.sex),this.setValueByType(i,n.BIRTHDAY,s(new Date(u.birthday),e.call(this)))}function c(e){const s=this.getValueByType(e,n.BIRTHDAY);if(!t(s))return;const{age:i,ageUnit:r}=o(u(s));this.setValueByType(e,n.AGE_UNIT,r),this.setValueByType(e,n.AGE,i)}function
|
|
1
|
+
import{isField as e}from"@formily/core";import{isString as t}from"@vueuse/core";import{format as s}from"date-fns";import{isFunction as i,isNumber as r}from"lodash-es";import{FIELD_BUSINESS_TYPE as n}from"../constants/index.js";import"../utils/index.js";import{isIdCard as a,parseIdCard as l,parseAgeFromContext as o,parseBirthday as u,parseAge2Birthday as y}from"../utils/business.js";class h{constructor(e){this.businessFormatter=e,this.triggerLock=!1,this.typeLockMap=new Map,this.typeCollector=new Map,this.fieldNameCollector=new Map,this.changeHandlerMap=new Map([])}formatter(...e){return i(this.businessFormatter)?this.businessFormatter(...e):e[0].value}collect(e,t){this.typeCollector.set(e,t),this.fieldNameCollector.set(t.val_key,e)}getField(e){return this.typeCollector.get(e)}getFieldInstanceByType(e,t){const s=this.getField(t);return s?e.query(s.val_key).take():null}getType(e){return this.fieldNameCollector.get(e)}getValueByField(t,s){const i=t.query(s).take();return e(i)?i.value:null}getValueByType(e,t){const s=this.getField(t);return s?this.getValueByField(e,s.val_key):null}setValueByType(e,t,s){const i=this.getField(t);i&&e.setFieldState(i.val_key,(e=>{if(e.value===s)return;const n=this.typeLockMap.get(t);this.typeLockMap.set(t,r(n)?n+1:1),e.value=this.formatter({value:s,type:t,fieldKey:i.val_key})}))}registerChangeBusiness(e,t){return this.changeHandlerMap.set(e,t),this}trigger(e,t,s="change"){var i;if(this.triggerLock)return;const r=this.getType(t);if(!r)return;if("change"===s&&this.typeLockMap.get(r)>0)return this.typeLockMap.set(r,this.typeLockMap.get(r)-1);const n="change"===s?this.changeHandlerMap:null;n&&(null==(i=n.get(r))||i.call(this,e))}}function c(){function e(){var e;const t=this.getField(n.BIRTHDAY);return null!=(e=null==t?void 0:t.date_format)?e:"yyyy-MM-dd HH:mm"}function i(i){const r=this.getValueByType(i,n.ID_CARD);if(!r||!t(r)||!a(r))return;const u=l(r),{age:y,ageUnit:h}=o(u);this.setValueByType(i,n.AGE_UNIT,h),this.setValueByType(i,n.AGE,y),this.setValueByType(i,n.SEX,u.sex),this.setValueByType(i,n.BIRTHDAY,s(new Date(u.birthday),e.call(this)))}function c(e){const s=this.getValueByType(e,n.BIRTHDAY);if(!t(s))return;const{age:i,ageUnit:r}=o(u(s));this.setValueByType(e,n.AGE_UNIT,r),this.setValueByType(e,n.AGE,i)}function g(s){const i=this.getValueByType(s,n.AGE),a=this.getValueByType(s,n.AGE_UNIT);(t(i)||r(i))&&""!==i&&t(a)&&""!==a&&this.setValueByType(s,n.BIRTHDAY,y(+i,a,e.call(this)))}return{create:function(e){return new h(e).registerChangeBusiness(n.ID_CARD,i).registerChangeBusiness(n.AGE_UNIT,g).registerChangeBusiness(n.AGE,g).registerChangeBusiness(n.BIRTHDAY,c)}}}export{h as BusinessCollector,c as useBusinessBinding};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,pick as n}from"lodash-es";import"../../index.js";import{parseNumberFromMaybeString as r,formRenderLog as i}from"../utils/index.js";import{useFieldNormalize as s}from"./useFieldNormalize.js";import{fieldKeyEscape as a,createLinebarId as p}from"../utils/schema.js";import{useFormValidator as l}from"./useFormValidator.js";import{transformDateFormat as c}from"../utils/business.js";function m(e,o){Object.assign(e["x-component-props"],{...n(o,["wordbook","autograph"])})}function
|
|
1
|
+
import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,pick as n}from"lodash-es";import"../../index.js";import{parseNumberFromMaybeString as r,formRenderLog as i}from"../utils/index.js";import{useFieldNormalize as s}from"./useFieldNormalize.js";import{fieldKeyEscape as a,createLinebarId as p}from"../utils/schema.js";import{useFormValidator as l}from"./useFormValidator.js";import{transformDateFormat as c}from"../utils/business.js";function m(e,o){Object.assign(e["x-component-props"],{...n(o,["wordbook","autograph"])})}function u(u){const{createValidatorSchema:d}=l(),x=e=>{var t;const n={name:e.val_key,type:null!=(t=e.fieldType)?t:"string",title:e.alias||e.name,"x-component":e.html_type,default:e.default_val,"x-component-props":{placeholder:e.placeholder,clearable:"0"===e.is_empty,...e.componentProps||{}},"x-content":e.slots,"x-display":"0"===e.is_show?"hidden":"visible","x-pattern":"0"===e.is_edit?"disabled":"editable"};e.reactions&&(n["x-reactions"]=e.reactions),e.noDecorator||Object.assign(n,{"x-decorator":"FORM_ITEM","x-decorator-props":{fieldItem:o(e,["reactions"]),span:2*(e.elem_width||3),showLabel:"1"!==e.hide_title,remark:e.remark,propertyKey:e.val_key,annotation:e.annotation,...e.decoratorProps||{}}});const r=d(e);return r&&(n["x-validator"]=r),"0"===e.is_null&&(n.required=!0),n},f=e=>{var o;const t=x(e);e.urlConfig?function(e,o){Object.assign(e["x-component-props"],{...n(o,["urlConfig"])})}(t,e):e.autograph&&m(t,e);const i=!!e.__multiple;return Object.assign(t["x-component-props"],{multiple:i,options:e.option||(null==(o=e.componentProps)?void 0:o.options),allowCreate:"1"===e.free_entry||!!t["x-component-props"].allowCreate,maxTagCount:r(e.multi_select_value),...n(e,["lazyRequest","requestCache"])}),i&&(t.type="array"),t},_=e=>{const o=x(e);return Object.assign(o["x-component-props"],{options:e.option,vertical:e.__vertical}),m(o,e),o},h=e=>{const t=x(e);return Object.assign(t["x-component-props"],{fieldItem:o(e,["reactions"])}),t},g=e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINEBAR","x-display":"visible","x-component-props":{disabled:"1"===e.is_not_fold,id:p(e.val_key),show:"0"!==e.is_show,remark:e.remark}}),y=new Map([["LINEBAR",g],["LINE_BREAKS",e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINE_BREAKS","x-display":"0"===e.is_show?"hidden":"visible"})],["INPUT",e=>{const o=x(e);return Object.assign(o["x-component-props"],{...n(e,["prefix","suffix"])}),o}],["TEXTAREA",e=>{const o=x(e);return Object.assign(o["x-component-props"],{rows:e.initialize_high||3}),o}],["INPUT_NUMBER",e=>{const o=x(e),{decimal_length:t,validate:n}=e;return Object.assign(o["x-component-props"],{precision:null!=t?t:null==n?void 0:n.decimal_length,prefix:e.prefix,suffix:e.suffix}),o}],["SELECT",f],["REMOTE_SEARCH",f],["DATE",e=>{const o=x(e);return Object.assign(o["x-component-props"],{valueFormat:e.date_format,type:c(e.date_format),validate:e.validate}),o}],["LEVEL_SEARCH_CASCADER",e=>{const o=x(e);return Object.assign(o["x-component-props"],{...n(e,["wordbook","lazyRequest","autograph"])}),o}],["SEARCH_CASCADER",e=>{var o;const t=x(e);return Object.assign(t["x-component-props"],{urlConfig:e.urlConfig,depth:null==(o=e.wordbook)?void 0:o.level_num,options:e.option}),t}],["COMBINATION",e=>{const o=x(e);return o.type="array",!1!==e.jsonCombination&&(o["x-component"]="JSON_COMBINATION"),Object.assign(o["x-decorator-props"],{showLabel:!1,showFeedback:!1}),Object.assign(o["x-component-props"],{title:e.alias||e.name,maxGroupNum:e.maxGroupNum,getProperties:()=>e.children||[]}),o}],["RADIO",_],["CHECKBOX",_],["SWITCH",e=>{const o=x(e);return Object.assign(o["x-component-props"],{openDescription:e.open,closeDescription:e.close}),o}],["SLIDER",e=>{const o=x(e);return Object.assign(o["x-component-props"],{step:r(e.step_length),max:r(e.max_length),min:r(e.min_length),option:e.option}),o}],["COMPLEX",e=>{const o=x(e);Array.isArray(e.properties)&&i("COMPLEX控件的properties属性已经废弃, 请使用children作为替代, 在之后的版本中properties属性将不再支持");const t=Array.isArray(e.properties||e.children)?C(e.properties||e.children):{};return o.type=e.fieldType||"void",o.properties=t,Object.assign(o["x-decorator-props"],{showFeedback:!1}),Object.assign(o["x-component-props"],n(e,["wrapperStyle","display"])),o}]]),b=e=>{if(e.suffixConfig)return v(e);return(y.get(e.html_type)||h)(e)},v=o=>{if(!o.suffixConfig)return b(o);const t=e(o.suffixConfig),n=[{...o,is_show:"1",hide_title:"1",suffixConfig:void 0}].concat(t.map((e=>({...e,hide_title:"1",is_show:"1"})))),r=x(o);return Object.assign(r,{type:"void",name:a(n),title:o.alias||o.name,"x-component":"INPUT_GROUP","x-component-props":{span:2*(o.elem_width||3)},"x-decorator-props":{...r["x-decorator-props"],showFeedback:!1,suffixFields:n.map((e=>e.val_key))},properties:C(n)}),r},{FieldNormalizeWaterfallHook:O}=s();function C(o){let n=null;return o.reduce(((e,o,s)=>{var a;const p=null==(a=(o=O.call(t(o))).validate)?void 0:a.obj_type;return p&&u&&u.collect(p,t(o)),"LINEBAR"===o.html_type?(e[i(o)]=r(g(o),s),n=e[i(o)].properties={}):n?n[i(o)]=r(b(o),s):(n=null,e[i(o)]=r(b(o),s)),e}),{});function r(e,o){return e["x-index"]=o,e}function i(o){return o.suffixConfig?a([o,...e(o.suffixConfig)]):o.val_key}}return{schemaAdaptor:C}}export{u as useFieldListAdaptor};
|
|
@@ -11,7 +11,7 @@ export declare function useFormExposeEvent({ formModel, formRenderRef, formUUID,
|
|
|
11
11
|
}): {
|
|
12
12
|
validate(path?: string): Promise<void>;
|
|
13
13
|
getFormValues(needCombineExtendKey?: boolean): any;
|
|
14
|
-
setFormValues(values: AnyObject, needSplitExtendKey?: boolean): void;
|
|
14
|
+
setFormValues(values: AnyObject, needSplitExtendKey?: boolean, overwrite?: boolean): void;
|
|
15
15
|
setFieldState(path: string, handler: (field: IFieldState) => void): void;
|
|
16
16
|
resetFields(path?: string): Promise<void>;
|
|
17
17
|
queryWidget(key: string): Promise<{
|
|
@@ -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{isArray as s,isFunction as a}from"lodash-es";import{nextTick as m}from"vue";import"../../index.js";import{FormItemLineBarDepKeyPrepend as u,NESTED_FORM_ITEM_TYPE as f}from"../constants/index.js";import{queryDecoratorByAddress as l,queryInput as d,queryDecoratorByFieldKey as c,findNextWidget as p}from"../utils/dom.js";import{validateMessageParser as g,combineExtendKey as v,splitExtendKey as y}from"../utils/index.js";import{getParentLinebar as h}from"../utils/schema.js";function I({formModel:t,formRenderRef:n,formUUID:a,getFieldList:f,formItemDepsCollector:p}){return{validate(r="*"){return t.validate(r).catch((e=>Promise.reject(Array.isArray(e)?e.reduce(o,[]):e)));function o(t,r){if(!i(r))return t;let o=!1;return s(r.messages)&&r.messages.forEach((r=>{i(r)&&(t.push(...e(r).map(m)),o=!0)})),!o&&t.push(m(r)),t}function m(e){if(e.decoratorElement)return e;const r=t.query(e.path),o=r.get("title"),s=e.messages.map((e=>function(e,t){var r;return t&&i(t.fieldItem)?g(null!=(r=t.fieldItem.defined_error_msg)?r:e,t.fieldItem):e}(e,r.get("decoratorProps")))),m=l(e.address,n.value,a);return{...e,messages:s,title:o,decoratorElement:m,...d(m)}}},getFormValues(e=!0){let r=t.getFormState().values;return e&&(r=v(f(),r)),r},setFormValues(e,i=!0){i&&(e=y(f(),e)),t.setFieldState("*",(t=>{r(t)&&(t.value=o.getIn(e,t.path))}))},setFieldState(e,r){t.setFieldState(e,r)},resetFields:(e="*")=>t.reset(e),queryWidget:async e=>n.value?await async function(e,t,r){if(!n.value)return s();const o=c(e,t,a);if(o)return s(o);const i=h(e,r);return i?(p.trigger(u+i,!0),await m(),s(c(e,t,a))):s();function s(e){return{decoratorElement:e,...d(e)}}}(e,n.value,f()):null}}function x({props:e,formRenderRef:r,formModel:o}){return{onKeydown:function i(s){var m;if(!e.enterToNextWidget||!r.value)return;const u=t(s.target,(e=>e.classList.contains("form-render__formItem")));if(!u)return;const l=`.form-render__formItem${f.map((e=>`:not([widget-type=${e}])`)).join("")}`,d=Array.from(r.value.querySelectorAll(l)),c=d.findIndex((e=>e.id===u.id));if(!~c)return;const{widget:g,field:v}=p(d,c,s.target);if(g)if(a(e.enterToNextWidget)){const t=v&&o.query(v).take();!t||e.enterToNextWidget(null==(m=t.decoratorProps)?void 0:m.fieldItem)?y():i({target:g})}else y();async function y(){await n(0),g.focus()}}}}export{x as useFormDomEvent,I as useFormExposeEvent};
|
|
1
|
+
import{arrayed as e,findAncestor as t}from"../../../../shared/utils/index.js";import{isField as r}from"@formily/core";import{Path as o}from"@formily/path";import{isObject as i}from"@vue/shared";import{promiseTimeout as n}from"@vueuse/shared";import{isArray as s,isFunction as a}from"lodash-es";import{nextTick as m}from"vue";import"../../index.js";import{FormItemLineBarDepKeyPrepend as u,NESTED_FORM_ITEM_TYPE as f}from"../constants/index.js";import{queryDecoratorByAddress as l,queryInput as d,queryDecoratorByFieldKey as c,findNextWidget as p}from"../utils/dom.js";import{validateMessageParser as g,combineExtendKey as v,splitExtendKey as y}from"../utils/index.js";import{getParentLinebar as h}from"../utils/schema.js";function I({formModel:t,formRenderRef:n,formUUID:a,getFieldList:f,formItemDepsCollector:p}){return{validate(r="*"){return t.validate(r).catch((e=>Promise.reject(Array.isArray(e)?e.reduce(o,[]):e)));function o(t,r){if(!i(r))return t;let o=!1;return s(r.messages)&&r.messages.forEach((r=>{i(r)&&(t.push(...e(r).map(m)),o=!0)})),!o&&t.push(m(r)),t}function m(e){if(e.decoratorElement)return e;const r=t.query(e.path),o=r.get("title"),s=e.messages.map((e=>function(e,t){var r;return t&&i(t.fieldItem)?g(null!=(r=t.fieldItem.defined_error_msg)?r:e,t.fieldItem):e}(e,r.get("decoratorProps")))),m=l(e.address,n.value,a);return{...e,messages:s,title:o,decoratorElement:m,...d(m)}}},getFormValues(e=!0){let r=t.getFormState().values;return e&&(r=v(f(),r)),r},setFormValues(e,i=!0,n=!0){i&&(e=y(f(),e)),t.setFieldState("*",(t=>{r(t)&&(n||o.existIn(e,t.path))&&(t.value=o.getIn(e,t.path))}))},setFieldState(e,r){t.setFieldState(e,r)},resetFields:(e="*")=>t.reset(e),queryWidget:async e=>n.value?await async function(e,t,r){if(!n.value)return s();const o=c(e,t,a);if(o)return s(o);const i=h(e,r);return i?(p.trigger(u+i,!0),await m(),s(c(e,t,a))):s();function s(e){return{decoratorElement:e,...d(e)}}}(e,n.value,f()):null}}function x({props:e,formRenderRef:r,formModel:o}){return{onKeydown:function i(s){var m;if(!e.enterToNextWidget||!r.value)return;const u=t(s.target,(e=>e.classList.contains("form-render__formItem")));if(!u)return;const l=`.form-render__formItem${f.map((e=>`:not([widget-type=${e}])`)).join("")}`,d=Array.from(r.value.querySelectorAll(l)),c=d.findIndex((e=>e.id===u.id));if(!~c)return;const{widget:g,field:v}=p(d,c,s.target);if(g)if(a(e.enterToNextWidget)){const t=v&&o.query(v).take();!t||e.enterToNextWidget(null==(m=t.decoratorProps)?void 0:m.fieldItem)?y():i({target:g})}else y();async function y(){await n(0),g.focus()}}}}export{x as useFormDomEvent,I as useFormExposeEvent};
|
|
@@ -4,7 +4,7 @@ import { CSSProperties, VNode } from 'vue';
|
|
|
4
4
|
import { DependKeyType, FormCommonState, FormRequestType } from '../../../../../es/components/form-render';
|
|
5
5
|
export * from '@formily/core';
|
|
6
6
|
declare type FieldBusinessType = 'password' | 'id_card' | 'age' | 'age_unit' | 'mobile' | 'telephone' | 'email' | 'sex' | 'birthday' | 'bank_card' | 'website' | 'gestational_weeks' | 'gestational_stage' | 'customer_name';
|
|
7
|
-
declare type HtmlType = 'INPUT' | 'SELECT' | 'LINEBAR' | 'LINE_BREAKS' | 'INPUT_NUMBER' | 'REMOTE_SEARCH' | 'DATE' | 'LEVEL_SEARCH_CASCADER' | 'SEARCH_CASCADER' | 'COMBINATION' | 'RADIO' | 'CHECKBOX' | 'SWITCH' | 'SLIDER' | 'COMPLEX' | 'SEARCH' | 'PHONE_TYPE' | 'IDCARD_TYPE' | 'SEARCH_MORE' | 'DIGITAL' | 'CHECKBOX_BLOCK' | 'RADIO_BLOCK' | 'DATE-INPUT' | 'DATETIME-INPUT' | 'SWITCH_COMPONENT' | 'SLIDER_COMPONENT' | 'LEVEL_SEARCH_CASCADE' | 'SEARCH_CASCADE' | ({} & string);
|
|
7
|
+
declare type HtmlType = 'INPUT' | 'TEXTAREA' | 'SELECT' | 'LINEBAR' | 'LINE_BREAKS' | 'INPUT_NUMBER' | 'REMOTE_SEARCH' | 'DATE' | 'LEVEL_SEARCH_CASCADER' | 'SEARCH_CASCADER' | 'COMBINATION' | 'RADIO' | 'CHECKBOX' | 'SWITCH' | 'SLIDER' | 'COMPLEX' | 'SEARCH' | 'PHONE_TYPE' | 'IDCARD_TYPE' | 'SEARCH_MORE' | 'DIGITAL' | 'CHECKBOX_BLOCK' | 'RADIO_BLOCK' | 'DATE-INPUT' | 'DATETIME-INPUT' | 'SWITCH_COMPONENT' | 'SLIDER_COMPONENT' | 'LEVEL_SEARCH_CASCADE' | 'SEARCH_CASCADE' | ({} & string);
|
|
8
8
|
declare type ValidateType = 'mobile' | 'integer' | 'number' | 'id_card' | 'regular' | string;
|
|
9
9
|
export declare type ValidateItem = Partial<{
|
|
10
10
|
/**
|
|
@@ -204,6 +204,10 @@ export declare type FieldItem = {
|
|
|
204
204
|
* 是否允许用户在下拉控件中创建自定义选项
|
|
205
205
|
*/
|
|
206
206
|
free_entry: FormCommonState;
|
|
207
|
+
/**
|
|
208
|
+
* 文本域控件默认行数
|
|
209
|
+
*/
|
|
210
|
+
initialize_high: number;
|
|
207
211
|
/**
|
|
208
212
|
* 数据类型
|
|
209
213
|
*/
|
|
@@ -31,7 +31,7 @@ export declare type FormRenderExpose = {
|
|
|
31
31
|
formModel: Form;
|
|
32
32
|
validate(path?: string): Promise<unknown>;
|
|
33
33
|
getFormValues(needCombineExtendKey?: boolean): AnyObject;
|
|
34
|
-
setFormValues(values: AnyObject, needSplitExtendKey?: boolean): AnyObject;
|
|
34
|
+
setFormValues(values: AnyObject, needSplitExtendKey?: boolean, avoidBusinessConnection?: boolean, overwrite?: boolean): AnyObject;
|
|
35
35
|
setFieldState(path: string, setter: (field: Field) => void): void;
|
|
36
36
|
resetFields(path?: string): void;
|
|
37
37
|
queryWidget(key: string): Promise<{
|
|
@@ -787,6 +787,7 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
787
787
|
isCurrent?: boolean | undefined;
|
|
788
788
|
isHover?: boolean | undefined;
|
|
789
789
|
height?: number | undefined;
|
|
790
|
+
clickToCancel?: boolean | undefined;
|
|
790
791
|
} | undefined;
|
|
791
792
|
customConfig?: {
|
|
792
793
|
storage?: boolean | {
|
|
@@ -3259,6 +3260,7 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
3259
3260
|
isCurrent?: boolean | undefined;
|
|
3260
3261
|
isHover?: boolean | undefined;
|
|
3261
3262
|
height?: number | undefined;
|
|
3263
|
+
clickToCancel?: boolean | undefined;
|
|
3262
3264
|
} | undefined;
|
|
3263
3265
|
customConfig?: {
|
|
3264
3266
|
storage?: boolean | {
|
|
@@ -786,6 +786,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
786
786
|
isCurrent?: boolean | undefined;
|
|
787
787
|
isHover?: boolean | undefined;
|
|
788
788
|
height?: number | undefined;
|
|
789
|
+
clickToCancel?: boolean | undefined;
|
|
789
790
|
} | undefined;
|
|
790
791
|
customConfig?: {
|
|
791
792
|
storage?: boolean | {
|
|
@@ -3258,6 +3259,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3258
3259
|
isCurrent?: boolean | undefined;
|
|
3259
3260
|
isHover?: boolean | undefined;
|
|
3260
3261
|
height?: number | undefined;
|
|
3262
|
+
clickToCancel?: boolean | undefined;
|
|
3261
3263
|
} | undefined;
|
|
3262
3264
|
customConfig?: {
|
|
3263
3265
|
storage?: boolean | {
|