cnhis-design-vue 3.1.40-beta.1 → 3.1.40-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -48
- package/es/components/form-config/index.d.ts +66 -148
- package/es/components/form-config/src/FormConfig.vue.d.ts +66 -148
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +33 -74
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +33 -74
- package/es/components/form-render/index.d.ts +33 -74
- package/es/components/form-render/src/FormRender.vue.d.ts +33 -74
- package/es/components/form-render/src/FormRender.vue.js +36 -20
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +33 -74
- package/es/components/form-render/src/components/renderer/formItem.js +8 -2
- package/es/components/form-render/src/components/renderer/searchCascade.js +1 -0
- package/es/components/form-render/src/components/renderer/select.js +1 -0
- package/es/components/form-render/src/hooks/useAnchor.d.ts +6 -3
- package/es/components/form-render/src/hooks/useAnchor.js +26 -26
- package/es/components/form-render/src/hooks/useAutoHidden.d.ts +4 -0
- package/es/components/form-render/src/hooks/useAutoHidden.js +43 -0
- package/es/components/form-render/src/hooks/useBusinessBinding.d.ts +7 -10
- package/es/components/form-render/src/hooks/useBusinessBinding.js +38 -36
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +10 -12
- package/es/components/form-render/src/hooks/useFormContext.d.ts +1 -2
- package/es/components/form-render/src/hooks/useFormContext.js +2 -2
- package/es/components/form-render/src/types/fieldItem.d.ts +1 -1
- package/es/components/iho-table/index.d.ts +121 -121
- package/es/components/iho-table/src/IhoTable.vue.d.ts +121 -121
- package/es/components/iho-table/src/constants/index.d.ts +2 -2
- package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +59 -59
- package/es/components/iho-table/src/hooks/tapHooks/useEventHooks.d.ts +1 -1
- package/es/components/index.css +1 -1
- package/es/components/index.d.ts +3 -1
- package/es/components/index.js +6 -0
- package/es/components/info-header/index.d.ts +18 -3
- package/es/components/info-header/src/HiddenContent.vue.d.ts +2 -2
- package/es/components/info-header/src/InfoEllipsis.vue.d.ts +1 -1
- package/es/components/info-header/src/InfoHeader.vue.d.ts +18 -3
- package/es/components/info-header/src/InfoHeader.vue.js +33 -19
- package/es/components/keyboard/index.d.ts +20 -2
- package/es/components/keyboard/src/Keyboard.vue.d.ts +20 -2
- package/es/components/keyboard/src/components/InputNumber.vue.d.ts +19 -2
- package/es/components/keyboard/src/components/InputNumber.vue.js +15 -5
- package/es/components/keyboard/src/components/NumberPanel.vue.d.ts +20 -2
- package/es/components/keyboard/src/components/NumberPanel.vue.js +14 -10
- package/es/components/recommend-search/index.d.ts +14 -14
- package/es/components/recommend-search/src/RecommendSearch.vue.d.ts +14 -14
- package/es/components/recommend-search/src/components/BaseSearch.vue.d.ts +2 -2
- package/es/components/recommend-search/src/components/RecommendInput.vue.d.ts +4 -4
- package/es/components/recommend-search/src/components/RecommendSelect.vue.d.ts +4 -4
- package/es/components/scale-view/index.d.ts +4 -2
- package/es/components/scale-view/src/ScaleView.vue.d.ts +7 -2
- package/es/components/scale-view/src/ScaleView.vue.js +2 -1
- package/es/components/scale-view/src/components/formitem/standard-modal.d.ts +1 -1
- package/es/components/scale-view/src/components/formitem/text-over-tooltip/TextOverTooltip.vue.d.ts +1 -1
- package/es/components/shortcut-provider/index.d.ts +15 -1
- package/es/components/shortcut-provider/src/ShortcutProvider.vue.d.ts +15 -1
- package/es/components/shortcut-provider/src/ShortcutProvider.vue.js +7 -2
- package/es/components/shortcut-setter/index.d.ts +33 -74
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +33 -74
- package/es/components/steps-wheel/index.d.ts +1 -1
- package/es/components/steps-wheel/src/StepsWheel.vue.d.ts +1 -1
- package/es/components/table-filter/index.d.ts +8933 -0
- package/es/components/table-filter/index.js +21 -0
- package/es/components/table-filter/src/base-search-com/BaseSearch.vue.d.ts +3841 -0
- package/es/components/table-filter/src/base-search-com/BaseSearch.vue.js +2272 -0
- package/es/components/table-filter/src/classification/Classification-com.vue.d.ts +3198 -0
- package/es/components/table-filter/src/classification/Classification-com.vue.js +1315 -0
- package/es/components/table-filter/src/classification/search-class-name.vue.d.ts +71 -0
- package/es/components/table-filter/src/classification/search-class-name.vue.js +195 -0
- package/es/components/table-filter/src/classification/search-professional-model.vue.d.ts +1119 -0
- package/es/components/table-filter/src/classification/search-professional-model.vue.js +594 -0
- package/es/components/table-filter/src/components/age-com/index.vue.d.ts +119 -0
- package/es/components/table-filter/src/components/age-com/index.vue.js +185 -0
- package/es/components/table-filter/src/components/button-group/ButtonGroup.vue.d.ts +199 -0
- package/es/components/table-filter/src/components/button-group/ButtonGroup.vue.js +86 -0
- package/es/components/table-filter/src/components/button-icon/getBtnIcon.d.ts +2 -0
- package/es/components/table-filter/src/components/button-icon/getBtnIcon.js +30 -0
- package/es/components/table-filter/src/components/c-tree-select/tree-select.vue.d.ts +90 -0
- package/es/components/table-filter/src/components/c-tree-select/tree-select.vue.js +253 -0
- package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +112 -0
- package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.js +114 -0
- package/es/components/table-filter/src/components/classify-filter/helpers/options.d.ts +4 -0
- package/es/components/table-filter/src/components/classify-filter/helpers/options.js +14 -0
- package/es/components/table-filter/src/components/classify-filter/hooks/useDisplayCategory.d.ts +20 -0
- package/es/components/table-filter/src/components/classify-filter/hooks/useDisplayCategory.js +87 -0
- package/es/components/table-filter/src/components/classify-filter/hooks/useFilterConditions.d.ts +59 -0
- package/es/components/table-filter/src/components/classify-filter/hooks/useFilterConditions.js +147 -0
- package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +278 -0
- package/es/components/table-filter/src/components/classify-filter/index.vue.js +304 -0
- package/es/components/table-filter/src/components/multi-select/multi-select.vue.d.ts +113 -0
- package/es/components/table-filter/src/components/multi-select/multi-select.vue.js +153 -0
- package/es/components/table-filter/src/components/out-quick-search/out-quick-search.vue.d.ts +266 -0
- package/es/components/table-filter/src/components/out-quick-search/out-quick-search.vue.js +310 -0
- package/es/components/table-filter/src/components/range-age/index.vue.d.ts +248 -0
- package/es/components/table-filter/src/components/range-age/index.vue.js +137 -0
- package/es/components/table-filter/src/components/render-widget/components/CheckboxGroup.vue.d.ts +104 -0
- package/es/components/table-filter/src/components/render-widget/components/CheckboxGroup.vue.js +64 -0
- package/es/components/table-filter/src/components/render-widget/components/Select.vue.d.ts +34 -0
- package/es/components/table-filter/src/components/render-widget/components/Select.vue.js +45 -0
- package/es/components/table-filter/src/components/render-widget/components/index.d.ts +3 -0
- package/es/components/table-filter/src/components/render-widget/components/index.js +2 -0
- package/es/components/table-filter/src/components/render-widget/enums.d.ts +25 -0
- package/es/components/table-filter/src/components/render-widget/enums.js +27 -0
- package/es/components/table-filter/src/components/render-widget/helpers/presetValToTimestamp.d.ts +1 -0
- package/es/components/table-filter/src/components/render-widget/helpers/presetValToTimestamp.js +70 -0
- package/es/components/table-filter/src/components/render-widget/index.vue.d.ts +32 -0
- package/es/components/table-filter/src/components/render-widget/index.vue.js +107 -0
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +199 -0
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.js +152 -0
- package/es/components/table-filter/src/components/search-condition/SearchCondition.vue.d.ts +789 -0
- package/es/components/table-filter/src/components/search-condition/SearchCondition.vue.js +1520 -0
- package/es/components/table-filter/src/components/search-condition/fieldTypeList.d.ts +18 -0
- package/es/components/table-filter/src/components/search-condition/fieldTypeList.js +171 -0
- package/es/components/table-filter/src/components/search-filter/SearchFilter.vue.d.ts +1217 -0
- package/es/components/table-filter/src/components/search-filter/SearchFilter.vue.js +199 -0
- package/es/components/table-filter/src/components/search-modal/set-classification.vue.d.ts +1624 -0
- package/es/components/table-filter/src/components/search-modal/set-classification.vue.js +241 -0
- package/es/components/table-filter/src/components/table-modal/TableModal.vue.d.ts +292 -0
- package/es/components/table-filter/src/components/table-modal/TableModal.vue.js +526 -0
- package/es/components/table-filter/src/const/dataOptions.d.ts +36 -0
- package/es/components/table-filter/src/const/dataOptions.js +107 -0
- package/es/components/table-filter/src/const/index.d.ts +5 -0
- package/es/components/table-filter/src/const/index.js +5 -0
- package/es/components/table-filter/src/directive/flexibleResize.d.ts +28 -0
- package/es/components/table-filter/src/directive/flexibleResize.js +157 -0
- package/es/components/table-filter/src/directive/preventReClick.d.ts +4 -0
- package/es/components/table-filter/src/directive/preventReClick.js +14 -0
- package/es/components/table-filter/src/directive/resize.d.ts +4 -0
- package/es/components/table-filter/src/directive/resize.js +12 -0
- package/es/components/table-filter/src/hooks/export.d.ts +1 -0
- package/es/components/table-filter/src/hooks/export.js +1 -0
- package/es/components/table-filter/src/hooks/useAdvanced.d.ts +28 -0
- package/es/components/table-filter/src/hooks/useAdvanced.js +64 -0
- package/es/components/table-filter/src/hooks/useMixins.d.ts +60 -0
- package/es/components/table-filter/src/hooks/useMixins.js +532 -0
- package/es/components/table-filter/src/hooks/useRenderWidget.d.ts +15 -0
- package/es/components/table-filter/src/hooks/useRenderWidget.js +94 -0
- package/es/components/table-filter/src/hooks/useTableSearchCon.d.ts +8 -0
- package/es/components/table-filter/src/hooks/useTableSearchCon.js +131 -0
- package/es/components/table-filter/src/hooks/useWordBookutils.d.ts +12 -0
- package/es/components/table-filter/src/hooks/useWordBookutils.js +91 -0
- package/es/components/table-filter/src/quick-search/QuickSearch.vue.d.ts +1942 -0
- package/es/components/table-filter/src/quick-search/QuickSearch.vue.js +2038 -0
- package/es/components/table-filter/src/tool/generateDefOptions.d.ts +14 -0
- package/es/components/table-filter/src/tool/generateDefOptions.js +65 -0
- package/es/components/table-filter/src/tool/getWidgetType.d.ts +1 -0
- package/es/components/table-filter/src/tool/getWidgetType.js +27 -0
- package/es/components/table-filter/src/tool/options.d.ts +18 -0
- package/es/components/table-filter/src/tool/options.js +200 -0
- package/es/components/table-filter/src/tool/resizeSensor.d.ts +16 -0
- package/es/components/table-filter/src/tool/resizeSensor.js +123 -0
- package/es/components/table-filter/src/tool/time-domain.d.ts +39 -0
- package/es/components/table-filter/src/tool/time-domain.js +100 -0
- package/es/components/table-filter/src/tool/transformData.d.ts +92 -0
- package/es/components/table-filter/src/tool/transformData.js +169 -0
- package/es/components/table-filter/src/tool/utils.d.ts +4 -0
- package/es/components/table-filter/src/tool/utils.js +29 -0
- package/es/components/table-filter/src/types/enums.d.ts +65 -0
- package/es/components/table-filter/src/types/enums.js +67 -0
- package/es/components/table-filter/src/types/index.d.ts +483 -0
- package/es/components/table-filter/src/types/index.js +1 -0
- package/es/components/table-filter/src/types/tool.d.ts +7 -0
- package/es/components/table-filter/src/types/tool.js +1 -0
- package/es/components/table-filter/style/index.css +1 -0
- package/es/shared/assets/img/failure.js +1 -1
- package/es/shared/assets/img/failure.png.js +1 -1
- package/es/shared/assets/img/icon-asc.js +1 -1
- package/es/shared/assets/img/icon-desc.js +1 -1
- package/es/shared/assets/img/no-permission.js +1 -1
- package/es/shared/assets/img/no-permission.png.js +1 -1
- package/es/shared/assets/img/nodata.js +1 -1
- package/es/shared/assets/img/nodata.png.js +1 -1
- package/es/shared/assets/img/notfound.js +1 -1
- package/es/shared/assets/img/notfound.png.js +1 -1
- package/es/shared/assets/img/qr.js +1 -1
- package/es/shared/assets/img/qr.png.js +1 -1
- package/es/shared/assets/img/success.js +1 -1
- package/es/shared/assets/img/success.png.js +1 -1
- package/es/shared/assets/img/video.js +1 -1
- package/es/shared/assets/img/video.png.js +1 -1
- package/es/shared/assets/img/video_default_cover.js +1 -1
- package/es/shared/assets/img/video_default_cover.png.js +1 -1
- package/es/shared/assets/img/video_hover.js +1 -1
- package/es/shared/assets/img/video_play_hover.js +1 -1
- package/es/shared/assets/img/xb_big.js +1 -1
- package/es/shared/assets/img/xb_big.png.js +1 -1
- package/es/shared/assets/img/xb_small.js +1 -1
- package/es/shared/assets/img/xb_small.png.js +1 -1
- package/es/shared/components/TextOverTooltip/TextOverTooltip.vue.d.ts +1 -1
- package/es/shared/utils/utilExpand.js +66 -0
- package/package.json +3 -3
|
@@ -129,6 +129,9 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
129
129
|
lowCodeReactions: {
|
|
130
130
|
type: import("vue").PropType<import("../../../../es/components/form-render").FormLowCodeReactions.Config[]>;
|
|
131
131
|
};
|
|
132
|
+
linebarAutoHidden: {
|
|
133
|
+
type: BooleanConstructor;
|
|
134
|
+
};
|
|
132
135
|
}, {
|
|
133
136
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
134
137
|
fieldList: {
|
|
@@ -254,6 +257,9 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
254
257
|
lowCodeReactions: {
|
|
255
258
|
type: import("vue").PropType<import("../../../../es/components/form-render").FormLowCodeReactions.Config[]>;
|
|
256
259
|
};
|
|
260
|
+
linebarAutoHidden: {
|
|
261
|
+
type: BooleanConstructor;
|
|
262
|
+
};
|
|
257
263
|
}>> & {
|
|
258
264
|
onFormChange?: ((...args: any[]) => any) | undefined;
|
|
259
265
|
onScroll?: ((...args: any[]) => any) | undefined;
|
|
@@ -261,17 +267,30 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
261
267
|
}>>;
|
|
262
268
|
emit: (event: "scroll" | "formChange" | "annotationChange", ...args: any[]) => void;
|
|
263
269
|
nuiThemeOverrides: import("naive-ui").GlobalThemeOverrides;
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
}>;
|
|
267
|
-
lowCodeReactionsHandler: (field: string, value: unknown) => void;
|
|
268
|
-
triggerAllReactionsHandler: () => void;
|
|
270
|
+
formRenderRef: import("vue").Ref<HTMLElement | undefined>;
|
|
271
|
+
formHeight: import("vue").ComputedRef<string>;
|
|
269
272
|
SchemaField: import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>;
|
|
270
273
|
businessCollector: import("../../../../es/components/form-render").BusinessCollector;
|
|
271
274
|
formItemDepsCollector: import("../../../../es/components/form-render").FormItemDepsCollector;
|
|
272
275
|
changeContextCollector: import("../../../../es/components/form-render").ContextCollector;
|
|
273
276
|
formUUID: string;
|
|
274
|
-
|
|
277
|
+
anchorBarRef: import("vue").Ref<{
|
|
278
|
+
syncBarPosition: import("../../../shared/types").Func<any[], any>;
|
|
279
|
+
} | undefined>;
|
|
280
|
+
currentAnchor: import("vue").WritableComputedRef<string>;
|
|
281
|
+
generateAnchorList: (formModel: import("../../../../es/components/form-render").Form<any>) => Promise<void>;
|
|
282
|
+
updateAnchorList: (field: import("../../../../es/components/form-render").GeneralField) => void;
|
|
283
|
+
anchorIdList: import("vue").Ref<{
|
|
284
|
+
name: string;
|
|
285
|
+
title: string;
|
|
286
|
+
}[]>;
|
|
287
|
+
onScroll: (scrollEvent: Event) => void;
|
|
288
|
+
triggerAutoHidden: (field: import("../../../../es/components/form-render").GeneralField) => Promise<void>;
|
|
289
|
+
formModel: import("../../../../es/components/form-render").Form<{
|
|
290
|
+
[x: string]: any;
|
|
291
|
+
}>;
|
|
292
|
+
lowCodeReactionsHandler: (field: string, value: unknown) => void;
|
|
293
|
+
triggerAllReactionsHandler: () => void;
|
|
275
294
|
schemaAdaptor: (fieldList: import("../../../../es/components/form-render").FieldItem[]) => Record<string, import("@formily/json-schema").Stringify<{
|
|
276
295
|
[key: symbol]: any;
|
|
277
296
|
[key: `x-${string}`]: any;
|
|
@@ -387,70 +406,6 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
387
406
|
"x-read-pretty"?: boolean | undefined;
|
|
388
407
|
"x-compile-omitted"?: string[] | undefined;
|
|
389
408
|
}>>;
|
|
390
|
-
currentAnchor: import("vue").WritableComputedRef<string>;
|
|
391
|
-
generateAnchorList: (schema: import("@formily/json-schema").Stringify<{
|
|
392
|
-
[key: symbol]: any;
|
|
393
|
-
[key: `x-${string}`]: any;
|
|
394
|
-
[key: `x-${number}`]: any;
|
|
395
|
-
version?: string | undefined;
|
|
396
|
-
name?: import("@formily/json-schema").SchemaKey | undefined;
|
|
397
|
-
title?: any;
|
|
398
|
-
description?: any;
|
|
399
|
-
default?: any;
|
|
400
|
-
readOnly?: boolean | undefined;
|
|
401
|
-
writeOnly?: boolean | undefined;
|
|
402
|
-
type?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
403
|
-
enum?: import("@formily/json-schema").SchemaEnum<any> | undefined;
|
|
404
|
-
const?: any;
|
|
405
|
-
multipleOf?: number | undefined;
|
|
406
|
-
maximum?: number | undefined;
|
|
407
|
-
exclusiveMaximum?: number | undefined;
|
|
408
|
-
minimum?: number | undefined;
|
|
409
|
-
exclusiveMinimum?: number | undefined;
|
|
410
|
-
maxLength?: number | undefined;
|
|
411
|
-
minLength?: number | undefined;
|
|
412
|
-
pattern?: string | RegExp | undefined;
|
|
413
|
-
maxItems?: number | undefined;
|
|
414
|
-
minItems?: number | undefined;
|
|
415
|
-
uniqueItems?: boolean | undefined;
|
|
416
|
-
maxProperties?: number | undefined;
|
|
417
|
-
minProperties?: number | undefined;
|
|
418
|
-
required?: string | boolean | string[] | undefined;
|
|
419
|
-
format?: string | undefined;
|
|
420
|
-
$ref?: string | undefined;
|
|
421
|
-
$namespace?: string | undefined;
|
|
422
|
-
definitions?: import("@formily/json-schema").SchemaProperties<any, any, any, any, any, any, any, any> | undefined;
|
|
423
|
-
properties?: import("@formily/json-schema").SchemaProperties<any, any, any, any, any, any, any, any> | undefined;
|
|
424
|
-
items?: import("@formily/json-schema").SchemaItems<any, any, any, any, any, any, any, any> | undefined;
|
|
425
|
-
additionalItems?: import("@formily/json-schema").Stringify<any> | undefined;
|
|
426
|
-
patternProperties?: import("@formily/json-schema").SchemaProperties<any, any, any, any, any, any, any, any> | undefined;
|
|
427
|
-
additionalProperties?: import("@formily/json-schema").Stringify<any> | undefined;
|
|
428
|
-
"x-value"?: any;
|
|
429
|
-
"x-index"?: number | undefined;
|
|
430
|
-
"x-pattern"?: any;
|
|
431
|
-
"x-display"?: any;
|
|
432
|
-
"x-validator"?: any;
|
|
433
|
-
"x-decorator"?: any;
|
|
434
|
-
"x-decorator-props"?: any;
|
|
435
|
-
"x-component"?: any;
|
|
436
|
-
"x-component-props"?: any;
|
|
437
|
-
"x-reactions"?: import("@formily/json-schema").SchemaReactions<any> | undefined;
|
|
438
|
-
"x-content"?: any;
|
|
439
|
-
"x-data"?: any;
|
|
440
|
-
"x-visible"?: boolean | undefined;
|
|
441
|
-
"x-hidden"?: boolean | undefined;
|
|
442
|
-
"x-disabled"?: boolean | undefined;
|
|
443
|
-
"x-editable"?: boolean | undefined;
|
|
444
|
-
"x-read-only"?: boolean | undefined;
|
|
445
|
-
"x-read-pretty"?: boolean | undefined;
|
|
446
|
-
"x-compile-omitted"?: string[] | undefined;
|
|
447
|
-
}>) => void;
|
|
448
|
-
anchorIdList: import("vue").Ref<{
|
|
449
|
-
name: string;
|
|
450
|
-
title: string;
|
|
451
|
-
}[]>;
|
|
452
|
-
formHeight: import("vue").ComputedRef<string | undefined>;
|
|
453
|
-
onScroll: (scrollEvent: Event) => void;
|
|
454
409
|
onKeydown: (event: KeyboardEvent) => void;
|
|
455
410
|
clearSpan: (uuid: string) => void;
|
|
456
411
|
exposeEvent: {
|
|
@@ -479,17 +434,19 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
479
434
|
content: any;
|
|
480
435
|
hidden: boolean;
|
|
481
436
|
active: boolean;
|
|
437
|
+
dataSource: import("../../../../es/components/form-render").FieldDataSource;
|
|
438
|
+
description: string;
|
|
439
|
+
display: import("../../../../es/components/form-render").FieldDisplayTypes;
|
|
482
440
|
mounted: boolean;
|
|
483
441
|
readonly destroyed: boolean;
|
|
484
442
|
unmounted: boolean;
|
|
485
443
|
componentProps: Record<string, any>;
|
|
486
444
|
decoratorProps: Record<string, any>;
|
|
487
|
-
display: import("../../../../es/components/form-render").FieldDisplayTypes;
|
|
488
|
-
description: string;
|
|
489
445
|
readOnly: boolean;
|
|
490
446
|
editable: boolean;
|
|
491
447
|
component: import("../../../../es/components/form-render").FieldComponent<any, any>;
|
|
492
448
|
decorator: import("../../../../es/components/form-render").FieldDecorator<any, any>;
|
|
449
|
+
readPretty: boolean;
|
|
493
450
|
validating: boolean;
|
|
494
451
|
submitting: boolean;
|
|
495
452
|
visited: boolean;
|
|
@@ -497,7 +454,6 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
497
454
|
modified: boolean;
|
|
498
455
|
inputValue: string;
|
|
499
456
|
inputValues: any[];
|
|
500
|
-
dataSource: import("../../../../es/components/form-render").FieldDataSource;
|
|
501
457
|
feedbacks: import("../../../../es/components/form-render").IFieldFeedback[];
|
|
502
458
|
caches: import("../../../../es/components/form-render").IFieldCaches;
|
|
503
459
|
selfErrors: import("../../../../es/components/form-render").FeedbackMessage;
|
|
@@ -533,7 +489,6 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
533
489
|
designable: boolean;
|
|
534
490
|
locate: (address: import("@formily/path").Pattern) => void;
|
|
535
491
|
readonly parent: import("../../../../es/components/form-render").GeneralField;
|
|
536
|
-
readPretty: boolean;
|
|
537
492
|
setTitle: (title?: string | undefined) => void;
|
|
538
493
|
setDescription: (description?: string | undefined) => void;
|
|
539
494
|
setDisplay: (type?: import("../../../../es/components/form-render").FieldDisplayTypes | undefined) => void;
|
|
@@ -741,6 +696,9 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
741
696
|
lowCodeReactions: {
|
|
742
697
|
type: import("vue").PropType<import("../../../../es/components/form-render").FormLowCodeReactions.Config[]>;
|
|
743
698
|
};
|
|
699
|
+
linebarAutoHidden: {
|
|
700
|
+
type: BooleanConstructor;
|
|
701
|
+
};
|
|
744
702
|
}>> & {
|
|
745
703
|
onFormChange?: ((...args: any[]) => any) | undefined;
|
|
746
704
|
onScroll?: ((...args: any[]) => any) | undefined;
|
|
@@ -755,6 +713,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
755
713
|
scope: import("../../../shared/types").AnyObject;
|
|
756
714
|
consumer: boolean;
|
|
757
715
|
enterToNextWidget: boolean | ((fieldItem: import("../../../../es/components/form-render").FieldItem) => boolean | void);
|
|
716
|
+
linebarAutoHidden: boolean;
|
|
758
717
|
}>;
|
|
759
718
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
760
719
|
export default _default;
|
|
@@ -2,7 +2,7 @@ import { defineComponent, inject, computed, createVNode, mergeProps } from 'vue'
|
|
|
2
2
|
import { arrayed, widthAppend } from '../../../../../shared/utils/index.js';
|
|
3
3
|
import { isVoidField } from '@formily/core';
|
|
4
4
|
import { connect, mapProps } from '@formily/vue';
|
|
5
|
-
import { isString } from 'lodash-es';
|
|
5
|
+
import { isString, isArray } from 'lodash-es';
|
|
6
6
|
import { NFormItem } from 'naive-ui';
|
|
7
7
|
import Annotation from '../../../../annotation-edit/index.js';
|
|
8
8
|
import '../../../index.js';
|
|
@@ -104,10 +104,11 @@ const FORM_ITEM = connect(script, mapProps({
|
|
|
104
104
|
title: "label"
|
|
105
105
|
}, (props, field) => {
|
|
106
106
|
const feedback = !isVoidField(field) ? arrayed(field.selfErrors).length ? parseFeedback(arrayed(field.selfErrors), props.fieldItem) : void 0 : void 0;
|
|
107
|
+
const required = isVoidField(field) ? isSuffixRequired(props.fieldItem) : field.required;
|
|
107
108
|
return {
|
|
108
109
|
...props,
|
|
109
110
|
fieldItem: void 0,
|
|
110
|
-
required
|
|
111
|
+
required,
|
|
111
112
|
feedback,
|
|
112
113
|
"validation-status": feedback ? "error" : void 0
|
|
113
114
|
};
|
|
@@ -118,5 +119,10 @@ function parseFeedback(selfErrors, fieldItem) {
|
|
|
118
119
|
}
|
|
119
120
|
return validateMessageParser(fieldItem.defined_error_msg, fieldItem);
|
|
120
121
|
}
|
|
122
|
+
function isSuffixRequired(field) {
|
|
123
|
+
if (!field || !isArray(field.suffixConfig) || !field.suffixConfig.length)
|
|
124
|
+
return false;
|
|
125
|
+
return `${field.is_null}` === "0";
|
|
126
|
+
}
|
|
121
127
|
|
|
122
128
|
export { FORM_ITEM };
|
|
@@ -20,6 +20,7 @@ import '../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js';
|
|
|
20
20
|
import '../../hooks/useFormValidator.js';
|
|
21
21
|
import '@formily/core';
|
|
22
22
|
import 'date-fns';
|
|
23
|
+
import '@formily/reactive';
|
|
23
24
|
import { connect, mapProps } from '@formily/vue';
|
|
24
25
|
import '@vue/shared';
|
|
25
26
|
import './index.js';
|
|
@@ -20,6 +20,7 @@ import '../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js';
|
|
|
20
20
|
import '../../hooks/useFormValidator.js';
|
|
21
21
|
import '@formily/core';
|
|
22
22
|
import 'date-fns';
|
|
23
|
+
import '@formily/reactive';
|
|
23
24
|
import { connect, mapProps } from '@formily/vue';
|
|
24
25
|
import '@vue/shared';
|
|
25
26
|
import './index.js';
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { Func, UndefinedAble } from '../../../../../es/shared/types';
|
|
2
|
-
import {
|
|
2
|
+
import { Form, GeneralField } from '@formily/core';
|
|
3
3
|
import { Ref } from 'vue';
|
|
4
4
|
import { FormItemDepsCollector, FormRenderProps } from '../../../../../es/components/form-render';
|
|
5
5
|
export declare function useAnchor(props: Readonly<FormRenderProps>, emit: Func, scrollbarRef: Ref<UndefinedAble<HTMLElement>>, collector: FormItemDepsCollector): {
|
|
6
6
|
currentAnchor: import("vue").WritableComputedRef<string>;
|
|
7
7
|
onScroll: (scrollEvent: Event) => void;
|
|
8
|
-
formHeight: import("vue").ComputedRef<string | undefined>;
|
|
9
8
|
anchorIdList: Ref<{
|
|
10
9
|
name: string;
|
|
11
10
|
title: string;
|
|
12
11
|
}[]>;
|
|
13
|
-
generateAnchorList: (
|
|
12
|
+
generateAnchorList: (formModel: Form) => Promise<void>;
|
|
13
|
+
updateAnchorList: (field: GeneralField) => void;
|
|
14
14
|
scrollTo: (id: string) => Promise<void>;
|
|
15
|
+
anchorBarRef: Ref<{
|
|
16
|
+
syncBarPosition: Func;
|
|
17
|
+
} | undefined>;
|
|
15
18
|
};
|
|
@@ -1,27 +1,30 @@
|
|
|
1
1
|
import { doAnimation } from '../../../../shared/utils/anime.js';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { ref,
|
|
2
|
+
import { untracked } from '@formily/reactive';
|
|
3
|
+
import { useDebounceFn, watchOnce } from '@vueuse/core';
|
|
4
|
+
import { ref, nextTick, computed } from 'vue';
|
|
5
5
|
import { FormItemLineBarDepKeyPrepend } from '../constants/index.js';
|
|
6
6
|
import '../utils/index.js';
|
|
7
|
-
import { createLinebarId
|
|
7
|
+
import { createLinebarId } from '../utils/schema.js';
|
|
8
8
|
|
|
9
9
|
function useAnchor(props, emit, scrollbarRef, collector) {
|
|
10
|
+
const anchorBarRef = ref();
|
|
10
11
|
const __currentAnchor = ref("");
|
|
11
|
-
const formHeight = computed(() => {
|
|
12
|
-
if (isNumber(props.maxHeight))
|
|
13
|
-
return props.maxHeight + "px";
|
|
14
|
-
return props.maxHeight;
|
|
15
|
-
});
|
|
16
12
|
const anchorIdList = ref([]);
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
anchorIdList.value.push({ title: _schema.title, name: ((_a = _schema.name) == null ? void 0 : _a.toString()) || "" });
|
|
13
|
+
const generateAnchorList = useDebounceFn(async function(formModel) {
|
|
14
|
+
var _a;
|
|
15
|
+
anchorIdList.value = Object.values(formModel.fields).reduce((res, field) => {
|
|
16
|
+
if (field.componentType === "LINEBAR" && field.selfDisplay === "visible") {
|
|
17
|
+
res.push({ title: field.title, name: field.address.toString() });
|
|
23
18
|
}
|
|
24
|
-
|
|
19
|
+
return res;
|
|
20
|
+
}, []);
|
|
21
|
+
await nextTick();
|
|
22
|
+
(_a = anchorBarRef.value) == null ? void 0 : _a.syncBarPosition();
|
|
23
|
+
}, 100);
|
|
24
|
+
function updateAnchorList(field) {
|
|
25
|
+
if (field.componentType !== "LINEBAR" || !field.selfDisplay)
|
|
26
|
+
return;
|
|
27
|
+
untracked(() => generateAnchorList(field.form));
|
|
25
28
|
}
|
|
26
29
|
let scrollLock = false;
|
|
27
30
|
async function scrollTo(id) {
|
|
@@ -68,14 +71,10 @@ function useAnchor(props, emit, scrollbarRef, collector) {
|
|
|
68
71
|
__currentAnchor.value = (_a = result == null ? void 0 : result.name) != null ? _a : "";
|
|
69
72
|
emit("scroll", scrollEvent);
|
|
70
73
|
}, 300);
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
(_anchorIdList)
|
|
74
|
-
|
|
75
|
-
__currentAnchor.value = (_b = (_a = _anchorIdList[0]) == null ? void 0 : _a.name) != null ? _b : "";
|
|
76
|
-
},
|
|
77
|
-
{ deep: true, immediate: true }
|
|
78
|
-
);
|
|
74
|
+
watchOnce(anchorIdList, (_anchorIdList) => {
|
|
75
|
+
var _a, _b;
|
|
76
|
+
__currentAnchor.value = (_b = (_a = _anchorIdList[0]) == null ? void 0 : _a.name) != null ? _b : "";
|
|
77
|
+
});
|
|
79
78
|
const currentAnchor = computed({
|
|
80
79
|
get() {
|
|
81
80
|
return __currentAnchor.value;
|
|
@@ -89,10 +88,11 @@ function useAnchor(props, emit, scrollbarRef, collector) {
|
|
|
89
88
|
return {
|
|
90
89
|
currentAnchor,
|
|
91
90
|
onScroll,
|
|
92
|
-
formHeight,
|
|
93
91
|
anchorIdList,
|
|
94
92
|
generateAnchorList,
|
|
95
|
-
|
|
93
|
+
updateAnchorList,
|
|
94
|
+
scrollTo,
|
|
95
|
+
anchorBarRef
|
|
96
96
|
};
|
|
97
97
|
}
|
|
98
98
|
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { untracked } from '@formily/reactive';
|
|
2
|
+
import { nextTick } from 'vue';
|
|
3
|
+
|
|
4
|
+
function useAutoHidden() {
|
|
5
|
+
async function trigger(field) {
|
|
6
|
+
const fieldDisplay = field.selfDisplay;
|
|
7
|
+
untracked(async () => {
|
|
8
|
+
if (field.componentType === "LINEBAR") {
|
|
9
|
+
await nextTick();
|
|
10
|
+
linebarVisibleCheck(field);
|
|
11
|
+
} else {
|
|
12
|
+
const parent = field.parent;
|
|
13
|
+
if (!parent || parent.componentType !== "LINEBAR")
|
|
14
|
+
return;
|
|
15
|
+
if (fieldDisplay === "visible") {
|
|
16
|
+
parent.setDisplay("visible");
|
|
17
|
+
} else {
|
|
18
|
+
linebarVisibleCheck(parent);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return { trigger };
|
|
24
|
+
}
|
|
25
|
+
async function linebarVisibleCheck(field) {
|
|
26
|
+
if (field.selfDisplay === "hidden")
|
|
27
|
+
return;
|
|
28
|
+
const visible = getChildrenAddress(field).some((address) => {
|
|
29
|
+
const targetField = field.form.fields[address];
|
|
30
|
+
return targetField && targetField.selfDisplay === "visible";
|
|
31
|
+
});
|
|
32
|
+
field.setDisplay(visible ? "visible" : "hidden");
|
|
33
|
+
}
|
|
34
|
+
function getChildrenAddress(field) {
|
|
35
|
+
const fieldAddress = field.address.toString();
|
|
36
|
+
const addresses = Reflect.get(field.form.query(fieldAddress + ".*"), "addresses");
|
|
37
|
+
return addresses.filter((address) => {
|
|
38
|
+
const targetField = field.form.fields[address];
|
|
39
|
+
return targetField && targetField.address.parent().toString() === fieldAddress;
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export { useAutoHidden };
|
|
@@ -2,26 +2,23 @@ import { Form } from '@formily/core';
|
|
|
2
2
|
import { FieldItem, FormBusinessFormatter } from '../../../../../es/components/form-render';
|
|
3
3
|
import { FIELD_BUSINESS_TYPE } from '../constants';
|
|
4
4
|
export declare class BusinessCollector {
|
|
5
|
-
private formModel;
|
|
6
5
|
private businessFormatter?;
|
|
7
6
|
private readonly typeLockMap;
|
|
8
7
|
private readonly typeCollector;
|
|
9
8
|
private readonly fieldNameCollector;
|
|
10
|
-
constructor(
|
|
9
|
+
constructor(businessFormatter?: FormBusinessFormatter | undefined);
|
|
11
10
|
private formatter;
|
|
12
11
|
collect(type: FIELD_BUSINESS_TYPE, fieldItem: FieldItem): void;
|
|
13
12
|
getField(type: FIELD_BUSINESS_TYPE): FieldItem | undefined;
|
|
14
|
-
getFieldInstanceByType(type: FIELD_BUSINESS_TYPE): import("@formily/core").GeneralField | null;
|
|
13
|
+
getFieldInstanceByType(formModel: Form, type: FIELD_BUSINESS_TYPE): import("@formily/core").GeneralField | null;
|
|
15
14
|
private getType;
|
|
16
15
|
private getValueByField;
|
|
17
|
-
getValueByType(type: FIELD_BUSINESS_TYPE): unknown;
|
|
18
|
-
setValueByType(type: FIELD_BUSINESS_TYPE, value: unknown): void;
|
|
19
|
-
registerChangeBusiness(type: FIELD_BUSINESS_TYPE, handler: () => void): this;
|
|
20
|
-
registerBlurBusiness(type: FIELD_BUSINESS_TYPE, handler: () => void): this;
|
|
16
|
+
getValueByType(formModel: Form, type: FIELD_BUSINESS_TYPE): unknown;
|
|
17
|
+
setValueByType(formModel: Form, type: FIELD_BUSINESS_TYPE, value: unknown): void;
|
|
18
|
+
registerChangeBusiness(type: FIELD_BUSINESS_TYPE, handler: (formModel: Form) => void): this;
|
|
21
19
|
private changeHandlerMap;
|
|
22
|
-
|
|
23
|
-
trigger(fieldName: string, triggerType?: 'change' | 'blur'): Map<FIELD_BUSINESS_TYPE, number> | undefined;
|
|
20
|
+
trigger(formModel: Form, fieldName: string, triggerType?: 'change' | 'blur'): Map<FIELD_BUSINESS_TYPE, number> | undefined;
|
|
24
21
|
}
|
|
25
22
|
export declare function useBusinessBinding(): {
|
|
26
|
-
create: (
|
|
23
|
+
create: (formatter?: FormBusinessFormatter) => BusinessCollector;
|
|
27
24
|
};
|
|
@@ -7,14 +7,12 @@ import '../utils/index.js';
|
|
|
7
7
|
import { isIdCard, parseIdCard, parseAgeFromContext, parseBirthday, parseAge2Birthday } from '../utils/business.js';
|
|
8
8
|
|
|
9
9
|
class BusinessCollector {
|
|
10
|
-
constructor(
|
|
11
|
-
this.formModel = formModel;
|
|
10
|
+
constructor(businessFormatter) {
|
|
12
11
|
this.businessFormatter = businessFormatter;
|
|
13
12
|
this.typeLockMap = /* @__PURE__ */ new Map();
|
|
14
13
|
this.typeCollector = /* @__PURE__ */ new Map();
|
|
15
14
|
this.fieldNameCollector = /* @__PURE__ */ new Map();
|
|
16
15
|
this.changeHandlerMap = /* @__PURE__ */ new Map([]);
|
|
17
|
-
this.blurHandlerMap = /* @__PURE__ */ new Map([]);
|
|
18
16
|
}
|
|
19
17
|
formatter(...args) {
|
|
20
18
|
return isFunction(this.businessFormatter) ? this.businessFormatter(...args) : args[0].value;
|
|
@@ -26,24 +24,24 @@ class BusinessCollector {
|
|
|
26
24
|
getField(type) {
|
|
27
25
|
return this.typeCollector.get(type);
|
|
28
26
|
}
|
|
29
|
-
getFieldInstanceByType(type) {
|
|
27
|
+
getFieldInstanceByType(formModel, type) {
|
|
30
28
|
const field = this.getField(type);
|
|
31
|
-
return field ?
|
|
29
|
+
return field ? formModel.query(field.val_key).take() : null;
|
|
32
30
|
}
|
|
33
31
|
getType(fieldName) {
|
|
34
32
|
return this.fieldNameCollector.get(fieldName);
|
|
35
33
|
}
|
|
36
|
-
getValueByField(fieldName) {
|
|
37
|
-
const _field =
|
|
34
|
+
getValueByField(formModel, fieldName) {
|
|
35
|
+
const _field = formModel.query(fieldName).take();
|
|
38
36
|
return isField(_field) ? _field.value : null;
|
|
39
37
|
}
|
|
40
|
-
getValueByType(type) {
|
|
38
|
+
getValueByType(formModel, type) {
|
|
41
39
|
const field = this.getField(type);
|
|
42
|
-
return field ? this.getValueByField(field.val_key) : null;
|
|
40
|
+
return field ? this.getValueByField(formModel, field.val_key) : null;
|
|
43
41
|
}
|
|
44
|
-
setValueByType(type, value) {
|
|
42
|
+
setValueByType(formModel, type, value) {
|
|
45
43
|
const field = this.getField(type);
|
|
46
|
-
field &&
|
|
44
|
+
field && formModel.setFieldState(field.val_key, (state) => {
|
|
47
45
|
if (state.value === value)
|
|
48
46
|
return;
|
|
49
47
|
const lock = this.typeLockMap.get(type);
|
|
@@ -55,11 +53,7 @@ class BusinessCollector {
|
|
|
55
53
|
this.changeHandlerMap.set(type, handler);
|
|
56
54
|
return this;
|
|
57
55
|
}
|
|
58
|
-
|
|
59
|
-
this.blurHandlerMap.set(type, handler);
|
|
60
|
-
return this;
|
|
61
|
-
}
|
|
62
|
-
trigger(fieldName, triggerType = "change") {
|
|
56
|
+
trigger(formModel, fieldName, triggerType = "change") {
|
|
63
57
|
var _a;
|
|
64
58
|
const type = this.getType(fieldName);
|
|
65
59
|
if (!type)
|
|
@@ -67,10 +61,10 @@ class BusinessCollector {
|
|
|
67
61
|
if (triggerType === "change" && this.typeLockMap.get(type) > 0) {
|
|
68
62
|
return this.typeLockMap.set(type, this.typeLockMap.get(type) - 1);
|
|
69
63
|
}
|
|
70
|
-
const handler = triggerType === "change" ? this.changeHandlerMap :
|
|
64
|
+
const handler = triggerType === "change" ? this.changeHandlerMap : null;
|
|
71
65
|
if (!handler)
|
|
72
66
|
return;
|
|
73
|
-
(_a = handler.get(type)) == null ? void 0 : _a.call(this);
|
|
67
|
+
(_a = handler.get(type)) == null ? void 0 : _a.call(this, formModel);
|
|
74
68
|
}
|
|
75
69
|
}
|
|
76
70
|
function useBusinessBinding() {
|
|
@@ -79,37 +73,45 @@ function useBusinessBinding() {
|
|
|
79
73
|
const birthdayField = this.getField(FIELD_BUSINESS_TYPE.BIRTHDAY);
|
|
80
74
|
return (_a = birthdayField == null ? void 0 : birthdayField.date_format) != null ? _a : "yyyy-MM-dd HH:mm";
|
|
81
75
|
}
|
|
82
|
-
function handlerIdCardType() {
|
|
83
|
-
const idCard = this.getValueByType(FIELD_BUSINESS_TYPE.ID_CARD);
|
|
76
|
+
function handlerIdCardType(formModel) {
|
|
77
|
+
const idCard = this.getValueByType(formModel, FIELD_BUSINESS_TYPE.ID_CARD);
|
|
84
78
|
if (!idCard || !isString(idCard) || !isIdCard(idCard)) {
|
|
85
79
|
return;
|
|
86
80
|
}
|
|
87
81
|
const info = parseIdCard(idCard);
|
|
88
82
|
const { age, ageUnit } = parseAgeFromContext(info);
|
|
89
|
-
this.setValueByType(FIELD_BUSINESS_TYPE.AGE_UNIT, ageUnit);
|
|
90
|
-
this.setValueByType(FIELD_BUSINESS_TYPE.AGE, age);
|
|
91
|
-
this.setValueByType(FIELD_BUSINESS_TYPE.SEX, info.sex);
|
|
92
|
-
this.setValueByType(
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
83
|
+
this.setValueByType(formModel, FIELD_BUSINESS_TYPE.AGE_UNIT, ageUnit);
|
|
84
|
+
this.setValueByType(formModel, FIELD_BUSINESS_TYPE.AGE, age);
|
|
85
|
+
this.setValueByType(formModel, FIELD_BUSINESS_TYPE.SEX, info.sex);
|
|
86
|
+
this.setValueByType(
|
|
87
|
+
formModel,
|
|
88
|
+
FIELD_BUSINESS_TYPE.BIRTHDAY,
|
|
89
|
+
format(new Date(info.birthday), getBirthdayFormat.call(this))
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
function handlerBirthdayType(formModel) {
|
|
93
|
+
const birthday = this.getValueByType(formModel, FIELD_BUSINESS_TYPE.BIRTHDAY);
|
|
96
94
|
if (!isString(birthday))
|
|
97
95
|
return;
|
|
98
96
|
const { age, ageUnit } = parseAgeFromContext(parseBirthday(birthday));
|
|
99
|
-
this.setValueByType(FIELD_BUSINESS_TYPE.AGE_UNIT, ageUnit);
|
|
100
|
-
this.setValueByType(FIELD_BUSINESS_TYPE.AGE, age);
|
|
97
|
+
this.setValueByType(formModel, FIELD_BUSINESS_TYPE.AGE_UNIT, ageUnit);
|
|
98
|
+
this.setValueByType(formModel, FIELD_BUSINESS_TYPE.AGE, age);
|
|
101
99
|
}
|
|
102
|
-
function handlerAgeType() {
|
|
103
|
-
const age = this.getValueByType(FIELD_BUSINESS_TYPE.AGE);
|
|
104
|
-
const ageUnit = this.getValueByType(FIELD_BUSINESS_TYPE.AGE_UNIT);
|
|
100
|
+
function handlerAgeType(formModel) {
|
|
101
|
+
const age = this.getValueByType(formModel, FIELD_BUSINESS_TYPE.AGE);
|
|
102
|
+
const ageUnit = this.getValueByType(formModel, FIELD_BUSINESS_TYPE.AGE_UNIT);
|
|
105
103
|
if (!isString(age) && !isNumber(age) || age === "")
|
|
106
104
|
return;
|
|
107
105
|
if (!isString(ageUnit) || ageUnit === "")
|
|
108
106
|
return;
|
|
109
|
-
this.setValueByType(
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
107
|
+
this.setValueByType(
|
|
108
|
+
formModel,
|
|
109
|
+
FIELD_BUSINESS_TYPE.BIRTHDAY,
|
|
110
|
+
parseAge2Birthday(+age, ageUnit, getBirthdayFormat.call(this))
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
function create(formatter) {
|
|
114
|
+
return new BusinessCollector(formatter).registerChangeBusiness(FIELD_BUSINESS_TYPE.ID_CARD, handlerIdCardType).registerChangeBusiness(FIELD_BUSINESS_TYPE.AGE_UNIT, handlerAgeType).registerChangeBusiness(FIELD_BUSINESS_TYPE.AGE, handlerAgeType).registerChangeBusiness(FIELD_BUSINESS_TYPE.BIRTHDAY, handlerBirthdayType);
|
|
113
115
|
}
|
|
114
116
|
return { create };
|
|
115
117
|
}
|
|
@@ -4,8 +4,8 @@ import '../../index.js';
|
|
|
4
4
|
import { parseNumberFromMaybeString, formRenderLog } from '../utils/index.js';
|
|
5
5
|
import { useFieldNormalize } from './useFieldNormalize.js';
|
|
6
6
|
import { fieldKeyEscape, createLinebarId } from '../utils/schema.js';
|
|
7
|
-
import { transformDateFormat } from '../utils/business.js';
|
|
8
7
|
import { useFormValidator } from './useFormValidator.js';
|
|
8
|
+
import { transformDateFormat } from '../utils/business.js';
|
|
9
9
|
|
|
10
10
|
function bindAutoGraphProps(schema, item) {
|
|
11
11
|
Object.assign(schema["x-component-props"], {
|
|
@@ -30,12 +30,7 @@ function useFieldListAdaptor(collector) {
|
|
|
30
30
|
"x-component-props": {
|
|
31
31
|
placeholder: item.placeholder,
|
|
32
32
|
clearable: item.is_empty === "0",
|
|
33
|
-
...item.componentProps || {}
|
|
34
|
-
onBlur(...args) {
|
|
35
|
-
var _a2, _b;
|
|
36
|
-
collector.trigger(item.val_key, "blur");
|
|
37
|
-
(_b = (_a2 = item.componentProps) == null ? void 0 : _a2.onBlur) == null ? void 0 : _b.call(_a2, ...args);
|
|
38
|
-
}
|
|
33
|
+
...item.componentProps || {}
|
|
39
34
|
},
|
|
40
35
|
"x-content": item.slots,
|
|
41
36
|
"x-display": item.is_show === "0" ? "hidden" : "visible",
|
|
@@ -180,6 +175,7 @@ function useFieldListAdaptor(collector) {
|
|
|
180
175
|
type: "void",
|
|
181
176
|
title: item.alias || item.name,
|
|
182
177
|
"x-component": "LINEBAR",
|
|
178
|
+
"x-display": "visible",
|
|
183
179
|
"x-component-props": {
|
|
184
180
|
disabled: item.is_not_fold === "1",
|
|
185
181
|
id: createLinebarId(item.val_key),
|
|
@@ -238,23 +234,25 @@ function useFieldListAdaptor(collector) {
|
|
|
238
234
|
if (!item.suffixConfig)
|
|
239
235
|
return createWidgetSchema(item);
|
|
240
236
|
const suffixList = arrayed(item.suffixConfig);
|
|
241
|
-
const fieldList = [{ ...item, suffixConfig: void 0 }].concat(
|
|
237
|
+
const fieldList = [{ ...item, hide_title: "1", suffixConfig: void 0 }].concat(
|
|
242
238
|
suffixList.map((suffix) => {
|
|
243
239
|
return {
|
|
244
240
|
...suffix,
|
|
245
|
-
|
|
246
|
-
|
|
241
|
+
hide_title: "1",
|
|
242
|
+
is_show: item.is_show
|
|
247
243
|
};
|
|
248
244
|
})
|
|
249
245
|
);
|
|
250
|
-
|
|
246
|
+
const schema = createStandardSchema(item);
|
|
247
|
+
Object.assign(schema, {
|
|
251
248
|
type: "void",
|
|
252
249
|
name: fieldKeyEscape(fieldList),
|
|
253
250
|
title: item.alias || item.name,
|
|
254
251
|
"x-component": "INPUT_GROUP",
|
|
255
252
|
"x-component-props": { span: (item.elem_width || 3) * 2 },
|
|
256
253
|
properties: schemaAdaptor(fieldList)
|
|
257
|
-
};
|
|
254
|
+
});
|
|
255
|
+
return schema;
|
|
258
256
|
};
|
|
259
257
|
const { FieldNormalizeWaterfallHook } = useFieldNormalize();
|
|
260
258
|
function schemaAdaptor(fieldList) {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Func } from '../../../../../es/shared/types';
|
|
2
|
-
import { Form } from '@formily/core';
|
|
3
2
|
import { ShallowReactive } from 'vue';
|
|
4
3
|
import { FormRenderProps } from '../../../../../es/components/form-render';
|
|
5
|
-
export declare function useFormContext(props: ShallowReactive<FormRenderProps>,
|
|
4
|
+
export declare function useFormContext(props: ShallowReactive<FormRenderProps>, emit: Func): {
|
|
6
5
|
asyncQueue: import("../../../../../es/components/form-render").FormAsyncQueue;
|
|
7
6
|
SchemaField: import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>;
|
|
8
7
|
businessCollector: import("../../../../../es/components/form-render").BusinessCollector;
|
|
@@ -14,7 +14,7 @@ import { useBusinessBinding } from './useBusinessBinding.js';
|
|
|
14
14
|
import { useChangeContext } from './useChangeContext.js';
|
|
15
15
|
import { useFormItemDeps } from './useFormItemDeps.js';
|
|
16
16
|
|
|
17
|
-
function useFormContext(props,
|
|
17
|
+
function useFormContext(props, emit) {
|
|
18
18
|
const { callLifeCycle } = useFormRenderLifeCycle(props);
|
|
19
19
|
const asyncQueue = injectOrProvide(
|
|
20
20
|
InjectionAsyncQueue,
|
|
@@ -34,7 +34,7 @@ function useFormContext(props, formModel, emit) {
|
|
|
34
34
|
scope: Object.assign({}, usePresetScope(), props.scope)
|
|
35
35
|
}).SchemaField
|
|
36
36
|
);
|
|
37
|
-
const businessCollector = useBusinessBinding().create(
|
|
37
|
+
const businessCollector = useBusinessBinding().create(props.businessFormatter);
|
|
38
38
|
provide(InjectionBusinessCollector, businessCollector);
|
|
39
39
|
const changeContextCollector = useChangeContext().create();
|
|
40
40
|
provide(InjectionChangeContextCollector, changeContextCollector);
|