@hbdlzy/ui-core 0.1.7 → 0.1.9

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 (74) hide show
  1. package/README.md +30 -2
  2. package/components.manifest.json +16 -2
  3. package/dist/components/BaseTable/BaseTable.types.d.ts +6 -1
  4. package/dist/components/OutlinedCascader/OutlinedCascader.vue.d.ts +1 -1
  5. package/dist/components/OutlinedDatePicker/OutlinedDatePicker.vue.d.ts +3 -3
  6. package/dist/components/OutlinedSelect/OutlinedSelect.vue.d.ts +4 -4
  7. package/dist/components/OutlinedTimePicker/OutlinedTimePicker.vue.d.ts +6 -6
  8. package/dist/components/OutlinedTreeSelect/OutlinedTreeSelect.vue.d.ts +4 -4
  9. package/dist/index.cjs +5 -5
  10. package/dist/index.d.ts +50 -13
  11. package/dist/index.js +531 -147
  12. package/dist/ripple/index.cjs +42 -0
  13. package/dist/ripple/index.d.ts +8 -1
  14. package/dist/ripple/index.js +171 -0
  15. package/dist/style.css +1 -1
  16. package/package.json +17 -2
  17. package/src/components/BaseCard/BaseCard.types.d.ts +36 -0
  18. package/src/components/BaseCard/BaseCard.vue.d.ts +122 -0
  19. package/src/components/BaseCard/README.md +33 -0
  20. package/src/components/BaseCard/index.d.ts +3 -0
  21. package/src/components/BaseEChart/BaseEChart.types.d.ts +26 -0
  22. package/src/components/BaseEChart/BaseEChart.vue.d.ts +66 -0
  23. package/src/components/BaseEChart/README.md +33 -0
  24. package/src/components/BaseEChart/index.d.ts +3 -0
  25. package/src/components/BaseExportButton/BaseExportButton.types.d.ts +21 -0
  26. package/src/components/BaseExportButton/BaseExportButton.utils.d.ts +4 -0
  27. package/src/components/BaseExportButton/BaseExportButton.vue.d.ts +128 -0
  28. package/src/components/BaseExportButton/README.md +34 -0
  29. package/src/components/BaseExportButton/index.d.ts +5 -0
  30. package/src/components/BaseTable/BaseTable.types.d.ts +183 -0
  31. package/src/components/BaseTable/BaseTable.types.ts +15 -1
  32. package/src/components/BaseTable/BaseTable.vue +340 -111
  33. package/src/components/BaseTable/BaseTable.vue.d.ts +157 -0
  34. package/src/components/BaseTable/README.md +121 -2
  35. package/src/components/BaseTable/index.d.ts +3 -0
  36. package/src/components/OutlinedCascader/OutlinedCascader.types.d.ts +28 -0
  37. package/src/components/OutlinedCascader/OutlinedCascader.vue.d.ts +94 -0
  38. package/src/components/OutlinedCascader/README.md +34 -0
  39. package/src/components/OutlinedCascader/index.d.ts +3 -0
  40. package/src/components/OutlinedDatePicker/OutlinedDatePicker.types.d.ts +30 -0
  41. package/src/components/OutlinedDatePicker/OutlinedDatePicker.vue.d.ts +97 -0
  42. package/src/components/OutlinedDatePicker/README.md +34 -0
  43. package/src/components/OutlinedDatePicker/index.d.ts +3 -0
  44. package/src/components/OutlinedDateTimePicker/OutlinedDateTimePicker.types.d.ts +29 -0
  45. package/src/components/OutlinedDateTimePicker/OutlinedDateTimePicker.vue.d.ts +106 -0
  46. package/src/components/OutlinedDateTimePicker/README.md +33 -0
  47. package/src/components/OutlinedDateTimePicker/index.d.ts +3 -0
  48. package/src/components/OutlinedInput/OutlinedInput.types.d.ts +32 -0
  49. package/src/components/OutlinedInput/OutlinedInput.vue.d.ts +106 -0
  50. package/src/components/OutlinedInput/README.md +34 -0
  51. package/src/components/OutlinedInput/index.d.ts +3 -0
  52. package/src/components/OutlinedSelect/OutlinedSelect.types.d.ts +41 -0
  53. package/src/components/OutlinedSelect/OutlinedSelect.vue.d.ts +125 -0
  54. package/src/components/OutlinedSelect/README.md +34 -0
  55. package/src/components/OutlinedSelect/index.d.ts +3 -0
  56. package/src/components/OutlinedTimePicker/OutlinedTimePicker.types.d.ts +31 -0
  57. package/src/components/OutlinedTimePicker/OutlinedTimePicker.vue.d.ts +103 -0
  58. package/src/components/OutlinedTimePicker/README.md +33 -0
  59. package/src/components/OutlinedTimePicker/index.d.ts +3 -0
  60. package/src/components/OutlinedTreeSelect/OutlinedTreeSelect.types.d.ts +49 -0
  61. package/src/components/OutlinedTreeSelect/OutlinedTreeSelect.vue.d.ts +146 -0
  62. package/src/components/OutlinedTreeSelect/README.md +34 -0
  63. package/src/components/OutlinedTreeSelect/index.d.ts +3 -0
  64. package/src/components/SvgIcon/README.md +33 -0
  65. package/src/components/SvgIcon/SvgIcon.types.d.ts +6 -0
  66. package/src/components/SvgIcon/SvgIcon.vue.d.ts +32 -0
  67. package/src/components/SvgIcon/index.d.ts +3 -0
  68. package/src/echarts/index.d.ts +9 -0
  69. package/src/excel/exportExcel.d.ts +18 -0
  70. package/src/index.d.ts +66 -0
  71. package/src/index.ts +78 -13
  72. package/src/ripple/README.md +160 -0
  73. package/src/ripple/index.d.ts +9 -0
  74. package/src/ripple/index.ts +15 -1
