@jt-home/mfe-components 1.0.19 → 1.0.21

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.
@@ -1,10 +1,12 @@
1
- import type { GlobalInfoActions, GlobalInfoExternalOperationParamsFormatter, GlobalInfoNode, GlobalInfoSection, GlobalInfoSectionStatus, GlobalInfoService, GlobalInfoState, GlobalInfoViewModel } from '../model/types';
1
+ import type { GlobalInfoActions, GlobalInfoExternalOperationParamsFormatter, GlobalInfoNode, GlobalInfoRenderConfig, GlobalInfoSection, GlobalInfoSectionStatus, GlobalInfoService, GlobalInfoState, GlobalInfoViewModel } from '../model/types';
2
2
  export interface UseGlobalInfoControllerOptions<TService extends GlobalInfoService = GlobalInfoService> {
3
3
  service: TService;
4
4
  adaptScene?: string;
5
5
  emplid?: string | number;
6
6
  autoLoad?: boolean;
7
7
  initialActiveNodeKey?: string;
8
+ /** 渲染配置会被控制器保存逻辑复用,确保内置校验和业务侧文案配置保持一致。 */
9
+ renderConfig?: GlobalInfoRenderConfig;
8
10
  formatOperationParams?: GlobalInfoExternalOperationParamsFormatter;
9
11
  }
