@hbdlzy/ui-core 0.1.6 → 0.1.7
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/README.md +4 -0
- package/components.manifest.json +16 -1
- package/dist/components/BaseTable/BaseTable.types.d.ts +17 -2
- package/dist/components/BaseTable/BaseTable.vue.d.ts +4 -4
- package/dist/components/BaseTable/index.d.ts +1 -1
- package/dist/components/OutlinedTreeSelect/OutlinedTreeSelect.vue.d.ts +1 -1
- package/dist/components/SvgIcon/SvgIcon.types.d.ts +6 -0
- package/dist/components/SvgIcon/SvgIcon.vue.d.ts +32 -0
- package/dist/components/SvgIcon/index.d.ts +3 -0
- package/dist/index.cjs +5 -5
- package/dist/index.d.ts +2 -0
- package/dist/index.js +788 -133
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/BaseTable/BaseTable.types.ts +19 -2
- package/src/components/BaseTable/BaseTable.vue +1089 -105
- package/src/components/BaseTable/README.md +88 -5
- package/src/components/BaseTable/index.ts +5 -0
- package/src/components/SvgIcon/README.md +53 -0
- package/src/components/SvgIcon/SvgIcon.types.ts +6 -0
- package/src/components/SvgIcon/SvgIcon.vue +68 -0
- package/src/components/SvgIcon/index.ts +5 -0
- package/src/index.ts +2 -0
package/README.md
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
- `BaseCard`
|
|
9
9
|
- `BaseEChart`
|
|
10
10
|
- `BaseExportButton`
|
|
11
|
+
- `SvgIcon`
|
|
11
12
|
- `OutlinedInput`
|
|
12
13
|
- `OutlinedSelect`
|
|
13
14
|
- `OutlinedDatePicker`
|
|
@@ -27,6 +28,7 @@ import {
|
|
|
27
28
|
BaseCard,
|
|
28
29
|
BaseEChart,
|
|
29
30
|
BaseExportButton,
|
|
31
|
+
SvgIcon,
|
|
30
32
|
OutlinedInput,
|
|
31
33
|
OutlinedSelect,
|
|
32
34
|
OutlinedDatePicker,
|
|
@@ -49,6 +51,7 @@ import {
|
|
|
49
51
|
- `BaseCard`: [src/components/BaseCard/README.md](./src/components/BaseCard/README.md)
|
|
50
52
|
- `BaseEChart`: [src/components/BaseEChart/README.md](./src/components/BaseEChart/README.md)
|
|
51
53
|
- `BaseExportButton`: [src/components/BaseExportButton/README.md](./src/components/BaseExportButton/README.md)
|
|
54
|
+
- `SvgIcon`: [src/components/SvgIcon/README.md](./src/components/SvgIcon/README.md)
|
|
52
55
|
- `OutlinedInput`: [src/components/OutlinedInput/README.md](./src/components/OutlinedInput/README.md)
|
|
53
56
|
- `OutlinedSelect`: [src/components/OutlinedSelect/README.md](./src/components/OutlinedSelect/README.md)
|
|
54
57
|
- `OutlinedDatePicker`: [src/components/OutlinedDatePicker/README.md](./src/components/OutlinedDatePicker/README.md)
|
|
@@ -65,6 +68,7 @@ import {
|
|
|
65
68
|
- `BaseCard`
|
|
66
69
|
- `BaseEChart`
|
|
67
70
|
- `BaseExportButton`
|
|
71
|
+
- `SvgIcon`
|
|
68
72
|
- `OutlinedInput`
|
|
69
73
|
- `OutlinedSelect`
|
|
70
74
|
- `OutlinedDatePicker`
|
package/components.manifest.json
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
"name": "headerSearch",
|
|
33
|
-
"type": "boolean | { paramKey?: string; placeholder?: string; width?: string | number; searchText?: string; resetText?: string }",
|
|
33
|
+
"type": "boolean | { type?: 'input' | 'select' | 'cascader'; paramKey?: string; placeholder?: string; width?: string | number; searchText?: string; resetText?: string; options?: BaseTableOption[]; multiple?: boolean; clearable?: boolean; filterable?: boolean; optionChildrenKey?: string }",
|
|
34
34
|
"required": false
|
|
35
35
|
},
|
|
36
36
|
{ "name": "hasSelection", "type": "boolean", "default": false },
|
|
@@ -94,6 +94,21 @@
|
|
|
94
94
|
],
|
|
95
95
|
"emits": ["start", "success", "error"]
|
|
96
96
|
},
|
|
97
|
+
{
|
|
98
|
+
"name": "SvgIcon",
|
|
99
|
+
"category": "ui-core",
|
|
100
|
+
"entry": "@hbdlzy/ui-core",
|
|
101
|
+
"importName": "SvgIcon",
|
|
102
|
+
"docs": "packages/ui-core/src/components/SvgIcon/README.md",
|
|
103
|
+
"description": "统一展示 SVG symbol sprite 和外链 SVG 图标,兼容旧项目 icon-class、class-name 写法。",
|
|
104
|
+
"props": [
|
|
105
|
+
{ "name": "iconClass", "type": "string", "required": true },
|
|
106
|
+
{ "name": "className", "type": "string", "default": "" },
|
|
107
|
+
{ "name": "prefix", "type": "string", "default": "icon" },
|
|
108
|
+
{ "name": "ariaLabel", "type": "string", "default": "" }
|
|
109
|
+
],
|
|
110
|
+
"emits": []
|
|
111
|
+
},
|
|
97
112
|
{
|
|
98
113
|
"name": "OutlinedInput",
|
|
99
114
|
"category": "ui-core",
|
|
@@ -3,18 +3,33 @@ export type BaseTableAlign = 'left' | 'center' | 'right';
|
|
|
3
3
|
export type BaseTableColumnKind = 'text' | 'link' | 'actions' | 'image' | 'tag' | 'html' | 'input';
|
|
4
4
|
export type BaseTableSortOrder = 'ascending' | 'descending' | null;
|
|
5
5
|
export type BaseTableSortDirection = string | null;
|
|
6
|
+
export type BaseTableHeaderSearchType = 'input' | 'select' | 'cascader';
|
|
7
|
+
export type BaseTableHeaderSearchPrimitiveValue = string | number | boolean;
|
|
8
|
+
export type BaseTableHeaderSearchPathValue = BaseTableHeaderSearchPrimitiveValue[];
|
|
9
|
+
export type BaseTableHeaderSearchValue = BaseTableHeaderSearchPrimitiveValue | BaseTableHeaderSearchPrimitiveValue[];
|
|
6
10
|
export interface BaseTableHeaderSearchConfig {
|
|
11
|
+
type?: BaseTableHeaderSearchType;
|
|
7
12
|
paramKey?: string;
|
|
8
13
|
placeholder?: string;
|
|
9
14
|
width?: BaseTableCssValue;
|
|
10
15
|
searchText?: string;
|
|
11
16
|
resetText?: string;
|
|
17
|
+
options?: BaseTableOption[];
|
|
18
|
+
multiple?: boolean;
|
|
19
|
+
clearable?: boolean;
|
|
20
|
+
filterable?: boolean;
|
|
21
|
+
optionValueKey?: string;
|
|
22
|
+
optionLabelKey?: string;
|
|
23
|
+
optionDisabledKey?: string;
|
|
24
|
+
optionChildrenKey?: string;
|
|
12
25
|
}
|
|
13
26
|
export interface BaseTableOption {
|
|
14
27
|
label: string;
|
|
15
28
|
value: string | number | boolean;
|
|
16
29
|
tagType?: '' | 'success' | 'warning' | 'info' | 'danger' | 'primary';
|
|
17
30
|
color?: string;
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
children?: BaseTableOption[];
|
|
18
33
|
}
|
|
19
34
|
export interface BaseTableAction<Row = Record<string, any>> {
|
|
20
35
|
label: string;
|
|
@@ -153,9 +168,9 @@ export interface BaseTableExpose<Row = Record<string, any>> {
|
|
|
153
168
|
refresh: () => Promise<void>;
|
|
154
169
|
setData: (data: Row[]) => void;
|
|
155
170
|
resetPage: () => Promise<void>;
|
|
156
|
-
setHeaderSearchValue: (key: string, value:
|
|
171
|
+
setHeaderSearchValue: (key: string, value: BaseTableHeaderSearchValue, shouldReload?: boolean) => Promise<void>;
|
|
157
172
|
resetHeaderSearch: (key?: string) => Promise<void>;
|
|
158
|
-
getHeaderSearchValues: () => Record<string,
|
|
173
|
+
getHeaderSearchValues: () => Record<string, BaseTableHeaderSearchValue>;
|
|
159
174
|
clearSelection: () => void;
|
|
160
175
|
toggleRowSelection: (row: Row, selected?: boolean) => void;
|
|
161
176
|
getSelectionRows: () => Row[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BaseTableCellPayload, BaseTableColumn, BaseTableCssValue, BaseTableLoadedPayload, BaseTablePagination, BaseTableProps, BaseTableRowActionPayload, BaseTableSortPayload } from './BaseTable.types';
|
|
1
|
+
import type { BaseTableCellPayload, BaseTableColumn, BaseTableCssValue, BaseTableHeaderSearchValue, BaseTableLoadedPayload, BaseTablePagination, BaseTableProps, BaseTableRowActionPayload, BaseTableSortPayload } from './BaseTable.types';
|
|
2
2
|
type BaseTableRow = Record<string, any>;
|
|
3
3
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<BaseTableProps<Record<string, any>>>, {
|
|
4
4
|
data: () => never[];
|
|
@@ -37,9 +37,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
|
|
|
37
37
|
refresh: () => Promise<void>;
|
|
38
38
|
setData: (data: Record<string, any>[]) => void;
|
|
39
39
|
resetPage: () => Promise<void>;
|
|
40
|
-
setHeaderSearchValue: (key: string, value:
|
|
40
|
+
setHeaderSearchValue: (key: string, value: BaseTableHeaderSearchValue, shouldReload?: boolean | undefined) => Promise<void>;
|
|
41
41
|
resetHeaderSearch: (key?: string | undefined) => Promise<void>;
|
|
42
|
-
getHeaderSearchValues: () => Record<string,
|
|
42
|
+
getHeaderSearchValues: () => Record<string, BaseTableHeaderSearchValue>;
|
|
43
43
|
clearSelection: () => void;
|
|
44
44
|
toggleRowSelection: (row: Record<string, any>, selected?: boolean | undefined) => void;
|
|
45
45
|
getSelectionRows: () => Record<string, any>[];
|
|
@@ -100,13 +100,13 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
|
|
|
100
100
|
"onRequest-error"?: ((error: unknown) => any) | undefined;
|
|
101
101
|
}>, {
|
|
102
102
|
data: Record<string, any>[];
|
|
103
|
+
border: boolean;
|
|
103
104
|
requestParams: Record<string, unknown>;
|
|
104
105
|
autoLoad: boolean;
|
|
105
106
|
reloadOnParamsChange: boolean;
|
|
106
107
|
reloadOnSortChange: boolean;
|
|
107
108
|
rowKey: string;
|
|
108
109
|
height: BaseTableCssValue;
|
|
109
|
-
border: boolean;
|
|
110
110
|
stripe: boolean;
|
|
111
111
|
showToolbar: boolean;
|
|
112
112
|
showPagination: boolean;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import BaseTable from './BaseTable.vue';
|
|
2
2
|
export default BaseTable;
|
|
3
|
-
export type { BaseTableAction, BaseTableAlign, BaseTableCellPayload, BaseTableColumn, BaseTableColumnKind, BaseTableCssValue, BaseTableExpose, BaseTableLoadedPayload, BaseTableNormalizedResult, BaseTableOption, BaseTablePagination, BaseTableProps, BaseTableResultAdapter, BaseTableRequestHandler, BaseTableRequestParams, BaseTableRequestResult, BaseTableRowActionPayload, BaseTableSortOrder, BaseTableSortPayload } from './BaseTable.types';
|
|
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';
|
|
@@ -91,8 +91,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
|
|
|
91
91
|
disabled: boolean;
|
|
92
92
|
value: OutlinedTreeSelectValue;
|
|
93
93
|
errorMessage: string;
|
|
94
|
-
defaultExpandAll: boolean;
|
|
95
94
|
required: boolean;
|
|
95
|
+
defaultExpandAll: boolean;
|
|
96
96
|
popperClass: string;
|
|
97
97
|
placeholder: string;
|
|
98
98
|
clearable: boolean;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { SvgIconProps } from './SvgIcon.types';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<SvgIconProps>, {
|
|
3
|
+
className: string;
|
|
4
|
+
prefix: string;
|
|
5
|
+
ariaLabel: string;
|
|
6
|
+
}>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<SvgIconProps>, {
|
|
7
|
+
className: string;
|
|
8
|
+
prefix: string;
|
|
9
|
+
ariaLabel: string;
|
|
10
|
+
}>>> & Readonly<{}>, {
|
|
11
|
+
className: string;
|
|
12
|
+
prefix: string;
|
|
13
|
+
ariaLabel: string;
|
|
14
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
15
|
+
export default _default;
|
|
16
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
17
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
18
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
19
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
20
|
+
} : {
|
|
21
|
+
type: import('vue').PropType<T[K]>;
|
|
22
|
+
required: true;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
type __VLS_WithDefaults<P, D> = {
|
|
26
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
27
|
+
default: D[K];
|
|
28
|
+
}> : P[K];
|
|
29
|
+
};
|
|
30
|
+
type __VLS_Prettify<T> = {
|
|
31
|
+
[K in keyof T]: T[K];
|
|
32
|
+
} & {};
|