@@ -0,0 +1,157 @@
1
+ import type { BaseTableCellPayload, BaseTableColumn, BaseTableCssValue, BaseTableHeaderSearchValue, BaseTableLoadedPayload, BaseTablePagination, BaseTableProps, BaseTableRowActionPayload, BaseTableSortPayload } from './BaseTable.types';
2
+ type BaseTableRow = Record<string, any>;
3
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<BaseTableProps<Record<string, any>>>, {
4
+ data: () => never[];
5
+ requestParams: () => {};
6
+ autoLoad: boolean;
7
+ reloadOnParamsChange: boolean;
8
+ reloadOnSortChange: boolean;
9
+ rowKey: string;
10
+ height: string;
11
+ border: boolean;
12
+ stripe: boolean;
13
+ showToolbar: boolean;
14
+ showPagination: boolean;
15
+ hasSelection: boolean;
16
+ hasIndex: boolean;
17
+ indexLabel: string;
18
+ indexWidth: number;
19
+ selectionWidth: number;
20
+ pagination: () => {};
21
+ currentPageKey: string;
22
+ pageSizeKey: string;
23
+ defaultSort: () => {
24
+ prop: undefined;
25
+ order: null;
26
+ };
27
+ sortFieldKey: string;
28
+ sortOrderKey: string;
29
+ sortOrderMap: () => {
30
+ ascending: string;
31
+ descending: string;
32
+ };
33
+ emptyText: string;
34
+ loadingText: string;
35
+ }>>, {
36
+ load: (data?: Record<string, any>[] | undefined) => Promise<void>;
37
+ refresh: () => Promise<void>;
38
+ setData: (data: Record<string, any>[]) => void;
39
+ resetPage: () => Promise<void>;
40
+ setHeaderSearchValue: (key: string, value: BaseTableHeaderSearchValue, shouldReload?: boolean | undefined) => Promise<void>;
41
+ resetHeaderSearch: (key?: string | undefined) => Promise<void>;
42
+ getHeaderSearchValues: () => Record<string, BaseTableHeaderSearchValue>;
43
+ clearSelection: () => void;
44
+ toggleRowSelection: (row: Record<string, any>, selected?: boolean | undefined) => void;
45
+ getSelectionRows: () => Record<string, any>[];
46
+ getRows: () => Record<string, any>[];
47
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
48
+ "selection-change": (rows: BaseTableRow[]) => void;
49
+ "sort-change": (payload: BaseTableSortPayload<Record<string, any>>) => void;
50
+ "row-action": (payload: BaseTableRowActionPayload<Record<string, any>>) => void;
51
+ "cell-click": (payload: BaseTableCellPayload<Record<string, any>>) => void;
52
+ "cell-input": (payload: BaseTableCellPayload<Record<string, any>>) => void;
53
+ "page-change": (currentPage: number) => void;
54
+ "size-change": (pageSize: number) => void;
55
+ "update:pagination": (pagination: BaseTablePagination) => void;
56
+ loaded: (payload: BaseTableLoadedPayload<Record<string, any>>) => void;
57
+ "request-error": (error: unknown) => void;
58
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<BaseTableProps<Record<string, any>>>, {
59
+ data: () => never[];
60
+ requestParams: () => {};
61
+ autoLoad: boolean;
62
+ reloadOnParamsChange: boolean;
63
+ reloadOnSortChange: boolean;
64
+ rowKey: string;
65
+ height: string;
66
+ border: boolean;
67
+ stripe: boolean;
68
+ showToolbar: boolean;
69
+ showPagination: boolean;
70
+ hasSelection: boolean;
71
+ hasIndex: boolean;
72
+ indexLabel: string;
73
+ indexWidth: number;
74
+ selectionWidth: number;
75
+ pagination: () => {};
76
+ currentPageKey: string;
77
+ pageSizeKey: string;
78
+ defaultSort: () => {
79
+ prop: undefined;
80
+ order: null;
81
+ };
82
+ sortFieldKey: string;
83
+ sortOrderKey: string;
84
+ sortOrderMap: () => {
85
+ ascending: string;
86
+ descending: string;
87
+ };
88
+ emptyText: string;
89
+ loadingText: string;
90
+ }>>> & Readonly<{
91
+ "onSelection-change"?: ((rows: BaseTableRow[]) => any) | undefined;
92
+ "onSort-change"?: ((payload: BaseTableSortPayload<Record<string, any>>) => any) | undefined;
93
+ "onRow-action"?: ((payload: BaseTableRowActionPayload<Record<string, any>>) => any) | undefined;
94
+ "onCell-click"?: ((payload: BaseTableCellPayload<Record<string, any>>) => any) | undefined;
95
+ "onCell-input"?: ((payload: BaseTableCellPayload<Record<string, any>>) => any) | undefined;
96
+ "onPage-change"?: ((currentPage: number) => any) | undefined;
97
+ "onSize-change"?: ((pageSize: number) => any) | undefined;
98
+ "onUpdate:pagination"?: ((pagination: BaseTablePagination) => any) | undefined;
99
+ onLoaded?: ((payload: BaseTableLoadedPayload<Record<string, any>>) => any) | undefined;
100
+ "onRequest-error"?: ((error: unknown) => any) | undefined;
101
+ }>, {
102
+ data: Record<string, any>[];
103
+ border: boolean;
104
+ requestParams: Record<string, unknown>;
105
+ autoLoad: boolean;
106
+ reloadOnParamsChange: boolean;
107
+ reloadOnSortChange: boolean;
108
+ rowKey: string;
109
+ height: BaseTableCssValue;
110
+ stripe: boolean;
111
+ showToolbar: boolean;
112
+ showPagination: boolean;
113
+ hasSelection: boolean;
114
+ hasIndex: boolean;
115
+ indexLabel: string;
116
+ indexWidth: BaseTableCssValue;
117
+ selectionWidth: BaseTableCssValue;
118
+ pagination: Partial<BaseTablePagination>;
119
+ currentPageKey: string;
120
+ pageSizeKey: string;
121
+ defaultSort: import("./BaseTable.types").BaseTableSortState;
122
+ sortFieldKey: string;
123
+ sortOrderKey: string;
124
+ sortOrderMap: import("./BaseTable.types").BaseTableSortOrderMap;
125
+ emptyText: string;
126
+ loadingText: string;
127
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: {
128
+ row: any;
129
+ columnConfig: BaseTableColumn<Record<string, any>>;
130
+ columnIndex: any;
131
+ value: any;
132
+ }) => any>> & {
133
+ toolbar?(_: {}): any;
134
+ }>;
135
+ export default _default;
136
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
137
+ type __VLS_TypePropsToRuntimeProps<T> = {
138
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
139
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
140
+ } : {
141
+ type: import('vue').PropType<T[K]>;
142
+ required: true;
143
+ };
144
+ };
145
+ type __VLS_WithDefaults<P, D> = {
146
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
147
+ default: D[K];
148
+ }> : P[K];
149
+ };
150
+ type __VLS_Prettify<T> = {
151
+ [K in keyof T]: T[K];
152
+ } & {};
153
+ type __VLS_WithTemplateSlots<T, S> = T & {
154
+ new (): {
155
+ $slots: S;
156
+ };
157
+ };
@@ -251,13 +251,14 @@ const columns = [
251
251
  type: 'select',
252
252
  placeholder: '请选择状态',
253
253
  width: 220,
254
+ filterable: true,
254
255
  searchText: '筛选'
255
256
  }