10
12
  export declare const useGlobalInfoController: <TService extends GlobalInfoService = GlobalInfoService>(options: UseGlobalInfoControllerOptions<TService>) => {
@@ -11,4 +11,5 @@ export { default as GlobalInfoFieldValue } from './renderers/GlobalInfoFieldValu
11
11
  export { default as GlobalInfoDeleteConfirm } from './renderers/GlobalInfoDeleteConfirm.vue';
12
12
  export { useGlobalInfoController } from './controller/useGlobalInfoController';
13
13
  export { buildGlobalInfoUpdatePayload, createEmptyGlobalInfoViewModel, isGlobalInfoNode, mergeGlobalInfoChildren, normalizeGlobalInfoDetail, normalizeGlobalInfoTree, resolveGlobalInfoRenderType, } from './model/adapter';
14
- export type { GlobalInfoActions, GlobalInfoApiOperation, GlobalInfoDetailParams, GlobalInfoExternalOperationParamsFormatter, GlobalInfoExternalOperationParamsFormatterContext, GlobalInfoField, GlobalInfoFieldBusinessChangeContext, GlobalInfoFieldBusinessChangeHandler, GlobalInfoFieldHiddenContext, GlobalInfoFieldHiddenRule, GlobalInfoFieldOption, GlobalInfoInfoSet, GlobalInfoNode, GlobalInfoOperationContext, GlobalInfoOpenTreeParams, GlobalInfoProviderSlotProps, GlobalInfoRawRecord, GlobalInfoRequestSource, GlobalInfoRequestType, GlobalInfoRenderConfig, GlobalInfoRenderType, GlobalInfoScheme, GlobalInfoSection, GlobalInfoSectionLoadTarget, GlobalInfoSectionSlotScope, GlobalInfoSectionStatus, GlobalInfoSectionTarget, GlobalInfoService, GlobalInfoSetMark, GlobalInfoState, GlobalInfoTableRowDeleteVisibleContext, GlobalInfoTableRowDeleteVisibleRule, GlobalInfoTemplateTreeParams, GlobalInfoUpdateParams, GlobalInfoViewModel, } from './model/types';
14
+ export { DEFAULT_GLOBAL_INFO_REQUIRED_INFO_SET_EMPTY_MESSAGE, validateGlobalInfoRequiredInfoSet, } from './model/requiredInfoSetValidation';
15
+ export type { GlobalInfoActions, GlobalInfoApiOperation, GlobalInfoDetailParams, GlobalInfoExternalOperationParamsFormatter, GlobalInfoExternalOperationParamsFormatterContext, GlobalInfoField, GlobalInfoFieldBusinessChangeContext, GlobalInfoFieldBusinessChangeHandler, GlobalInfoFieldHiddenContext, GlobalInfoFieldHiddenRule, GlobalInfoFieldOption, GlobalInfoInfoSet, GlobalInfoNode, GlobalInfoOperationContext, GlobalInfoOpenTreeParams, GlobalInfoProviderSlotProps, GlobalInfoRawRecord, GlobalInfoRequestSource, GlobalInfoRequestType, GlobalInfoRequiredInfoSetEmptyMessage, GlobalInfoRequiredInfoSetEmptyMessageContext, GlobalInfoRenderConfig, GlobalInfoRenderType, GlobalInfoScheme, GlobalInfoSection, GlobalInfoSectionLoadTarget, GlobalInfoSectionSlotScope, GlobalInfoSectionStatus, GlobalInfoSectionTarget, GlobalInfoService, GlobalInfoSetMark, GlobalInfoState, GlobalInfoTableRowDeleteVisibleContext, GlobalInfoTableRowDeleteVisibleRule, GlobalInfoTemplateTreeParams, GlobalInfoUpdateParams, GlobalInfoViewModel, } from './model/types';
@@ -0,0 +1,7 @@
1
+ import type { GlobalInfoRawRecord, GlobalInfoRenderConfig, GlobalInfoSection } from './types';
2
+ export declare const DEFAULT_GLOBAL_INFO_REQUIRED_INFO_SET_EMPTY_MESSAGE = "\u4FE1\u606F\u96C6\u4E0D\u80FD\u4E3A\u7A7A\uFF0C\u6700\u540E\u4E00\u6761\u6570\u636E\u4E0D\u53EF\u5220\u9664";
3
+ export type GlobalInfoRequiredInfoSetValidationOptions = {
4
+ /** 允许业务侧复用渲染配置中的文案规则,避免自定义保存入口和内置保存提示不一致。 */
5
+ emptyMessage?: GlobalInfoRenderConfig['requiredInfoSetEmptyMessage'];
6
+ };
7
+ export declare function validateGlobalInfoRequiredInfoSet(section: GlobalInfoSection, infSetValues?: GlobalInfoRawRecord[], options?: GlobalInfoRequiredInfoSetValidationOptions): string | null;
@@ -79,6 +79,13 @@ export interface GlobalInfoTableRowDeleteVisibleContext {
79
79
  }
80
80
  /** 返回 false 时隐藏当前行删除按钮;未配置时组件只读取行数据 allowDelete 字段。 */
81
81
  export type GlobalInfoTableRowDeleteVisibleRule = (context: GlobalInfoTableRowDeleteVisibleContext) => boolean;
82
+ export type GlobalInfoRequiredInfoSetEmptyMessageContext = {
83
+ /** 当前被保存的信息集。 */
84
+ section: GlobalInfoSection;
85
+ /** 本次即将提交给后端的 infSetValues。 */
86
+ infSetValues: GlobalInfoRawRecord[];
87
+ };
88
+ export type GlobalInfoRequiredInfoSetEmptyMessage = string | ((context: GlobalInfoRequiredInfoSetEmptyMessageContext) => string);
82
89
  /** globalInfo 默认渲染器配置,字段隐藏只保留 hiddenRule 一种方式,避免多套规则互相覆盖。 */
83
90
  export interface GlobalInfoRenderConfig {
84
91
  /** 字段隐藏方法;字段值变化后 computed 会重新执行,返回 true 时隐藏当前字段。 */
@@ -87,6 +94,8 @@ export interface GlobalInfoRenderConfig {
87
94
  onFieldBusinessChange?: GlobalInfoFieldBusinessChangeHandler;
88
95
  /** 表格行删除按钮展示方法;返回 false 时只隐藏当前行删除入口。 */
89
96
  rowDeleteVisibleRule?: GlobalInfoTableRowDeleteVisibleRule;
97
+ /** 信息集级必填为空时的提示文案;默认提示“信息集不能为空,最后一条数据不可删除”。 */
98
+ requiredInfoSetEmptyMessage?: GlobalInfoRequiredInfoSetEmptyMessage;
90
99
  /** 序号列表头文案。 */
91
100
  sequenceLabel?: string;
92
101
  /** 序号列宽度。 */
@@ -4,8 +4,8 @@ export { JtButton } from './JtButton/index';
4
4
  export { JtAttachmentPreview, JtAttachmentPreviewByParams, setupJtAttachmentPreview, } from './JtAttachmentPreview/index';
5
5
  export { JtCascader, JtDatePicker, JtFormItems, JtInput, JtSelect } from './form/index';
6
6
  export { JtPageHeader } from './JtPageHeader/index';
7
- export { GlobalInfoAutoRenderer, GlobalInfoDeleteConfirm, GlobalInfoFieldControl, GlobalInfoFieldValue, GlobalInfoFormRenderer, GlobalInfoGroup, GlobalInfoProvider, GlobalInfoSectionBlock, GlobalInfoSectionOutlet, GlobalInfoSections, GlobalInfoTableRenderer, useGlobalInfoController, buildGlobalInfoUpdatePayload, createEmptyGlobalInfoViewModel, isGlobalInfoNode, mergeGlobalInfoChildren, normalizeGlobalInfoDetail, normalizeGlobalInfoTree, resolveGlobalInfoRenderType, } from './globalInfo/index';
7
+ export { GlobalInfoAutoRenderer, GlobalInfoDeleteConfirm, GlobalInfoFieldControl, GlobalInfoFieldValue, GlobalInfoFormRenderer, GlobalInfoGroup, GlobalInfoProvider, GlobalInfoSectionBlock, GlobalInfoSectionOutlet, GlobalInfoSections, GlobalInfoTableRenderer, useGlobalInfoController, buildGlobalInfoUpdatePayload, createEmptyGlobalInfoViewModel, isGlobalInfoNode, mergeGlobalInfoChildren, normalizeGlobalInfoDetail, normalizeGlobalInfoTree, resolveGlobalInfoRenderType, DEFAULT_GLOBAL_INFO_REQUIRED_INFO_SET_EMPTY_MESSAGE, validateGlobalInfoRequiredInfoSet, } from './globalInfo/index';
8
8
  export type { JTCascaderFormItemConfig, JTCompatibleFormItemType, JTElementFormItemType, JTFormItemCascaderOption, JTFormItemConfig, JTFormItemEventHandler, JTFormItemType, JTFormItemsForm, JTFormItemsProps, JtOptionItem, } from './form/index';
9
9
  export type { JtPageHeaderOperate, JtPageHeaderProps } from './JtPageHeader/index';
10
10
  export type { JtAttachmentPreviewHandler, JtAttachmentPreviewFileOptions, JtAttachmentPreviewRequestConfig, JtAttachmentPreviewService, JtAttachmentPreviewMode, JtAttachmentPreviewOptions, JtAttachmentPreviewResolvedType, } from './JtAttachmentPreview/index';
11
- export type { GlobalInfoActions, GlobalInfoApiOperation, GlobalInfoDetailParams, GlobalInfoField, GlobalInfoFieldHiddenContext, GlobalInfoFieldHiddenRule, GlobalInfoFieldOption, GlobalInfoInfoSet, GlobalInfoNode, GlobalInfoOperationContext, GlobalInfoOpenTreeParams, GlobalInfoProviderSlotProps, GlobalInfoRawRecord, GlobalInfoRenderConfig, GlobalInfoRenderType, GlobalInfoScheme, GlobalInfoSection, GlobalInfoSectionLoadTarget, GlobalInfoSectionSlotScope, GlobalInfoSectionStatus, GlobalInfoSectionTarget, GlobalInfoService, GlobalInfoSetMark, GlobalInfoState, GlobalInfoTableRowDeleteVisibleContext, GlobalInfoTableRowDeleteVisibleRule, GlobalInfoTemplateTreeParams, GlobalInfoUpdateParams, GlobalInfoViewModel, } from './globalInfo/index';
11
+ export type { GlobalInfoActions, GlobalInfoApiOperation, GlobalInfoDetailParams, GlobalInfoField, GlobalInfoFieldHiddenContext, GlobalInfoFieldHiddenRule, GlobalInfoFieldOption, GlobalInfoInfoSet, GlobalInfoNode, GlobalInfoOperationContext, GlobalInfoOpenTreeParams, GlobalInfoProviderSlotProps, GlobalInfoRawRecord, GlobalInfoRequiredInfoSetEmptyMessage, GlobalInfoRequiredInfoSetEmptyMessageContext, GlobalInfoRenderConfig, GlobalInfoRenderType, GlobalInfoScheme, GlobalInfoSection, GlobalInfoSectionLoadTarget, GlobalInfoSectionSlotScope, GlobalInfoSectionStatus, GlobalInfoSectionTarget, GlobalInfoService, GlobalInfoSetMark, GlobalInfoState, GlobalInfoTableRowDeleteVisibleContext, GlobalInfoTableRowDeleteVisibleRule, GlobalInfoTemplateTreeParams, GlobalInfoUpdateParams, GlobalInfoViewModel, } from './globalInfo/index';
@@ -1,3 +1,3 @@
1
1
  import './assets/styles/base.css';
2
- export { GlobalInfoAutoRenderer, GlobalInfoDeleteConfirm, GlobalInfoFieldControl, GlobalInfoFieldValue, GlobalInfoFormRenderer, GlobalInfoGroup, GlobalInfoProvider, GlobalInfoSectionBlock, GlobalInfoSectionOutlet, GlobalInfoSections, GlobalInfoTableRenderer, JtAttachmentPreview, JtAttachmentPreviewByParams, JtCascader, JtButton, JtCrudTable, JtDatePicker, JtFilterBar, JtFormItems, JtInput, JtPageHeader, JtPagination, JtSelect, JtTable, buildGlobalInfoUpdatePayload, createEmptyGlobalInfoViewModel, isGlobalInfoNode, mergeGlobalInfoChildren, normalizeGlobalInfoDetail, normalizeGlobalInfoTree, resolveGlobalInfoRenderType, setupJtAttachmentPreview, useGlobalInfoController, } from './components/index';
3
- export type { GlobalInfoActions, GlobalInfoApiOperation, GlobalInfoDetailParams, GlobalInfoField, GlobalInfoFieldHiddenContext, GlobalInfoFieldHiddenRule, GlobalInfoFieldOption, GlobalInfoInfoSet, GlobalInfoNode, GlobalInfoOperationContext, GlobalInfoOpenTreeParams, GlobalInfoProviderSlotProps, GlobalInfoRawRecord, GlobalInfoRenderConfig, GlobalInfoRenderType, GlobalInfoScheme, GlobalInfoSection, GlobalInfoSectionLoadTarget, GlobalInfoSectionSlotScope, GlobalInfoSectionStatus, GlobalInfoSectionTarget, GlobalInfoService, GlobalInfoSetMark, GlobalInfoState, GlobalInfoTemplateTreeParams, GlobalInfoUpdateParams, GlobalInfoViewModel, JTCascaderFormItemConfig, JtCrudColumn, JtCrudOption, JtDicItem, JTCompatibleFormItemType, JTElementFormItemType, JTFormItemConfig, JTFormItemEventHandler, JTFormItemType, JTFormItemsForm, JTFormItemsProps, JTFormItemCascaderOption, JtAttachmentPreviewHandler, JtAttachmentPreviewFileOptions, JtAttachmentPreviewRequestConfig, JtAttachmentPreviewService, JtAttachmentPreviewMode, JtAttachmentPreviewOptions, JtAttachmentPreviewResolvedType, JtOptionItem, JtPageHeaderOperate, JtPageHeaderProps, JtPaginationData, JtSearchType, } from './components/index';
2
+ export { GlobalInfoAutoRenderer, GlobalInfoDeleteConfirm, GlobalInfoFieldControl, GlobalInfoFieldValue, GlobalInfoFormRenderer, GlobalInfoGroup, GlobalInfoProvider, GlobalInfoSectionBlock, GlobalInfoSectionOutlet, GlobalInfoSections, GlobalInfoTableRenderer, JtAttachmentPreview, JtAttachmentPreviewByParams, JtCascader, JtButton, JtCrudTable, JtDatePicker, JtFilterBar, JtFormItems, JtInput, JtPageHeader, JtPagination, JtSelect, JtTable, buildGlobalInfoUpdatePayload, createEmptyGlobalInfoViewModel, isGlobalInfoNode, mergeGlobalInfoChildren, normalizeGlobalInfoDetail, normalizeGlobalInfoTree, resolveGlobalInfoRenderType, setupJtAttachmentPreview, useGlobalInfoController, DEFAULT_GLOBAL_INFO_REQUIRED_INFO_SET_EMPTY_MESSAGE, validateGlobalInfoRequiredInfoSet, } from './components/index';
3
+ export type { GlobalInfoActions, GlobalInfoApiOperation, GlobalInfoDetailParams, GlobalInfoField, GlobalInfoFieldHiddenContext, GlobalInfoFieldHiddenRule, GlobalInfoFieldOption, GlobalInfoInfoSet, GlobalInfoNode, GlobalInfoOperationContext, GlobalInfoOpenTreeParams, GlobalInfoProviderSlotProps, GlobalInfoRawRecord, GlobalInfoRenderConfig, GlobalInfoRenderType, GlobalInfoRequiredInfoSetEmptyMessage, GlobalInfoRequiredInfoSetEmptyMessageContext, GlobalInfoScheme, GlobalInfoSection, GlobalInfoSectionLoadTarget, GlobalInfoSectionSlotScope, GlobalInfoSectionStatus, GlobalInfoSectionTarget, GlobalInfoService, GlobalInfoSetMark, GlobalInfoState, GlobalInfoTemplateTreeParams, GlobalInfoUpdateParams, GlobalInfoViewModel, JTCascaderFormItemConfig, JtCrudColumn, JtCrudOption, JtDicItem, JTCompatibleFormItemType, JTElementFormItemType, JTFormItemConfig, JTFormItemEventHandler, JTFormItemType, JTFormItemsForm, JTFormItemsProps, JTFormItemCascaderOption, JtAttachmentPreviewHandler, JtAttachmentPreviewFileOptions, JtAttachmentPreviewRequestConfig, JtAttachmentPreviewService, JtAttachmentPreviewMode, JtAttachmentPreviewOptions, JtAttachmentPreviewResolvedType, JtOptionItem, JtPageHeaderOperate, JtPageHeaderProps, JtPaginationData, JtSearchType, } from './components/index';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jt-home/mfe-components",
3
- "version": "1.0.19",
3
+ "version": "1.0.21",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",