wlwy-package 3.1.63 → 3.2.0

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.
Files changed (73) hide show
  1. package/dist/editor/index.es.js +4 -0
  2. package/dist/editor-core-D9MSA0yc.js +21080 -0
  3. package/dist/index-D4mQXwMj.js +9479 -0
  4. package/dist/index-DbAXWdHe.js +101 -0
  5. package/dist/style.css +1 -1
  6. package/dist/types/index.d.ts +2 -0
  7. package/dist/types/packages/components/antd/index.d.ts +10 -0
  8. package/dist/types/packages/components/{common → antd}/src/button.vue.d.ts +1 -1
  9. package/dist/types/packages/components/antd/src/descriptions-item.vue.d.ts +9 -0
  10. package/dist/types/packages/components/antd/src/descriptions.vue.d.ts +6 -0
  11. package/dist/types/packages/components/{common → antd}/src/select.vue.d.ts +1 -1
  12. package/dist/types/packages/components/antd/type.d.ts +164 -0
  13. package/dist/types/packages/components/common/index.d.ts +4 -20
  14. package/dist/types/packages/components/common/src/page.vue.d.ts +38 -0
  15. package/dist/types/packages/components/common/src/pageHead.vue.d.ts +2 -2
  16. package/dist/types/packages/components/common/type.d.ts +60 -217
  17. package/dist/types/packages/components/form/default/src/dateRange.vue.d.ts +1 -1
  18. package/dist/types/packages/components/form/default/src/form.vue.d.ts +412 -0
  19. package/dist/types/packages/components/form/default/src/formItem.vue.d.ts +10 -4
  20. package/dist/types/packages/components/form/default/src/inputMatch.vue.d.ts +1 -1
  21. package/dist/types/packages/components/form/default/src/inputTags.vue.d.ts +5 -3
  22. package/dist/types/packages/components/form/default/src/page.vue.d.ts +2 -2
  23. package/dist/types/packages/components/form/default/src/select.vue.d.ts +3 -3
  24. package/dist/types/packages/components/form/default/src/selectInput.vue.d.ts +2 -2
  25. package/dist/types/packages/components/form/default/src/upload-image.vue.d.ts +1 -1
  26. package/dist/types/packages/components/form/default/src/wrap.vue.d.ts +2 -2
  27. package/dist/types/packages/components/form/default/type.d.ts +23 -4
  28. package/dist/types/packages/components/icon/src/index.vue.d.ts +0 -1
  29. package/dist/types/packages/components/icon/type.d.ts +2 -1
  30. package/dist/types/packages/components/index.d.ts +2 -0
  31. package/dist/types/packages/components/{editor/src/editor.vue.d.ts → lazy/editor/editor-core.vue.d.ts} +3 -3
  32. package/dist/types/packages/components/lazy/editor/index.d.ts +3 -0
  33. package/dist/types/packages/components/lazy/editor/index.vue.d.ts +35 -0
  34. package/dist/types/packages/components/list/input.d.ts +13 -3
  35. package/dist/types/packages/components/list/src/header.vue.d.ts +2 -2
  36. package/dist/types/packages/components/list/src/table.vue.d.ts +757 -4
  37. package/dist/types/packages/components/list/type.d.ts +5 -4
  38. package/dist/types/packages/components/table/constants.d.ts +15 -0
  39. package/dist/types/packages/components/table/index.d.ts +7 -0
  40. package/dist/types/packages/components/table/resolveInjectColumns.d.ts +17 -0
  41. package/dist/types/packages/components/table/src/action-column.vue.d.ts +11 -0
  42. package/dist/types/packages/components/{common → table}/src/column.vue.d.ts +7 -9
  43. package/dist/types/packages/components/table/src/pager.vue.d.ts +314 -0
  44. package/dist/types/packages/components/table/src/search.vue.d.ts +34 -0
  45. package/dist/types/packages/components/table/src/table.vue.d.ts +802 -0
  46. package/dist/types/packages/components/table/type.d.ts +179 -0
  47. package/dist/types/packages/components/table/useWTableConfig.d.ts +34 -0
  48. package/dist/types/packages/components/table/vxeDefaultConfig.d.ts +8 -0
  49. package/dist/types/packages/components/table/warnDeprecated.d.ts +6 -0
  50. package/dist/types/packages/hooks/private/index.d.ts +1 -1
  51. package/dist/types/packages/hooks/private/src/useRenderCell.d.ts +51 -35
  52. package/dist/types/packages/hooks/web/index.d.ts +0 -1
  53. package/dist/types/packages/hooks/web/src/usePrefixTitle.d.ts +6 -2
  54. package/dist/types/packages/index.d.ts +2 -0
  55. package/dist/types/packages/keys/index.d.ts +3 -0
  56. package/dist/types/packages/setup/vxe.d.ts +5 -1
  57. package/dist/types/packages/utils/createRefInstanceProxy.d.ts +13 -0
  58. package/dist/types/packages/utils/formatCellValue.d.ts +82 -0
  59. package/dist/types/packages/utils/getPrefixTitle.d.ts +5 -0
  60. package/dist/types/packages/utils/index.d.ts +3 -0
  61. package/dist/wlwy-package.es.js +4641 -12799
  62. package/package.json +17 -1
  63. package/dist/types/packages/components/common/src/descriptions-item.vue.d.ts +0 -6
  64. package/dist/types/packages/components/common/src/descriptions.vue.d.ts +0 -26
  65. package/dist/types/packages/components/common/src/pager.vue.d.ts +0 -32
  66. package/dist/types/packages/components/common/src/table.vue.d.ts +0 -40
  67. package/dist/types/packages/components/editor/index.d.ts +0 -2
  68. package/dist/types/packages/hooks/web/src/useExposeRef.d.ts +0 -1
  69. /package/dist/types/packages/components/{common → antd}/src/datePicker.vue.d.ts +0 -0
  70. /package/dist/types/packages/components/{common → antd}/src/modal.vue.d.ts +0 -0
  71. /package/dist/types/packages/components/{common → antd}/src/statistic.vue.d.ts +0 -0
  72. /package/dist/types/packages/components/{common → antd}/src/upload.vue.d.ts +0 -0
  73. /package/dist/types/packages/components/{editor → lazy/editor}/type.d.ts +0 -0
