cnhis-design-vue 3.1.52-beta.0 → 3.1.52-beta.10
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/body-select/index.d.ts +47 -0
- package/es/components/body-select/index.js +1 -0
- package/es/components/body-select/src/config/index.d.ts +101 -0
- package/es/components/body-select/src/config/index.js +1 -0
- package/es/components/body-select/src/hooks/renderCanvas.d.ts +6 -0
- package/es/components/body-select/src/hooks/renderCanvas.js +1 -0
- package/es/components/body-select/src/index.vue.d.ts +48 -0
- package/es/components/body-select/src/index.vue.js +1 -0
- package/es/components/body-select/src/index.vue2.js +1 -0
- package/es/components/body-select/style/index.css +1 -0
- package/es/components/callback/src/components/render/popupMaps.d.ts +1 -1
- package/es/components/classification/index.d.ts +40 -6
- package/es/components/classification/src/components/search-filter/index.vue.d.ts +40 -6
- package/es/components/classification/src/components/set-classification/index.vue.d.ts +40 -6
- package/es/components/classification/src/index.vue.d.ts +40 -6
- package/es/components/date-picker/index.d.ts +20 -3
- package/es/components/date-picker/src/DatePicker.vue.d.ts +20 -3
- package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
- package/es/components/form-config/index.d.ts +9 -2
- package/es/components/form-config/src/FormConfig.vue.d.ts +9 -2
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +1 -1
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +4 -1
- package/es/components/form-render/index.d.ts +1 -1
- package/es/components/form-render/src/FormRender.vue.d.ts +1 -1
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +1 -1
- package/es/components/form-render/src/components/renderer/formItem.js +1 -1
- package/es/components/form-render/src/components/renderer/radio&checkbox.d.ts +18 -0
- package/es/components/form-render/src/components/renderer/radio_checkbox.js +1 -1
- package/es/components/form-render/src/hooks/useComplexOptions.d.ts +2 -1
- package/es/components/form-render/src/hooks/useComplexOptions.js +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/form-render/src/hooks/useFormEvent.d.ts +2 -2
- package/es/components/form-render/src/hooks/useFormEvent.js +1 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +1 -0
- package/es/components/form-render/src/types/index.d.ts +2 -2
- package/es/components/form-render/style/index.css +1 -1
- package/es/components/iho-table/src/plugins/defaultValuePlugin.js +1 -1
- package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue.d.ts +20 -3
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +20 -3
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useAutoFocus.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -1
- package/es/components/index.css +1 -1
- package/es/components/index.d.ts +2 -1
- package/es/components/index.js +1 -1
- package/es/components/info-header/index.d.ts +2 -2
- package/es/components/info-header/src/InfoHeader.vue.d.ts +2 -2
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +1 -1
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +1 -1
- package/es/components/recommend-search/index.d.ts +1 -1
- package/es/components/recommend-search/src/RecommendSearch.vue.d.ts +1 -1
- package/es/components/recommend-search/src/components/RecommendInput.vue.d.ts +1 -1
- package/es/components/scale-view/src/components/formitem/r-map.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-computed.js +1 -1
- package/es/components/scale-view/style/index.css +1 -1
- package/es/components/select-person/src/SearchOrgAndStaff.vue2.js +1 -1
- package/es/components/shortcut-setter/index.d.ts +2 -1
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +2 -1
- package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +40 -6
- package/es/components/table-filter/src/components/classify-filter/components/Date.vue.d.ts +20 -3
- package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue.d.ts +20 -3
- package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +40 -6
- package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +40 -6
- package/es/components/table-filter/src/components/render-widget/components/DateInner.vue.d.ts +20 -3
- package/es/components/table-filter/src/components/render-widget/components/DateOut.vue.d.ts +20 -3
- package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue.d.ts +20 -3
- package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue.d.ts +20 -3
- package/es/components/table-filter/src/components/render-widget/components/index.d.ts +80 -12
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +80 -12
- package/es/components/time-picker/src/TimePicker.vue2.js +1 -1
- package/es/shared/components/InputNumberSlash/InputNumberSlash.d.ts +9 -0
- package/es/shared/components/InputNumberSlash/InputNumberSlash.js +1 -1
- package/es/shared/hooks/useDateTime.d.ts +7 -2
- package/es/shared/hooks/useDateTime.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
|
@@ -804,6 +804,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
804
804
|
onConfirm: {
|
|
805
805
|
type: FunctionConstructor;
|
|
806
806
|
};
|
|
807
|
+
formattedValue: {
|
|
808
|
+
type: StringConstructor;
|
|
809
|
+
};
|
|
807
810
|
}, {
|
|
808
811
|
attrs: {
|
|
809
812
|
[x: string]: unknown;
|
|
@@ -815,9 +818,17 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
815
818
|
onConfirm: {
|
|
816
819
|
type: FunctionConstructor;
|
|
817
820
|
};
|
|
818
|
-
|
|
821
|
+
formattedValue: {
|
|
822
|
+
type: StringConstructor;
|
|
823
|
+
};
|
|
824
|
+
}>> & {
|
|
825
|
+
"onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
|
|
826
|
+
}>>;
|
|
827
|
+
emit: (event: "update:formatted-value", ...args: any[]) => void;
|
|
819
828
|
datePickerRef: import("vue").Ref<import("../..").AnyObject | null>;
|
|
820
829
|
panelInstRef: import("vue").Ref<null>;
|
|
830
|
+
placeholder: import("vue").Ref<any>;
|
|
831
|
+
currentFormattedValue: import("vue").WritableComputedRef<string | undefined>;
|
|
821
832
|
isDateTime: import("vue").ComputedRef<boolean>;
|
|
822
833
|
formatRef: import("vue").ComputedRef<string>;
|
|
823
834
|
panelFormatRef: import("vue").ComputedRef<string | [string, string]>;
|
|
@@ -826,15 +837,21 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
826
837
|
handleConfirm: (target: HTMLInputElement) => void;
|
|
827
838
|
onUpdateShow: (show: boolean) => void;
|
|
828
839
|
onConfirm: (...args: any[]) => Promise<void>;
|
|
840
|
+
isOtherValue: (value?: string) => boolean;
|
|
829
841
|
NDatePicker: any;
|
|
830
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
842
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:formatted-value"[], "update:formatted-value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
831
843
|
updateUnchangedValue: {
|
|
832
844
|
type: BooleanConstructor;
|
|
833
845
|
};
|
|
834
846
|
onConfirm: {
|
|
835
847
|
type: FunctionConstructor;
|
|
836
848
|
};
|
|
837
|
-
|
|
849
|
+
formattedValue: {
|
|
850
|
+
type: StringConstructor;
|
|
851
|
+
};
|
|
852
|
+
}>> & {
|
|
853
|
+
"onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
|
|
854
|
+
}, {
|
|
838
855
|
updateUnchangedValue: boolean;
|
|
839
856
|
}>>;
|
|
840
857
|
NSelect: any;
|
|
@@ -1397,6 +1414,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1397
1414
|
onConfirm: {
|
|
1398
1415
|
type: FunctionConstructor;
|
|
1399
1416
|
};
|
|
1417
|
+
formattedValue: {
|
|
1418
|
+
type: StringConstructor;
|
|
1419
|
+
};
|
|
1400
1420
|
}, {
|
|
1401
1421
|
attrs: {
|
|
1402
1422
|
[x: string]: unknown;
|
|
@@ -1408,9 +1428,17 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1408
1428
|
onConfirm: {
|
|
1409
1429
|
type: FunctionConstructor;
|
|
1410
1430
|
};
|
|
1411
|
-
|
|
1431
|
+
formattedValue: {
|
|
1432
|
+
type: StringConstructor;
|
|
1433
|
+
};
|
|
1434
|
+
}>> & {
|
|
1435
|
+
"onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
|
|
1436
|
+
}>>;
|
|
1437
|
+
emit: (event: "update:formatted-value", ...args: any[]) => void;
|
|
1412
1438
|
datePickerRef: import("vue").Ref<import("../..").AnyObject | null>;
|
|
1413
1439
|
panelInstRef: import("vue").Ref<null>;
|
|
1440
|
+
placeholder: import("vue").Ref<any>;
|
|
1441
|
+
currentFormattedValue: import("vue").WritableComputedRef<string | undefined>;
|
|
1414
1442
|
isDateTime: import("vue").ComputedRef<boolean>;
|
|
1415
1443
|
formatRef: import("vue").ComputedRef<string>;
|
|
1416
1444
|
panelFormatRef: import("vue").ComputedRef<string | [string, string]>;
|
|
@@ -1419,15 +1447,21 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1419
1447
|
handleConfirm: (target: HTMLInputElement) => void;
|
|
1420
1448
|
onUpdateShow: (show: boolean) => void;
|
|
1421
1449
|
onConfirm: (...args: any[]) => Promise<void>;
|
|
1450
|
+
isOtherValue: (value?: string) => boolean;
|
|
1422
1451
|
NDatePicker: any;
|
|
1423
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
1452
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:formatted-value"[], "update:formatted-value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
1424
1453
|
updateUnchangedValue: {
|
|
1425
1454
|
type: BooleanConstructor;
|
|
1426
1455
|
};
|
|
1427
1456
|
onConfirm: {
|
|
1428
1457
|
type: FunctionConstructor;
|
|
1429
1458
|
};
|
|
1430
|
-
|
|
1459
|
+
formattedValue: {
|
|
1460
|
+
type: StringConstructor;
|
|
1461
|
+
};
|
|
1462
|
+
}>> & {
|
|
1463
|
+
"onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
|
|
1464
|
+
}, {
|
|
1431
1465
|
updateUnchangedValue: boolean;
|
|
1432
1466
|
}>>;
|
|
1433
1467
|
WidgetValEnums: {
|
|
@@ -6,6 +6,9 @@ declare const DatePicker: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
6
6
|
onConfirm: {
|
|
7
7
|
type: FunctionConstructor;
|
|
8
8
|
};
|
|
9
|
+
formattedValue: {
|
|
10
|
+
type: StringConstructor;
|
|
11
|
+
};
|
|
9
12
|
}, {
|
|
10
13
|
attrs: {
|
|
11
14
|
[x: string]: unknown;
|
|
@@ -17,9 +20,17 @@ declare const DatePicker: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
17
20
|
onConfirm: {
|
|
18
21
|
type: FunctionConstructor;
|
|
19
22
|
};
|
|
20
|
-
|
|
23
|
+
formattedValue: {
|
|
24
|
+
type: StringConstructor;
|
|
25
|
+
};
|
|
26
|
+
}>> & {
|
|
27
|
+
"onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
|
|
28
|
+
}>>;
|
|
29
|
+
emit: (event: "update:formatted-value", ...args: any[]) => void;
|
|
21
30
|
datePickerRef: import("vue").Ref<import("../../../es/shared/types").AnyObject | null>;
|
|
22
31
|
panelInstRef: import("vue").Ref<null>;
|
|
32
|
+
placeholder: import("vue").Ref<any>;
|
|
33
|
+
currentFormattedValue: import("vue").WritableComputedRef<string | undefined>;
|
|
23
34
|
isDateTime: import("vue").ComputedRef<boolean>;
|
|
24
35
|
formatRef: import("vue").ComputedRef<string>;
|
|
25
36
|
panelFormatRef: import("vue").ComputedRef<string | [string, string]>;
|
|
@@ -28,15 +39,21 @@ declare const DatePicker: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
28
39
|
handleConfirm: (target: HTMLInputElement) => void;
|
|
29
40
|
onUpdateShow: (show: boolean) => void;
|
|
30
41
|
onConfirm: (...args: any[]) => Promise<void>;
|
|
42
|
+
isOtherValue: (value?: string) => boolean;
|
|
31
43
|
NDatePicker: any;
|
|
32
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
44
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:formatted-value"[], "update:formatted-value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
33
45
|
updateUnchangedValue: {
|
|
34
46
|
type: BooleanConstructor;
|
|
35
47
|
};
|
|
36
48
|
onConfirm: {
|
|
37
49
|
type: FunctionConstructor;
|
|
38
50
|
};
|
|
39
|
-
|
|
51
|
+
formattedValue: {
|
|
52
|
+
type: StringConstructor;
|
|
53
|
+
};
|
|
54
|
+
}>> & {
|
|
55
|
+
"onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
|
|
56
|
+
}, {
|
|
40
57
|
updateUnchangedValue: boolean;
|
|
41
58
|
}>>;
|
|
42
59
|
export default DatePicker;
|
|
@@ -6,6 +6,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
6
6
|
onConfirm: {
|
|
7
7
|
type: FunctionConstructor;
|
|
8
8
|
};
|
|
9
|
+
formattedValue: {
|
|
10
|
+
type: StringConstructor;
|
|
11
|
+
};
|
|
9
12
|
}, {
|
|
10
13
|
attrs: {
|
|
11
14
|
[x: string]: unknown;
|
|
@@ -17,9 +20,17 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
17
20
|
onConfirm: {
|
|
18
21
|
type: FunctionConstructor;
|
|
19
22
|
};
|
|
20
|
-
|
|
23
|
+
formattedValue: {
|
|
24
|
+
type: StringConstructor;
|
|
25
|
+
};
|
|
26
|
+
}>> & {
|
|
27
|
+
"onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
|
|
28
|
+
}>>;
|
|
29
|
+
emit: (event: "update:formatted-value", ...args: any[]) => void;
|
|
21
30
|
datePickerRef: import("vue").Ref<AnyObject | null>;
|
|
22
31
|
panelInstRef: import("vue").Ref<null>;
|
|
32
|
+
placeholder: import("vue").Ref<any>;
|
|
33
|
+
currentFormattedValue: import("vue").WritableComputedRef<string | undefined>;
|
|
23
34
|
isDateTime: import("vue").ComputedRef<boolean>;
|
|
24
35
|
formatRef: import("vue").ComputedRef<string>;
|
|
25
36
|
panelFormatRef: import("vue").ComputedRef<string | [string, string]>;
|
|
@@ -28,15 +39,21 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
28
39
|
handleConfirm: (target: HTMLInputElement) => void;
|
|
29
40
|
onUpdateShow: (show: boolean) => void;
|
|
30
41
|
onConfirm: (...args: any[]) => Promise<void>;
|
|
42
|
+
isOtherValue: (value?: string) => boolean;
|
|
31
43
|
NDatePicker: any;
|
|
32
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
44
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:formatted-value"[], "update:formatted-value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
33
45
|
updateUnchangedValue: {
|
|
34
46
|
type: BooleanConstructor;
|
|
35
47
|
};
|
|
36
48
|
onConfirm: {
|
|
37
49
|
type: FunctionConstructor;
|
|
38
50
|
};
|
|
39
|
-
|
|
51
|
+
formattedValue: {
|
|
52
|
+
type: StringConstructor;
|
|
53
|
+
};
|
|
54
|
+
}>> & {
|
|
55
|
+
"onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
|
|
56
|
+
}, {
|
|
40
57
|
updateUnchangedValue: boolean;
|
|
41
58
|
}>;
|
|
42
59
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,useAttrs as
|
|
1
|
+
import{defineComponent as e,useAttrs as t,ref as a,computed as l,watch as n,openBlock as u,createBlock as r,unref as o,mergeProps as i,isRef as d,createSlots as s,renderList as f,withCtx as m,renderSlot as p,nextTick as v}from"vue";import{NDatePicker as c}from"naive-ui";import"../../../shared/utils/index.js";import"lodash-es";import{useDateTime as y}from"../../../shared/hooks/useDateTime.js";import{format as h}from"date-fns";var g=e({__name:"DatePicker",props:{updateUnchangedValue:{type:Boolean},onConfirm:{type:Function},formattedValue:{type:String}},emits:["update:formatted-value"],setup(e,{expose:g,emit:R}){const M=e,V=t(),k=a(null),w=a(null),C=a(),D=l({get:()=>j(M.formattedValue)?void 0:M.formattedValue,set(e){R("update:formatted-value",e,e?Date.parse(e):null)}}),$=l((()=>{const e=Reflect.get(V,"type")||"";return["datetime","datetimerange"].includes(e)})),E=l((()=>{if(Reflect.get(V,"format"))return V.format;const e=V.type||"";return $.value?"yyyy-MM-dd HH:mm:ss":"month"===e?"yyyy-MM":"year"===e?"yyyy":"yyyy-MM-dd"})),I=l((()=>$.value?E.value.split(" "):"")),{focus:P,blur:U,handleConfirm:_}=y(k,{formatRef:E,attrs:V,emit:R});function b(e){e&&$.value&&v((()=>{var e;w.value=null==(e=k.value)?void 0:e.panelInstRef,y(w,{formatRef:I,attrs:V,isPanel:!0})}))}async function x(...e){var t,a,l,n,u,r;const o=Reflect.get(V,"type")||"",i=null==(n=null==(l=null==(a=null==(t=k.value)?void 0:t.inputInstRef)?void 0:a.$el)?void 0:l.querySelector)?void 0:n.call(l,"input");if(o.includes("range")?null==(u=M.onConfirm)||u.call(M,...e):(await v(),i.focus(),_(i),i.blur(),null==(r=M.onConfirm)||r.call(M,Date.parse(i.value),i.value)),!(null==i?void 0:i.value)||!M.updateUnchangedValue||o.includes("range"))return;const d=i.value;i.value=h(new Date,E.value),i.dispatchEvent(new InputEvent("input")),i.value=d,i.dispatchEvent(new InputEvent("input"))}function j(e=""){return["-"].includes(e)}return n((()=>M.formattedValue),(e=>{C.value=j(e)?e:V.placeholder?V.placeholder:"选择日期时间"}),{immediate:!0}),g({$datePicker:k,focus:P,blur:U}),(e,t)=>(u(),r(o(c),i({ref_key:"datePickerRef",ref:k},e.$attrs,{"onUpdate:show":b,onConfirm:x,placeholder:C.value,"formatted-value":o(D),"onUpdate:formatted-value":t[0]||(t[0]=e=>d(D)?D.value=e:null)}),s({_:2},[f(e.$slots,((t,a)=>({name:a,fn:m((()=>[p(e.$slots,a)]))})))]),1040,["placeholder","formatted-value"]))}});export{g as default};
|
|
@@ -1931,6 +1931,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
1931
1931
|
"vector-effect"?: import("csstype").VectorEffectProperty | undefined;
|
|
1932
1932
|
} | undefined;
|
|
1933
1933
|
childFieldStrategy?: "checked" | "all" | undefined;
|
|
1934
|
+
childWidthMode?: "inner" | "outer" | undefined;
|
|
1934
1935
|
validator?: ((value: unknown, fieldItem: import("..").FieldItem) => string | void) | undefined;
|
|
1935
1936
|
reactions?: {
|
|
1936
1937
|
[x: string]: any;
|
|
@@ -3665,6 +3666,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
3665
3666
|
"vector-effect"?: import("csstype").VectorEffectProperty | undefined;
|
|
3666
3667
|
} | undefined;
|
|
3667
3668
|
childFieldStrategy?: "checked" | "all" | undefined;
|
|
3669
|
+
childWidthMode?: "inner" | "outer" | undefined;
|
|
3668
3670
|
validator?: ((value: unknown, fieldItem: import("..").FieldItem) => string | void) | undefined;
|
|
3669
3671
|
reactions?: {
|
|
3670
3672
|
[x: string]: any;
|
|
@@ -5424,6 +5426,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
5424
5426
|
"vector-effect"?: import("csstype").VectorEffectProperty | undefined;
|
|
5425
5427
|
} | undefined;
|
|
5426
5428
|
childFieldStrategy?: "checked" | "all" | undefined;
|
|
5429
|
+
childWidthMode?: "inner" | "outer" | undefined;
|
|
5427
5430
|
validator?: ((value: unknown, fieldItem: import("..").FieldItem) => string | void) | undefined;
|
|
5428
5431
|
reactions?: {
|
|
5429
5432
|
[x: string]: any;
|
|
@@ -7158,6 +7161,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
7158
7161
|
"vector-effect"?: import("csstype").VectorEffectProperty | undefined;
|
|
7159
7162
|
} | undefined;
|
|
7160
7163
|
childFieldStrategy?: "checked" | "all" | undefined;
|
|
7164
|
+
childWidthMode?: "inner" | "outer" | undefined;
|
|
7161
7165
|
validator?: ((value: unknown, fieldItem: import("..").FieldItem) => string | void) | undefined;
|
|
7162
7166
|
reactions?: {
|
|
7163
7167
|
[x: string]: any;
|
|
@@ -7842,7 +7846,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
7842
7846
|
onKeydown: (event: KeyboardEvent) => Promise<void>;
|
|
7843
7847
|
clearSpan: (uuid: string) => void;
|
|
7844
7848
|
exposeEvent: {
|
|
7845
|
-
validate(path?: string, { force }?: {
|
|
7849
|
+
validate(path?: string | ((field: import("@formily/core").Field<any, any, any, any>) => boolean), { force }?: {
|
|
7846
7850
|
force?: boolean | undefined;
|
|
7847
7851
|
}): Promise<void>;
|
|
7848
7852
|
getFormValues(needCombineExtendKey?: boolean): any;
|
|
@@ -10164,6 +10168,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
10164
10168
|
"vector-effect"?: import("csstype").VectorEffectProperty | undefined;
|
|
10165
10169
|
} | undefined;
|
|
10166
10170
|
childFieldStrategy?: "checked" | "all" | undefined;
|
|
10171
|
+
childWidthMode?: "inner" | "outer" | undefined;
|
|
10167
10172
|
validator?: ((value: unknown, fieldItem: import("..").FieldItem) => string | void) | undefined;
|
|
10168
10173
|
reactions?: {
|
|
10169
10174
|
[x: string]: any;
|
|
@@ -11909,6 +11914,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
11909
11914
|
"vector-effect"?: import("csstype").VectorEffectProperty | undefined;
|
|
11910
11915
|
} | undefined;
|
|
11911
11916
|
childFieldStrategy?: "checked" | "all" | undefined;
|
|
11917
|
+
childWidthMode?: "inner" | "outer" | undefined;
|
|
11912
11918
|
validator?: ((value: unknown, fieldItem: import("..").FieldItem) => string | void) | undefined;
|
|
11913
11919
|
reactions?: {
|
|
11914
11920
|
[x: string]: any;
|
|
@@ -13627,6 +13633,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
13627
13633
|
"vector-effect"?: import("csstype").VectorEffectProperty | undefined;
|
|
13628
13634
|
} | undefined;
|
|
13629
13635
|
childFieldStrategy?: "checked" | "all" | undefined;
|
|
13636
|
+
childWidthMode?: "inner" | "outer" | undefined;
|
|
13630
13637
|
validator?: ((value: unknown, fieldItem: import("..").FieldItem) => string | void) | undefined;
|
|
13631
13638
|
reactions?: {
|
|
13632
13639
|
[x: string]: any;
|
|
@@ -14229,7 +14236,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
14229
14236
|
onKeydown: (event: KeyboardEvent) => Promise<void>;
|
|
14230
14237
|
clearSpan: (uuid: string) => void;
|
|
14231
14238
|
exposeEvent: {
|
|
14232
|
-
validate(path?: string, { force }?: {
|
|
14239
|
+
validate(path?: string | ((field: import("@formily/core").Field<any, any, any, any>) => boolean), { force }?: {
|
|
14233
14240
|
force?: boolean | undefined;
|
|
14234
14241
|
}): Promise<void>;
|
|
14235
14242
|
getFormValues(needCombineExtendKey?: boolean): any;
|
|
@@ -1933,6 +1933,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1933
1933
|
"vector-effect"?: import("csstype").VectorEffectProperty | undefined;
|
|
1934
1934
|
} | undefined;
|
|
1935
1935
|
childFieldStrategy?: "checked" | "all" | undefined;
|
|
1936
|
+
childWidthMode?: "inner" | "outer" | undefined;
|
|
1936
1937
|
validator?: ((value: unknown, fieldItem: import("../../../../es/components/form-render").FieldItem) => string | void) | undefined;
|
|
1937
1938
|
reactions?: {
|
|
1938
1939
|
[x: string]: any;
|
|
@@ -3667,6 +3668,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3667
3668
|
"vector-effect"?: import("csstype").VectorEffectProperty | undefined;
|
|
3668
3669
|
} | undefined;
|
|
3669
3670
|
childFieldStrategy?: "checked" | "all" | undefined;
|
|
3671
|
+
childWidthMode?: "inner" | "outer" | undefined;
|
|
3670
3672
|
validator?: ((value: unknown, fieldItem: import("../../../../es/components/form-render").FieldItem) => string | void) | undefined;
|
|
3671
3673
|
reactions?: {
|
|
3672
3674
|
[x: string]: any;
|
|
@@ -5426,6 +5428,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
5426
5428
|
"vector-effect"?: import("csstype").VectorEffectProperty | undefined;
|
|
5427
5429
|
} | undefined;
|
|
5428
5430
|
childFieldStrategy?: "checked" | "all" | undefined;
|
|
5431
|
+
childWidthMode?: "inner" | "outer" | undefined;
|
|
5429
5432
|
validator?: ((value: unknown, fieldItem: import("../../../../es/components/form-render").FieldItem) => string | void) | undefined;
|
|
5430
5433
|
reactions?: {
|
|
5431
5434
|
[x: string]: any;
|
|
@@ -7160,6 +7163,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
7160
7163
|
"vector-effect"?: import("csstype").VectorEffectProperty | undefined;
|
|
7161
7164
|
} | undefined;
|
|
7162
7165
|
childFieldStrategy?: "checked" | "all" | undefined;
|
|
7166
|
+
childWidthMode?: "inner" | "outer" | undefined;
|
|
7163
7167
|
validator?: ((value: unknown, fieldItem: import("../../../../es/components/form-render").FieldItem) => string | void) | undefined;
|
|
7164
7168
|
reactions?: {
|
|
7165
7169
|
[x: string]: any;
|
|
@@ -7844,7 +7848,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
7844
7848
|
onKeydown: (event: KeyboardEvent) => Promise<void>;
|
|
7845
7849
|
clearSpan: (uuid: string) => void;
|
|
7846
7850
|
exposeEvent: {
|
|
7847
|
-
validate(path?: string, { force }?: {
|
|
7851
|
+
validate(path?: string | ((field: import("../../../../es/components/form-render").Field<any, any, any, any>) => boolean), { force }?: {
|
|
7848
7852
|
force?: boolean | undefined;
|
|
7849
7853
|
}): Promise<void>;
|
|
7850
7854
|
getFormValues(needCombineExtendKey?: boolean): any;
|
|
@@ -10166,6 +10170,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
10166
10170
|
"vector-effect"?: import("csstype").VectorEffectProperty | undefined;
|
|
10167
10171
|
} | undefined;
|
|
10168
10172
|
childFieldStrategy?: "checked" | "all" | undefined;
|
|
10173
|
+
childWidthMode?: "inner" | "outer" | undefined;
|
|
10169
10174
|
validator?: ((value: unknown, fieldItem: import("../../../../es/components/form-render").FieldItem) => string | void) | undefined;
|
|
10170
10175
|
reactions?: {
|
|
10171
10176
|
[x: string]: any;
|
|
@@ -11911,6 +11916,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
11911
11916
|
"vector-effect"?: import("csstype").VectorEffectProperty | undefined;
|
|
11912
11917
|
} | undefined;
|
|
11913
11918
|
childFieldStrategy?: "checked" | "all" | undefined;
|
|
11919
|
+
childWidthMode?: "inner" | "outer" | undefined;
|
|
11914
11920
|
validator?: ((value: unknown, fieldItem: import("../../../../es/components/form-render").FieldItem) => string | void) | undefined;
|
|
11915
11921
|
reactions?: {
|
|
11916
11922
|
[x: string]: any;
|
|
@@ -13629,6 +13635,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
13629
13635
|
"vector-effect"?: import("csstype").VectorEffectProperty | undefined;
|
|
13630
13636
|
} | undefined;
|
|
13631
13637
|
childFieldStrategy?: "checked" | "all" | undefined;
|
|
13638
|
+
childWidthMode?: "inner" | "outer" | undefined;
|
|
13632
13639
|
validator?: ((value: unknown, fieldItem: import("../../../../es/components/form-render").FieldItem) => string | void) | undefined;
|
|
13633
13640
|
reactions?: {
|
|
13634
13641
|
[x: string]: any;
|
|
@@ -14231,7 +14238,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
14231
14238
|
onKeydown: (event: KeyboardEvent) => Promise<void>;
|
|
14232
14239
|
clearSpan: (uuid: string) => void;
|
|
14233
14240
|
exposeEvent: {
|
|
14234
|
-
validate(path?: string, { force }?: {
|
|
14241
|
+
validate(path?: string | ((field: import("../../../../es/components/form-render").Field<any, any, any, any>) => boolean), { force }?: {
|
|
14235
14242
|
force?: boolean | undefined;
|
|
14236
14243
|
}): Promise<void>;
|
|
14237
14244
|
getFormValues(needCombineExtendKey?: boolean): any;
|
|
@@ -576,7 +576,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
576
576
|
onKeydown: (event: KeyboardEvent) => Promise<void>;
|
|
577
577
|
clearSpan: (uuid: string) => void;
|
|
578
578
|
exposeEvent: {
|
|
579
|
-
validate(path?: string, { force }?: {
|
|
579
|
+
validate(path?: string | ((field: import("../../../../../es/components/form-render").Field<any, any, any, any>) => boolean), { force }?: {
|
|
580
580
|
force?: boolean | undefined;
|
|
581
581
|
}): Promise<void>;
|
|
582
582
|
getFormValues(needCombineExtendKey?: boolean): any;
|
|
@@ -1883,6 +1883,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1883
1883
|
"vector-effect"?: import("csstype").VectorEffectProperty | undefined;
|
|
1884
1884
|
} | undefined;
|
|
1885
1885
|
childFieldStrategy?: "checked" | "all" | undefined;
|
|
1886
|
+
childWidthMode?: "inner" | "outer" | undefined;
|
|
1886
1887
|
validator?: ((value: unknown, fieldItem: FieldItem) => string | void) | undefined;
|
|
1887
1888
|
reactions?: {
|
|
1888
1889
|
[x: string]: any;
|
|
@@ -3628,6 +3629,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3628
3629
|
"vector-effect"?: import("csstype").VectorEffectProperty | undefined;
|
|
3629
3630
|
} | undefined;
|
|
3630
3631
|
childFieldStrategy?: "checked" | "all" | undefined;
|
|
3632
|
+
childWidthMode?: "inner" | "outer" | undefined;
|
|
3631
3633
|
validator?: ((value: unknown, fieldItem: FieldItem) => string | void) | undefined;
|
|
3632
3634
|
reactions?: {
|
|
3633
3635
|
[x: string]: any;
|
|
@@ -5346,6 +5348,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
5346
5348
|
"vector-effect"?: import("csstype").VectorEffectProperty | undefined;
|
|
5347
5349
|
} | undefined;
|
|
5348
5350
|
childFieldStrategy?: "checked" | "all" | undefined;
|
|
5351
|
+
childWidthMode?: "inner" | "outer" | undefined;
|
|
5349
5352
|
validator?: ((value: unknown, fieldItem: FieldItem) => string | void) | undefined;
|
|
5350
5353
|
reactions?: {
|
|
5351
5354
|
[x: string]: any;
|
|
@@ -5948,7 +5951,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
5948
5951
|
onKeydown: (event: KeyboardEvent) => Promise<void>;
|
|
5949
5952
|
clearSpan: (uuid: string) => void;
|
|
5950
5953
|
exposeEvent: {
|
|
5951
|
-
validate(path?: string, { force }?: {
|
|
5954
|
+
validate(path?: string | ((field: import("../../../../../es/components/form-render").Field<any, any, any, any>) => boolean), { force }?: {
|
|
5952
5955
|
force?: boolean | undefined;
|
|
5953
5956
|
}): Promise<void>;
|
|
5954
5957
|
getFormValues(needCombineExtendKey?: boolean): any;
|
|
@@ -563,7 +563,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
|
563
563
|
onKeydown: (event: KeyboardEvent) => Promise<void>;
|
|
564
564
|
clearSpan: (uuid: string) => void;
|
|
565
565
|
exposeEvent: {
|
|
566
|
-
validate(path?: string, { force }?: {
|
|
566
|
+
validate(path?: string | ((field: import("@formily/core/esm/models/Field").Field<any, any, any, any>) => boolean), { force }?: {
|
|
567
567
|
force?: boolean | undefined;
|
|
568
568
|
}): Promise<void>;
|
|
569
569
|
getFormValues(needCombineExtendKey?: boolean): any;
|
|
@@ -558,7 +558,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
558
558
|
onKeydown: (event: KeyboardEvent) => Promise<void>;
|
|
559
559
|
clearSpan: (uuid: string) => void;
|
|
560
560
|
exposeEvent: {
|
|
561
|
-
validate(path?: string, { force }?: {
|
|
561
|
+
validate(path?: string | ((field: Field<any, any, any, any>) => boolean), { force }?: {
|
|
562
562
|
force?: boolean | undefined;
|
|
563
563
|
}): Promise<void>;
|
|
564
564
|
getFormValues(needCombineExtendKey?: boolean): any;
|
|
@@ -561,7 +561,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
561
561
|
onKeydown: (event: KeyboardEvent) => Promise<void>;
|
|
562
562
|
clearSpan: (uuid: string) => void;
|
|
563
563
|
exposeEvent: {
|
|
564
|
-
validate(path?: string, { force }?: {
|
|
564
|
+
validate(path?: string | ((field: import("../../../../es/components/form-render").Field<any, any, any, any>) => boolean), { force }?: {
|
|
565
565
|
force?: boolean | undefined;
|
|
566
566
|
}): Promise<void>;
|
|
567
567
|
getFormValues(needCombineExtendKey?: boolean): any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,inject as r,computed as
|
|
1
|
+
import{defineComponent as e,inject as r,computed as l,ref as o,onUnmounted as t,createVNode as n,mergeProps as i}from"vue";import{arrayed as a,widthAppend as s}from"../../../../../shared/utils/index.js";import{isVoidField as m}from"@formily/core";import{observe as u,autorun as d}from"@formily/reactive";import{connect as f,mapProps as p}from"@formily/vue";import{useDebounceFn as v}from"@vueuse/core";import{isString as c,isArray as b,isFunction as y}from"lodash-es";import{NFormItem as _}from"naive-ui";import g from"../../../../annotation-edit/index.js";import"../../../index.js";import x from"../tooltipMessage.vue.js";import{InjectionFormUUID as I,InjectionFormGraph as j,InjectionAnnotation as h,InjectionFormGlobalProps as k}from"../../constants/index.js";import{useComplexOptionsSpan as F}from"../../hooks/useComplexOptions.js";import{dotEscape as R}from"../../utils/schema.js";import{validateMessageParser as L}from"../../utils/index.js";import{useFormField as q}from"../../hooks/useFormField.js";const K=f(e({name:"FormRenderItem",props:{label:String,propertyKey:String,remark:String,span:{type:Number,default:6},suffixFields:{type:Array},labelRender:Function,annotation:{},fieldItem:{type:Object}},setup(e,{slots:a}){const{field:f,fieldKey:p,fieldAddress:c}=q(),L=r(I),K=l((()=>R(`${L}-${c.value}`))),S=o(!1);if(m(f.value)&&b(e.suffixFields)){const l=r(j);t(u(l,v((()=>{m(f.value)&&b(e.suffixFields)&&(S.value=e.suffixFields.some((e=>{const r=f.value.form.query(e).take();return r&&Reflect.get(r,"required")})))}),100)))}else t(d((()=>{S.value=Reflect.get(f.value,"required")})));const A=r(h),E=l({get(){var r,l;return null!=(l=null==(r=A.value)?void 0:r[e.propertyKey])?l:""},set(r){A.value={property:e.propertyKey,value:r}}});const M=l((()=>A.value&&!1!==e.annotation)),O=l((()=>e.label&&" "!==e.label)),V=l((()=>{let r=0;return M.value&&(r+=18),e.remark&&(r+=18),r})),$=r(k,{}),w=l((()=>{var r;const l=null==(r=e.fieldItem)?void 0:r.bordered;return null==l?$.bordered:l}));function C(){return O.value?n("section",{class:"form-render__formItemLabel"},[n("span",{class:"form-render__formItemLabel--text",style:{marginRight:s(V.value)}},[y(e.labelRender)?e.labelRender(e.label):e.label]),V.value?n("section",{class:"form-render__formItemLabel--operation"},[e.remark?n("div",{class:"form-render__formItemLabel--tooltip"},[n(x,{message:e.remark},null)]):null,M.value?n(g,{class:"form-render__formItemLabel--annotation",modelValue:E.value,"onUpdate:modelValue":e=>E.value=e},null):null]):null]):null}const{getSpan:N}=F();return()=>{return n(_,i({class:["form-render__formItem",{"form-render--no-border":!w.value,"form-render--underline":"underline"===w.value}],style:{"--form-item-column":"inner"===(null==(r=e.fieldItem)?void 0:r.childWidthMode)?e.span:N(L,f.value.address,!1)+e.span}},{id:K.value,uuid:L,"widget-type":f.value.componentType,"field-key":R(p.value),"field-address":R(c.value),required:S.value}),{...a,label:C});var r}}}),p({title:"label"},((e,r)=>{const l=m(r)?void 0:a(r.selfErrors).length?function(e,r){if(!c(r.defined_error_msg)||!r.defined_error_msg)return e.map((e=>L(e,r))).join(",");return L(r.defined_error_msg,r)}(a(r.selfErrors),e.fieldItem):void 0;return{...e,fieldItem:void 0,feedback:l,"validation-status":l?"error":void 0}})));export{K as FORM_ITEM};
|
|
@@ -64,6 +64,10 @@ export declare const RADIO: import("vue").DefineComponent<{
|
|
|
64
64
|
type: PropType<"checked" | "all">;
|
|
65
65
|
default: string;
|
|
66
66
|
};
|
|
67
|
+
childWidthMode: {
|
|
68
|
+
type: PropType<"inner" | "outer">;
|
|
69
|
+
default: string;
|
|
70
|
+
};
|
|
67
71
|
clearable: BooleanConstructor;
|
|
68
72
|
onChange: {};
|
|
69
73
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -129,6 +133,10 @@ export declare const RADIO: import("vue").DefineComponent<{
|
|
|
129
133
|
type: PropType<"checked" | "all">;
|
|
130
134
|
default: string;
|
|
131
135
|
};
|
|
136
|
+
childWidthMode: {
|
|
137
|
+
type: PropType<"inner" | "outer">;
|
|
138
|
+
default: string;
|
|
139
|
+
};
|
|
132
140
|
clearable: BooleanConstructor;
|
|
133
141
|
onChange: {};
|
|
134
142
|
}>> & {
|
|
@@ -141,6 +149,7 @@ export declare const RADIO: import("vue").DefineComponent<{
|
|
|
141
149
|
lazyRequest: boolean;
|
|
142
150
|
requestCache: boolean;
|
|
143
151
|
childFieldStrategy: "checked" | "all";
|
|
152
|
+
childWidthMode: "inner" | "outer";
|
|
144
153
|
clearable: boolean;
|
|
145
154
|
}>;
|
|
146
155
|
export declare const CHECKBOX: import("vue").DefineComponent<{
|
|
@@ -206,6 +215,10 @@ export declare const CHECKBOX: import("vue").DefineComponent<{
|
|
|
206
215
|
type: PropType<"checked" | "all">;
|
|
207
216
|
default: string;
|
|
208
217
|
};
|
|
218
|
+
childWidthMode: {
|
|
219
|
+
type: PropType<"inner" | "outer">;
|
|
220
|
+
default: string;
|
|
221
|
+
};
|
|
209
222
|
clearable: BooleanConstructor;
|
|
210
223
|
onChange: {};
|
|
211
224
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -271,6 +284,10 @@ export declare const CHECKBOX: import("vue").DefineComponent<{
|
|
|
271
284
|
type: PropType<"checked" | "all">;
|
|
272
285
|
default: string;
|
|
273
286
|
};
|
|
287
|
+
childWidthMode: {
|
|
288
|
+
type: PropType<"inner" | "outer">;
|
|
289
|
+
default: string;
|
|
290
|
+
};
|
|
274
291
|
clearable: BooleanConstructor;
|
|
275
292
|
onChange: {};
|
|
276
293
|
}>> & {
|
|
@@ -283,5 +300,6 @@ export declare const CHECKBOX: import("vue").DefineComponent<{
|
|
|
283
300
|
lazyRequest: boolean;
|
|
284
301
|
requestCache: boolean;
|
|
285
302
|
childFieldStrategy: "checked" | "all";
|
|
303
|
+
childWidthMode: "inner" | "outer";
|
|
286
304
|
clearable: boolean;
|
|
287
305
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as t,createVNode as o,isVNode as
|
|
1
|
+
import{defineComponent as e,computed as t,createVNode as o,isVNode as l}from"vue";import a from"../../../../../shared/components/CancelRadio/CancelRadio.js";import{connect as i,mapProps as r}from"@formily/vue";import{isNumber as n,isEmpty as u,isArray as d}from"lodash-es";import{NRadioGroup as s,NCheckboxGroup as c,NCheckbox as p}from"naive-ui";import"../../../index.js";import{useComplexOptions as m}from"../../hooks/useComplexOptions.js";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"date-fns";import{assignUpdateValue as f,createVisitedSetter as v}from"../../utils/schema.js";import{useUrlConfigOptions as y,useAutographOptions as h}from"../../hooks/useFormRenderOptions.js";import{useCommonInjection as j}from"../../hooks/useCommonInjection.js";import{useFormField as b}from"../../hooks/useFormField.js";function g(a,i,r){return e({name:a,props:{value:{type:[String,Number,Object,Array]},options:{type:Array,default:()=>[]},urlConfig:{type:Object},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"},childWidthMode:{type:String,default:"outer"},clearable:Boolean,onChange:{}},emits:["update:value"],setup(e,{emit:a}){const{field:s}=b();const c=t({get(){return t=e.value,n(t)?t+"":t;var t},set(e){a("update:value",e)}}),{renderComplexOption:p}=m(e,c),{labelKey:f,valueKey:g,fullOptions:x}=e.urlConfig?y(e,c):h(e,c),{injectValueBindKey:C,injectValueValidate:F}=j();F(c);const S=C(c);function k(){c.value=null}function O(t){let a;const i={display:"flex",alignItems:"center"};if(t.__spanPercent&&"inner"===e.childWidthMode){const e=`${t.__spanPercent}%`;i.maxWidth=e,function(e,t){return!u(t.childrenFields)&&(d(e)?e.includes(t[g.value]):e===t[g.value])}(c.value,t)&&(i.width=e)}return o(r,{key:t[g.value],value:t[g.value],disabled:t.disabled,currentValue:c.value,cancelable:e.clearable,onCancel:k,style:i},"function"==typeof(n=a=p({value:c.value,option:t,valueKey:g.value,labelKey:f.value,childFieldStrategy:e.childFieldStrategy,childWidthMode:e.childWidthMode}))||"[object Object]"===Object.prototype.toString.call(n)&&!l(n)?a:{default:()=>[a]});var n}return()=>{const t=x.value.map((e=>{var t;const o=null==(t=e.childrenFields)?void 0:t.reduce(((e,t)=>e+ +(t.elem_width||3)),0);return{...e,__spanPercent:(o||0)/12*100}})),l={display:"flex",flexDirection:e.vertical?"column":"row",flexWrap:"wrap",justifyItems:"flex-start",alignItems:"center",width:"100%"};return o(i,{key:S.value,value:c.value,"onUpdate:value":e=>c.value=e,onClick:v(s),style:{width:"100%"}},{default:()=>[o("section",{style:l},[t.map(O)])]})}}})}const x=i(g("FormRadio",s,a),r({dataSource:"options"},f)),C=i(g("FormCheckbox",c,p),r({dataSource:"options"},f));export{C as CHECKBOX,x as RADIO};
|
|
@@ -10,12 +10,13 @@ export declare function useComplexOptions(props: {
|
|
|
10
10
|
options: AnyObject[];
|
|
11
11
|
value: unknown;
|
|
12
12
|
}, valueRef: Ref): {
|
|
13
|
-
renderComplexOption: ({ value, option, valueKey, labelKey, childFieldStrategy, renderLabel, attrs }: {
|
|
13
|
+
renderComplexOption: ({ value, option, valueKey, labelKey, childFieldStrategy, childWidthMode, renderLabel, attrs }: {
|
|
14
14
|
value: unknown;
|
|
15
15
|
option: FormOptionItem;
|
|
16
16
|
valueKey?: string | undefined;
|
|
17
17
|
labelKey?: string | undefined;
|
|
18
18
|
childFieldStrategy: 'checked' | 'all';
|
|
19
|
+
childWidthMode?: "inner" | "outer" | undefined;
|
|
19
20
|
renderLabel?: boolean | undefined;
|
|
20
21
|
attrs?: AnyObject | undefined;
|
|
21
22
|
}) => any[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{reactive as e,computed as t,createVNode as r,mergeProps as
|
|
1
|
+
import{reactive as e,computed as t,createVNode as r,mergeProps as l,defineComponent as n,inject as o,provide as i,watch as a,onUnmounted as s,onMounted as d,withModifiers as c}from"vue";import{checkInSetupEnv as u}from"../../../../shared/utils/index.js";import{useField as p,useForm as m,RecursionField as h}from"@formily/vue";import{isArray as f,noop as v,isEmpty as y}from"lodash-es";import"../../index.js";import{InjectionFormUUID as g,InjectionBusinessCollector as x}from"../constants/index.js";import{renderDescOption as b}from"../utils/index.js";import{useFieldListAdaptor as F}from"./useFieldListAdaptor.js";import{createObjSchema as S}from"../utils/schema.js";const j=e(new Map);function O(e,t,r=0){j.set(e,j.get(e)||{});j.get(e)[t+""]=r}function M(e,t,r=!0){const l=j.get(e);return l?Object.entries(l).reduce(((e,[l,n])=>r&&l===`${t}`||l.startsWith(`${t}.`)?e+n:e),0):0}function W(e,t){const r=j.get(e);r&&Reflect.deleteProperty(r,t+"")}function $(e){j.delete(e)}const k=n({props:{fieldItems:{type:Array,default:()=>[]},childFieldStrategy:{type:String,default:"checked"},childWidthMode:{type:String,default:"outer"},name:{type:String,required:!0}},setup(e){const n=o(g),u=o(x),f=p(),y=o(n+"_virtualParent",""),b=`${y?y+".":""}${f.value.address}`;function j(e){return`${b}.${e}`}i(n+"_virtualParent",b);const{schemaAdaptor:$}=F(u);function k(t){var r,l,n,o;return Object.assign(t,{"x-decorator-props":{...t["x-decorator-props"],labelPlacement:"left",showFeedback:!1},"x-component-props":{...t["x-component-props"],childFieldStrategy:null!=(l=null==(r=t["x-component-props"])?void 0:r.childFieldStrategy)?l:e.childFieldStrategy,childWidthMode:null!=(o=null==(n=t["x-component-props"])?void 0:n.childWidthMode)?o:e.childWidthMode,size:"small"}})}const E=t((()=>{const t=$(e.fieldItems);return Object.values(t).forEach(k),S(t)}));a(E,(()=>{return e=E.value,void Object.values(e.properties||{}).forEach((e=>{var t;O(n,j(e.name),null==(t=null==e?void 0:e["x-decorator-props"])?void 0:t.span)}));var e}),{immediate:!0});const K=m();function P(){return e.fieldItems.map((e=>K.value.query(e.val_key).take()))}s((()=>{var e;P().forEach((e=>{e&&e.setDisplay("none")})),e=E.value,Object.values(e.properties||{}).forEach((e=>{W(n,j(e.name))}))})),d((()=>{P().forEach((e=>{e&&e.setDisplay("visible")}))}));const _=c(v,["stop"]),I=["onClick","onKeydown","onKeyup","onKeypress"].reduce(((e,t)=>(e[t]=_,e)),{});return()=>{return r("section",l({class:"form-render__labelField",style:{"--column":(e=E.value,Object.values(e.properties||{}).reduce(((e,t)=>e+M(n,j(t.name))),0)),flex:"1"}},I),[r(h,{basePath:".",schema:E.value},null)]);var e}}});function E(e,n){u();const o=t((()=>e.options.some((e=>f(e.childrenFields)&&e.childrenFields.length))));function i(e,t,r="value"){return!y(t.childrenFields)&&(f(e)?e.includes(t[r]):e===t[r])}return{renderComplexOption:function({value:e,option:t,valueKey:n="value",labelKey:a="label",childFieldStrategy:s,childWidthMode:d,renderLabel:c=!0,attrs:u}){return[c?t.desc?b(t[a],t):t[a]:null,o.value&&("all"===s||i(e,t,n))?r(k,l({fieldItems:t.childrenFields,name:t[n],childFieldStrategy:s,childWidthMode:d},u),null):null]},valueRef:n,hasComplexOption:o}}function K(){return{getSpan:M,setSpan:O,deleteSpan:W,clearSpan:$}}export{E as useComplexOptions,K as useComplexOptionsSpan};
|