256
257
  }
257
258
  ]
258
259
  ```
259
260
 
260
- 下拉筛选默认复用当前列的 `options`,也可以在 `headerSearch.options` 中单独传入选项。需要多选时可以配置 `multiple: true`,请求参数会以数组形式传出。
261
+ 下拉筛选默认复用当前列的 `options`,也可以在 `headerSearch.options` 中单独传入选项。需要搜索下拉选项时配置 `filterable: true`,会启用 Element Plus `el-select` 原生搜索能力。需要多选时可以配置 `multiple: true`,请求参数会以数组形式传出。
261
262
 
262
263
  ### 多选下拉筛选写法
263
264
 
@@ -316,13 +317,86 @@ const columns = [
316
317
 
317
318
  级联筛选默认使用 `children` 作为子级字段,可以通过 `optionChildrenKey` 改写;请求参数会以完整路径数组传出,例如 `{ regionPath: ['north', 'beijing', 'chaoyang'] }`。
318
319
 
320
+ ### 时间筛选写法
321
+
322
+ ```ts
323
+ const columns = [
324
+ {
325
+ label: '创建日期',
326
+ prop: 'createdDate',
327
+ headerSearch: {
328
+ type: 'date',
329
+ placeholder: '请选择日期',
330
+ valueFormat: 'YYYY-MM-DD',
331
+ searchText: '筛选'
332
+ }
333
+ },
334
+ {
335
+ label: '创建时间',
336
+ prop: 'createdAt',
337
+ headerSearch: {
338
+ type: 'datetime',
339
+ placeholder: '请选择时间',
340
+ valueFormat: 'YYYY-MM-DD HH:mm:ss',
341
+ searchText: '筛选'
342
+ }
343
+ },
344
+ {
345
+ label: '执行时刻',
346
+ prop: 'runTime',
347
+ headerSearch: {
348
+ type: 'time',
349
+ placeholder: '请选择时刻',
350
+ valueFormat: 'HH:mm:ss',
351
+ searchText: '筛选'
352
+ }
353
+ }
354
+ ]
355
+ ```
356
+
357
+ `date`、`datetime` 会使用 Element Plus `el-date-picker`,`time` 会使用 `el-time-picker`。`format` 控制展示格式,`valueFormat` 控制筛选值和请求参数值。
358
+
359
+ ### 时间范围筛选写法
360
+
361
+ ```ts
362
+ const columns = [
363
+ {
364
+ label: '创建时间',
365
+ prop: 'createdAt',
366
+ headerSearch: {
367
+ type: 'datetimerange',
368
+ paramKey: 'createdAtRange',
369
+ startPlaceholder: '开始',
370
+ endPlaceholder: '结束',
371
+ valueFormat: 'YYYY-MM-DD HH:mm:ss',
372
+ searchText: '筛选'
373
+ }
374
+ },
375
+ {
376
+ label: '执行时间段',
377
+ prop: 'runTime',
378
+ headerSearch: {
379
+ type: 'timerange',
380
+ paramKey: 'runTimeRange',
381
+ startPlaceholder: '开始',
382
+ endPlaceholder: '结束',
383
+ valueFormat: 'HH:mm:ss',
384
+ searchText: '筛选'
385
+ }
386
+ }
387
+ ]
388
+ ```
389
+
390
+ 范围类型支持 `daterange`、`datetimerange`、`timerange`,请求参数会以数组形式传出,例如 `{ createdAtRange: ['2026-04-01 00:00:00', '2026-04-30 23:59:59'] }`。
391
+
319
392
  ### 行为说明
320
393
 
321
394
  - 远程模式下,列头搜索值会自动合并到 `request(params)` 的参数里
322
395
  - 触发搜索或重置时,会自动把页码重置到第一页
323
396
  - 如果配置了 `paramKey`,请求参数会优先使用它
324
397
  - 如果没有配置 `paramKey`,默认使用当前列的 `prop`
325
- - 本地数据模式下,输入搜索会对当前 `data` 做简单文本包含过滤,下拉筛选会按选项值精确匹配,级联筛选会按路径前缀匹配
398
+ - 表头搜索面板打开后,点击表格外或页面其他区域会自动关闭
399
+ - 本地数据模式下,输入搜索会对当前 `data` 做简单文本包含过滤,下拉筛选会按选项值精确匹配,级联筛选会按路径前缀匹配,时间范围会按起止时间包含过滤
326
400
  - 多个开启搜索的列会按“同时满足”处理
327
401
 
328
402
  示例请求参数:
@@ -465,3 +539,48 @@ tableRef.value?.resetHeaderSearch()
465
539
  - 默认优先使用列配置驱动,只有复杂单元格才使用插槽
466
540
  - 通用操作列尽量统一收敛到 `row-action`
467
541
  - 复杂筛选表单不要内置到表格组件里,统一通过 `toolbar` 扩展
542
+
543
+ ## AI 使用指引
544
+
545
+ AI 在生成列表页、管理页、日志页、明细页时,应优先使用 `BaseTable`,不要在页面里重复封装 `el-table + el-pagination + loading + request + sort + selection`。
546
+
547
+ 推荐优先从统一入口导入:
548
+
549
+ ```ts
550
+ import { BaseTable, type BaseTableColumn, type BaseTableExpose } from '@hbdlzy/ui'
551
+ ```
552
+
553
+ 如果当前只安装了核心包,也可以从 `@hbdlzy/ui-core` 导入。
554
+
555
+ AI 生成代码时按下面顺序判断:
556
+
557
+ 1. 先定义业务行类型 `RowItem`
558
+ 2. 再定义 `BaseTableColumn<RowItem>[]`
559
+ 3. 本地静态数据用 `data`
560
+ 4. 远程分页数据用 `request`,不要把 `listUrl` 字符串直接塞给组件
561
+ 5. 接口返回结构不统一时,用 `resultAdapter` 映射成 `{ rows, total }`
562
+ 6. 顶部筛选表单放进 `toolbar` 插槽
563
+ 7. 行操作统一配置 `kind: 'actions'`,通过 `@row-action` 承接
564
+ 8. 复杂单元格才使用 `cell-${prop}` 插槽
565
+
566
+ AI 不应该做这些事:
567
+
568
+ - 不要在页面里重新写分页状态、页码变化、每页条数变化和远程加载逻辑
569
+ - 不要在页面里重复写通用排序参数映射,优先使用 `sortFieldKey`、`sortOrderKey`、`sortMapper`
570
+ - 不要为常见状态标签、图片、链接、操作列重复写模板,优先使用 `kind`
571
+ - 不要把复杂业务筛选塞进列头搜索,复杂筛选应放在 `toolbar`
572
+ - 不要绕过 `BaseTableExpose` 直接操作内部 `el-table`
573
+
574
+ 旧项目迁移时,AI 可以按这个映射处理:
575
+
576
+ - `columnsList` 迁移为 `columns`
577
+ - `listUrl + paramsData` 迁移为 `request + requestParams`
578
+ - `isSearch / isFilter / isCity` 迁移为 `headerSearch`
579
+ - `actions` 迁移为 `kind: 'actions'`
580
+ - `@handleAction` 迁移为 `@row-action`
581
+
582
+ 生成代码前建议同时读取:
583
+
584
+ - `packages/ui-core/components.manifest.json`
585
+ - `packages/ui-core/src/components/BaseTable/BaseTable.types.ts`
586
+ - 本 README 的 `Props / Column 能力 / Events / Expose` 部分
@@ -0,0 +1,3 @@
1
+ import BaseTable from './BaseTable.vue';
2
+ export default BaseTable;
3
+ export type { BaseTableAction, BaseTableAlign, BaseTableCellPayload, BaseTableColumn, BaseTableColumnKind, BaseTableCssValue, BaseTableExpose, BaseTableHeaderSearchConfig, BaseTableHeaderSearchPathValue, BaseTableHeaderSearchPrimitiveValue, BaseTableHeaderSearchType, BaseTableHeaderSearchValue, BaseTableLoadedPayload, BaseTableNormalizedResult, BaseTableOption, BaseTablePagination, BaseTableProps, BaseTableResultAdapter, BaseTableRequestHandler, BaseTableRequestParams, BaseTableRequestResult, BaseTableRowActionPayload, BaseTableSortOrder, BaseTableSortPayload } from './BaseTable.types';
@@ -0,0 +1,28 @@
1
+ export type OutlinedCascaderCssValue = string | number;
2
+ export type OutlinedCascaderValue = Array<string | number>;
3
+ export interface OutlinedCascaderProps {
4
+ value?: OutlinedCascaderValue;
5
+ options?: Record<string, unknown>[];
6
+ clearable?: boolean;
7
+ propsValue?: Record<string, unknown>;
8
+ placeholder?: string;
9
+ label?: string;
10
+ popperClass?: string;
11
+ disabled?: boolean;
12
+ inputHeight?: number;
13
+ isBorder?: boolean;
14
+ filterable?: boolean;
15
+ levels?: boolean;
16
+ marginBottom?: OutlinedCascaderCssValue;
17
+ paddingTop?: OutlinedCascaderCssValue;
18
+ required?: boolean;
19
+ error?: boolean;
20
+ errorMessage?: string;
21
+ }
22
+ export interface OutlinedCascaderExpose {
23
+ focus: () => void;
24
+ blur: () => void;
25
+ togglePopperVisible: () => void;
26
+ clear: () => void;
27
+ getCascaderRef: () => unknown | null;
28
+ }
@@ -0,0 +1,94 @@
1
+ import type { OutlinedCascaderCssValue, OutlinedCascaderProps, OutlinedCascaderValue } from './OutlinedCascader.types';
2
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<OutlinedCascaderProps>, {
3
+ value: () => never[];
4
+ options: () => never[];
5
+ clearable: boolean;
6
+ propsValue: undefined;
7
+ placeholder: string;
8
+ label: string;
9
+ popperClass: string;
10
+ disabled: boolean;
11
+ inputHeight: number;
12
+ isBorder: boolean;
13
+ filterable: boolean;
14
+ levels: boolean;
15
+ marginBottom: number;
16
+ paddingTop: number;
17
+ required: boolean;
18
+ error: boolean;
19
+ errorMessage: string;
20
+ }>>, {
21
+ focus: () => void;
22
+ blur: () => void;
23
+ togglePopperVisible: () => void;
24
+ clear: () => void;
25
+ getCascaderRef: () => unknown;
26
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
27
+ input: (value: OutlinedCascaderValue) => void;
28
+ "update:value": (value: OutlinedCascaderValue) => void;
29
+ change: (value: OutlinedCascaderValue) => void;
30
+ focus: (value: FocusEvent) => void;
31
+ blur: (value: FocusEvent) => void;
32
+ "visible-change": (value: boolean) => void;
33
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<OutlinedCascaderProps>, {
34
+ value: () => never[];
35
+ options: () => never[];
36
+ clearable: boolean;
37
+ propsValue: undefined;
38
+ placeholder: string;
39
+ label: string;
40
+ popperClass: string;
41
+ disabled: boolean;
42
+ inputHeight: number;
43
+ isBorder: boolean;
44
+ filterable: boolean;
45
+ levels: boolean;
46
+ marginBottom: number;
47
+ paddingTop: number;
48
+ required: boolean;
49
+ error: boolean;
50
+ errorMessage: string;
51
+ }>>> & Readonly<{
52
+ onBlur?: ((value: FocusEvent) => any) | undefined;
53
+ onChange?: ((value: OutlinedCascaderValue) => any) | undefined;
54
+ onFocus?: ((value: FocusEvent) => any) | undefined;
55
+ onInput?: ((value: OutlinedCascaderValue) => any) | undefined;
56
+ "onUpdate:value"?: ((value: OutlinedCascaderValue) => any) | undefined;
57
+ "onVisible-change"?: ((value: boolean) => any) | undefined;
58
+ }>, {
59
+ error: boolean;
60
+ label: string;
61
+ disabled: boolean;
62
+ required: boolean;
63
+ popperClass: string;
64
+ value: OutlinedCascaderValue;
65
+ placeholder: string;
66
+ filterable: boolean;
67
+ clearable: boolean;
68
+ options: Record<string, unknown>[];
69
+ errorMessage: string;
70
+ inputHeight: number;
71
+ isBorder: boolean;
72
+ marginBottom: OutlinedCascaderCssValue;
73
+ paddingTop: OutlinedCascaderCssValue;
74
+ propsValue: Record<string, unknown>;
75
+ levels: boolean;
76
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
77
+ export default _default;
78
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
79
+ type __VLS_TypePropsToRuntimeProps<T> = {
80
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
81
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
82
+ } : {
83
+ type: import('vue').PropType<T[K]>;
84
+ required: true;
85
+ };
86
+ };
87
+ type __VLS_WithDefaults<P, D> = {
88
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
89
+ default: D[K];
90
+ }> : P[K];
91
+ };
92
+ type __VLS_Prettify<T> = {
93
+ [K in keyof T]: T[K];
94
+ } & {};
@@ -92,3 +92,37 @@ const areaOptions = [
92
92
  - 组件只负责通用级联选择壳子和交互状态,不直接耦合区域接口、组织树接口等业务数据源
93
93
  - 页面层如果需要多选级联、懒加载或复杂回填逻辑,优先先通过 `propsValue` 和插值配置解决
94
94
  - 如果业务需要固定某种树结构,可以在业务包里再封一层领域组件,而不是反向污染 `ui-core`
95
+
96
+ ## AI 使用指引
97
+
98
+ AI 在生成区域、组织、站点、分类等级联选择项时,应优先使用 `OutlinedCascader`,不要重复封装 `el-cascader` 的浮动标签、面板显隐和清空逻辑。
99
+
100
+ 推荐优先从统一入口导入:
101
+
102
+ ```ts
103
+ import { OutlinedCascader, type OutlinedCascaderExpose } from '@hbdlzy/ui'
104
+ ```
105
+
106
+ 如果当前只安装了核心包,也可以从 `@hbdlzy/ui-core` 导入。
107
+
108
+ AI 生成代码时按下面顺序判断:
109
+
110
+ 1. 选项为标准 `label/value/children` 时直接传 `options`
111
+ 2. 后端字段不同,优先通过 `propsValue` 映射,不要先复制转换一份树
112
+ 3. 需要搜索时传 `filterable`
113
+ 4. 需要展示完整路径时保持 `levels` 为 `true`
114
+ 5. 需要下边框风格,传 `:is-border="true"`
115
+ 6. 需要手动打开、关闭、清空时,使用 `ref<OutlinedCascaderExpose>`
116
+
117
+ AI 不应该做这些事:
118
+
119
+ - 不要为普通级联选择重复写 `el-cascader` 外壳
120
+ - 不要把区域接口、组织接口请求逻辑写进基础组件
121
+ - 不要为了字段映射在页面层重复转换大树,优先使用 `propsValue`
122
+ - 不要把业务固定层级、路径拼接规则塞回 `ui-core`
123
+
124
+ 生成代码前建议同时读取:
125
+
126
+ - `packages/ui-core/components.manifest.json`
127
+ - `packages/ui-core/src/components/OutlinedCascader/OutlinedCascader.types.ts`
128
+ - 本 README 的 `Props / Emits / Expose` 部分
@@ -0,0 +1,3 @@
1
+ import OutlinedCascader from './OutlinedCascader.vue';
2
+ export default OutlinedCascader;
3
+ export type { OutlinedCascaderCssValue, OutlinedCascaderExpose, OutlinedCascaderProps, OutlinedCascaderValue } from './OutlinedCascader.types';
@@ -0,0 +1,30 @@
1
+ export type OutlinedDatePickerCssValue = string | number;
2
+ export type OutlinedDatePickerValue = string | number | Date | Array<string | number | Date> | null;
3
+ export type OutlinedDatePickerDisabledDate = string | number | Date | ((date: Date) => boolean);
4
+ export interface OutlinedDatePickerProps {
5
+ value?: OutlinedDatePickerValue;
6
+ placeholder?: string;
7
+ label?: string;
8
+ disabled?: boolean;
9
+ timeValue?: boolean;
10
+ typeDate?: string;
11
+ format?: string;
12
+ valueFormat?: string;
13
+ showPassword?: boolean;
14
+ multiple?: boolean;
15
+ inputHeight?: number;
16
+ isBorder?: boolean;
17
+ disabledDate?: OutlinedDatePickerDisabledDate;
18
+ marginBottom?: OutlinedDatePickerCssValue;
19
+ paddingTop?: OutlinedDatePickerCssValue;
20
+ required?: boolean;
21
+ error?: boolean;
22
+ errorMessage?: string;
23
+ }
24
+ export interface OutlinedDatePickerExpose {
25
+ focus: () => void;
26
+ blur: () => void;
27
+ handleOpen: () => void;
28
+ handleClose: () => void;
29
+ getPickerRef: () => unknown | null;
30
+ }
@@ -0,0 +1,97 @@
1
+ import type { OutlinedDatePickerCssValue, OutlinedDatePickerDisabledDate, OutlinedDatePickerProps, OutlinedDatePickerValue } from './OutlinedDatePicker.types';
2
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<OutlinedDatePickerProps>, {
3
+ value: string;
4
+ placeholder: string;
5
+ label: string;
6
+ disabled: boolean;
7
+ timeValue: boolean;
8
+ typeDate: string;
9
+ format: string;
10
+ valueFormat: string;
11
+ showPassword: boolean;
12
+ multiple: boolean;
13
+ inputHeight: number;
14
+ isBorder: boolean;
15
+ disabledDate: undefined;
16
+ marginBottom: number;
17
+ paddingTop: number;
18
+ required: boolean;
19
+ error: boolean;
20
+ errorMessage: string;
21
+ }>>, {
22
+ focus: () => void;
23
+ blur: () => void;
24
+ handleOpen: () => void;
25
+ handleClose: () => void;
26
+ getPickerRef: () => unknown;
27
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
28
+ input: (value: OutlinedDatePickerValue) => void;
29
+ "update:value": (value: OutlinedDatePickerValue) => void;
30
+ change: (value: OutlinedDatePickerValue) => void;
31
+ focus: (value: FocusEvent) => void;
32
+ blur: (value: FocusEvent) => void;
33
+ "visible-change": (value: boolean) => void;
34
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<OutlinedDatePickerProps>, {
35
+ value: string;
36
+ placeholder: string;
37
+ label: string;
38
+ disabled: boolean;
39
+ timeValue: boolean;
40
+ typeDate: string;
41
+ format: string;
42
+ valueFormat: string;
43
+ showPassword: boolean;
44
+ multiple: boolean;
45
+ inputHeight: number;
46
+ isBorder: boolean;
47
+ disabledDate: undefined;
48
+ marginBottom: number;
49
+ paddingTop: number;
50
+ required: boolean;
51
+ error: boolean;
52
+ errorMessage: string;
53
+ }>>> & Readonly<{
54
+ onBlur?: ((value: FocusEvent) => any) | undefined;
55
+ onChange?: ((value: OutlinedDatePickerValue) => any) | undefined;
56
+ onFocus?: ((value: FocusEvent) => any) | undefined;
57
+ onInput?: ((value: OutlinedDatePickerValue) => any) | undefined;
58
+ "onUpdate:value"?: ((value: OutlinedDatePickerValue) => any) | undefined;
59
+ "onVisible-change"?: ((value: boolean) => any) | undefined;
60
+ }>, {
61
+ error: boolean;
62
+ label: string;
63
+ disabled: boolean;
64
+ required: boolean;
65
+ format: string;
66
+ value: OutlinedDatePickerValue;
67
+ placeholder: string;
68
+ multiple: boolean;
69
+ valueFormat: string;
70
+ errorMessage: string;
71
+ showPassword: boolean;
72
+ inputHeight: number;
73
+ isBorder: boolean;
74
+ marginBottom: OutlinedDatePickerCssValue;
75
+ paddingTop: OutlinedDatePickerCssValue;
76
+ timeValue: boolean;
77
+ typeDate: string;
78
+ disabledDate: OutlinedDatePickerDisabledDate;
79
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
80
+ export default _default;
81
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
82
+ type __VLS_TypePropsToRuntimeProps<T> = {
83
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
84
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
85
+ } : {
86
+ type: import('vue').PropType<T[K]>;
87
+ required: true;
88
+ };
89
+ };
90
+ type __VLS_WithDefaults<P, D> = {
91
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
92
+ default: D[K];
93
+ }> : P[K];
94
+ };
95
+ type __VLS_Prettify<T> = {
96
+ [K in keyof T]: T[K];
97
+ } & {};
@@ -138,3 +138,37 @@ const form = reactive({
138
138
  - 普通日期和日期时间选择器优先使用 `OutlinedDatePicker`
139
139
  - 默认通过 `typeDate + format` 收敛常见场景
140
140
  - 自定义日期禁用规则优先使用 `disabledDate`,不要在页面层重复封装相同逻辑
141
+
142
+ ## AI 使用指引
143
+
144
+ AI 在生成日期选择项时,如果页面需要浮动标签、统一高度、日期禁用规则或兼容旧项目 `v-model:value`,应优先使用 `OutlinedDatePicker`。
145
+
146
+ 推荐优先从统一入口导入:
147
+
148
+ ```ts
149
+ import { OutlinedDatePicker, type OutlinedDatePickerExpose } from '@hbdlzy/ui'
150
+ ```
151
+
152
+ 如果当前只安装了核心包,也可以从 `@hbdlzy/ui-core` 导入。
153
+
154
+ AI 生成代码时按下面顺序判断:
155
+
156
+ 1. 普通日期使用 `type-date="date"` 和默认 `YYYY-MM-DD`
157
+ 2. 日期时间使用 `type-date="datetime"`,同步设置 `format` 和必要的 `valueFormat`
158
+ 3. 日期范围继续透传 Element Plus 原生 `type` 能力时,要确认 `value` 类型为数组
159
+ 4. 禁止选择今天之前的日期时,优先使用 `:disabled-date="'nowDate'"`
160
+ 5. 更复杂禁用规则传函数,不要在页面里包一层重复组件
161
+ 6. 需要手动打开或关闭面板时,使用 `ref<OutlinedDatePickerExpose>`
162
+
163
+ AI 不应该做这些事:
164
+
165
+ - 不要重新封装基础 `el-date-picker` 只为实现浮动标签
166
+ - 不要在多个页面复制相同的禁用日期判断
167
+ - 不要混用 `format` 和 `valueFormat` 导致展示值、提交值不一致
168
+ - 不要把业务接口逻辑塞进日期组件
169
+
170
+ 生成代码前建议同时读取:
171
+
172
+ - `packages/ui-core/components.manifest.json`
173
+ - `packages/ui-core/src/components/OutlinedDatePicker/OutlinedDatePicker.types.ts`
174
+ - 本 README 的 `Props / Events / Expose / 透传规则` 部分
@@ -0,0 +1,3 @@
1
+ import OutlinedDatePicker from './OutlinedDatePicker.vue';
2
+ export default OutlinedDatePicker;
3
+ export type { OutlinedDatePickerCssValue, OutlinedDatePickerDisabledDate, OutlinedDatePickerExpose, OutlinedDatePickerProps, OutlinedDatePickerValue } from './OutlinedDatePicker.types';
@@ -0,0 +1,29 @@
1
+ export type OutlinedDateTimePickerCssValue = string | number;
2
+ export type OutlinedDateTimePickerValue = string;
3
+ export type OutlinedDateTimePickerDisabledDate = string | number | Date | ((date: Date) => boolean);
4
+ export interface OutlinedDateTimePickerProps {
5
+ value?: OutlinedDateTimePickerValue;
6
+ placeholder?: string;
7
+ label?: string;
8
+ inputHeight?: number;
9
+ isBorder?: boolean;
10
+ disabledDate?: OutlinedDateTimePickerDisabledDate;
11
+ separatorText?: string;
12
+ timePlaceholder?: string;
13
+ clearable?: boolean;
14
+ marginBottom?: OutlinedDateTimePickerCssValue;
15
+ paddingTop?: OutlinedDateTimePickerCssValue;
16
+ required?: boolean;
17
+ error?: boolean;
18
+ errorMessage?: string;
19
+ }
20
+ export interface OutlinedDateTimePickerExpose {
21
+ focusDate: () => void;
22
+ focusTime: () => void;
23
+ blurDate: () => void;
24
+ blurTime: () => void;
25
+ openDatePanel: () => void;
26
+ openTimePanel: () => void;
27
+ getDatePickerRef: () => unknown | null;
28
+ getTimePickerRef: () => unknown | null;
29
+ }