@@ -0,0 +1,179 @@
1
+ import type { FormInstance, FormProps } from 'ant-design-vue';
2
+ import type { VxeColumnProps, VxePagerInstance, VxePagerProps, VxeTableInstance, VxeTableProps, VxeToolbarInstance, VxeToolbarProps } from 'vxe-table';
3
+ import type { RenderCellProps, RenderCellFormatType } from '../../hooks/private';
4
+ import type { Slot } from 'vue';
5
+ /**
6
+ * w-toolbar 组件属性
7
+ */
8
+ export interface WToolbarProps extends Omit<VxeToolbarProps, 'id'> {
9
+ toolid?: string;
10
+ /** @deprecated 请改用 WTable 顶层的 `showToolbar` */
11
+ hideToolbar?: boolean;
12
+ }
13
+ /** 多子组件共享,平铺在 WTable 顶层 */
14
+ export type WTableSharedPropKeys = 'loading' | 'size' | 'perfect' | 'border' | 'align';
15
+ export type WToolbarOnlyProps = Omit<WToolbarProps, WTableSharedPropKeys>;
16
+ export type WPagerOnlyProps = Omit<WPagerProps, WTableSharedPropKeys | 'dataSource'>;
17
+ export type WTableOnlyProps<Row = any> = Omit<VxeTableProps<Row>, 'data' | WTableSharedPropKeys>;
18
+ /**
19
+ * w-table 组件属性
20
+ */
21
+ export interface WTableProps<Row = any> extends WTableOnlyProps<Row>, Partial<Pick<WToolbarProps & WPagerProps, WTableSharedPropKeys>> {
22
+ data?: Row[];
23
+ showPager?: boolean;
24
+ /** 是否显示复选框列 */
25
+ showCheckbox?: boolean;
26
+ /** 是否显示序号列 @default true */
27
+ showSeq?: boolean;
28
+ /**
29
+ * 是否显示工具栏,优先级高于 `toolbar.hideToolbar`。
30
+ * 若存在 `#toolbar-buttons` / `#toolbar-tools`(或旧 `#buttons` / `#tools`),则以 slot 为准强制显示。
31
+ */
32
+ showToolbar?: boolean;
33
+ toolbar?: Partial<WToolbarOnlyProps>;
34
+ pager?: Partial<WPagerOnlyProps>;
35
+ }
36
+ /**
37
+ * w-table 弃用平铺属性(仍可通过 attrs 传入,请迁移至 toolbar / pager 嵌套对象)
38
+ */
39
+ export interface WTableDeprecatedProps extends Partial<WToolbarOnlyProps>, Partial<Omit<WPagerOnlyProps, keyof WToolbarOnlyProps>> {
40
+ /** @deprecated 请改用 `data` */
41
+ dataSource?: unknown[];
42
+ }
43
+ /**
44
+ * w-table 插槽
45
+ */
46
+ export interface WTableSlots {
47
+ 'toolbar-buttons'?: Slot;
48
+ 'toolbar-tools'?: Slot;
49
+ 'pager-left'?: Slot;
50
+ 'pager-right'?: Slot;
51
+ default?: Slot;
52
+ }
53
+ /**
54
+ * w-pager组件示例
55
+ */
56
+ export interface WPagerInstance extends VxePagerInstance {
57
+ /**
58
+ * 获取分页实例
59
+ */
60
+ getPagerInstance: () => VxePagerInstance | undefined;
61
+ }
62
+ /** w-table.resetPager 参数 */
63
+ export type ResetPagerParams = {
64
+ currentPage?: number;
65
+ pageSize?: number;
66
+ };
67
+ /** w-table 内部分页快照 */
68
+ export type PagerState = {
69
+ currentPage: number;
70
+ pageSize: number;
71
+ };
72
+ /**
73
+ * w-table组件示例
74
+ */
75
+ export interface WTableInstance extends VxeTableInstance {
76
+ /**
77
+ * 获取表格实例
78
+ */
79
+ getTableInstance: () => VxeTableInstance | undefined;
80
+ /**
81
+ * 获取表格工具栏实例
82
+ */
83
+ getToolbarInstance: () => VxeToolbarInstance | undefined;
84
+ /**
85
+ * 获取表格分页实例
86
+ */
87
+ getPagerInstance: () => WPagerInstance | undefined;
88
+ /**
89
+ * 读取内部分页状态(供列表页拼请求参数)
90
+ */
91
+ getPagerState: () => PagerState;
92
+ /**
93
+ * 更新内部分页状态(默认回到第 1 页;pageSize 不传则保持)
94
+ */
95
+ resetPager: (params?: ResetPagerParams) => void;
96
+ }
97
+ /**
98
+ * w-column组件属性
99
+ */
100
+ export type WColumnProp = Omit<RenderCellProps, 'type' | 'field'> & Pick<VxeColumnProps, 'field' | 'title' | 'fixed' | 'width' | 'minWidth' | 'editRender' | 'headerClassName' | 'formatter' | 'showOverflow'> & {
101
+ /**
102
+ * 渲染类型
103
+ */
104
+ type?: VxeColumnProps['type'] | RenderCellFormatType | 'action';
105
+ /**
106
+ * 列是否可排序
107
+ */
108
+ sortable?: boolean;
109
+ /**
110
+ * 列头提示图标
111
+ * @default 'QuestionCircleOutlined'
112
+ */
113
+ suffixIcon?: 'QuestionCircleOutlined' | 'InfoCircleOutlined' | 'ExclamationCircleOutlined' | Slot;
114
+ /**
115
+ * 列头提示图标
116
+ * @default 'QuestionCircleOutlined'
117
+ */
118
+ prefixIcon?: 'QuestionCircleOutlined' | 'InfoCircleOutlined' | 'ExclamationCircleOutlined' | Slot;
119
+ /**
120
+ * 列头提示内容
121
+ */
122
+ tipsContent?: string | Slot;
123
+ /**
124
+ * 默认值
125
+ */
126
+ defaultValue?: string;
127
+ };
128
+ /**
129
+ * w-pager 组件属性
130
+ */
131
+ export interface WPagerProps<T = any[]> extends VxePagerProps {
132
+ /**
133
+ * 数据源
134
+ */
135
+ dataSource?: T;
136
+ }
137
+ /**********************WListSearch组件********************** */
138
+ /**
139
+ * WListSearch 组件属性
140
+ */
141
+ export interface WListSearchProps extends Pick<FormProps, 'rules'> {
142
+ /**
143
+ * 搜索表单 model
144
+ */
145
+ model: Record<string, any>;
146
+ /**
147
+ * 每行几列,默认 4
148
+ */
149
+ column?: number;
150
+ /**
151
+ * 列间距
152
+ */
153
+ gutter?: number;
154
+ /**
155
+ * 查询按钮 loading
156
+ */
157
+ loading?: boolean;
158
+ /**
159
+ * 是否显示展开/收起
160
+ */
161
+ expand?: boolean;
162
+ /**
163
+ * 卡片 bordered
164
+ */
165
+ bordered?: boolean;
166
+ }
167
+ /**
168
+ * WListSearch 组件实例
169
+ */
170
+ export interface WListSearchInstance {
171
+ /**
172
+ * 获取 FormInstance
173
+ */
174
+ getFormInstance: () => FormInstance | undefined;
175
+ /**
176
+ * 触发重置
177
+ */
178
+ reset: () => void;
179
+ }
@@ -0,0 +1,34 @@
1
+ import { type ComputedRef, type Slots } from 'vue';
2
+ import type { WPagerOnlyProps, WTableProps, WToolbarOnlyProps } from './type';
3
+ export type WTableResolvedConfig = {
4
+ toolbar: Partial<WToolbarOnlyProps> & {
5
+ hideToolbar?: boolean;
6
+ toolid?: string;
7
+ };
8
+ pager: Partial<WPagerOnlyProps>;
9
+ table: Record<string, unknown>;
10
+ };
11
+ /** 父组件 vnode 上是否显式传入过该 prop */
12
+ export declare function isPropExplicit(vnodeProps: Record<string, unknown>, key: string): boolean;
13
+ /** 父组件 vnode 上真正传过的 prop(未传的 Boolean 不会出现在这里,避免 Vue 缺省 false 覆盖 setConfig) */
14
+ export declare function pickExplicitProps(props: Record<string, unknown>, vnodeProps: Record<string, unknown> | null | undefined): Record<string, unknown>;
15
+ export declare function resolveWTableConfig(props: WTableProps, attrs: Record<string, unknown>, vnodeProps?: Record<string, unknown> | null): WTableResolvedConfig;
16
+ export declare function useWTableConfig(props: WTableProps, attrs: Record<string, unknown>): {
17
+ config: ComputedRef<WTableResolvedConfig>;
18
+ };
19
+ export declare function resolveWTableSlots(slots: Slots): {
20
+ hasToolbarButtons: boolean;
21
+ hasToolbarTools: boolean;
22
+ hasPagerLeft: boolean;
23
+ hasPagerRight: boolean;
24
+ hasToolbarSlots: boolean;
25
+ tableSlotNames: string[];
26
+ };
27
+ export declare function useWTableSlots(slots: Slots): ComputedRef<{
28
+ hasToolbarButtons: boolean;
29
+ hasToolbarTools: boolean;
30
+ hasPagerLeft: boolean;
31
+ hasPagerRight: boolean;
32
+ hasToolbarSlots: boolean;
33
+ tableSlotNames: string[];
34
+ }>;
@@ -0,0 +1,8 @@
1
+ import type { VxePagerProps, VxeTableProps, VxeToolbarProps } from 'vxe-table';
2
+ export type WTableVxeDefaultConfig = {
3
+ table: Partial<VxeTableProps>;
4
+ toolbar: Partial<VxeToolbarProps>;
5
+ pager: Partial<VxePagerProps>;
6
+ };
7
+ /** WTable 组件约定的 vxe 全局默认配置 */
8
+ export declare const WTABLE_VXE_DEFAULT_CONFIG: WTableVxeDefaultConfig;
@@ -0,0 +1,6 @@
1
+ export declare function warnDeprecated(oldKey: string, newPath: string): void;
2
+ export declare function warnDeprecatedSlot(oldName: string, newName: string): void;
3
+ export declare function warnPropConflict(key: string, namespace: 'toolbar' | 'pager'): void;
4
+ export declare function warnShowToolbarConflict(): void;
5
+ /** toolbar slot 与显式关闭工具栏冲突时,以 slot 为准 */
6
+ export declare function warnToolbarSlotConflict(source: 'showToolbar' | 'toolbar.hideToolbar'): void;
@@ -1,2 +1,2 @@
1
- export { default as useRenderCell, type RenderCellProps } from './src/useRenderCell';
1
+ export { default as useRenderCell, toFormatCellOptions, resolveLegacyEnumMap, type RenderCellProps, type RenderCellFormatByType, type RenderCellFormatType, type RenderCellLegacyProps } from './src/useRenderCell';
2
2
  export { default as useKey } from './src/useKey';
