@hbdlzy/ui-core 0.1.0 → 0.1.2
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 +61 -3
- package/components.manifest.json +239 -24
- package/dist/index.cjs +1 -1
- package/dist/index.js +3005 -13
- package/dist/style.css +1 -0
- package/package.json +5 -3
- package/src/components/BaseCard/BaseCard.types.ts +38 -0
- package/src/components/BaseCard/BaseCard.vue +250 -0
- package/src/components/BaseCard/README.md +164 -0
- package/src/components/BaseCard/index.ts +5 -0
- package/src/components/BaseEChart/BaseEChart.types.ts +35 -0
- package/src/components/BaseEChart/BaseEChart.vue +327 -0
- package/src/components/BaseEChart/README.md +136 -0
- package/src/components/BaseEChart/index.ts +5 -0
- package/src/components/BaseExportButton/BaseExportButton.vue +1 -1
- package/src/components/BaseExportButton/README.md +104 -8
- package/src/components/BaseTable/BaseTable.types.ts +174 -0
- package/src/components/BaseTable/BaseTable.vue +809 -0
- package/src/components/BaseTable/README.md +398 -0
- package/src/components/BaseTable/index.ts +25 -0
- package/src/components/OutlinedCascader/OutlinedCascader.types.ts +28 -0
- package/src/components/OutlinedCascader/OutlinedCascader.vue +250 -0
- package/src/components/OutlinedCascader/README.md +91 -0
- package/src/components/OutlinedCascader/index.ts +10 -0
- package/src/components/OutlinedDatePicker/OutlinedDatePicker.types.ts +40 -0
- package/src/components/OutlinedDatePicker/OutlinedDatePicker.vue +365 -0
- package/src/components/OutlinedDatePicker/README.md +137 -0
- package/src/components/OutlinedDatePicker/index.ts +11 -0
- package/src/components/OutlinedDateTimePicker/OutlinedDateTimePicker.types.ts +34 -0
- package/src/components/OutlinedDateTimePicker/OutlinedDateTimePicker.vue +421 -0
- package/src/components/OutlinedDateTimePicker/README.md +88 -0
- package/src/components/OutlinedDateTimePicker/index.ts +11 -0
- package/src/components/OutlinedInput/OutlinedInput.types.ts +32 -0
- package/src/components/OutlinedInput/OutlinedInput.vue +307 -0
- package/src/components/OutlinedInput/README.md +154 -0
- package/src/components/OutlinedInput/index.ts +10 -0
- package/src/components/OutlinedSelect/OutlinedSelect.types.ts +48 -0
- package/src/components/OutlinedSelect/OutlinedSelect.vue +359 -0
- package/src/components/OutlinedSelect/README.md +166 -0
- package/src/components/OutlinedSelect/index.ts +12 -0
- package/src/components/OutlinedTimePicker/OutlinedTimePicker.types.ts +36 -0
- package/src/components/OutlinedTimePicker/OutlinedTimePicker.vue +303 -0
- package/src/components/OutlinedTimePicker/README.md +93 -0
- package/src/components/OutlinedTimePicker/index.ts +10 -0
- package/src/components/OutlinedTreeSelect/OutlinedTreeSelect.types.ts +56 -0
- package/src/components/OutlinedTreeSelect/OutlinedTreeSelect.vue +354 -0
- package/src/components/OutlinedTreeSelect/README.md +107 -0
- package/src/components/OutlinedTreeSelect/index.ts +12 -0
- package/src/echarts/index.ts +12 -0
- package/src/excel/exportExcel.ts +36 -10
- package/src/index.ts +29 -0
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
export type BaseTableCssValue = string | number
|
|
2
|
+
export type BaseTableAlign = 'left' | 'center' | 'right'
|
|
3
|
+
export type BaseTableColumnKind = 'text' | 'link' | 'actions' | 'image' | 'tag' | 'html' | 'input'
|
|
4
|
+
export type BaseTableSortOrder = 'ascending' | 'descending' | null
|
|
5
|
+
export type BaseTableSortDirection = string | null
|
|
6
|
+
|
|
7
|
+
export interface BaseTableOption {
|
|
8
|
+
label: string
|
|
9
|
+
value: string | number | boolean
|
|
10
|
+
tagType?: '' | 'success' | 'warning' | 'info' | 'danger' | 'primary'
|
|
11
|
+
color?: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface BaseTableAction<Row = Record<string, any>> {
|
|
15
|
+
label: string
|
|
16
|
+
type: string
|
|
17
|
+
buttonType?: '' | 'primary' | 'success' | 'warning' | 'info' | 'danger'
|
|
18
|
+
disabled?: boolean | ((row: Row) => boolean)
|
|
19
|
+
visible?: boolean | ((row: Row) => boolean)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface BaseTableColumn<Row = Record<string, any>> {
|
|
23
|
+
label: string
|
|
24
|
+
prop?: keyof Row | string
|
|
25
|
+
kind?: BaseTableColumnKind
|
|
26
|
+
type?: string
|
|
27
|
+
width?: BaseTableCssValue
|
|
28
|
+
minWidth?: BaseTableCssValue
|
|
29
|
+
align?: BaseTableAlign
|
|
30
|
+
headerAlign?: BaseTableAlign
|
|
31
|
+
fixed?: boolean | 'left' | 'right'
|
|
32
|
+
sortable?: boolean | 'custom'
|
|
33
|
+
sortField?: string
|
|
34
|
+
showOverflowTooltip?: boolean
|
|
35
|
+
className?: string
|
|
36
|
+
headerClassName?: string
|
|
37
|
+
actions?: BaseTableAction<Row>[]
|
|
38
|
+
clickable?: boolean
|
|
39
|
+
options?: BaseTableOption[]
|
|
40
|
+
optionValueKey?: string
|
|
41
|
+
optionLabelKey?: string
|
|
42
|
+
optionTagTypeKey?: string
|
|
43
|
+
emptyText?: string
|
|
44
|
+
inputType?: string
|
|
45
|
+
imageFit?: '' | 'fill' | 'contain' | 'cover' | 'none' | 'scale-down'
|
|
46
|
+
imageWidth?: BaseTableCssValue
|
|
47
|
+
imageHeight?: BaseTableCssValue
|
|
48
|
+
slotName?: string
|
|
49
|
+
headerSlotName?: string
|
|
50
|
+
formatter?: (row: Row, column: BaseTableColumn<Row>) => unknown
|
|
51
|
+
html?: (row: Row, column: BaseTableColumn<Row>) => string
|
|
52
|
+
clickHandler?: (row: Row, column: BaseTableColumn<Row>) => void
|
|
53
|
+
inputHandler?: (value: string, row: Row, column: BaseTableColumn<Row>) => void
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface BaseTablePagination {
|
|
57
|
+
currentPage: number
|
|
58
|
+
pageSize: number
|
|
59
|
+
total: number
|
|
60
|
+
pageSizes: number[]
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface BaseTableRequestParams {
|
|
64
|
+
currentPage: number
|
|
65
|
+
pageSize: number
|
|
66
|
+
[key: string]: unknown
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface BaseTableSortState {
|
|
70
|
+
prop?: string
|
|
71
|
+
order: BaseTableSortOrder
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface BaseTableSortOrderMap {
|
|
75
|
+
ascending: string
|
|
76
|
+
descending: string
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export interface BaseTableRequestResult<Row = Record<string, any>> {
|
|
80
|
+
records?: Row[]
|
|
81
|
+
list?: Row[]
|
|
82
|
+
items?: Row[]
|
|
83
|
+
total?: number
|
|
84
|
+
data?: {
|
|
85
|
+
records?: Row[]
|
|
86
|
+
list?: Row[]
|
|
87
|
+
items?: Row[]
|
|
88
|
+
total?: number
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export interface BaseTableNormalizedResult<Row = Record<string, any>> {
|
|
93
|
+
rows?: Row[]
|
|
94
|
+
total?: number
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export type BaseTableRequestHandler<Row = Record<string, any>> = (
|
|
98
|
+
params: BaseTableRequestParams
|
|
99
|
+
) => Promise<BaseTableRequestResult<Row> | Row[]>
|
|
100
|
+
|
|
101
|
+
export type BaseTableResultAdapter<Row = Record<string, any>> = (
|
|
102
|
+
result: unknown,
|
|
103
|
+
params: BaseTableRequestParams
|
|
104
|
+
) => BaseTableNormalizedResult<Row>
|
|
105
|
+
|
|
106
|
+
export interface BaseTableProps<Row = Record<string, any>> {
|
|
107
|
+
columns: BaseTableColumn<Row>[]
|
|
108
|
+
data?: Row[]
|
|
109
|
+
request?: BaseTableRequestHandler<Row>
|
|
110
|
+
requestParams?: Record<string, unknown>
|
|
111
|
+
resultAdapter?: BaseTableResultAdapter<Row>
|
|
112
|
+
autoLoad?: boolean
|
|
113
|
+
reloadOnParamsChange?: boolean
|
|
114
|
+
reloadOnSortChange?: boolean
|
|
115
|
+
rowKey?: string
|
|
116
|
+
height?: BaseTableCssValue
|
|
117
|
+
border?: boolean
|
|
118
|
+
stripe?: boolean
|
|
119
|
+
showToolbar?: boolean
|
|
120
|
+
showPagination?: boolean
|
|
121
|
+
hasSelection?: boolean
|
|
122
|
+
hasIndex?: boolean
|
|
123
|
+
indexLabel?: string
|
|
124
|
+
indexWidth?: BaseTableCssValue
|
|
125
|
+
selectionWidth?: BaseTableCssValue
|
|
126
|
+
rowSelectable?: (row: Row, index: number) => boolean
|
|
127
|
+
pagination?: Partial<BaseTablePagination>
|
|
128
|
+
currentPageKey?: string
|
|
129
|
+
pageSizeKey?: string
|
|
130
|
+
defaultSort?: BaseTableSortState
|
|
131
|
+
sortFieldKey?: string
|
|
132
|
+
sortOrderKey?: string
|
|
133
|
+
sortOrderMap?: BaseTableSortOrderMap
|
|
134
|
+
sortMapper?: (payload: BaseTableSortPayload<Row>) => Record<string, unknown> | void
|
|
135
|
+
emptyText?: string
|
|
136
|
+
loadingText?: string
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export interface BaseTableSortPayload<Row = Record<string, any>> {
|
|
140
|
+
column: BaseTableColumn<Row> | undefined
|
|
141
|
+
prop?: string
|
|
142
|
+
order: BaseTableSortOrder
|
|
143
|
+
field?: string
|
|
144
|
+
direction: BaseTableSortDirection
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export interface BaseTableRowActionPayload<Row = Record<string, any>> {
|
|
148
|
+
row: Row
|
|
149
|
+
action: BaseTableAction<Row>
|
|
150
|
+
column: BaseTableColumn<Row>
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export interface BaseTableCellPayload<Row = Record<string, any>> {
|
|
154
|
+
row: Row
|
|
155
|
+
column: BaseTableColumn<Row>
|
|
156
|
+
value: unknown
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export interface BaseTableLoadedPayload<Row = Record<string, any>> {
|
|
160
|
+
rows: Row[]
|
|
161
|
+
total: number
|
|
162
|
+
params: BaseTableRequestParams
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export interface BaseTableExpose<Row = Record<string, any>> {
|
|
166
|
+
load: (data?: Row[]) => Promise<void>
|
|
167
|
+
refresh: () => Promise<void>
|
|
168
|
+
setData: (data: Row[]) => void
|
|
169
|
+
resetPage: () => Promise<void>
|
|
170
|
+
clearSelection: () => void
|
|
171
|
+
toggleRowSelection: (row: Row, selected?: boolean) => void
|
|
172
|
+
getSelectionRows: () => Row[]
|
|
173
|
+
getRows: () => Row[]
|
|
174
|
+
}
|