cnhis-design-vue 3.1.46-release.4 → 3.1.47-beta.0
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/src/utils/print.js +1 -1
- package/es/components/form-config/index.d.ts +67 -16
- package/es/components/form-config/src/FormConfig.vue.d.ts +67 -16
- package/es/components/form-config/src/FormConfig.vue2.js +1 -1
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +5 -4
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +29 -7
- package/es/components/form-config/src/hooks/useDataNormalize.d.ts +1 -1
- package/es/components/form-config/src/hooks/useDataNormalize.js +1 -1
- package/es/components/form-config/src/types/index.d.ts +1 -1
- package/es/components/form-render/index.d.ts +5 -4
- package/es/components/form-render/src/FormRender.vue.d.ts +4 -3
- package/es/components/form-render/src/FormRender.vue2.js +1 -1
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +5 -4
- package/es/components/form-render/src/components/renderer/levelSearchCascader.d.ts +16 -2
- package/es/components/form-render/src/components/renderer/levelSearchCascader.js +1 -1
- package/es/components/form-render/src/components/renderer/radio&checkbox.d.ts +32 -4
- package/es/components/form-render/src/components/renderer/radio_checkbox.js +1 -1
- package/es/components/form-render/src/components/renderer/remoteSearch.d.ts +3 -0
- package/es/components/form-render/src/components/renderer/remoteSearch.js +1 -1
- package/es/components/form-render/src/components/renderer/select.d.ts +16 -2
- 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/hooks/useFormRenderOptions.js +1 -1
- package/es/components/form-render/src/hooks/useOperationalForm.d.ts +1 -1
- package/es/components/form-render/src/hooks/useOperationalForm.js +1 -1
- package/es/components/form-render/src/hooks/useWordbookSetting.d.ts +5 -0
- package/es/components/form-render/src/hooks/useWordbookSetting.js +1 -0
- package/es/components/form-render/src/types/fieldItem.d.ts +8 -1
- package/es/components/form-render/src/types/index.d.ts +1 -7
- package/es/components/iho-table/index.d.ts +12 -0
- package/es/components/iho-table/src/IhoTable.vue.d.ts +12 -0
- package/es/components/iho-table/src/plugins/defaultConfigPlugin/index.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/index.js +1 -1
- package/es/components/iho-table/src/plugins/keyboardEventPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/operationalFormPlugin/index.d.ts +1 -0
- package/es/components/iho-table/src/plugins/operationalFormPlugin/index.js +1 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.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 +5 -3
- package/es/components/iho-table/src/utils/index.d.ts +1 -1
- 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 +14 -12
- package/es/components/info-header/src/InfoHeader.vue.d.ts +14 -12
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +5 -4
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +5 -4
- package/es/components/search-cascader/src/SearchCascader.vue2.js +1 -1
- package/es/components/search-cascader/src/components/SearchMenu.js +1 -1
- package/es/components/select-person/index.d.ts +153 -14
- package/es/components/select-person/src/SearchMultiple.vue2.js +1 -1
- package/es/components/select-person/src/SearchOrgAndStaff.vue.d.ts +106 -0
- package/es/components/select-person/src/SearchOrgAndStaff.vue.js +1 -0
- package/es/components/select-person/src/SearchOrgAndStaff.vue2.js +1 -0
- package/es/components/select-person/src/SelectPerson.vue.d.ts +150 -12
- package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
- package/es/components/select-person/src/types/enums.d.ts +4 -0
- package/es/components/select-person/src/types/enums.js +1 -0
- package/es/components/select-person/src/utils/index.d.ts +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 +13 -5
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +13 -5
- package/es/components/steps-wheel/index.d.ts +16 -0
- package/es/components/steps-wheel/src/StepsWheel.vue.d.ts +16 -0
- package/es/components/steps-wheel/src/StepsWheel.vue2.js +1 -1
- package/es/components/steps-wheel/style/index.css +1 -1
- package/es/components/table-export-field/src/components/ExportModal.vue2.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/es/shared/types/business.d.ts +6 -0
- package/es/shared/utils/business.d.ts +6 -1
- package/es/shared/utils/business.js +1 -1
- package/es/shared/utils/index.js +1 -1
- package/es/shared/utils/tapableLess.d.ts +28 -0
- package/es/shared/utils/tapableLess.js +1 -0
- package/package.json +2 -2
- package/es/components/form-render/src/components/renderer/dist/levelSearchCascader.d.ts +0 -77
- package/es/components/form-render/src/components/renderer/dist/searchCascade.d.ts +0 -93
- package/es/components/iho-table/src/plugins/dist/highLightSetPlugin.d.ts +0 -3
- package/es/components/iho-table/src/plugins/filterRenderPlugin/dist/index.d.ts +0 -3
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/dist/index.d.ts +0 -3
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/dist/defaultRendererPlugin.d.ts +0 -3
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/dist/seqRendererPlugin.d.ts +0 -3
- package/es/components/iho-table/src/plugins/varialbleHeightPlugin/dist/index.d.ts +0 -3
- package/es/components/iho-table/src/utils/dist/index.d.ts +0 -44
- package/es/components/scale-view/src/components/formitem/dist/r-address.d.ts +0 -36
- package/es/components/scale-view/src/components/formitem/dist/r-sign.d.ts +0 -36
- package/es/components/scale-view/src/components/formitem/dist/standard-modal.d.ts +0 -82
- package/es/components/search-cascader/src/components/dist/SearchMenu.d.ts +0 -57
- package/es/components/search-cascader/src/components/dist/SearchMenu1.d.ts +0 -57
|
@@ -147,7 +147,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
147
147
|
type: import("vue").PropType<import("../../../../../es/components/form-render").FormLowCodeReactions.Config[]>;
|
|
148
148
|
};
|
|
149
149
|
operationalForm: {
|
|
150
|
-
type: import("vue").PropType<import("
|
|
150
|
+
type: import("vue").PropType<import("../../..").FormOperationalConfig[]>;
|
|
151
151
|
};
|
|
152
152
|
linebarAutoHidden: {
|
|
153
153
|
type: BooleanConstructor;
|
|
@@ -287,7 +287,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
287
287
|
type: import("vue").PropType<import("../../../../../es/components/form-render").FormLowCodeReactions.Config[]>;
|
|
288
288
|
};
|
|
289
289
|
operationalForm: {
|
|
290
|
-
type: import("vue").PropType<import("
|
|
290
|
+
type: import("vue").PropType<import("../../..").FormOperationalConfig[]>;
|
|
291
291
|
};
|
|
292
292
|
linebarAutoHidden: {
|
|
293
293
|
type: BooleanConstructor;
|
|
@@ -348,6 +348,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
348
348
|
triggerAllReactionsHandler: () => void;
|
|
349
349
|
operationalFormHandler: (field: string) => void;
|
|
350
350
|
triggerAllOperationalFormHandler: () => void;
|
|
351
|
+
wordbookSettingHandler: (fieldKey: string, value: unknown) => void;
|
|
351
352
|
schemaAdaptor: (fieldList: FieldItem[]) => Record<string, import("@formily/json-schema").Stringify<{
|
|
352
353
|
[key: symbol]: any;
|
|
353
354
|
[key: `x-${string}`]: any;
|
|
@@ -463,7 +464,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
463
464
|
"x-read-pretty"?: boolean | undefined;
|
|
464
465
|
"x-compile-omitted"?: string[] | undefined;
|
|
465
466
|
}>>;
|
|
466
|
-
onKeydown: (event: KeyboardEvent) => void
|
|
467
|
+
onKeydown: (event: KeyboardEvent) => Promise<void>;
|
|
467
468
|
clearSpan: (uuid: string) => void;
|
|
468
469
|
exposeEvent: {
|
|
469
470
|
validate(path?: string): Promise<void>;
|
|
@@ -755,7 +756,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
755
756
|
type: import("vue").PropType<import("../../../../../es/components/form-render").FormLowCodeReactions.Config[]>;
|
|
756
757
|
};
|
|
757
758
|
operationalForm: {
|
|
758
|
-
type: import("vue").PropType<import("
|
|
759
|
+
type: import("vue").PropType<import("../../..").FormOperationalConfig[]>;
|
|
759
760
|
};
|
|
760
761
|
linebarAutoHidden: {
|
|
761
762
|
type: BooleanConstructor;
|
|
@@ -89,15 +89,22 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
89
89
|
name?: string | undefined;
|
|
90
90
|
render_key?: string[] | undefined;
|
|
91
91
|
search_key?: string[] | undefined;
|
|
92
|
+
value_key?: string | undefined;
|
|
93
|
+
queryParams?: string[] | undefined;
|
|
92
94
|
primary_key?: string | undefined;
|
|
93
95
|
type?: string | undefined;
|
|
94
|
-
value_key?: string | undefined;
|
|
95
96
|
level_key?: string | undefined;
|
|
96
97
|
link_key?: string | undefined;
|
|
97
98
|
link_key_split?: string | undefined;
|
|
98
99
|
show_key?: string[] | undefined;
|
|
99
100
|
conObj?: import("../../../../../es/shared/types").AnyObject[] | undefined;
|
|
100
101
|
conObjFirstLevel?: import("../../../../../es/shared/types").AnyObject[] | undefined;
|
|
102
|
+
setting?: {
|
|
103
|
+
cascading?: {
|
|
104
|
+
'form.name': string;
|
|
105
|
+
value: string;
|
|
106
|
+
}[] | undefined;
|
|
107
|
+
} | undefined;
|
|
101
108
|
} | undefined;
|
|
102
109
|
open?: {
|
|
103
110
|
value?: any;
|
|
@@ -1813,15 +1820,22 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1813
1820
|
name?: string | undefined;
|
|
1814
1821
|
render_key?: string[] | undefined;
|
|
1815
1822
|
search_key?: string[] | undefined;
|
|
1823
|
+
value_key?: string | undefined;
|
|
1824
|
+
queryParams?: string[] | undefined;
|
|
1816
1825
|
primary_key?: string | undefined;
|
|
1817
1826
|
type?: string | undefined;
|
|
1818
|
-
value_key?: string | undefined;
|
|
1819
1827
|
level_key?: string | undefined;
|
|
1820
1828
|
link_key?: string | undefined;
|
|
1821
1829
|
link_key_split?: string | undefined;
|
|
1822
1830
|
show_key?: string[] | undefined;
|
|
1823
1831
|
conObj?: import("../../../../../es/shared/types").AnyObject[] | undefined;
|
|
1824
1832
|
conObjFirstLevel?: import("../../../../../es/shared/types").AnyObject[] | undefined;
|
|
1833
|
+
setting?: {
|
|
1834
|
+
cascading?: {
|
|
1835
|
+
'form.name': string;
|
|
1836
|
+
value: string;
|
|
1837
|
+
}[] | undefined;
|
|
1838
|
+
} | undefined;
|
|
1825
1839
|
} | undefined;
|
|
1826
1840
|
open?: {
|
|
1827
1841
|
value?: any;
|
|
@@ -3510,15 +3524,22 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3510
3524
|
name?: string | undefined;
|
|
3511
3525
|
render_key?: string[] | undefined;
|
|
3512
3526
|
search_key?: string[] | undefined;
|
|
3527
|
+
value_key?: string | undefined;
|
|
3528
|
+
queryParams?: string[] | undefined;
|
|
3513
3529
|
primary_key?: string | undefined;
|
|
3514
3530
|
type?: string | undefined;
|
|
3515
|
-
value_key?: string | undefined;
|
|
3516
3531
|
level_key?: string | undefined;
|
|
3517
3532
|
link_key?: string | undefined;
|
|
3518
3533
|
link_key_split?: string | undefined;
|
|
3519
3534
|
show_key?: string[] | undefined;
|
|
3520
3535
|
conObj?: import("../../../../../es/shared/types").AnyObject[] | undefined;
|
|
3521
3536
|
conObjFirstLevel?: import("../../../../../es/shared/types").AnyObject[] | undefined;
|
|
3537
|
+
setting?: {
|
|
3538
|
+
cascading?: {
|
|
3539
|
+
'form.name': string;
|
|
3540
|
+
value: string;
|
|
3541
|
+
}[] | undefined;
|
|
3542
|
+
} | undefined;
|
|
3522
3543
|
} | undefined;
|
|
3523
3544
|
open?: {
|
|
3524
3545
|
value?: any;
|
|
@@ -5278,7 +5299,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
5278
5299
|
type: PropType<import("../../../../../es/components/form-render").FormLowCodeReactions.Config[]>;
|
|
5279
5300
|
};
|
|
5280
5301
|
operationalForm: {
|
|
5281
|
-
type: PropType<import("../../../../../es/
|
|
5302
|
+
type: PropType<import("../../../../../es/shared/types").FormOperationalConfig[]>;
|
|
5282
5303
|
};
|
|
5283
5304
|
linebarAutoHidden: {
|
|
5284
5305
|
type: BooleanConstructor;
|
|
@@ -5418,7 +5439,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
5418
5439
|
type: PropType<import("../../../../../es/components/form-render").FormLowCodeReactions.Config[]>;
|
|
5419
5440
|
};
|
|
5420
5441
|
operationalForm: {
|
|
5421
|
-
type: PropType<import("../../../../../es/
|
|
5442
|
+
type: PropType<import("../../../../../es/shared/types").FormOperationalConfig[]>;
|
|
5422
5443
|
};
|
|
5423
5444
|
linebarAutoHidden: {
|
|
5424
5445
|
type: BooleanConstructor;
|
|
@@ -5479,6 +5500,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
5479
5500
|
triggerAllReactionsHandler: () => void;
|
|
5480
5501
|
operationalFormHandler: (field: string) => void;
|
|
5481
5502
|
triggerAllOperationalFormHandler: () => void;
|
|
5503
|
+
wordbookSettingHandler: (fieldKey: string, value: unknown) => void;
|
|
5482
5504
|
schemaAdaptor: (fieldList: FieldItem[]) => Record<string, import("@formily/json-schema").Stringify<{
|
|
5483
5505
|
[key: symbol]: any;
|
|
5484
5506
|
[key: `x-${string}`]: any;
|
|
@@ -5594,7 +5616,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
5594
5616
|
"x-read-pretty"?: boolean | undefined;
|
|
5595
5617
|
"x-compile-omitted"?: string[] | undefined;
|
|
5596
5618
|
}>>;
|
|
5597
|
-
onKeydown: (event: KeyboardEvent) => void
|
|
5619
|
+
onKeydown: (event: KeyboardEvent) => Promise<void>;
|
|
5598
5620
|
clearSpan: (uuid: string) => void;
|
|
5599
5621
|
exposeEvent: {
|
|
5600
5622
|
validate(path?: string): Promise<void>;
|
|
@@ -5886,7 +5908,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
5886
5908
|
type: PropType<import("../../../../../es/components/form-render").FormLowCodeReactions.Config[]>;
|
|
5887
5909
|
};
|
|
5888
5910
|
operationalForm: {
|
|
5889
|
-
type: PropType<import("../../../../../es/
|
|
5911
|
+
type: PropType<import("../../../../../es/shared/types").FormOperationalConfig[]>;
|
|
5890
5912
|
};
|
|
5891
5913
|
linebarAutoHidden: {
|
|
5892
5914
|
type: BooleanConstructor;
|
|
@@ -3,5 +3,5 @@ export declare function useDataNormalize(props: {
|
|
|
3
3
|
fieldVisitor?: FormConfigVisitor;
|
|
4
4
|
}): {
|
|
5
5
|
transform: (fieldList: FormConfigItem[]) => FormConfigItem[];
|
|
6
|
-
inverseTransform: (fieldList: FormConfigItem[]) => FormConfigItem[];
|
|
6
|
+
inverseTransform: (fieldList: FormConfigItem[], withOriginalSetting: boolean) => FormConfigItem[];
|
|
7
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isObject as e,omit as n}from"lodash-es";function r(r){return{transform:function(n){let i=null;const t=r.fieldVisitor;return n.reduce(((n,r)=>(r.originalSetting&&e(t)&&t[r.key]&&t[r.key]({field:r.originalSetting,replace(e){r.originalSetting=e}}),"LINE_BAR"===r.type?(r.children=[],i=r.children,n.push(r),n):i?(i.push(r),n):(n.push(r),n))),[])},inverseTransform:function(e){return e.reduce(((e,r)=>("LINE_BAR"===r.type?(e.push(n(r,["children"])),e.push(...r.children||[])):e.push(r),e)),[]).map((e=>n(e,["originalSetting"])))}}}export{r as useDataNormalize};
|
|
1
|
+
import{isObject as e,omit as n}from"lodash-es";function r(r){return{transform:function(n){let i=null;const t=r.fieldVisitor;return n.reduce(((n,r)=>(r.originalSetting&&e(t)&&t[r.key]&&t[r.key]({field:r.originalSetting,replace(e){r.originalSetting=e}}),"LINE_BAR"===r.type?(r.children=[],i=r.children,n.push(r),n):i?(i.push(r),n):(n.push(r),n))),[])},inverseTransform:function(e,r){return e.reduce(((e,r)=>("LINE_BAR"===r.type?(e.push(n(r,["children"])),e.push(...r.children||[])):e.push(r),e)),[]).map((e=>r?e:n(e,["originalSetting"])))}}}export{r as useDataNormalize};
|
|
@@ -38,7 +38,7 @@ export interface FormConfigTextFormatter {
|
|
|
38
38
|
export interface FormConfigExpose {
|
|
39
39
|
loadData(payload: Record<'fieldList', FormConfigItem[]>): void;
|
|
40
40
|
validate(): Promise<unknown>;
|
|
41
|
-
getData(): Record<'fieldList' | 'materialList', FormConfigItem[]>;
|
|
41
|
+
getData(withOriginalSetting?: boolean): Record<'fieldList' | 'materialList', FormConfigItem[]>;
|
|
42
42
|
clearExtraList(): void;
|
|
43
43
|
}
|
|
44
44
|
interface FieldVisitorContext {
|
|
@@ -134,7 +134,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
|
134
134
|
type: import("vue").PropType<import("./src/types").FormLowCodeReactions.Config[]>;
|
|
135
135
|
};
|
|
136
136
|
operationalForm: {
|
|
137
|
-
type: import("vue").PropType<import("
|
|
137
|
+
type: import("vue").PropType<import("../../../es/shared/types").FormOperationalConfig[]>;
|
|
138
138
|
};
|
|
139
139
|
linebarAutoHidden: {
|
|
140
140
|
type: BooleanConstructor;
|
|
@@ -274,7 +274,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
|
274
274
|
type: import("vue").PropType<import("./src/types").FormLowCodeReactions.Config[]>;
|
|
275
275
|
};
|
|
276
276
|
operationalForm: {
|
|
277
|
-
type: import("vue").PropType<import("
|
|
277
|
+
type: import("vue").PropType<import("../../../es/shared/types").FormOperationalConfig[]>;
|
|
278
278
|
};
|
|
279
279
|
linebarAutoHidden: {
|
|
280
280
|
type: BooleanConstructor;
|
|
@@ -335,6 +335,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
|
335
335
|
triggerAllReactionsHandler: () => void;
|
|
336
336
|
operationalFormHandler: (field: string) => void;
|
|
337
337
|
triggerAllOperationalFormHandler: () => void;
|
|
338
|
+
wordbookSettingHandler: (fieldKey: string, value: unknown) => void;
|
|
338
339
|
schemaAdaptor: (fieldList: import("./src/types").FieldItem[]) => Record<string, import("@formily/json-schema").Stringify<{
|
|
339
340
|
[key: symbol]: any;
|
|
340
341
|
[key: `x-${string}`]: any;
|
|
@@ -450,7 +451,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
|
450
451
|
"x-read-pretty"?: boolean | undefined;
|
|
451
452
|
"x-compile-omitted"?: string[] | undefined;
|
|
452
453
|
}>>;
|
|
453
|
-
onKeydown: (event: KeyboardEvent) => void
|
|
454
|
+
onKeydown: (event: KeyboardEvent) => Promise<void>;
|
|
454
455
|
clearSpan: (uuid: string) => void;
|
|
455
456
|
exposeEvent: {
|
|
456
457
|
validate(path?: string): Promise<void>;
|
|
@@ -742,7 +743,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
|
742
743
|
type: import("vue").PropType<import("./src/types").FormLowCodeReactions.Config[]>;
|
|
743
744
|
};
|
|
744
745
|
operationalForm: {
|
|
745
|
-
type: import("vue").PropType<import("
|
|
746
|
+
type: import("vue").PropType<import("../../../es/shared/types").FormOperationalConfig[]>;
|
|
746
747
|
};
|
|
747
748
|
linebarAutoHidden: {
|
|
748
749
|
type: BooleanConstructor;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AnyObject } from '../../../../es/shared/types';
|
|
1
|
+
import { AnyObject, FormOperationalConfig } from '../../../../es/shared/types';
|
|
2
2
|
import { Component, FunctionalComponent, PropType } from 'vue';
|
|
3
3
|
import { RequestInstance } from './hooks';
|
|
4
|
-
import { FieldItem, FieldVisitor, FormBusinessFormatter, FormLowCodeReactions
|
|
4
|
+
import { FieldItem, FieldVisitor, FormBusinessFormatter, FormLowCodeReactions } from './types';
|
|
5
5
|
declare const _default: import("vue").DefineComponent<{
|
|
6
6
|
fieldList: {
|
|
7
7
|
type: PropType<FieldItem[]>;
|
|
@@ -329,6 +329,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
329
329
|
triggerAllReactionsHandler: () => void;
|
|
330
330
|
operationalFormHandler: (field: string) => void;
|
|
331
331
|
triggerAllOperationalFormHandler: () => void;
|
|
332
|
+
wordbookSettingHandler: (fieldKey: string, value: unknown) => void;
|
|
332
333
|
schemaAdaptor: (fieldList: FieldItem[]) => Record<string, import("@formily/vue").Stringify<{
|
|
333
334
|
[key: symbol]: any;
|
|
334
335
|
[key: `x-${string}`]: any;
|
|
@@ -444,7 +445,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
444
445
|
"x-read-pretty"?: boolean | undefined;
|
|
445
446
|
"x-compile-omitted"?: string[] | undefined;
|
|
446
447
|
}>>;
|
|
447
|
-
onKeydown: (event: KeyboardEvent) => void
|
|
448
|
+
onKeydown: (event: KeyboardEvent) => Promise<void>;
|
|
448
449
|
clearSpan: (uuid: string) => void;
|
|
449
450
|
exposeEvent: {
|
|
450
451
|
validate(path?: string): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as o,computed as t,provide as r,onMounted as s,onUnmounted as a,nextTick as i,openBlock as l,createBlock as n,unref as m,normalizeClass as d,normalizeStyle as p,withCtx as u,createElementBlock as c,createVNode as f,isRef as h,Fragment as y,renderList as
|
|
1
|
+
import{defineComponent as e,ref as o,computed as t,provide as r,onMounted as s,onUnmounted as a,nextTick as i,openBlock as l,createBlock as n,unref as m,normalizeClass as d,normalizeStyle as p,withCtx as u,createElementBlock as c,createVNode as f,isRef as h,Fragment as y,renderList as g,createCommentVNode as j,createElementVNode as b,withKeys as k,withModifiers as v,toDisplayString as F,renderSlot as C}from"vue";import{useTheme as H}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isNumber as S,cloneDeep as x}from"lodash-es";import{createForm as A,onFieldValueChange as L,onFieldMount as O,onFieldUnmount as R,onFieldReact as w,onFormMount as B}from"@formily/core";import{FormProvider as _,FormConsumer as V}from"@formily/vue";import{NForm as D,NTabs as I,NTabPane as N,NConfigProvider as q}from"naive-ui";import{InjectionFormLifeCycleCaller as W,InjectionFormGraph as T}from"./constants/index.js";import{useAutoHidden as U}from"./hooks/useAutoHidden.js";import{useComplexOptionsSpan as E}from"./hooks/useComplexOptions.js";import{useFormDomEvent as G,useFormExposeEvent as K}from"./hooks/useFormEvent.js";import{useFormGraph as M}from"./hooks/useFormGraph.js";import{useFormRenderLifeCycle as P}from"./hooks/useFormRenderLifeCycle.js";import{useLowCodeEvent as J}from"./hooks/useLowCodeEvent.js";import{useLowCodeReactions as $}from"./hooks/useLowCodeReactions.js";import{useNuiThemeOverrides as z}from"./hooks/useNuiThemeOverrides.js";import{useOperationalForm as Q}from"./hooks/useOperationalForm.js";import{useWordbookSetting as X}from"./hooks/useWordbookSetting.js";import"./utils/index.js";import{useFieldListAdaptor as Y}from"./hooks/useFieldListAdaptor.js";import"../../../shared/utils/index.js";import"../index.js";import{useFieldVisitor as Z}from"./hooks/useFieldVisitor.js";import"../../../shared/utils/tapable/SyncHook.js";import"../../../shared/utils/tapable/SyncBailHook.js";import"../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../shared/utils/tapable/SyncLoopHook.js";import"../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{validateMessageLocale as ee}from"./hooks/useFormValidator.js";import{useAnchor as oe}from"./hooks/useAnchor.js";import{useFormContext as te}from"./hooks/useFormContext.js";import"./hooks/useFormRenderOptions.js";import{createObjSchema as re}from"./utils/schema.js";const se={key:0,style:{height:"54px"}},ae={style:{"white-space":"pre"}};var ie=e({__name:"FormRender",props:{fieldList:{type:Array},initialData:{type:Object,default:()=>({})},fieldVisitor:{type:Object},column:{type:Number,default:24},maxHeight:{type:[Number,String],default:""},anchor:{type:Boolean,default:!1},parallelism:{type:Number,default:3},businessFormatter:{type:Function},schema:{type:Object},components:{type:Object,default:()=>({})},scope:{type:Object,default:()=>({})},annotation:{type:Object},consumer:{type:Boolean,default:!1},uuid:{type:String},lifeCycle:{type:Object},requestInstance:{type:Object},enterToNextWidget:{type:[Boolean,Function],default:!0},lowCodeReactions:{type:Array},operationalForm:{type:Object},linebarAutoHidden:{type:Boolean},bordered:{type:[Boolean,String],default:!0},uniqueCacheData:{type:Boolean,default:!1}},emits:["formChange","annotationChange","scroll"],setup(e,{expose:ie,emit:le}){const ne=e,me=H(),{nuiThemeOverrides:de}=z();ee();const pe=o(),ue=t((()=>S(ne.maxHeight)?ne.maxHeight+"px":ne.maxHeight)),{SchemaField:ce,businessCollector:fe,formItemDepsCollector:he,changeContextCollector:ye,formUUID:ge}=te(ne,le),{anchorBarRef:je,currentAnchor:be,updateAnchorList:ke,anchorIdList:ve,onScroll:Fe}=oe(ne,le,pe,he),{callLifeCycle:Ce}=P(ne);r(W,Ce),Ce("onSetup");const{trigger:He}=U(),{observeFormGraph:Se,setGraph:xe,removeGraph:Ae}=M();r(T,Se);const{lowCodeEventTrigger:Le}=J(),Oe=A({initialValues:ne.initialData,effects(e){L("*",(o=>{const t=o.props.name.toString();fe.trigger(e,t),he.trigger(t),le("formChange",{fieldInstance:o,fieldKey:t,fieldName:o.title,value:o.value,context:ye.getContext(t,o.value)}),Le(o),Re(t,o.value),Be(t),Ve(t,o.value)})),O("*",xe),R("*",Ae),ne.linebarAutoHidden&&(w("*",He),B((e=>e.query("*").forEach(He)))),ne.anchor&&w("*",ke)}}),{lowCodeReactionsHandler:Re,triggerAllReactionsHandler:we}=$(t((()=>ne.lowCodeReactions)),Oe),{operationalFormHandler:Be,triggerAllOperationalFormHandler:_e}=Q(t((()=>ne.operationalForm)),Oe),{wordbookSettingHandler:Ve}=X(Oe,ye);s(we),s(_e);const{schemaAdaptor:De}=Y(fe);let Ie=ne.fieldList||[];const Ne=t((()=>ne.schema?ne.schema:ne.fieldList?(Ie=Z().traverse(x(ne.fieldList),ne.fieldVisitor),re(De(Ie))):re({}))),{onKeydown:qe}=G({formModel:Oe,formRenderRef:pe,props:ne}),{clearSpan:We}=E();a((()=>We(ge)));const Te=K({formModel:Oe,formRenderRef:pe,formItemDepsCollector:he,getFieldList:()=>Ie,formUUID:ge});return ie({formModel:Oe,validate:(e="*")=>Te.validate(e),getFormValues:(e=!0)=>Te.getFormValues(e),async setFormValues(e,o=!0,t=!1,r=!0){t&&(fe.triggerLock=!0),Te.setFormValues(e,o,r),await i(),fe.triggerLock=!1},setFieldState(e,o){Te.setFieldState(e,o)},resetFields(e="*"){Te.resetFields(e)},queryWidget:async e=>Te.queryWidget(e),getFieldList:()=>Ie,async reload(){console.error("reload function is abstract,it should be overwrite!")}}),(o,t)=>(l(),n(m(D),{class:d(["form-render",{"form-render--no-border":!e.bordered,"form-render--underline":"underline"===e.bordered}]),"require-mark-placement":"left",style:p(m(me))},{default:u((()=>[e.anchor?(l(),c("section",se,[f(m(I),{value:m(be),"onUpdate:value":t[0]||(t[0]=e=>h(be)?be.value=e:null),type:"line",ref_key:"anchorBarRef",ref:je},{default:u((()=>[(l(!0),c(y,null,g(m(ve),(e=>(l(),n(m(N),{name:e.name,tab:e.title,key:e.name},null,8,["name","tab"])))),128))])),_:1},8,["value"])])):j("v-if",!0),f(m(q),{"theme-overrides":m(de)},{default:u((()=>[b("section",{class:"form-render__wrapper",style:p({"--column":e.column,"--form-height":m(ue)}),ref_key:"formRenderRef",ref:pe,onScroll:t[1]||(t[1]=(...e)=>m(Fe)&&m(Fe)(...e)),onKeydownCapture:t[2]||(t[2]=k(v(((...e)=>m(qe)&&m(qe)(...e)),["prevent"]),["enter"]))},[f(m(_),{form:m(Oe)},{default:u((()=>[f(m(ce),{schema:m(Ne)},null,8,["schema"]),e.consumer?(l(),n(m(V),{key:0},{default:u((({form:e})=>[b("div",ae,F(JSON.stringify(e.values,null,2)),1)])),_:1})):j("v-if",!0),C(o.$slots,"default")])),_:3},8,["form"])],36)])),_:3},8,["theme-overrides"])])),_:3},8,["class","style"]))}});export{ie as default};
|
|
@@ -132,7 +132,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
132
132
|
type: import("vue").PropType<import("../../../../es/components/form-render").FormLowCodeReactions.Config[]>;
|
|
133
133
|
};
|
|
134
134
|
operationalForm: {
|
|
135
|
-
type: import("vue").PropType<import("../../../../es/
|
|
135
|
+
type: import("vue").PropType<import("../../../../es/shared/types").FormOperationalConfig[]>;
|
|
136
136
|
};
|
|
137
137
|
linebarAutoHidden: {
|
|
138
138
|
type: BooleanConstructor;
|
|
@@ -272,7 +272,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
272
272
|
type: import("vue").PropType<import("../../../../es/components/form-render").FormLowCodeReactions.Config[]>;
|
|
273
273
|
};
|
|
274
274
|
operationalForm: {
|
|
275
|
-
type: import("vue").PropType<import("../../../../es/
|
|
275
|
+
type: import("vue").PropType<import("../../../../es/shared/types").FormOperationalConfig[]>;
|
|
276
276
|
};
|
|
277
277
|
linebarAutoHidden: {
|
|
278
278
|
type: BooleanConstructor;
|
|
@@ -333,6 +333,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
333
333
|
triggerAllReactionsHandler: () => void;
|
|
334
334
|
operationalFormHandler: (field: string) => void;
|
|
335
335
|
triggerAllOperationalFormHandler: () => void;
|
|
336
|
+
wordbookSettingHandler: (fieldKey: string, value: unknown) => void;
|
|
336
337
|
schemaAdaptor: (fieldList: import("../../../../es/components/form-render").FieldItem[]) => Record<string, import("@formily/json-schema").Stringify<{
|
|
337
338
|
[key: symbol]: any;
|
|
338
339
|
[key: `x-${string}`]: any;
|
|
@@ -448,7 +449,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
448
449
|
"x-read-pretty"?: boolean | undefined;
|
|
449
450
|
"x-compile-omitted"?: string[] | undefined;
|
|
450
451
|
}>>;
|
|
451
|
-
onKeydown: (event: KeyboardEvent) => void
|
|
452
|
+
onKeydown: (event: KeyboardEvent) => Promise<void>;
|
|
452
453
|
clearSpan: (uuid: string) => void;
|
|
453
454
|
exposeEvent: {
|
|
454
455
|
validate(path?: string): Promise<void>;
|
|
@@ -740,7 +741,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
740
741
|
type: import("vue").PropType<import("../../../../es/components/form-render").FormLowCodeReactions.Config[]>;
|
|
741
742
|
};
|
|
742
743
|
operationalForm: {
|
|
743
|
-
type: import("vue").PropType<import("../../../../es/
|
|
744
|
+
type: import("vue").PropType<import("../../../../es/shared/types").FormOperationalConfig[]>;
|
|
744
745
|
};
|
|
745
746
|
linebarAutoHidden: {
|
|
746
747
|
type: BooleanConstructor;
|
|
@@ -33,15 +33,22 @@ export declare const LEVEL_SEARCH_CASCADER: import("vue").DefineComponent<{
|
|
|
33
33
|
name: string;
|
|
34
34
|
render_key: string[];
|
|
35
35
|
search_key: string[];
|
|
36
|
+
value_key: string;
|
|
37
|
+
queryParams: string[];
|
|
36
38
|
primary_key: string;
|
|
37
39
|
type: string;
|
|
38
|
-
value_key: string;
|
|
39
40
|
level_key: string;
|
|
40
41
|
link_key: string;
|
|
41
42
|
link_key_split: string;
|
|
42
43
|
show_key: string[];
|
|
43
44
|
conObj: AnyObject[];
|
|
44
45
|
conObjFirstLevel: AnyObject[];
|
|
46
|
+
setting: Partial<{
|
|
47
|
+
cascading: {
|
|
48
|
+
'form.name': string;
|
|
49
|
+
value: string;
|
|
50
|
+
}[];
|
|
51
|
+
}>;
|
|
45
52
|
}>>;
|
|
46
53
|
required: true;
|
|
47
54
|
};
|
|
@@ -81,15 +88,22 @@ export declare const LEVEL_SEARCH_CASCADER: import("vue").DefineComponent<{
|
|
|
81
88
|
name: string;
|
|
82
89
|
render_key: string[];
|
|
83
90
|
search_key: string[];
|
|
91
|
+
value_key: string;
|
|
92
|
+
queryParams: string[];
|
|
84
93
|
primary_key: string;
|
|
85
94
|
type: string;
|
|
86
|
-
value_key: string;
|
|
87
95
|
level_key: string;
|
|
88
96
|
link_key: string;
|
|
89
97
|
link_key_split: string;
|
|
90
98
|
show_key: string[];
|
|
91
99
|
conObj: AnyObject[];
|
|
92
100
|
conObjFirstLevel: AnyObject[];
|
|
101
|
+
setting: Partial<{
|
|
102
|
+
cascading: {
|
|
103
|
+
'form.name': string;
|
|
104
|
+
value: string;
|
|
105
|
+
}[];
|
|
106
|
+
}>;
|
|
93
107
|
}>>;
|
|
94
108
|
required: true;
|
|
95
109
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as r,computed as t,inject as
|
|
1
|
+
import{defineComponent as e,ref as r,computed as t,inject as a,watch as o,createVNode as n}from"vue";import{useVModel as u}from"@vueuse/core";import{isEqual as l,isArray as i,isString as s,isNumber as c,isEmpty as d,isFunction as v,omit as p,cloneDeep as f}from"lodash-es";import"../../../index.js";import{InjectionAsyncQueue as m}from"../../constants/index.js";import{useCommonInjection as y}from"../../hooks/useCommonInjection.js";import{formRenderLog as h}from"../../utils/index.js";import{connect as k,mapProps as j}from"@formily/vue";import g from"../../../../search-cascader/index.js";import w from"../../../../../shared/components/no-data/NoData.vue.js";import{assignUpdateValue as _}from"../../utils/schema.js";import{useFormField as b}from"../../hooks/useFormField.js";import{useFormRequest as F}from"../../hooks/useFormRequest.js";const K=k(e({name:"FormSearchCascade",props:{options:{type:Array,default:()=>[]},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},autograph:{type:String,required:!0},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},wordbook:{type:Object,required:!0},onChange:{},value:{type:[String,Array]}},emits:["update:value"],setup(e,{emit:k}){const j=u(e,"value",k),_=r(!1),K=r([]),{field:O,fieldKey:q}=b(),S=t((()=>{var r,t,a;return null!=(a=null==(t=null==(r=e.wordbook)?void 0:r.show_key)?void 0:t[0])?a:e.labelField})),C=t((()=>{var r,t;return null!=(t=null==(r=e.wordbook)?void 0:r.value_key)?t:e.valueField})),x=t((()=>{var r,t;return null==(t=null==(r=e.wordbook)?void 0:r.render_key)?void 0:t[0]})),L=t((()=>{var r;return(null==(r=e.wordbook)?void 0:r.level_num)||1/0})),V=a(m),{getSearchRequestInfo:A}=F(),I=r(150),P=r();async function R(r,t){var a,o,n;if(I.value=t&&(null==(a=P.value)?void 0:a.getWidth())||150,i(e.value)&&e.value.length&&!r&&!t){const[r,t]=function(e){if(!e.length)return[];const r=[(e=f(e))[0]];let t=e[0];for(let r=1;r<e.length;r++){const a=e[r];a&&(t.children=[a],a.parent=t,t=a)}return[e,r]}(e.value);K.value=t;const a=r[Math.max(0,r.length-2)];return await R(a),a}try{if(r&&!r.__keyword&&r.isLeaf)return u(r);if(null==r?void 0:r.__keyword){if(!s(r.id_link))return Promise.reject();const t=r.id_link.split("_").filter((e=>e));c(L.value)&&L.value!==1/0&&t.splice(L.value);const a=await async function(r){if(!A().primaryKeyUrl)return[];try{return await V.addAsync(t(e.wordbook,e.autograph,r,q.value))}catch(e){s(e)&&h(e)}function t(r,t,a,o){const n=A();return{key:o,params:{autograph:t,tableId:r.id,primaryKeyValue:a.join(","),page:1},...n,url:n.primaryKeyUrl,cache:e.requestCache}}}(t);if(!a)return Promise.reject();const{lastOption:o,options:u}=function(e,r){let t=e[0];return{options:r.reduce(((r,o,n)=>{const u=a(e,o);return 0===n?(t=u,[u]):(Object.assign(u,{parent:t,isLeaf:n+1>=L.value}),t.children=[u],t=u,r)}),[]),lastOption:t};function a(e,r){return e.find((e=>e[C.value]===r))}}(a,t);return u.length<L.value&&(await R(o),d(o.children))?(j.value=function(e,r){return r.map((r=>e.find((e=>e[C.value]===r))))}(a,t),_.value=!1,Promise.reject()):(K.value=u,null==(n=P.value)||n.setCursor(o),o)}{const a=await V.addAsync(function(r,a,o,n,u){const l={autograph:()=>a,wordbookId:"id",wordbookType:"type",fieldKeys:()=>r.search_key?JSON.stringify(r.search_key):void 0,conObj:()=>JSON.stringify(function(e,r,t){return r?e.conObj||[]:t?[{con:"EQ",is_compare_field:!1,field_key:e.level_key,value:t[C.value]}]:e.conObjFirstLevel||[]}(r,t,n)),primaryKey:"primary_key",levelKey:"level_key",keyword:()=>t,page:()=>1},i=Object.entries(l).reduce(((e,[t,a])=>(e[t]=s(a)?r[a]:v(a)?a():void 0,e)),{});return{...A(),params:i,key:u,cache:e.requestCache}}(e.wordbook,e.autograph,O.value,r,q.value));if(r){if(!a.length)return u(r);r.children=a.map((e=>function(e,r,t){return{...e,parent:r,isLeaf:l(r)+1>=t}}(e,r,L.value)))}else K.value=a.map((e=>function(e,r){e.__keyword=!!r,e.isLeaf=!!r,r&&(e[S.value]=e[x.value||S.value]||e[S.value]);return e}(e,t))),t&&(null==(o=P.value)||o.setCursor(K.value[0]))}}catch(e){s(e)&&h(e)}function u(e){return j.value=function(e){const r=[];let t=e;for(;t;)r.unshift(p(t,["parent","isLeaf","__keyword","children"])),t=t.parent;return r}(e),_.value=!1,Promise.reject()}function l(e){let r=1,t=e.parent;for(;t;)r++,t=t.parent;return r}}function U(){I.value=150}o((()=>e.wordbook),((r,t)=>{l(r,t)||(K.value=[],r&&(j.value||!e.lazyRequest)&&R())}),{immediate:!0});const{injectValueValidate:B,injectValueWatchFromEmpty:N,injectValueBindKey:W}=y();N(j,R),B(j);const z=W(j);return()=>n(g,{ref:P,value:j.value,"onUpdate:value":e=>j.value=e,show:_.value,"onUpdate:show":e=>_.value=e,options:K.value,key:z.value,labelKey:S.value,valueKey:C.value,search:R,onFocus:U,menuWidth:I.value},{empty:()=>n(w,null,null)})}}),j({dataSource:"options"},_));export{K as LEVEL_SEARCH_CASCADER};
|
|
@@ -34,15 +34,22 @@ export declare const RADIO: import("vue").DefineComponent<{
|
|
|
34
34
|
name: string;
|
|
35
35
|
render_key: string[];
|
|
36
36
|
search_key: string[];
|
|
37
|
+
value_key: string;
|
|
38
|
+
queryParams: string[];
|
|
37
39
|
primary_key: string;
|
|
38
40
|
type: string;
|
|
39
|
-
value_key: string;
|
|
40
41
|
level_key: string;
|
|
41
42
|
link_key: string;
|
|
42
43
|
link_key_split: string;
|
|
43
44
|
show_key: string[];
|
|
44
45
|
conObj: AnyObject[];
|
|
45
46
|
conObjFirstLevel: AnyObject[];
|
|
47
|
+
setting: Partial<{
|
|
48
|
+
cascading: {
|
|
49
|
+
'form.name': string;
|
|
50
|
+
value: string;
|
|
51
|
+
}[];
|
|
52
|
+
}>;
|
|
46
53
|
}>>;
|
|
47
54
|
};
|
|
48
55
|
vertical: {
|
|
@@ -89,15 +96,22 @@ export declare const RADIO: import("vue").DefineComponent<{
|
|
|
89
96
|
name: string;
|
|
90
97
|
render_key: string[];
|
|
91
98
|
search_key: string[];
|
|
99
|
+
value_key: string;
|
|
100
|
+
queryParams: string[];
|
|
92
101
|
primary_key: string;
|
|
93
102
|
type: string;
|
|
94
|
-
value_key: string;
|
|
95
103
|
level_key: string;
|
|
96
104
|
link_key: string;
|
|
97
105
|
link_key_split: string;
|
|
98
106
|
show_key: string[];
|
|
99
107
|
conObj: AnyObject[];
|
|
100
108
|
conObjFirstLevel: AnyObject[];
|
|
109
|
+
setting: Partial<{
|
|
110
|
+
cascading: {
|
|
111
|
+
'form.name': string;
|
|
112
|
+
value: string;
|
|
113
|
+
}[];
|
|
114
|
+
}>;
|
|
101
115
|
}>>;
|
|
102
116
|
};
|
|
103
117
|
vertical: {
|
|
@@ -156,15 +170,22 @@ export declare const CHECKBOX: import("vue").DefineComponent<{
|
|
|
156
170
|
name: string;
|
|
157
171
|
render_key: string[];
|
|
158
172
|
search_key: string[];
|
|
173
|
+
value_key: string;
|
|
174
|
+
queryParams: string[];
|
|
159
175
|
primary_key: string;
|
|
160
176
|
type: string;
|
|
161
|
-
value_key: string;
|
|
162
177
|
level_key: string;
|
|
163
178
|
link_key: string;
|
|
164
179
|
link_key_split: string;
|
|
165
180
|
show_key: string[];
|
|
166
181
|
conObj: AnyObject[];
|
|
167
182
|
conObjFirstLevel: AnyObject[];
|
|
183
|
+
setting: Partial<{
|
|
184
|
+
cascading: {
|
|
185
|
+
'form.name': string;
|
|
186
|
+
value: string;
|
|
187
|
+
}[];
|
|
188
|
+
}>;
|
|
168
189
|
}>>;
|
|
169
190
|
};
|
|
170
191
|
vertical: {
|
|
@@ -211,15 +232,22 @@ export declare const CHECKBOX: import("vue").DefineComponent<{
|
|
|
211
232
|
name: string;
|
|
212
233
|
render_key: string[];
|
|
213
234
|
search_key: string[];
|
|
235
|
+
value_key: string;
|
|
236
|
+
queryParams: string[];
|
|
214
237
|
primary_key: string;
|
|
215
238
|
type: string;
|
|
216
|
-
value_key: string;
|
|
217
239
|
level_key: string;
|
|
218
240
|
link_key: string;
|
|
219
241
|
link_key_split: string;
|
|
220
242
|
show_key: string[];
|
|
221
243
|
conObj: AnyObject[];
|
|
222
244
|
conObjFirstLevel: AnyObject[];
|
|
245
|
+
setting: Partial<{
|
|
246
|
+
cascading: {
|
|
247
|
+
'form.name': string;
|
|
248
|
+
value: string;
|
|
249
|
+
}[];
|
|
250
|
+
}>;
|
|
223
251
|
}>>;
|
|
224
252
|
};
|
|
225
253
|
vertical: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,
|
|
1
|
+
import{defineComponent as e,useAttrs as t,createVNode as l,isVNode as o}from"vue";import{connect as a,mapProps as r}from"@formily/vue";import{promiseTimeout as i}from"@vueuse/shared";import{NSpace as u,NRadio as n,NRadioGroup as p,NCheckbox as d,NCheckboxGroup as s}from"naive-ui";import"../../../index.js";import{useComplexOptions as c}from"../../hooks/useComplexOptions.js";import"../../utils/index.js";import{useAutographOptions as v}from"../../hooks/useFormRenderOptions.js";import{useCommonInjection as m}from"../../hooks/useCommonInjection.js";import{assignUpdateValue as f,createVisitedSetter as y}from"../../utils/schema.js";import{useFormField as b}from"../../hooks/useFormField.js";function j(a,r,n){return e({name:a,props:{value:{type:[String,Number,Object,Array]},options:{type:Array,default:()=>[]},autograph:{type:String},lazyRequest:{type:Boolean,default:!1},requestCache:{type:Boolean,default:!0},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},wordbook:{type:Object},vertical:{type:Boolean,default:!1},childFieldStrategy:{type:String,default:"checked"},clearable:Boolean,onChange:{}},emits:["update:value"],setup(e,{emit:a}){const{field:d}=b(),{renderComplexOption:s,valueRef:f}=c(e,a),{labelKey:j,valueKey:h,fullOptions:g}=v(e,f),{injectValueBindKey:k,injectValueValidate:S}=m();S(f);const F=k(f),C=t();return()=>l(r,{key:F.value,value:f.value,"onUpdate:value":e=>f.value=e,onClick:y(d)},{default:()=>[l(u,{vertical:e.vertical,"vertical-space":e.vertical},{default:()=>{var t;return[null==(t=g.value)?void 0:t.map((t=>{let a;return l(n,{key:t[h.value],value:t[h.value],disabled:t.disabled,onClick:()=>async function(t){if(null==C?void 0:C.disabled)return;if(r!==p||!e.clearable)return;const l=f.value;await i(0),l===t[h.value]&&(f.value=null)}(t)},"function"==typeof(u=a=s({value:f.value,option:t,valueKey:h.value,labelKey:j.value,childFieldStrategy:e.childFieldStrategy}))||"[object Object]"===Object.prototype.toString.call(u)&&!o(u)?a:{default:()=>[a]});var u}))]}})]})}})}const h=a(j("FormRadio",p,n),r({dataSource:"options"},f)),g=a(j("FormCheckbox",s,d),r({dataSource:"options"},f));export{g as CHECKBOX,h as RADIO};
|
|
@@ -13,6 +13,7 @@ export declare const REMOTE_SEARCH: import("vue").DefineComponent<{
|
|
|
13
13
|
type: PropType<AnyObject[]>;
|
|
14
14
|
default: () => never[];
|
|
15
15
|
};
|
|
16
|
+
allowCreate: BooleanConstructor;
|
|
16
17
|
labelField: {
|
|
17
18
|
type: StringConstructor;
|
|
18
19
|
default: string;
|
|
@@ -37,6 +38,7 @@ export declare const REMOTE_SEARCH: import("vue").DefineComponent<{
|
|
|
37
38
|
type: PropType<AnyObject[]>;
|
|
38
39
|
default: () => never[];
|
|
39
40
|
};
|
|
41
|
+
allowCreate: BooleanConstructor;
|
|
40
42
|
labelField: {
|
|
41
43
|
type: StringConstructor;
|
|
42
44
|
default: string;
|
|
@@ -56,4 +58,5 @@ export declare const REMOTE_SEARCH: import("vue").DefineComponent<{
|
|
|
56
58
|
labelField: string;
|
|
57
59
|
valueField: string;
|
|
58
60
|
requestCache: boolean;
|
|
61
|
+
allowCreate: boolean;
|
|
59
62
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as l,computed as
|
|
1
|
+
import{defineComponent as e,ref as l,computed as a,inject as u,watch as o,createVNode as t}from"vue";import{connect as n,mapProps as r}from"@formily/vue";import{useVModel as i,useDebounceFn as v}from"@vueuse/core";import{isString as s,isArray as m,cloneDeep as p,isEqual as d}from"lodash-es";import{NSelect as f}from"naive-ui";import"../../../index.js";import{InjectionAsyncQueue as c,InjectionChangeContextCollector as y,InjectionFormItemDepsCollector as C}from"../../constants/index.js";import{createUrlConfigParams as g,formRenderLog as h}from"../../utils/index.js";import{useCommonInjection as j,useSelectOptionProps as F}from"../../hooks/useCommonInjection.js";import{assignUpdateValue as x,assignClearBindVisited as b,createVisitedSetter as w}from"../../utils/schema.js";import{useFormField as K}from"../../hooks/useFormField.js";const S=n(e({name:"FormRemoteSearch",props:{value:{type:String},requestCache:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},allowCreate:Boolean,labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},urlConfig:{type:Object},onChange:{}},emits:["update:value"],setup(e,{slots:n,emit:r}){const x=i(e,"value",r),{field:b,fieldKey:S}=K(),k=l(null),B=a((()=>{var l,a,u;return null!=(u=null!=(a=null==(l=e.urlConfig)?void 0:l.nameKey)?a:e.labelField)?u:"text"})),V=a((()=>{var l,a,u;return null!=(u=null!=(a=null==(l=e.urlConfig)?void 0:l.valueKey)?a:e.valueField)?u:"value"})),q=u(c),A=l(""),O=v((async(l="",a="label")=>{if(A.value=l,!e.urlConfig)return k.value=null;try{k.value=await q.addAsync(await g({config:{...e.urlConfig,params:{...e.urlConfig.params,["value"===a?V.value:"keyword"]:l}},cache:e.requestCache,field:b.value}))}catch(e){s(e)&&h(e)}})),P=a((()=>m(k.value)?k.value:m(e.options)?e.options:[])),{injectValueValidate:U,injectValueBindKey:D}=j();U(x);const I=D(x);o(x,(e=>{if(e&&!P.value.find((l=>l[V.value]===e)))return O(e,"value")}));u(y).setContext(S.value,(e=>{return{currentOption:p((l=e,P.value.find((e=>e[V.value]===l))))};var l}));const R=u(C);o((()=>e.urlConfig),((e,l)=>{d(e,l)||(k.value=null,e&&(R.setDeps(S.value,e.dependKey||[],(async()=>{k.value=null,x.value=null})),x.value&&O(x.value,"value")))}),{immediate:!0});const{menuProps:z,nodeProps:E}=F(),G=a((()=>P.value.length||!e.allowCreate?P.value:A.value?[{[B.value]:A.value,[V.value]:A.value},...P.value]:P.value));return()=>t(f,{remote:!0,filterable:!0,key:I.value,value:x.value,"onUpdate:value":e=>x.value=e,labelField:B.value,valueField:V.value,"menu-props":z,"node-props":E,onSearch:O,"onUpdate:show":e=>e&&O(),options:G.value,onFocus:w(b)},n)}}),r(x,b));export{S as REMOTE_SEARCH};
|
|
@@ -42,15 +42,22 @@ export declare const SELECT: import("vue").DefineComponent<{
|
|
|
42
42
|
name: string;
|
|
43
43
|
render_key: string[];
|
|
44
44
|
search_key: string[];
|
|
45
|
+
value_key: string;
|
|
46
|
+
queryParams: string[];
|
|
45
47
|
primary_key: string;
|
|
46
48
|
type: string;
|
|
47
|
-
value_key: string;
|
|
48
49
|
level_key: string;
|
|
49
50
|
link_key: string;
|
|
50
51
|
link_key_split: string;
|
|
51
52
|
show_key: string[];
|
|
52
53
|
conObj: AnyObject[];
|
|
53
54
|
conObjFirstLevel: AnyObject[];
|
|
55
|
+
setting: Partial<{
|
|
56
|
+
cascading: {
|
|
57
|
+
'form.name': string;
|
|
58
|
+
value: string;
|
|
59
|
+
}[];
|
|
60
|
+
}>;
|
|
54
61
|
}>>;
|
|
55
62
|
};
|
|
56
63
|
recommend: {
|
|
@@ -117,15 +124,22 @@ export declare const SELECT: import("vue").DefineComponent<{
|
|
|
117
124
|
name: string;
|
|
118
125
|
render_key: string[];
|
|
119
126
|
search_key: string[];
|
|
127
|
+
value_key: string;
|
|
128
|
+
queryParams: string[];
|
|
120
129
|
primary_key: string;
|
|
121
130
|
type: string;
|
|
122
|
-
value_key: string;
|
|
123
131
|
level_key: string;
|
|
124
132
|
link_key: string;
|
|
125
133
|
link_key_split: string;
|
|
126
134
|
show_key: string[];
|
|
127
135
|
conObj: AnyObject[];
|
|
128
136
|
conObjFirstLevel: AnyObject[];
|
|
137
|
+
setting: Partial<{
|
|
138
|
+
cascading: {
|
|
139
|
+
'form.name': string;
|
|
140
|
+
value: string;
|
|
141
|
+
}[];
|
|
142
|
+
}>;
|
|
129
143
|
}>>;
|
|
130
144
|
};
|
|
131
145
|
recommend: {
|