cnhis-design-vue 3.1.41-beta.31 → 3.1.41-beta.33
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/fabric-chart/src/hooks/useBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/useBirthProcessChart.js +1 -1
- package/es/components/form-config/index.d.ts +27 -27
- package/es/components/form-config/src/FormConfig.vue.d.ts +27 -27
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +11 -11
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +14 -14
- package/es/components/form-render/index.d.ts +11 -11
- package/es/components/form-render/src/FormRender.vue.d.ts +11 -11
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +11 -11
- package/es/components/form-render/src/FormRenderWrapper.vue.js +1 -1
- package/es/components/form-render/src/components/renderer/radio&checkbox.d.ts +2 -2
- package/es/components/form-render/src/components/renderer/radio_checkbox.js +1 -1
- package/es/components/form-render/src/components/renderer/select.js +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.d.ts +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/form-render/src/hooks/useFormRenderOptions.d.ts +4 -2
- package/es/components/form-render/src/hooks/useFormRenderOptions.js +1 -1
- package/es/components/index.css +1 -1
- package/es/components/info-header/index.d.ts +421 -141
- package/es/components/info-header/src/InfoHeader.vue.d.ts +422 -141
- package/es/components/info-header/src/InfoHeader.vue.js +1 -1
- package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +320 -0
- package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.js +1 -0
- package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +447 -0
- package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.js +1 -0
- 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 +412 -139
- package/es/components/info-header/src/components/infoDescription/index.vue.js +1 -1
- package/es/components/info-header/src/constants/index.d.ts +4 -0
- package/es/components/info-header/src/constants/index.js +1 -0
- package/es/components/info-header/src/hooks/useThemeOverrides.d.ts +4 -0
- package/es/components/info-header/src/hooks/useThemeOverrides.js +1 -0
- package/es/components/info-header/src/types/index.d.ts +12 -3
- package/es/components/info-header/style/index.css +1 -1
- package/es/components/shortcut-setter/index.d.ts +12 -12
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +12 -12
- package/package.json +2 -2
|
@@ -26,7 +26,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
26
26
|
fieldList: import("vue").Ref<{
|
|
27
27
|
[x: string]: any;
|
|
28
28
|
val_key: string;
|
|
29
|
-
html_type: "LINEBAR" | "SELECT" | "DATE" |
|
|
29
|
+
html_type: "LINEBAR" | ({} & string) | "SELECT" | "DATE" | "COMBINATION" | "INPUT" | "LINE_BREAKS" | "INPUT_NUMBER" | "REMOTE_SEARCH" | "LEVEL_SEARCH_CASCADER" | "SEARCH_CASCADER" | "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";
|
|
30
30
|
annotation?: boolean | undefined;
|
|
31
31
|
val_key_unit?: string | undefined;
|
|
32
32
|
is_edit?: import("../../../../../es/components/form-render").FormCommonState | undefined;
|
|
@@ -1732,7 +1732,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1732
1732
|
originalSetting?: {
|
|
1733
1733
|
[x: string]: any;
|
|
1734
1734
|
val_key: string;
|
|
1735
|
-
html_type: "LINEBAR" | "SELECT" | "DATE" |
|
|
1735
|
+
html_type: "LINEBAR" | ({} & string) | "SELECT" | "DATE" | "COMBINATION" | "INPUT" | "LINE_BREAKS" | "INPUT_NUMBER" | "REMOTE_SEARCH" | "LEVEL_SEARCH_CASCADER" | "SEARCH_CASCADER" | "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
1736
|
annotation?: boolean | undefined;
|
|
1737
1737
|
val_key_unit?: string | undefined;
|
|
1738
1738
|
is_edit?: import("../../../../../es/components/form-render").FormCommonState | undefined;
|
|
@@ -3409,7 +3409,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3409
3409
|
originalSetting?: {
|
|
3410
3410
|
[x: string]: any;
|
|
3411
3411
|
val_key: string;
|
|
3412
|
-
html_type: "LINEBAR" | "SELECT" | "DATE" |
|
|
3412
|
+
html_type: "LINEBAR" | ({} & string) | "SELECT" | "DATE" | "COMBINATION" | "INPUT" | "LINE_BREAKS" | "INPUT_NUMBER" | "REMOTE_SEARCH" | "LEVEL_SEARCH_CASCADER" | "SEARCH_CASCADER" | "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";
|
|
3413
3413
|
annotation?: boolean | undefined;
|
|
3414
3414
|
val_key_unit?: string | undefined;
|
|
3415
3415
|
is_edit?: import("../../../../../es/components/form-render").FormCommonState | undefined;
|
|
@@ -5355,7 +5355,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
5355
5355
|
onScroll?: ((...args: any[]) => any) | undefined;
|
|
5356
5356
|
onAnnotationChange?: ((...args: any[]) => any) | undefined;
|
|
5357
5357
|
}>>;
|
|
5358
|
-
emit: (event: "
|
|
5358
|
+
emit: (event: "formChange" | "scroll" | "annotationChange", ...args: any[]) => void;
|
|
5359
5359
|
nuiThemeOverrides: import("naive-ui").GlobalThemeOverrides;
|
|
5360
5360
|
formRenderRef: import("vue").Ref<HTMLElement | undefined>;
|
|
5361
5361
|
formHeight: import("vue").ComputedRef<string>;
|
|
@@ -5525,28 +5525,24 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
5525
5525
|
title: string;
|
|
5526
5526
|
form: import("../../../../../es/components/form-render").Form<any>;
|
|
5527
5527
|
content: any;
|
|
5528
|
-
hidden: boolean;
|
|
5529
|
-
active: boolean;
|
|
5530
|
-
dataSource: import("../../../../../es/components/form-render").FieldDataSource;
|
|
5531
|
-
description: string;
|
|
5532
|
-
display: import("../../../../../es/components/form-render").FieldDisplayTypes;
|
|
5533
|
-
mounted: boolean;
|
|
5534
|
-
readonly destroyed: boolean;
|
|
5535
|
-
unmounted: boolean;
|
|
5536
5528
|
componentProps: Record<string, any>;
|
|
5537
5529
|
decoratorProps: Record<string, any>;
|
|
5530
|
+
display: import("../../../../../es/components/form-render").FieldDisplayTypes;
|
|
5531
|
+
description: string;
|
|
5538
5532
|
readOnly: boolean;
|
|
5539
5533
|
editable: boolean;
|
|
5534
|
+
hidden: boolean;
|
|
5540
5535
|
component: import("../../../../../es/components/form-render").FieldComponent<any, any>;
|
|
5541
5536
|
decorator: import("../../../../../es/components/form-render").FieldDecorator<any, any>;
|
|
5542
|
-
readPretty: boolean;
|
|
5543
5537
|
validating: boolean;
|
|
5544
5538
|
submitting: boolean;
|
|
5539
|
+
active: boolean;
|
|
5545
5540
|
visited: boolean;
|
|
5546
5541
|
selfModified: boolean;
|
|
5547
5542
|
modified: boolean;
|
|
5548
5543
|
inputValue: string;
|
|
5549
5544
|
inputValues: any[];
|
|
5545
|
+
dataSource: import("../../../../../es/components/form-render").FieldDataSource;
|
|
5550
5546
|
feedbacks: import("../../../../../es/components/form-render").IFieldFeedback[];
|
|
5551
5547
|
caches: import("../../../../../es/components/form-render").IFieldCaches;
|
|
5552
5548
|
selfErrors: import("../../../../../es/components/form-render").FeedbackMessage;
|
|
@@ -5577,11 +5573,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
5577
5573
|
queryFeedbacks: (search?: import("../../../../../es/components/form-render").ISearchFeedback | undefined) => import("../../../../../es/components/form-render").IFieldFeedback[];
|
|
5578
5574
|
modify: () => void;
|
|
5579
5575
|
initialized: boolean;
|
|
5576
|
+
mounted: boolean;
|
|
5577
|
+
unmounted: boolean;
|
|
5580
5578
|
decoratorType: any;
|
|
5581
5579
|
componentType: any;
|
|
5582
5580
|
designable: boolean;
|
|
5583
5581
|
locate: (address: import("@formily/path").Pattern) => void;
|
|
5584
5582
|
readonly parent: import("../../../../../es/components/form-render").GeneralField;
|
|
5583
|
+
readPretty: boolean;
|
|
5584
|
+
readonly destroyed: boolean;
|
|
5585
5585
|
setTitle: (title?: string | undefined) => void;
|
|
5586
5586
|
setDescription: (description?: string | undefined) => void;
|
|
5587
5587
|
setDisplay: (type?: import("../../../../../es/components/form-render").FieldDisplayTypes | undefined) => void;
|
|
@@ -5665,7 +5665,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
5665
5665
|
readonly displayDirective: "if" | "show" | "show:lazy";
|
|
5666
5666
|
}>;
|
|
5667
5667
|
NTabs: any;
|
|
5668
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("
|
|
5668
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("formChange" | "scroll" | "annotationChange")[], "scroll" | "formChange" | "annotationChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
5669
5669
|
fieldList: {
|
|
5670
5670
|
type: PropType<FieldItem[]>;
|
|
5671
5671
|
};
|
|
@@ -268,7 +268,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
|
268
268
|
onScroll?: ((...args: any[]) => any) | undefined;
|
|
269
269
|
onAnnotationChange?: ((...args: any[]) => any) | undefined;
|
|
270
270
|
}>>;
|
|
271
|
-
emit: (event: "
|
|
271
|
+
emit: (event: "formChange" | "scroll" | "annotationChange", ...args: any[]) => void;
|
|
272
272
|
nuiThemeOverrides: import("naive-ui").GlobalThemeOverrides;
|
|
273
273
|
formRenderRef: import("vue").Ref<HTMLElement | undefined>;
|
|
274
274
|
formHeight: import("vue").ComputedRef<string>;
|
|
@@ -438,28 +438,24 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
|
438
438
|
title: string;
|
|
439
439
|
form: import("@formily/core/esm/models/Form").Form<any>;
|
|
440
440
|
content: any;
|
|
441
|
-
hidden: boolean;
|
|
442
|
-
active: boolean;
|
|
443
|
-
dataSource: import("@formily/core/esm/types").FieldDataSource;
|
|
444
|
-
description: string;
|
|
445
|
-
display: import("@formily/core/esm/types").FieldDisplayTypes;
|
|
446
|
-
mounted: boolean;
|
|
447
|
-
readonly destroyed: boolean;
|
|
448
|
-
unmounted: boolean;
|
|
449
441
|
componentProps: Record<string, any>;
|
|
450
442
|
decoratorProps: Record<string, any>;
|
|
443
|
+
display: import("@formily/core/esm/types").FieldDisplayTypes;
|
|
444
|
+
description: string;
|
|
451
445
|
readOnly: boolean;
|
|
452
446
|
editable: boolean;
|
|
447
|
+
hidden: boolean;
|
|
453
448
|
component: import("@formily/core/esm/types").FieldComponent<any, any>;
|
|
454
449
|
decorator: import("@formily/core/esm/types").FieldDecorator<any, any>;
|
|
455
|
-
readPretty: boolean;
|
|
456
450
|
validating: boolean;
|
|
457
451
|
submitting: boolean;
|
|
452
|
+
active: boolean;
|
|
458
453
|
visited: boolean;
|
|
459
454
|
selfModified: boolean;
|
|
460
455
|
modified: boolean;
|
|
461
456
|
inputValue: string;
|
|
462
457
|
inputValues: any[];
|
|
458
|
+
dataSource: import("@formily/core/esm/types").FieldDataSource;
|
|
463
459
|
feedbacks: import("@formily/core/esm/types").IFieldFeedback[];
|
|
464
460
|
caches: import("@formily/core/esm/types").IFieldCaches;
|
|
465
461
|
selfErrors: import("@formily/core/esm/types").FeedbackMessage;
|
|
@@ -490,11 +486,15 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
|
490
486
|
queryFeedbacks: (search?: import("@formily/core/esm/types").ISearchFeedback | undefined) => import("@formily/core/esm/types").IFieldFeedback[];
|
|
491
487
|
modify: () => void;
|
|
492
488
|
initialized: boolean;
|
|
489
|
+
mounted: boolean;
|
|
490
|
+
unmounted: boolean;
|
|
493
491
|
decoratorType: any;
|
|
494
492
|
componentType: any;
|
|
495
493
|
designable: boolean;
|
|
496
494
|
locate: (address: import("@formily/path").Pattern) => void;
|
|
497
495
|
readonly parent: import("@formily/core/esm/types").GeneralField;
|
|
496
|
+
readPretty: boolean;
|
|
497
|
+
readonly destroyed: boolean;
|
|
498
498
|
setTitle: (title?: string | undefined) => void;
|
|
499
499
|
setDescription: (description?: string | undefined) => void;
|
|
500
500
|
setDisplay: (type?: import("@formily/core/esm/types").FieldDisplayTypes | undefined) => void;
|
|
@@ -578,7 +578,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
|
578
578
|
readonly displayDirective: "if" | "show" | "show:lazy";
|
|
579
579
|
}>;
|
|
580
580
|
NTabs: any;
|
|
581
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("
|
|
581
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("formChange" | "scroll" | "annotationChange")[], "scroll" | "formChange" | "annotationChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
582
582
|
fieldList: {
|
|
583
583
|
type: import("vue").PropType<import("./src/types").FieldItem[]>;
|
|
584
584
|
};
|
|
@@ -262,7 +262,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
262
262
|
onScroll?: ((...args: any[]) => any) | undefined;
|
|
263
263
|
onAnnotationChange?: ((...args: any[]) => any) | undefined;
|
|
264
264
|
}>>;
|
|
265
|
-
emit: (event: "
|
|
265
|
+
emit: (event: "formChange" | "scroll" | "annotationChange", ...args: any[]) => void;
|
|
266
266
|
nuiThemeOverrides: import("naive-ui").GlobalThemeOverrides;
|
|
267
267
|
formRenderRef: import("vue").Ref<HTMLElement | undefined>;
|
|
268
268
|
formHeight: import("vue").ComputedRef<string>;
|
|
@@ -432,28 +432,24 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
432
432
|
title: string;
|
|
433
433
|
form: import("@formily/core").Form<any>;
|
|
434
434
|
content: any;
|
|
435
|
-
hidden: boolean;
|
|
436
|
-
active: boolean;
|
|
437
|
-
dataSource: import("@formily/core").FieldDataSource;
|
|
438
|
-
description: string;
|
|
439
|
-
display: import("@formily/core").FieldDisplayTypes;
|
|
440
|
-
mounted: boolean;
|
|
441
|
-
readonly destroyed: boolean;
|
|
442
|
-
unmounted: boolean;
|
|
443
435
|
componentProps: Record<string, any>;
|
|
444
436
|
decoratorProps: Record<string, any>;
|
|
437
|
+
display: import("@formily/core").FieldDisplayTypes;
|
|
438
|
+
description: string;
|
|
445
439
|
readOnly: boolean;
|
|
446
440
|
editable: boolean;
|
|
441
|
+
hidden: boolean;
|
|
447
442
|
component: import("@formily/core").FieldComponent<any, any>;
|
|
448
443
|
decorator: import("@formily/core").FieldDecorator<any, any>;
|
|
449
|
-
readPretty: boolean;
|
|
450
444
|
validating: boolean;
|
|
451
445
|
submitting: boolean;
|
|
446
|
+
active: boolean;
|
|
452
447
|
visited: boolean;
|
|
453
448
|
selfModified: boolean;
|
|
454
449
|
modified: boolean;
|
|
455
450
|
inputValue: string;
|
|
456
451
|
inputValues: any[];
|
|
452
|
+
dataSource: import("@formily/core").FieldDataSource;
|
|
457
453
|
feedbacks: import("@formily/core").IFieldFeedback[];
|
|
458
454
|
caches: import("@formily/core").IFieldCaches;
|
|
459
455
|
selfErrors: import("@formily/core").FeedbackMessage;
|
|
@@ -484,11 +480,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
484
480
|
queryFeedbacks: (search?: import("@formily/core").ISearchFeedback | undefined) => import("@formily/core").IFieldFeedback[];
|
|
485
481
|
modify: () => void;
|
|
486
482
|
initialized: boolean;
|
|
483
|
+
mounted: boolean;
|
|
484
|
+
unmounted: boolean;
|
|
487
485
|
decoratorType: any;
|
|
488
486
|
componentType: any;
|
|
489
487
|
designable: boolean;
|
|
490
488
|
locate: (address: import("@formily/path").Pattern) => void;
|
|
491
489
|
readonly parent: import("@formily/core").GeneralField;
|
|
490
|
+
readPretty: boolean;
|
|
491
|
+
readonly destroyed: boolean;
|
|
492
492
|
setTitle: (title?: string | undefined) => void;
|
|
493
493
|
setDescription: (description?: string | undefined) => void;
|
|
494
494
|
setDisplay: (type?: import("@formily/core").FieldDisplayTypes | undefined) => void;
|
|
@@ -572,7 +572,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
572
572
|
readonly displayDirective: "if" | "show" | "show:lazy";
|
|
573
573
|
}>;
|
|
574
574
|
NTabs: any;
|
|
575
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("
|
|
575
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("formChange" | "scroll" | "annotationChange")[], "scroll" | "formChange" | "annotationChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
576
576
|
fieldList: {
|
|
577
577
|
type: PropType<FieldItem[]>;
|
|
578
578
|
};
|
|
@@ -266,7 +266,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
266
266
|
onScroll?: ((...args: any[]) => any) | undefined;
|
|
267
267
|
onAnnotationChange?: ((...args: any[]) => any) | undefined;
|
|
268
268
|
}>>;
|
|
269
|
-
emit: (event: "
|
|
269
|
+
emit: (event: "formChange" | "scroll" | "annotationChange", ...args: any[]) => void;
|
|
270
270
|
nuiThemeOverrides: import("naive-ui").GlobalThemeOverrides;
|
|
271
271
|
formRenderRef: import("vue").Ref<HTMLElement | undefined>;
|
|
272
272
|
formHeight: import("vue").ComputedRef<string>;
|
|
@@ -436,28 +436,24 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
436
436
|
title: string;
|
|
437
437
|
form: import("../../../../es/components/form-render").Form<any>;
|
|
438
438
|
content: any;
|
|
439
|
-
hidden: boolean;
|
|
440
|
-
active: boolean;
|
|
441
|
-
dataSource: import("../../../../es/components/form-render").FieldDataSource;
|
|
442
|
-
description: string;
|
|
443
|
-
display: import("../../../../es/components/form-render").FieldDisplayTypes;
|
|
444
|
-
mounted: boolean;
|
|
445
|
-
readonly destroyed: boolean;
|
|
446
|
-
unmounted: boolean;
|
|
447
439
|
componentProps: Record<string, any>;
|
|
448
440
|
decoratorProps: Record<string, any>;
|
|
441
|
+
display: import("../../../../es/components/form-render").FieldDisplayTypes;
|
|
442
|
+
description: string;
|
|
449
443
|
readOnly: boolean;
|
|
450
444
|
editable: boolean;
|
|
445
|
+
hidden: boolean;
|
|
451
446
|
component: import("../../../../es/components/form-render").FieldComponent<any, any>;
|
|
452
447
|
decorator: import("../../../../es/components/form-render").FieldDecorator<any, any>;
|
|
453
|
-
readPretty: boolean;
|
|
454
448
|
validating: boolean;
|
|
455
449
|
submitting: boolean;
|
|
450
|
+
active: boolean;
|
|
456
451
|
visited: boolean;
|
|
457
452
|
selfModified: boolean;
|
|
458
453
|
modified: boolean;
|
|
459
454
|
inputValue: string;
|
|
460
455
|
inputValues: any[];
|
|
456
|
+
dataSource: import("../../../../es/components/form-render").FieldDataSource;
|
|
461
457
|
feedbacks: import("../../../../es/components/form-render").IFieldFeedback[];
|
|
462
458
|
caches: import("../../../../es/components/form-render").IFieldCaches;
|
|
463
459
|
selfErrors: import("../../../../es/components/form-render").FeedbackMessage;
|
|
@@ -488,11 +484,15 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
488
484
|
queryFeedbacks: (search?: import("../../../../es/components/form-render").ISearchFeedback | undefined) => import("../../../../es/components/form-render").IFieldFeedback[];
|
|
489
485
|
modify: () => void;
|
|
490
486
|
initialized: boolean;
|
|
487
|
+
mounted: boolean;
|
|
488
|
+
unmounted: boolean;
|
|
491
489
|
decoratorType: any;
|
|
492
490
|
componentType: any;
|
|
493
491
|
designable: boolean;
|
|
494
492
|
locate: (address: import("@formily/path").Pattern) => void;
|
|
495
493
|
readonly parent: import("../../../../es/components/form-render").GeneralField;
|
|
494
|
+
readPretty: boolean;
|
|
495
|
+
readonly destroyed: boolean;
|
|
496
496
|
setTitle: (title?: string | undefined) => void;
|
|
497
497
|
setDescription: (description?: string | undefined) => void;
|
|
498
498
|
setDisplay: (type?: import("../../../../es/components/form-render").FieldDisplayTypes | undefined) => void;
|
|
@@ -576,7 +576,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
576
576
|
readonly displayDirective: "if" | "show" | "show:lazy";
|
|
577
577
|
}>;
|
|
578
578
|
NTabs: any;
|
|
579
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("
|
|
579
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("formChange" | "scroll" | "annotationChange")[], "scroll" | "formChange" | "annotationChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
580
580
|
fieldList: {
|
|
581
581
|
type: import("vue").PropType<import("../../../../es/components/form-render").FieldItem[]>;
|
|
582
582
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as r,computed as l,openBlock as
|
|
1
|
+
import{defineComponent as e,ref as r,computed as l,openBlock as t,createBlock as a,withCtx as o,renderSlot as u,nextTick as d}from"vue";import i from"./FormRender.vue.js";import s from"../../../_virtual/plugin-vue_export-helper.js";var m=s(e({__name:"FormRenderWrapper",setup(e,{expose:s}){const m=r(),n=r(0);return s({...["validate","getFormValues","setFormValues","setFieldState","resetFields","queryWidget","getFieldList"].reduce(((e,r)=>(e[r]=(...e)=>{var l;return(null==(l=m.value)?void 0:l[r]).call(l,...e)},e)),{}),formModel:l((()=>{var e;return null==(e=m.value)?void 0:e.formModel})),reload:async function(){n.value++,await d()}}),(e,r)=>(t(),a(i,{key:n.value,ref_key:"formRenderRef",ref:m},{default:o((()=>[u(e.$slots,"default")])),_:3}))}}),[["__file","FormRenderWrapper.vue"]]);export{m as default};
|
|
@@ -88,9 +88,9 @@ export declare const RADIO: import("vue").DefineComponent<{
|
|
|
88
88
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
89
89
|
}, {
|
|
90
90
|
options: AnyObject[];
|
|
91
|
-
vertical: boolean;
|
|
92
91
|
lazyRequest: boolean;
|
|
93
92
|
requestCache: boolean;
|
|
93
|
+
vertical: boolean;
|
|
94
94
|
}>;
|
|
95
95
|
export declare const CHECKBOX: import("vue").DefineComponent<{
|
|
96
96
|
value: {
|
|
@@ -180,7 +180,7 @@ export declare const CHECKBOX: import("vue").DefineComponent<{
|
|
|
180
180
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
181
181
|
}, {
|
|
182
182
|
options: AnyObject[];
|
|
183
|
-
vertical: boolean;
|
|
184
183
|
lazyRequest: boolean;
|
|
185
184
|
requestCache: boolean;
|
|
185
|
+
vertical: boolean;
|
|
186
186
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,createVNode as o,isVNode as t}from"vue";import{connect as a,mapProps as
|
|
1
|
+
import{defineComponent as e,createVNode as o,isVNode as t}from"vue";import{connect as a,mapProps as l}from"@formily/vue";import{NSpace as r,NRadio as u,NRadioGroup as i,NCheckbox as n,NCheckboxGroup as p}from"naive-ui";import"../../../index.js";import{useComplexOptions as s}from"../../hooks/useComplexOptions.js";import"../../utils/index.js";import{useAutographOptions as m}from"../../hooks/useFormRenderOptions.js";import{useCommonInjection as v}from"../../hooks/useCommonInjection.js";import{assignUpdateValue as c,createVisitedSetter as d}from"../../utils/schema.js";import{useFormField as f}from"../../hooks/useFormField.js";function y(a,l,u){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},wordbook:{type:Object},vertical:{type:Boolean,default:!1},onChange:{}},emits:["update:value"],setup(e,{emit:a}){const{field:i}=f(),{renderComplexOption:n,valueRef:p}=s(e,a),{labelKey:c,valueKey:y,fullOptions:j}=m(e,p),{injectValueBindKey:b,injectValueValidate:h}=v();h(p);const k=b(p);return()=>o(l,{key:k.value,value:p.value,"onUpdate:value":e=>p.value=e,onClick:d(i)},{default:()=>[o(r,{vertical:e.vertical,"vertical-space":e.vertical},{default:()=>{var e;return[null==(e=j.value)?void 0:e.map((e=>{let a;return o(u,{key:e[y.value],value:e[y.value],disabled:e.disabled},"function"==typeof(l=a=n({value:p.value,option:e,valueKey:y.value,labelKey:c.value}))||"[object Object]"===Object.prototype.toString.call(l)&&!t(l)?a:{default:()=>[a]});var l}))]}})]})}})}const j=a(y("FormRadio",i,u),l({dataSource:"options"},c)),b=a(y("FormCheckbox",p,n),l({dataSource:"options"},c));export{b as CHECKBOX,j as RADIO};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as o,inject as t,ref as a,createVNode as r}from"vue";import{useDebounceFn as l}from"@vueuse/core";import{cloneDeep as s,isString as i}from"lodash-es";import{useCommonInjection as n,useSelectOptionProps as u}from"../../hooks/useCommonInjection.js";import{InjectionChangeContextCollector as p}from"../../constants/index.js";import"../../../../../shared/utils/index.js";import"../../../index.js";import"../../utils/index.js";import{useFormField as m}from"../../hooks/useFormField.js";import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import"../../hooks/useFormValidator.js";import"@formily/core";import"date-fns";import"@formily/reactive";import{connect as c,mapProps as d}from"@formily/vue";import"@vue/shared";import"./index.js";import{useUrlConfigOptions as y,useAutographOptions as v,useRecommendOptions as f,searchContentMatcher as h}from"../../hooks/useFormRenderOptions.js";import{NSelect as j}from"naive-ui";import{createVisitedSetter as b,assignUpdateValue as k,assignClearBindVisited as S}from"../../utils/schema.js";const g=c(e({name:"FormSelect",props:{value:{type:[String,Array]},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},onChange:{},allowCreate:Boolean,urlConfig:{type:Object},autograph:{type:String},wordbook:{type:Object},recommend:{type:Boolean,default:!1},commonList:{type:Array},recentList:{type:Array},getRecommendInfo:{type:Function},recommendNum:{type:Number,default:10},recommendCache:{type:Boolean,default:!1}},emits:["update:value","postRecommend"],setup(e,{slots:c,emit:d}){const k=o({get:()=>e.value,async set(e){d("update:value",e),
|
|
1
|
+
import{defineComponent as e,computed as o,inject as t,ref as a,createVNode as r}from"vue";import{useDebounceFn as l}from"@vueuse/core";import{cloneDeep as s,isString as i}from"lodash-es";import{useCommonInjection as n,useSelectOptionProps as u}from"../../hooks/useCommonInjection.js";import{InjectionChangeContextCollector as p}from"../../constants/index.js";import"../../../../../shared/utils/index.js";import"../../../index.js";import"../../utils/index.js";import{useFormField as m}from"../../hooks/useFormField.js";import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import"../../hooks/useFormValidator.js";import"@formily/core";import"date-fns";import"@formily/reactive";import{connect as c,mapProps as d}from"@formily/vue";import"@vue/shared";import"./index.js";import{useUrlConfigOptions as y,useAutographOptions as v,useRecommendOptions as f,searchContentMatcher as h}from"../../hooks/useFormRenderOptions.js";import{NSelect as j}from"naive-ui";import{createVisitedSetter as b,assignUpdateValue as k,assignClearBindVisited as S}from"../../utils/schema.js";const g=c(e({name:"FormSelect",props:{value:{type:[String,Array]},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},onChange:{},allowCreate:Boolean,urlConfig:{type:Object},autograph:{type:String},wordbook:{type:Object},recommend:{type:Boolean,default:!1},commonList:{type:Array},recentList:{type:Array},getRecommendInfo:{type:Function},recommendNum:{type:Number,default:10},recommendCache:{type:Boolean,default:!1}},emits:["update:value","postRecommend"],setup(e,{slots:c,emit:d}){const k=o({get:()=>e.value,async set(e){d("update:value",e),C(e)}}),{labelKey:S,valueKey:g,fetchData:A,fullOptions:F,filterOptions:H}=e.urlConfig?y(e,k):v(e,k),{getRecommend:B,postRecommend:C,sortedOptions:x}=f(e,H,d,S,g),{field:O,fieldKey:R}=m();t(p).setContext(R.value,(e=>{return{currentOption:s((o=e,F.value.find((e=>e[g.value]===o))))};var o}));const L=a(""),V=l((async(e="")=>{L.value=e,A(e),B(e)}),300),{injectValueValidate:w,injectValueWatchFromEmpty:K,injectValueBindKey:P}=n();K(k,V),w(k);const W=P(k),{menuProps:q,nodeProps:I}=u();function N(e){const o=e[S.value];if(!o||!i(o))return"";const t=h(L.value,o);return t?r("section",null,[t.map(((e,o)=>0!==o&&e?r("span",{style:{color:o%2==0?"var(--n-option-text-color-active)":""}},[e]):null))]):o}const U=o((()=>x.value.length||!e.allowCreate?x.value:L.value?[{[S.value]:L.value,[g.value]:L.value},...x.value]:x.value));return()=>r(j,{key:W.value,remote:!0,filterable:!0,value:k.value,"onUpdate:value":e=>k.value=e,"menu-props":q,"node-props":I,labelField:S.value,valueField:g.value,options:U.value,onSearch:V,"onUpdate:show":e=>e&&V(),onFocus:b(O),renderLabel:N},c)}}),d({dataSource:"options"},k,S));export{g as SELECT};
|
|
@@ -3,7 +3,7 @@ import { FieldItem } from '../types';
|
|
|
3
3
|
/**
|
|
4
4
|
* @description 胶水层, 将低代码平台中的fieldList转换为JSONSchema
|
|
5
5
|
*/
|
|
6
|
-
export declare function useFieldListAdaptor(collector
|
|
6
|
+
export declare function useFieldListAdaptor(collector?: BusinessCollector): {
|
|
7
7
|
schemaAdaptor: (fieldList: FieldItem[]) => Record<string, import("@formily/json-schema/esm/types").Stringify<{
|
|
8
8
|
[key: symbol]: any;
|
|
9
9
|
[key: `x-${string}`]: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,pick as n}from"lodash-es";import"../../index.js";import{parseNumberFromMaybeString as 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 d(d){const{createValidatorSchema:u}=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=u(e);return r&&(n["x-validator"]=r),"0"===e.is_null&&(n.required=!0),n},f=e=>{const
|
|
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 d(d){const{createValidatorSchema:u}=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=u(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="0"===e.multi_select;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}],["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)?O(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:O(n)}),r},{FieldNormalizeWaterfallHook:C}=s();function O(o){let n=null;return o.reduce(((e,o,s)=>{var a;const p=null==(a=(o=C.call(t(o))).validate)?void 0:a.obj_type;return p&&d&&d.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:O}}export{d as useFieldListAdaptor};
|
|
@@ -23,7 +23,8 @@ export declare function useUrlConfigOptions(props: {
|
|
|
23
23
|
}, valueRef: Ref): {
|
|
24
24
|
labelKey: import("vue").ComputedRef<string>;
|
|
25
25
|
valueKey: import("vue").ComputedRef<string>;
|
|
26
|
-
|
|
26
|
+
filterOptions: import("vue").ComputedRef<AnyObject[]>;
|
|
27
|
+
fullOptions: import("vue").ComputedRef<AnyObject[]>;
|
|
27
28
|
fetchData: (content?: string) => Promise<null | undefined>;
|
|
28
29
|
};
|
|
29
30
|
export declare function useAutographOptions(props: {
|
|
@@ -35,6 +36,7 @@ export declare function useAutographOptions(props: {
|
|
|
35
36
|
}, valueRef: Ref): {
|
|
36
37
|
labelKey: import("vue").ComputedRef<string>;
|
|
37
38
|
valueKey: import("vue").ComputedRef<string>;
|
|
38
|
-
|
|
39
|
+
filterOptions: import("vue").ComputedRef<AnyObject[]>;
|
|
40
|
+
fullOptions: import("vue").ComputedRef<AnyObject[]>;
|
|
39
41
|
fetchData: (content?: string) => Promise<null | undefined>;
|
|
40
42
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{checkInSetupEnv as e,jsonParse as n}from"../../../../shared/utils/index.js";import{useMemoize as t,useDebounceFn as
|
|
1
|
+
import{checkInSetupEnv as e,jsonParse as n}from"../../../../shared/utils/index.js";import{useMemoize as t,useDebounceFn as o}from"@vueuse/core";import{identity as r,isString as u,isEqual as l,omit as a,isFunction as i}from"lodash-es";import{computed as c,inject as s,ref as v,watch as m}from"vue";import"../../index.js";import{InjectionAsyncQueue as d,InjectionFormItemDepsCollector as f}from"../constants/index.js";import{createUrlConfigParams as y,formRenderLog as p,keywordMatcher as h}from"../utils/index.js";import{useFormField as g}from"./useFormField.js";import{useFormRequest as w}from"./useFormRequest.js";function k(e,n){const t=v();return c({get:()=>t.value?t.value:e[n],set(e){t.value=e}})}const R=(()=>{const e=new Map,n=t((e=>new RegExp(`(.*)${e.split("").map((e=>`(${e})`)).join("(.*)")}(.*)`)),{getKey:r});return(t,o)=>{const r=e.get(t)||{};return e.set(t,r),Reflect.has(r,o)?r[o]:r[o]=o.match(n(t))}})();function C(){const e=v();return{searchContent:e,optionSearchFilter:function(n,t){return e.value?n.filter((n=>function(n,t){if(!e.value)return!0;const o=n?n[t]:"";return!!u(o)&&(!!R(e.value,o)||h(e.value,n.keyword))}(n,t))):n}}}function b(e,t,o,r,u){const l=k(e,"commonList"),v=k(e,"recentList"),{searchContent:m,optionSearchFilter:f}=C();function y(e){return n(e.itemObj)}const p=c((()=>{var e,n;return null!=(n=null==(e=l.value)?void 0:e.map(y))?n:[]})),h=c((()=>{var e,n;return null!=(n=null==(e=v.value)?void 0:e.map(y))?n:[]})),R=c((()=>{if(!e.recommend||!p.value.length&&!h.value.length)return t.value;const n=t.value.filter((e=>{return p.value.every(n)&&h.value.every(n);function n(n){return n[u.value]!==e[u.value]}}));return[...f(p.value,r.value),...f(h.value,r.value),...n]})),{getRecommendRequestInfo:b,getHttpInstance:K}=w();function j(n){const{url:t,getRecommendIds:o}=b(),r=i(o)?o():{},u=i(e.getRecommendInfo)?e.getRecommendInfo():{};return{url:t[n],info:Object.assign({},r,u)}}const{fieldKey:O}=g(),q=s(d);return{postRecommend:async function(n){if(!e.recommend)return;const t=K();if(!t)return;const{url:r,info:l}=j("post"),a=R.value.find((e=>e[u.value]===n));a&&o("postRecommend",await t.post(r,{...l,keyword:"",itemId:u.value,itemObj:JSON.stringify(a)}))},getRecommend:async function(n){if(!e.recommend)return;if(m.value=n,l.value&&v.value&&e.recommendCache)return;const t=await q.addAsync(function(n,t){const{url:o,info:r}=j("get");return{url:o,method:"get",key:n,cache:t,params:{...r,recNum:e.recommendNum,keyword:""}}}(O.value,e.recommendCache)),{commonly:o,recently:r}=t.reduce(((e,n)=>("commonly"===n.type?e.commonly.push(a(n,["type"])):"recently"===n.type&&e.recently.push(a(n,["type"])),e)),{commonly:[],recently:[]});l.value=o,v.value=r},sortedOptions:R}}function K(n,t){e();const r=s(d),a=c((()=>{var e,t;return null!=(t=null==(e=n.urlConfig)?void 0:e.nameKey)?t:"text"})),i=c((()=>{var e,t;return null!=(t=null==(e=n.urlConfig)?void 0:e.valueKey)?t:"value"})),{searchContent:h,optionSearchFilter:w}=C(),k=v(null),{field:R,fieldKey:b}=g(),K=o((async function(e){if(h.value=e||"",!n.urlConfig)return k.value=null;try{k.value=await r.addAsync(await y({config:n.urlConfig,cache:n.requestCache,field:R.value}))}catch(e){u(e)&&p(e)}}),300),j=c((()=>k.value?w(k.value,a.value):Array.isArray(n.options)?w(n.options,a.value):[])),O=c((()=>k.value||n.options||[])),q=s(f);return m((()=>n.urlConfig),((e,o)=>{l(e,o)||(k.value=null,e&&(q.setDeps(b.value,e.dependKey||[],(async()=>{k.value=null,t.value=null,!n.lazyRequest&&await K()})),(t.value||!n.lazyRequest)&&K()))}),{immediate:!0}),{labelKey:a,valueKey:i,filterOptions:j,fullOptions:O,fetchData:K}}function j(n,t){e();const r=s(d),a=c((()=>{var e,t,o;return null!=(o=null==(t=null==(e=n.wordbook)?void 0:e.render_key)?void 0:t[0])?o:"text"})),i=c((()=>{var e,t;return null!=(t=null==(e=n.wordbook)?void 0:e.value_key)?t:"value"})),{searchContent:f,optionSearchFilter:y}=C(),h=v(null),{fieldKey:k}=g(),{getSearchRequestInfo:R}=w(),b=o((async function(e){if(f.value=e||"",!n.autograph||!n.wordbook)return h.value=null;try{h.value=await r.addAsync(function(e,t,o){const r={autograph:t,wordbookId:e.id,wordbookType:e.type,fieldKeys:e.search_key,keyword:"",page:1};return{...R(),params:r,key:o,cache:n.requestCache}}(n.wordbook,n.autograph,k.value))}catch(e){u(e)&&p(e)}}),300),K=c((()=>h.value?y(h.value,a.value):Array.isArray(n.options)?y(n.options,a.value):[])),j=c((()=>h.value||n.options||[]));return m((()=>n.wordbook),((e,o)=>{l(e,o)||(h.value=null,e&&(t.value||!n.lazyRequest)&&b())}),{immediate:!0}),{labelKey:a,valueKey:i,filterOptions:K,fullOptions:j,fetchData:b}}export{R as searchContentMatcher,j as useAutographOptions,b as useRecommendOptions,K as useUrlConfigOptions};
|