cm-reporting 0.8.4 → 0.8.6

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/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { ForwardRefExoticComponent } from 'react';
2
+ import { JSX } from 'react/jsx-runtime';
2
3
  import { ReactNode } from 'react';
3
4
  import { RefAttributes } from 'react';
4
5
  import { ThemeConfig } from 'antd';
@@ -157,7 +158,7 @@ declare function cirsGpmLegacyToInternal(input: unknown): {
157
158
  * CM 自定义 CSS 变量配置。
158
159
  * 用于覆盖 lib/variables.css 中定义的默认值。
159
160
  */
160
- declare interface CMCSSVariables {
161
+ export declare interface CMCSSVariables {
161
162
  /** 布局相关 */
162
163
  layout?: {
163
164
  /** 内容区域最大宽度 */
@@ -247,6 +248,36 @@ export declare interface CMReportingApi {
247
248
  validate: () => Promise<boolean>;
248
249
  }
249
250
 
251
+ /**
252
+ * CMReportingApp:主入口组件。
253
+ * 接收 templateType、versionId 作为 props,内部管理页面导航状态。
254
+ */
255
+ export declare function CMReportingApp({ templateType, versionId, readOnly, showPageActions, pageKey: controlledPageKey, onNavigatePage, maxContentWidth, integrations, children, }: CMReportingAppProps): JSX.Element;
256
+
257
+ /**
258
+ * CMReportingApp Props。
259
+ */
260
+ export declare interface CMReportingAppProps {
261
+ /** 模板类型 */
262
+ templateType: TemplateType;
263
+ /** 版本 ID */
264
+ versionId: string;
265
+ /** 全局只读模式 */
266
+ readOnly?: boolean;
267
+ /** 是否显示底部翻页操作(默认 true) */
268
+ showPageActions?: boolean;
269
+ /** 当前页面(受控模式) */
270
+ pageKey?: PageKey;
271
+ /** 页面导航回调(受控模式) */
272
+ onNavigatePage?: (pageKey: PageKey) => void;
273
+ /** 内容区域最大宽度(可选,不设置则填充父容器) */
274
+ maxContentWidth?: number;
275
+ /** 宿主扩展点:外部选择/回写列表等 */
276
+ integrations?: CMReportingIntegrations;
277
+ /** 插入点:用于对外门面组件做 snapshot/export 绑定(不作为 public API 承诺) */
278
+ children?: ReactNode;
279
+ }
280
+
250
281
  export declare interface CMReportingIntegrations {
251
282
  smelterList?: SmelterListIntegration;
252
283
  productList?: ProductListIntegration;
@@ -274,10 +305,16 @@ export declare interface CMReportingProps {
274
305
  fallback?: ReactNode;
275
306
  }
276
307
 
308
+ /**
309
+ * CMReportingProvider:顶层 Provider。
310
+ * 负责 i18n 初始化、Ant Design 配置和 Suspense 边界。
311
+ */
312
+ export declare function CMReportingProvider({ locale, onLocaleChange, theme, cssVariables, children, fallback, }: CMReportingProviderProps): JSX.Element;
313
+
277
314
  /**
278
315
  * CMReportingProvider Props。
279
316
  */
280
- declare interface CMReportingProviderProps {
317
+ export declare interface CMReportingProviderProps {
281
318
  /** 初始语言,默认 'en-US' */
282
319
  locale?: Locale;
283
320
  /** 语言变化回调 */
@@ -302,6 +339,17 @@ export declare interface CMReportingRef {
302
339
  validate: () => Promise<boolean>;
303
340
  }
304
341
 
342
+ /**
343
+ * CM 主题配置。
344
+ * 结合 Ant Design 主题和 CM 自定义 CSS 变量。
345
+ */
346
+ export declare interface CMThemeConfig {
347
+ /** Ant Design 主题配置 */
348
+ antd?: ThemeConfig;
349
+ /** CM 自定义 CSS 变量 */
350
+ cssVariables?: CMCSSVariables;
351
+ }
352
+
305
353
  /**
306
354
  * 导出接口类型:CompanyQuestionDef。
307
355
  */
@@ -1550,6 +1598,11 @@ declare const _default: {
1550
1598
  }
1551
1599
  };
1552
1600
 
1601
+ /**
1602
+ * 默认 Ant Design 主题配置。
1603
+ */
1604
+ export declare const defaultAntdTheme: ThemeConfig;
1605
+
1553
1606
  declare type DotNestedKeys<T> = T extends object ? {
1554
1607
  [K in keyof T & string]: T[K] extends Array<unknown> ? `${K}` : T[K] extends object ? `${K}` | `${K}.${DotNestedKeys<T[K]>}` : `${K}`;
1555
1608
  }[keyof T & string] : never;
@@ -1644,6 +1697,12 @@ declare function internalToCirsGpmLegacy(snapshot: ReportSnapshotV1, ctx: CirsGp
1644
1697
  */
1645
1698
  export declare type Locale = 'en-US' | 'zh-CN';
1646
1699
 
1700
+ /**
1701
+ * 合并主题配置。
1702
+ * 将用户提供的配置与默认配置深度合并。
1703
+ */
1704
+ export declare function mergeThemeConfig(customTheme?: ThemeConfig, defaultTheme?: ThemeConfig): ThemeConfig;
1705
+
1647
1706
  /**
1648
1707
  * 导出类型:MetalDropdownSource。
1649
1708
  */