@hbdlzy/ui-core 0.1.8 → 0.1.10

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 (31) hide show
  1. package/components.manifest.json +4 -2
  2. package/dist/components/BaseCard/BaseCard.types.d.ts +1 -0
  3. package/dist/components/BaseCard/BaseCard.vue.d.ts +3 -0
  4. package/dist/components/BaseTable/BaseTable.types.d.ts +8 -1
  5. package/dist/components/BaseTable/BaseTable.vue.d.ts +4 -1
  6. package/dist/components/BaseTable/index.d.ts +1 -1
  7. package/dist/components/OutlinedCascader/OutlinedCascader.vue.d.ts +1 -1
  8. package/dist/components/OutlinedDatePicker/OutlinedDatePicker.vue.d.ts +3 -3
  9. package/dist/components/OutlinedSelect/OutlinedSelect.vue.d.ts +4 -4
  10. package/dist/components/OutlinedTimePicker/OutlinedTimePicker.vue.d.ts +6 -6
  11. package/dist/components/OutlinedTreeSelect/OutlinedTreeSelect.vue.d.ts +4 -4
  12. package/dist/index.cjs +5 -5
  13. package/dist/index.js +337 -136
  14. package/dist/style.css +1 -1
  15. package/package.json +1 -1
  16. package/src/components/BaseCard/BaseCard.types.ts +1 -0
  17. package/src/components/BaseCard/BaseCard.vue +3 -1
  18. package/src/components/BaseCard/README.md +1 -0
  19. package/src/components/BaseTable/BaseTable.types.d.ts +6 -1
  20. package/src/components/BaseTable/BaseTable.types.ts +18 -1
  21. package/src/components/BaseTable/BaseTable.vue +358 -100
  22. package/src/components/BaseTable/README.md +77 -2
  23. package/src/components/BaseTable/index.ts +1 -0
  24. package/src/components/OutlinedCascader/OutlinedCascader.vue.d.ts +2 -2
  25. package/src/components/OutlinedDatePicker/OutlinedDatePicker.vue.d.ts +3 -3
  26. package/src/components/OutlinedDateTimePicker/OutlinedDateTimePicker.vue.d.ts +1 -1
  27. package/src/components/OutlinedInput/OutlinedInput.vue.d.ts +1 -1
  28. package/src/components/OutlinedSelect/OutlinedSelect.vue.d.ts +5 -5
  29. package/src/components/OutlinedTimePicker/OutlinedTimePicker.vue.d.ts +7 -7
  30. package/src/components/OutlinedTreeSelect/OutlinedTreeSelect.vue.d.ts +5 -5
  31. package/src/index.d.ts +48 -12
@@ -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
  示例请求参数:
@@ -369,6 +443,7 @@ const columns = [
369
443
  - `stripe`: 是否显示斑马纹
370
444
  - `showToolbar`: 是否显示顶部工具栏容器
371
445
  - `showPagination`: 是否显示分页
446
+ - `paginationPosition`: 分页位置,支持 `top-right`、`bottom-right`,默认 `top-right`
372
447
  - `hasSelection`: 是否显示多选列
373
448
  - `hasIndex`: 是否显示序号列
374
449
  - `pagination`: 分页配置,支持 `currentPage`、`pageSize`、`total`、`pageSizes`
@@ -19,6 +19,7 @@ export type {
19
19
  BaseTableNormalizedResult,
20
20
  BaseTableOption,
21
21
  BaseTablePagination,
22
+ BaseTablePaginationPosition,
22
23
  BaseTableProps,
23
24
  BaseTableResultAdapter,
24
25
  BaseTableRequestHandler,
@@ -63,14 +63,14 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
63
63
  popperClass: string;
64
64
  value: OutlinedCascaderValue;
65
65
  placeholder: string;
66
+ filterable: boolean;
67
+ clearable: boolean;
66
68
  options: Record<string, unknown>[];
67
69
  errorMessage: string;
68
70
  inputHeight: number;
69
71
  isBorder: boolean;
70
- clearable: boolean;
71
72
  marginBottom: OutlinedCascaderCssValue;
72
73
  paddingTop: OutlinedCascaderCssValue;
73
- filterable: boolean;
74
74
  propsValue: Record<string, unknown>;
75
75
  levels: boolean;
76
76
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -62,19 +62,19 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
62
62
  label: string;
63
63
  disabled: boolean;
64
64
  required: boolean;
65
+ format: string;
65
66
  value: OutlinedDatePickerValue;
66
67
  placeholder: string;
68
+ multiple: boolean;
69
+ valueFormat: string;
67
70
  errorMessage: string;
68
71
  showPassword: boolean;
69
72
  inputHeight: number;
70
73
  isBorder: boolean;
71
74
  marginBottom: OutlinedDatePickerCssValue;
72
75
  paddingTop: OutlinedDatePickerCssValue;
73
- multiple: boolean;
74
76
  timeValue: boolean;
75
77
  typeDate: string;
76
- format: string;
77
- valueFormat: string;
78
78
  disabledDate: OutlinedDatePickerDisabledDate;
79
79
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
80
80
  export default _default;
@@ -76,10 +76,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
76
76
  required: boolean;
77
77
  value: string;
78
78
  placeholder: string;
79
+ clearable: boolean;
79
80
  errorMessage: string;
80
81
  inputHeight: number;
81
82
  isBorder: boolean;
82
- clearable: boolean;
83
83
  marginBottom: OutlinedDateTimePickerCssValue;
84
84
  paddingTop: OutlinedDateTimePickerCssValue;
85
85
  disabledDate: OutlinedDateTimePickerDisabledDate;
@@ -64,6 +64,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
64
64
  required: boolean;
65
65
  value: OutlinedInputValue;
66
66
  placeholder: string;
67
+ clearable: boolean;
67
68
  errorMessage: string;
68
69
  typeInput: string;
69
70
  showPassword: boolean;
@@ -71,7 +72,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
71
72
  inputHeight: number;
72
73
  isBorder: boolean;
73
74
  suffixText: string;
74
- clearable: boolean;
75
75
  showWordLimit: boolean;
76
76
  marginBottom: OutlinedInputCssValue;
77
77
  paddingTop: OutlinedInputCssValue;
@@ -76,19 +76,19 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
76
76
  required: boolean;
77
77
  value: OutlinedSelectValue;
78
78
  placeholder: string;
79
+ multiple: boolean;
80
+ filterable: boolean;
81
+ clearable: boolean;
82
+ collapseTags: boolean;
83
+ collapseTagsTooltip: boolean;
79
84
  options: OutlinedSelectOption[];
80
85
  errorMessage: string;
81
86
  typeInput: string;
82
87
  showPassword: boolean;
83
88
  inputHeight: number;
84
89
  isBorder: boolean;
85
- clearable: boolean;
86
90
  marginBottom: OutlinedSelectCssValue;
87
91
  paddingTop: OutlinedSelectCssValue;
88
- multiple: boolean;
89
- collapseTags: boolean;
90
- collapseTagsTooltip: boolean;
91
- filterable: boolean;
92
92
  keyValue: string;
93
93
  labelValue: string;
94
94
  noCheck: boolean;
@@ -67,20 +67,20 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
67
67
  label: string;
68
68
  disabled: boolean;
69
69
  required: boolean;
70
+ format: string;
70
71
  value: OutlinedTimePickerValue;
71
72
  placeholder: string;
73
+ clearable: boolean;
74
+ startPlaceholder: string;
75
+ endPlaceholder: string;
76
+ rangeSeparator: string;
77
+ valueFormat: string;
78
+ isRange: boolean;
72
79
  errorMessage: string;
73
80
  inputHeight: number;
74
81
  isBorder: boolean;
75
- clearable: boolean;
76
82
  marginBottom: OutlinedTimePickerCssValue;
77
83
  paddingTop: OutlinedTimePickerCssValue;
78
- format: string;
79
- valueFormat: string;
80
- isRange: boolean;
81
- startPlaceholder: string;
82
- endPlaceholder: string;
83
- rangeSeparator: string;
84
84
  arrowControl: boolean;
85
85
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
86
86
  export default _default;
@@ -94,16 +94,16 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
94
94
  popperClass: string;
95
95
  value: OutlinedTreeSelectValue;
96
96
  placeholder: string;
97
+ multiple: boolean;
98
+ filterable: boolean;
99
+ clearable: boolean;
100
+ collapseTags: boolean;
101
+ collapseTagsTooltip: boolean;
97
102
  errorMessage: string;
98
103
  inputHeight: number;
99
104
  isBorder: boolean;
100
- clearable: boolean;
101
105
  marginBottom: OutlinedTreeSelectCssValue;
102
106
  paddingTop: OutlinedTreeSelectCssValue;
103
- multiple: boolean;
104
- collapseTags: boolean;
105
- collapseTagsTooltip: boolean;
106
- filterable: boolean;
107
107
  keyValue: string;
108
108
  labelValue: string;
109
109
  maxCollapseTags: number;
package/src/index.d.ts CHANGED
@@ -1,28 +1,64 @@
1
+ import type { App, Component, Plugin } from 'vue';
2
+ import BaseCard from './components/BaseCard';
3
+ import BaseTable from './components/BaseTable';
4
+ import BaseEChart from './components/BaseEChart';
5
+ import BaseExportButton from './components/BaseExportButton';
6
+ import SvgIcon from './components/SvgIcon';
7
+ import OutlinedInput from './components/OutlinedInput';
8
+ import OutlinedSelect from './components/OutlinedSelect';
9
+ import OutlinedDatePicker from './components/OutlinedDatePicker';
10
+ import OutlinedDateTimePicker from './components/OutlinedDateTimePicker';
11
+ import OutlinedTimePicker from './components/OutlinedTimePicker';
12
+ import OutlinedCascader from './components/OutlinedCascader';
13
+ import OutlinedTreeSelect from './components/OutlinedTreeSelect';
14
+ export declare const uiCoreComponents: {
15
+ name: string;
16
+ component: Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>;
17
+ }[];
18
+ export declare function installUiCore(app: App): void;
19
+ export declare const HbdlUICore: Plugin;
20
+ export default HbdlUICore;
21
+ declare module 'vue' {
22
+ interface GlobalComponents {
23
+ BaseCard: typeof BaseCard;
24
+ BaseTable: typeof BaseTable;
25
+ BaseEChart: typeof BaseEChart;
26
+ BaseExportButton: typeof BaseExportButton;
27
+ SvgIcon: typeof SvgIcon;
28
+ OutlinedInput: typeof OutlinedInput;
29
+ OutlinedSelect: typeof OutlinedSelect;
30
+ OutlinedDatePicker: typeof OutlinedDatePicker;
31
+ OutlinedDateTimePicker: typeof OutlinedDateTimePicker;
32
+ OutlinedTimePicker: typeof OutlinedTimePicker;
33
+ OutlinedCascader: typeof OutlinedCascader;
34
+ OutlinedTreeSelect: typeof OutlinedTreeSelect;
35
+ }
36
+ }
1
37
  export { echarts } from './echarts';
2
38
  export type { EChartInitOptions, EChartInstance, EChartLoadingOptions, EChartOption, EChartResizeOptions, EChartSetOptionOptions } from './echarts';
3
- export { default as BaseCard } from './components/BaseCard';
39
+ export { BaseCard };
4
40
  export * from './components/BaseCard';
5
- export { default as BaseTable } from './components/BaseTable';
41
+ export { BaseTable };
6
42
  export * from './components/BaseTable';
7
- export { default as BaseEChart } from './components/BaseEChart';
43
+ export { BaseEChart };
8
44
  export * from './components/BaseEChart';
9
- export { default as BaseExportButton } from './components/BaseExportButton';
45
+ export { BaseExportButton };
10
46
  export * from './components/BaseExportButton';
11
- export { default as SvgIcon } from './components/SvgIcon';
47
+ export { SvgIcon };
12
48
  export * from './components/SvgIcon';
13
- export { default as OutlinedInput } from './components/OutlinedInput';
49
+ export { OutlinedInput };
14
50
  export * from './components/OutlinedInput';
15
- export { default as OutlinedSelect } from './components/OutlinedSelect';
51
+ export { OutlinedSelect };
16
52
  export * from './components/OutlinedSelect';
17
- export { default as OutlinedDatePicker } from './components/OutlinedDatePicker';
53
+ export { OutlinedDatePicker };
18
54
  export * from './components/OutlinedDatePicker';
19
- export { default as OutlinedDateTimePicker } from './components/OutlinedDateTimePicker';
55
+ export { OutlinedDateTimePicker };
20
56
  export * from './components/OutlinedDateTimePicker';
21
- export { default as OutlinedTimePicker } from './components/OutlinedTimePicker';
57
+ export { OutlinedTimePicker };
22
58
  export * from './components/OutlinedTimePicker';
23
- export { default as OutlinedCascader } from './components/OutlinedCascader';
59
+ export { OutlinedCascader };
24
60
  export * from './components/OutlinedCascader';
25
- export { default as OutlinedTreeSelect } from './components/OutlinedTreeSelect';
61
+ export { OutlinedTreeSelect };
26
62
  export * from './components/OutlinedTreeSelect';
27
63
  export { exportExcel } from './excel/exportExcel';
28
64
  export type { ExcelCellValue, ExcelExportColumn, ExcelExportOptions } from './excel/exportExcel';