@@ -1,55 +1,71 @@
1
1
  import { type DictBasicNameType } from '../../business';
2
2
  import type { OptionType } from '../../../type';
3
- type RenderType = 'date' | 'i18n' | 'amount';
3
+ import { type FormatCellBooleanOptions, type FormatCellEnumMap, type FormatCellEnumOptionsExtension, type FormatCellI18nOptions, type FormatCellNumberOptions, type FormatCellOptions, type FormatCellPercentOptions, type FormatCellTemporalOptions } from '../../../utils/formatCellValue';
4
+ type TemporalExtra = Pick<FormatCellTemporalOptions, 'format' | 'timeZone'>;
4
5
  type FieldPath = string | number | string[] | number[];
5
- export type RenderCellProps = {
6
- /**
7
- * 渲染字段名
8
- */
9
- field?: FieldPath;
10
- /**
11
- * 渲染类型
12
- */
13
- type?: RenderType;
14
- /**
15
- * 时间格式
16
- * @default 'YYYY-MM-DD HH:mm:ss'
17
- */
6
+ /** 与 {@link FormatCellOptions} 对齐的按 `type` 区分的格式化 props */
7
+ export type RenderCellFormatByType = {
8
+ type?: 'raw';
9
+ } | ({
10
+ type: 'date';
11
+ } & TemporalExtra) | ({
12
+ type: 'time';
13
+ } & TemporalExtra) | ({
14
+ type: 'datetime';
15
+ } & TemporalExtra) | ({
16
+ type: 'number';
17
+ } & Pick<FormatCellNumberOptions, 'precision'>) | ({
18
+ type: 'percent';
19
+ } & Pick<FormatCellPercentOptions, 'valueScale'>) | ({
20
+ type: 'boolean';
21
+ } & Pick<FormatCellBooleanOptions, 'trueText' | 'falseText'>) | ({
22
+ type: 'enum';
23
+ } & FormatCellEnumOptionsExtension & {
24
+ name?: string;
25
+ map?: FormatCellEnumMap;
26
+ }) | ({
27
+ type: 'i18n';
28
+ } & Pick<FormatCellI18nOptions, 'values'>)
29
+ /** @deprecated 请改用 `type: 'number'` 且 `precision: 2` */
30
+ | {
31
+ type: 'amount';
32
+ };
33
+ /** @deprecated 旧版平铺 props,由 {@link toFormatCellOptions} 自动映射 */
34
+ export type RenderCellLegacyProps = {
35
+ /** @deprecated 请改用 `format` */
18
36
  dateFormat?: string;
19
- /**
20
- * 枚举值
21
- */
22
37
  enum?: OptionType[] | Record<string, string> | string;
23
- /**
24
- * options值
25
- */
26
38
  options?: OptionType[];
27
- /**
28
- * 枚举值字段名等效fieldNames
29
- * @default { label: 'label', value: 'value' }
30
- */
31
39
  enumFieldNames?: {
32
40
  label?: string;
33
41
  value?: string;
34
42
  };
35
- /**
36
- * 枚举值字段名等效enumFieldNames
37
- * @default { label: 'label', value: 'value' }
38
- */
39
43
  fieldNames?: {
40
44
  label?: string;
41
45
  value?: string;
42
46
  };
43
- /**
44
- * 字典名称
45
- */
46
47
  dictName?: DictBasicNameType;
47
- /**
48
- * 数字精度
49
- */
48
+ /** @deprecated 请配合 `type: 'number'` 使用 */
50
49
  precision?: number;
51
50
  };
51
+ export type RenderCellFormatType = NonNullable<RenderCellFormatByType['type']>;
52
+ export type RenderCellProps = {
53
+ field?: FieldPath;
54
+ } & RenderCellFormatByType & Partial<RenderCellLegacyProps>;
55
+ export declare function resolveLegacyEnumMap(props: RenderCellProps, context: {
56
+ translate: (key: string) => string;
57
+ dictOptions?: OptionType[];
58
+ labelKey: string;
59
+ valueKey: string;
60
+ }): FormatCellEnumMap | undefined;
61
+ export declare function toFormatCellOptions(props: RenderCellProps, context?: {
62
+ enumMap?: FormatCellEnumMap;
63
+ translate?: (key: string) => string;
64
+ dictOptions?: OptionType[];
65
+ labelKey?: string;
66
+ valueKey?: string;
67
+ }): FormatCellOptions;
52
68
  export default function useRenderCell(props: RenderCellProps): {
53
- getRenderValue: (row?: any) => any;
69
+ getRenderValue: (row?: Record<string, unknown>) => string | undefined;
54
70
  };
55
71
  export {};
@@ -14,5 +14,4 @@ export { default as useTabsNav } from './src/useTabsNav';
14
14
  export { default as useUpload } from './src/useUpload';
15
15
  export { default as useWatchForm, type UseWatchFormType } from './src/useWatchForm';
16
16
  export { default as useWindowSize } from './src/useWindowSize';
17
- export { default as useExposeRef } from './src/useExposeRef';
18
17
  export { default as useEmitBack } from './src/useEmitBack';
@@ -1,3 +1,7 @@
1
- export default function (): {
2
- getTitle(title?: string, mode?: string): string;
1
+ import { getTitle } from '../../../utils/getPrefixTitle';
2
+ /**
3
+ * @deprecated 请改用 { getTitle } from 'wlwy-package'
4
+ */
5
+ export default function usePrefixTitle(): {
6
+ getTitle: typeof getTitle;
3
7
  };
@@ -9,8 +9,10 @@ export * from './setup';
9
9
  export * from './type';
10
10
  export * from './keys';
11
11
  export { default as WCharts, type WChartsProps, type WChartsInstance } from './components/lazy/charts';
12
+ export { default as WEditor, type WEditorInstance, type WEditorProps, type InsertFnType, type customUploadFnType } from './components/lazy/editor';
12
13
  export { useService, type ServiceType } from './axios';
13
14
  export { type Config } from './config';
15
+ export { getTitle } from './utils';
14
16
  export declare const install: (app: App) => App<any>;
15
17
  declare const _default: {
16
18
  install: (app: App<any>) => App<any>;
@@ -1,3 +1,6 @@
1
1
  import type { InjectionKey, ModelRef } from 'vue';
2
2
  import type { FormProps } from 'ant-design-vue';
3
+ import type { WIconProp } from '../components/icon/type';
3
4
  export declare const WHeaderForm: InjectionKey<ModelRef<Partial<FormProps>>>;
5
+ /** w-column type="action" 内 w-icon 的默认 size */
6
+ export declare const WIconSizeKey: InjectionKey<NonNullable<WIconProp['size']>>;
@@ -3,4 +3,8 @@ import 'vxe-table/lib/style.css';
3
3
  import type { App } from 'vue';
4
4
  import * as VxeUIAll from 'vxe-pc-ui';
5
5
  import * as VxeUITable from 'vxe-table';
6
- export declare const setupVxe: (app: App<Element>, callback?: (ui: typeof VxeUIAll, table: typeof VxeUITable) => void) => void;
6
+ export type SetupVxeCallback = (ui: typeof VxeUIAll, table: typeof VxeUITable) => void;
7
+ export type SetupVxeOptions = Parameters<typeof VxeUIAll.VxeUI.setConfig>[0];
8
+ export declare function setupVxe(app: App<Element>): void;
9
+ export declare function setupVxe(app: App<Element>, callback: SetupVxeCallback): void;
10
+ export declare function setupVxe(app: App<Element>, options: SetupVxeOptions, callback?: SetupVxeCallback): void;
@@ -0,0 +1,13 @@
1
+ import type { Ref } from 'vue';
2
+ export type CreateRefInstanceProxyOptions = {
3
+ /** 优先从 target 自身读取的 key(如 defineExpose 自定义方法) */
4
+ ownKeys?: Set<string> | readonly string[];
5
+ /** 是否将 inner 上的方法 bind 到 inner 实例,默认 true */
6
+ bindMethods?: boolean;
7
+ };
8
+ /**
9
+ * 将外层 ref / expose 对齐到 Ref 指向的内部实例(转发属性读写与 Reflect API)。
10
+ * 差异化 props/slots 逻辑放在各封装组件内处理,勿写入本文件。
11
+ */
12
+ export declare function createRefInstanceProxy<TInner extends object>(innerRef: Ref<TInner | null | undefined>): TInner;
13
+ export declare function createRefInstanceProxy<TTarget extends object, TInner extends object>(innerRef: Ref<TInner | null | undefined>, target: TTarget, options?: CreateRefInstanceProxyOptions): TTarget & TInner;
@@ -0,0 +1,82 @@
1
+ export interface FormatCellTemporalOptions {
2
+ /** dayjs 格式串;未传则用各 `type` 默认 */
3
+ format?: string;
4
+ /** IANA 时区,如 `Asia/Shanghai`;未传则按本地时区 */
5
+ timeZone?: string;
6
+ }
7
+ export interface FormatCellDateOnlyOptions extends FormatCellTemporalOptions {
8
+ type: 'date';
9
+ }
10
+ export interface FormatCellTimeOnlyOptions extends FormatCellTemporalOptions {
11
+ type: 'time';
12
+ }
13
+ export interface FormatCellDateTimeOptions extends FormatCellTemporalOptions {
14
+ type: 'datetime';
15
+ }
16
+ export interface FormatCellRawOptions {
17
+ type: 'raw';
18
+ }
19
+ export interface FormatCellNumberOptions {
20
+ type: 'number';
21
+ /** 小数位数:0 为整数,1 为一位小数,以此类推 */
22
+ precision?: number;
23
+ }
24
+ export interface FormatCellPercentOptions {
25
+ type: 'percent';
26
+ /** `ratio`:`0.12` → 12%;`hundred`:`12` → 12% */
27
+ valueScale?: 'ratio' | 'hundred';
28
+ }
29
+ export interface FormatCellBooleanOptions {
30
+ type: 'boolean';
31
+ trueText?: string;
32
+ falseText?: string;
33
+ }
34
+ /** 枚举项(`map` 为数组时的元素形状) */
35
+ export interface FormatCellEnumEntry {
36
+ key: string | number;
37
+ text: string | number;
38
+ }
39
+ /** 枚举查表数据:`Record` 或 `{ key, text }[]` */
40
+ export type FormatCellEnumMap = Record<string, string> | FormatCellEnumEntry[];
41
+ /**
42
+ * 宿主可对 `type: 'enum'` 的选项做声明合并扩展(勿在本接口上写必填字段,否则与合并语义冲突)。
43
+ *
44
+ * `name` 的强类型约束请通过 {@link useEnum} 的 `formatCell` 使用 `keyof R`。
45
+ *
46
+ * @example
47
+ * ```ts
48
+ * declare module 'wlwy-package' {
49
+ * interface FormatCellEnumOptionsExtension {
50
+ * columnKey?: string
51
+ * }
52
+ * }
53
+ * ```
54
+ */
55
+ export interface FormatCellEnumOptionsExtension {
56
+ }
57
+ export interface FormatCellEnumOptions extends FormatCellEnumOptionsExtension {
58
+ type: 'enum';
59
+ /** 枚举名;仅 `useEnum().formatCell` 解析,需配合注册表。与 `map` 同时存在时忽略 */
60
+ name?: string;
61
+ /** 查表数据;未传时须由 `useEnum` 根据 `name` 注入 */
62
+ map?: FormatCellEnumMap;
63
+ }
64
+ /** 将 {@link FormatCellEnumMap} 规范为 `Record<string, string>` */
65
+ export declare function normalizeEnumMap(map: FormatCellEnumMap): Record<string, string>;
66
+ export interface FormatCellI18nOptions {
67
+ type: 'i18n';
68
+ /** vue-i18n 插值参数 */
69
+ values?: Record<string, unknown>;
70
+ }
71
+ export type FormatCellOptions = FormatCellRawOptions | FormatCellDateOnlyOptions | FormatCellTimeOnlyOptions | FormatCellDateTimeOptions | FormatCellNumberOptions | FormatCellPercentOptions | FormatCellBooleanOptions | FormatCellEnumOptions | FormatCellI18nOptions;
72
+ /** 非「空单元格」场景:非法日期/数字等原样展示 */
73
+ export declare function preserveRawCellValue(value: unknown): string;
74
+ /**
75
+ * 单元格格式化核心:不包含「空值 → placeholder」逻辑,调用方需先处理占位或与 {@link formatCellValue} 配合使用。
76
+ */
77
+ export declare function formatCellValueCore(value: unknown, options: FormatCellOptions): string;
78
+ /**
79
+ * 表格/描述列表等场景的单元格格式化:按 `options.type` 输出字符串;
80
+ * 无法识别为日期/数字等时 **原样字符串化**,不使用 `Invalid Date`。
81
+ */
82
+ export declare function formatCellValue(value: unknown, options: FormatCellOptions): string;
@@ -0,0 +1,5 @@
1
+ import type { HandlerMode } from '../type';
2
+ /**
3
+ * 拼接表单模式前缀与标题(中文无空格,英文加空格)
4
+ */
5
+ export declare function getTitle(title: string, mode?: HandlerMode): string;
@@ -1,5 +1,8 @@
1
1
  import type { PickMultipleResult, TargetsType } from './type';
2
2
  export type { PickMultipleFn } from './type';
3
+ export { createRefInstanceProxy, type CreateRefInstanceProxyOptions } from './createRefInstanceProxy';
4
+ export { getTitle } from './getPrefixTitle';
5
+ export { formatCellValue, formatCellValueCore, normalizeEnumMap, preserveRawCellValue, type FormatCellOptions, type FormatCellEnumMap, type FormatCellEnumEntry, type FormatCellEnumOptionsExtension, type FormatCellTemporalOptions, type FormatCellDateOnlyOptions, type FormatCellTimeOnlyOptions, type FormatCellDateTimeOptions, type FormatCellRawOptions, type FormatCellNumberOptions, type FormatCellPercentOptions, type FormatCellBooleanOptions, type FormatCellEnumOptions, type FormatCellI18nOptions } from './formatCellValue';
3
6
  /**
4
7
  * 列表语言翻译
5
8
  *