@gct-paas/v-ben 0.1.4-dev.10 → 0.1.4-dev.11
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/dist/index.esm.min.mjs +793 -2
- package/dist/index.min.cjs +1 -1
- package/dist/index.min.css +1 -0
- package/dist/index.system.min.js +1 -1
- package/es/_virtual/_plugin-vue_export-helper.mjs +9 -0
- package/es/components/index.d.ts +3 -0
- package/es/components/v-ben-button/index.d.ts +133 -0
- package/es/components/v-ben-button/index.mjs +9 -0
- package/es/components/v-ben-button/src/BasicButton.vue.d.ts +75 -0
- package/es/components/v-ben-button/src/BasicButton.vue.mjs +40 -0
- package/es/components/v-ben-button/src/BasicButton.vue2.mjs +5 -0
- package/es/components/v-ben-button/src/PopConfirmButton.vue.d.ts +24 -0
- package/es/components/v-ben-button/src/PopConfirmButton.vue.mjs +46 -0
- package/es/components/v-ben-button/src/PopConfirmButton.vue2.mjs +5 -0
- package/es/components/v-ben-button/src/custom-button.css +64 -0
- package/es/components/v-ben-button/src/custom-button.vue.d.ts +27 -0
- package/es/components/v-ben-button/src/custom-button.vue.mjs +7 -0
- package/es/components/v-ben-button/src/custom-button.vue3.mjs +32 -0
- package/es/components/v-ben-button/src/props.d.ts +38 -0
- package/es/components/v-ben-button/src/props.mjs +29 -0
- package/es/components/v-ben-dropdown/index.d.ts +85 -0
- package/es/components/v-ben-dropdown/index.mjs +5 -0
- package/es/components/v-ben-dropdown/src/Dropdown.vue.d.ts +66 -0
- package/es/components/v-ben-dropdown/src/Dropdown.vue.mjs +113 -0
- package/es/components/v-ben-dropdown/src/Dropdown.vue2.mjs +5 -0
- package/es/components/v-ben-dropdown/src/typing.d.ts +10 -0
- package/es/components/v-ben-table/index.d.ts +3 -0
- package/es/components/v-ben-table/src/BasicTable.vue.d.ts +410 -0
- package/es/components/v-ben-table/src/BasicTable.vue.mjs +53 -0
- package/es/components/v-ben-table/src/BasicTable.vue2.mjs +48 -0
- package/es/components/v-ben-table/src/components/HeaderCell.vue.d.ts +20 -0
- package/es/components/v-ben-table/src/components/HeaderCell.vue.mjs +10 -0
- package/es/components/v-ben-table/src/components/HeaderCell.vue2.mjs +20 -0
- package/es/components/v-ben-table/src/components/TableAction.css +37 -0
- package/es/components/v-ben-table/src/components/TableAction.vue.d.ts +61 -0
- package/es/components/v-ben-table/src/components/TableAction.vue.mjs +174 -0
- package/es/components/v-ben-table/src/components/TableAction.vue3.mjs +6 -0
- package/es/components/v-ben-table/src/components/TableActionAuto.css +37 -0
- package/es/components/v-ben-table/src/components/TableActionAuto.vue.d.ts +61 -0
- package/es/components/v-ben-table/src/components/TableActionAuto.vue.mjs +181 -0
- package/es/components/v-ben-table/src/components/TableActionAuto.vue3.mjs +6 -0
- package/es/components/v-ben-table/src/props.d.ts +186 -0
- package/es/components/v-ben-table/src/props.mjs +136 -0
- package/es/components/v-ben-table/src/types/column.d.ts +164 -0
- package/es/components/v-ben-table/src/types/componentType.d.ts +1 -0
- package/es/components/v-ben-table/src/types/pagination.d.ts +93 -0
- package/es/components/v-ben-table/src/types/table.d.ts +356 -0
- package/es/components/v-ben-table/src/types/tableAction.d.ts +24 -0
- package/es/hooks/useDesign.d.ts +5 -0
- package/es/hooks/useDesign.mjs +9 -0
- package/es/index.d.ts +2 -0
- package/es/index.mjs +10 -0
- package/es/types/index.d.ts +18 -0
- package/es/utils/is.d.ts +23 -0
- package/es/utils/is.mjs +78 -0
- package/package.json +8 -5
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
import { VNodeChild, EmitFn } from 'vue';
|
|
2
|
+
import { PaginationProps } from './pagination';
|
|
3
|
+
import { TableRowSelection as ITableRowSelection, ColumnFilterItem } from 'ant-design-vue/lib/table/interface';
|
|
4
|
+
import { ColumnProps } from 'ant-design-vue/lib/table';
|
|
5
|
+
import { ComponentType } from './componentType';
|
|
6
|
+
import { RoleEnum } from '@gct-paas/core';
|
|
7
|
+
export type VueNode = VNodeChild | JSX.Element;
|
|
8
|
+
export declare type SortOrder = 'ascend' | 'descend';
|
|
9
|
+
export type { ColumnFilterItem };
|
|
10
|
+
export interface TableCurrentDataSource<T = Recordable> {
|
|
11
|
+
currentDataSource: T[];
|
|
12
|
+
}
|
|
13
|
+
export interface TableRowSelection<T = unknown> extends ITableRowSelection {
|
|
14
|
+
/**
|
|
15
|
+
* Callback executed when selected rows change
|
|
16
|
+
* @type Function
|
|
17
|
+
*/
|
|
18
|
+
onChange?: (selectedRowKeys: (string | number)[], selectedRows: T[]) => unknown;
|
|
19
|
+
/**
|
|
20
|
+
* Callback executed when select/deselect one row
|
|
21
|
+
* @type Function
|
|
22
|
+
*/
|
|
23
|
+
onSelect?: (record: T, selected: boolean, selectedRows: object[], nativeEvent: Event) => IObject;
|
|
24
|
+
/**
|
|
25
|
+
* Callback executed when select/deselect all rows
|
|
26
|
+
* @type Function
|
|
27
|
+
*/
|
|
28
|
+
onSelectAll?: (selected: boolean, selectedRows: T[], changeRows: T[]) => IObject;
|
|
29
|
+
/**
|
|
30
|
+
* Callback executed when row selection is inverted
|
|
31
|
+
* @type Function
|
|
32
|
+
*/
|
|
33
|
+
onSelectInvert?: (selectedRows: (string | number)[]) => unknown;
|
|
34
|
+
}
|
|
35
|
+
export interface ExpandedRowRenderRecord<T> extends TableCustomRecord<T> {
|
|
36
|
+
indent?: number;
|
|
37
|
+
expanded?: boolean;
|
|
38
|
+
}
|
|
39
|
+
export interface TableCustomRecord<T = Recordable> {
|
|
40
|
+
record?: T;
|
|
41
|
+
index?: number;
|
|
42
|
+
}
|
|
43
|
+
export interface SorterResult {
|
|
44
|
+
column: ColumnProps;
|
|
45
|
+
order: SortOrder;
|
|
46
|
+
field: string;
|
|
47
|
+
columnKey: string;
|
|
48
|
+
}
|
|
49
|
+
export interface FetchParams {
|
|
50
|
+
searchInfo?: Recordable;
|
|
51
|
+
page?: number;
|
|
52
|
+
sortInfo?: Recordable;
|
|
53
|
+
filterInfo?: Recordable;
|
|
54
|
+
}
|
|
55
|
+
export interface GetColumnsParams {
|
|
56
|
+
ignoreIndex?: boolean;
|
|
57
|
+
ignoreAction?: boolean;
|
|
58
|
+
sort?: boolean;
|
|
59
|
+
}
|
|
60
|
+
export type SizeType = 'default' | 'middle' | 'small' | 'large';
|
|
61
|
+
export interface TableActionType {
|
|
62
|
+
reload: (opt?: FetchParams) => Promise<void>;
|
|
63
|
+
setSelectedRows: (rows: Recordable[]) => void;
|
|
64
|
+
getSelectRows: <T = Recordable>() => T[];
|
|
65
|
+
clearSelectedRowKeys: () => void;
|
|
66
|
+
expandAll: () => void;
|
|
67
|
+
expandRows: (keys: string[] | number[]) => void;
|
|
68
|
+
collapseAll: () => void;
|
|
69
|
+
scrollTo: (pos: string) => void;
|
|
70
|
+
getSelectRowKeys: () => string[];
|
|
71
|
+
deleteSelectRowByKey: (key: string) => void;
|
|
72
|
+
setPagination: (info: Partial<PaginationProps>) => void;
|
|
73
|
+
setTableData: <T = Recordable>(values: T[]) => void;
|
|
74
|
+
updateTableDataRecord: (rowKey: string | number, record: Recordable) => Recordable | unknown;
|
|
75
|
+
deleteTableDataRecord: (rowKey: string | number | string[] | number[]) => void;
|
|
76
|
+
insertTableDataRecord: (record: Recordable | Recordable[], index?: number) => Recordable[] | unknown;
|
|
77
|
+
findTableDataRecord: (rowKey: string | number) => Recordable | unknown;
|
|
78
|
+
getColumns: (opt?: GetColumnsParams) => BasicColumn[];
|
|
79
|
+
setColumns: (columns: BasicColumn[] | string[]) => void;
|
|
80
|
+
getDataSource: <T = Recordable>() => T[];
|
|
81
|
+
getRawDataSource: <T = Recordable>() => T;
|
|
82
|
+
setLoading: (loading: boolean) => void;
|
|
83
|
+
setProps: (props: Partial<BasicTableProps>) => void;
|
|
84
|
+
redoHeight: () => void;
|
|
85
|
+
setSelectedRowKeys: (rowKeys: string[] | number[]) => void;
|
|
86
|
+
getPaginationRef: () => PaginationProps | boolean;
|
|
87
|
+
getSize: () => SizeType;
|
|
88
|
+
getRowSelection: () => TableRowSelection<Recordable>;
|
|
89
|
+
getCacheColumns: () => BasicColumn[];
|
|
90
|
+
emit?: EmitFn;
|
|
91
|
+
updateTableData: (index: number, key: string, value: unknown) => Recordable;
|
|
92
|
+
setShowPagination: (show: boolean) => Promise<void>;
|
|
93
|
+
getShowPagination: () => boolean;
|
|
94
|
+
setCacheColumnsByField?: (dataIndex: string | undefined, value: BasicColumn) => void;
|
|
95
|
+
setCacheColumns?: (columns: BasicColumn[]) => void;
|
|
96
|
+
}
|
|
97
|
+
export interface FetchSetting {
|
|
98
|
+
pageField: string;
|
|
99
|
+
sizeField: string;
|
|
100
|
+
listField: string;
|
|
101
|
+
totalField: string;
|
|
102
|
+
}
|
|
103
|
+
export interface TableSetting {
|
|
104
|
+
redo?: boolean;
|
|
105
|
+
size?: boolean;
|
|
106
|
+
setting?: boolean;
|
|
107
|
+
fullScreen?: boolean;
|
|
108
|
+
}
|
|
109
|
+
export interface BasicTableProps<T = unknown> {
|
|
110
|
+
clickToRowSelect?: boolean;
|
|
111
|
+
isTreeTable?: boolean;
|
|
112
|
+
sortFn?: (sortInfo: SorterResult) => IObject;
|
|
113
|
+
filterFn?: (data: Partial<Recordable<string[]>>) => IObject;
|
|
114
|
+
inset?: boolean;
|
|
115
|
+
showTableSetting?: boolean;
|
|
116
|
+
tableSetting?: TableSetting;
|
|
117
|
+
striped?: boolean;
|
|
118
|
+
autoCreateKey?: boolean;
|
|
119
|
+
summaryFunc?: (...arg: unknown[]) => Recordable[];
|
|
120
|
+
summaryData?: Recordable[];
|
|
121
|
+
showSummary?: boolean;
|
|
122
|
+
canColDrag?: boolean;
|
|
123
|
+
api?: (...arg: unknown[]) => Promise<IObject>;
|
|
124
|
+
beforeFetch?: Fn;
|
|
125
|
+
afterFetch?: Fn;
|
|
126
|
+
handleSearchInfoFn?: Fn;
|
|
127
|
+
fetchSetting?: Partial<FetchSetting>;
|
|
128
|
+
immediate?: boolean;
|
|
129
|
+
emptyDataIsShowTable?: boolean;
|
|
130
|
+
searchInfo?: Recordable;
|
|
131
|
+
defSort?: Recordable;
|
|
132
|
+
useSearchForm?: boolean;
|
|
133
|
+
formConfig?: Partial<IObject>;
|
|
134
|
+
columns: BasicColumn[];
|
|
135
|
+
showIndexColumn?: boolean;
|
|
136
|
+
indexColumnProps?: BasicColumn;
|
|
137
|
+
actionColumn?: BasicColumn;
|
|
138
|
+
ellipsis?: boolean;
|
|
139
|
+
isCanResizeParent?: boolean;
|
|
140
|
+
canResize?: boolean;
|
|
141
|
+
resizeHeightOffset?: number;
|
|
142
|
+
clearSelectOnPageChange?: boolean;
|
|
143
|
+
rowKey?: string | ((record: Recordable) => string);
|
|
144
|
+
dataSource?: Recordable[];
|
|
145
|
+
titleHelpMessage?: string | string[];
|
|
146
|
+
maxHeight?: number;
|
|
147
|
+
bordered?: boolean;
|
|
148
|
+
pagination?: PaginationProps | boolean;
|
|
149
|
+
loading?: boolean;
|
|
150
|
+
/**
|
|
151
|
+
* The column contains children to display
|
|
152
|
+
* @default 'children'
|
|
153
|
+
* @type string | string[]
|
|
154
|
+
*/
|
|
155
|
+
childrenColumnName?: string;
|
|
156
|
+
/**
|
|
157
|
+
* Override default table elements
|
|
158
|
+
* @type object
|
|
159
|
+
*/
|
|
160
|
+
components?: object;
|
|
161
|
+
/**
|
|
162
|
+
* Expand all rows initially
|
|
163
|
+
* @default false
|
|
164
|
+
* @type boolean
|
|
165
|
+
*/
|
|
166
|
+
defaultExpandAllRows?: boolean;
|
|
167
|
+
/**
|
|
168
|
+
* Initial expanded row keys
|
|
169
|
+
* @type string[]
|
|
170
|
+
*/
|
|
171
|
+
defaultExpandedRowKeys?: string[];
|
|
172
|
+
/**
|
|
173
|
+
* Current expanded row keys
|
|
174
|
+
* @type string[]
|
|
175
|
+
*/
|
|
176
|
+
expandedRowKeys?: string[];
|
|
177
|
+
/**
|
|
178
|
+
* Expanded container render for each row
|
|
179
|
+
* @type Function
|
|
180
|
+
*/
|
|
181
|
+
expandedRowRender?: (record?: ExpandedRowRenderRecord<T>) => VNodeChild | JSX.Element;
|
|
182
|
+
/**
|
|
183
|
+
* Customize row expand Icon.
|
|
184
|
+
* @type Function | VNodeChild
|
|
185
|
+
*/
|
|
186
|
+
expandIcon?: Fn | VNodeChild | JSX.Element;
|
|
187
|
+
/**
|
|
188
|
+
* Whether to expand row by clicking anywhere in the whole row
|
|
189
|
+
* @default false
|
|
190
|
+
* @type boolean
|
|
191
|
+
*/
|
|
192
|
+
expandRowByClick?: boolean;
|
|
193
|
+
/**
|
|
194
|
+
* The index of `expandIcon` which column will be inserted when `expandIconAsCell` is false. default 0
|
|
195
|
+
*/
|
|
196
|
+
expandIconColumnIndex?: number;
|
|
197
|
+
/**
|
|
198
|
+
* Table footer renderer
|
|
199
|
+
* @type Function | VNodeChild
|
|
200
|
+
*/
|
|
201
|
+
footer?: Fn | VNodeChild | JSX.Element;
|
|
202
|
+
/**
|
|
203
|
+
* Indent size in pixels of tree data
|
|
204
|
+
* @default 15
|
|
205
|
+
* @type number
|
|
206
|
+
*/
|
|
207
|
+
indentSize?: number;
|
|
208
|
+
/**
|
|
209
|
+
* i18n text including filter, sort, empty text, etc
|
|
210
|
+
* @default { filterConfirm: 'Ok', filterReset: 'Reset', emptyText: 'No Data' }
|
|
211
|
+
* @type object
|
|
212
|
+
*/
|
|
213
|
+
locale?: object;
|
|
214
|
+
/**
|
|
215
|
+
* Row's className
|
|
216
|
+
* @type Function
|
|
217
|
+
*/
|
|
218
|
+
rowClassName?: (record: TableCustomRecord<T>, index: number) => string;
|
|
219
|
+
/**
|
|
220
|
+
* Row selection config
|
|
221
|
+
* @type object
|
|
222
|
+
*/
|
|
223
|
+
rowSelection?: TableRowSelection;
|
|
224
|
+
/**
|
|
225
|
+
* Set horizontal or vertical scrolling, can also be used to specify the width and height of the scroll area.
|
|
226
|
+
* It is recommended to set a number for x, if you want to set it to true,
|
|
227
|
+
* you need to add style .ant-table td { white-space: nowrap; }.
|
|
228
|
+
* @type object
|
|
229
|
+
*/
|
|
230
|
+
scroll?: {
|
|
231
|
+
x?: number | string | true;
|
|
232
|
+
y?: number | string;
|
|
233
|
+
};
|
|
234
|
+
/**
|
|
235
|
+
* Whether to show table header
|
|
236
|
+
* @default true
|
|
237
|
+
* @type boolean
|
|
238
|
+
*/
|
|
239
|
+
showHeader?: boolean;
|
|
240
|
+
/**
|
|
241
|
+
* Size of table
|
|
242
|
+
* @default 'default'
|
|
243
|
+
* @type string
|
|
244
|
+
*/
|
|
245
|
+
size?: SizeType;
|
|
246
|
+
/**
|
|
247
|
+
* Table title renderer
|
|
248
|
+
* @type Function | ScopedSlot
|
|
249
|
+
*/
|
|
250
|
+
title?: VNodeChild | JSX.Element | string | ((data: Recordable) => string);
|
|
251
|
+
/**
|
|
252
|
+
* Set props on per header row
|
|
253
|
+
* @type Function
|
|
254
|
+
*/
|
|
255
|
+
customHeaderRow?: (column: ColumnProps, index: number) => object;
|
|
256
|
+
/**
|
|
257
|
+
* Set props on per row
|
|
258
|
+
* @type Function
|
|
259
|
+
*/
|
|
260
|
+
customRow?: (record: T, index: number) => object;
|
|
261
|
+
/**
|
|
262
|
+
* `table-layout` attribute of table element
|
|
263
|
+
* `fixed` when header/columns are fixed, or using `column.ellipsis`
|
|
264
|
+
*
|
|
265
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/table-layout
|
|
266
|
+
* @version 1.5.0
|
|
267
|
+
*/
|
|
268
|
+
tableLayout?: 'auto' | 'fixed' | string;
|
|
269
|
+
/**
|
|
270
|
+
* the render container of dropdowns in table
|
|
271
|
+
* @param triggerNode
|
|
272
|
+
* @version 1.5.0
|
|
273
|
+
*/
|
|
274
|
+
getPopupContainer?: (triggerNode?: HTMLElement) => HTMLElement;
|
|
275
|
+
/**
|
|
276
|
+
* Data can be changed again before rendering.
|
|
277
|
+
* The default configuration of general user empty data.
|
|
278
|
+
* You can configured globally through [ConfigProvider](https://antdv.com/components/config-provider-cn/)
|
|
279
|
+
*
|
|
280
|
+
* @version 1.5.4
|
|
281
|
+
*/
|
|
282
|
+
transformCellText?: Fn;
|
|
283
|
+
/**
|
|
284
|
+
* Callback executed before editable cell submit value, not for row-editor
|
|
285
|
+
*
|
|
286
|
+
* The cell will not submit data while callback return false
|
|
287
|
+
*/
|
|
288
|
+
beforeEditSubmit?: (data: {
|
|
289
|
+
record: Recordable;
|
|
290
|
+
index: number;
|
|
291
|
+
key: string | number;
|
|
292
|
+
value: unknown;
|
|
293
|
+
}) => Promise<IObject>;
|
|
294
|
+
/**
|
|
295
|
+
* Callback executed when pagination, filters or sorter is changed
|
|
296
|
+
* @param pagination
|
|
297
|
+
* @param filters
|
|
298
|
+
* @param sorter
|
|
299
|
+
* @param currentDataSource
|
|
300
|
+
*/
|
|
301
|
+
onChange?: (pagination: IObject, filters: Fn, sorter: IObject, extra: IObject) => void;
|
|
302
|
+
/**
|
|
303
|
+
* Callback executed when the row expand icon is clicked
|
|
304
|
+
*
|
|
305
|
+
* @param expanded
|
|
306
|
+
* @param record
|
|
307
|
+
*/
|
|
308
|
+
onExpand?: (expande: boolean, record: T) => void;
|
|
309
|
+
/**
|
|
310
|
+
* Callback executed when the expanded rows change
|
|
311
|
+
* @param expandedRows
|
|
312
|
+
*/
|
|
313
|
+
onExpandedRowsChange?: (expandedRows: string[] | number[]) => void;
|
|
314
|
+
onColumnsChange?: (data: ColumnChangeParam[]) => void;
|
|
315
|
+
}
|
|
316
|
+
export type CellFormat = string | ((text: string, record: Recordable, index: number) => string | number) | Map<string | number, unknown>;
|
|
317
|
+
export interface BasicColumn extends ColumnProps<Recordable> {
|
|
318
|
+
children?: BasicColumn[];
|
|
319
|
+
filters?: ColumnFilterItem[];
|
|
320
|
+
flag?: 'INDEX' | 'DEFAULT' | 'CHECKBOX' | 'RADIO' | 'ACTION';
|
|
321
|
+
customTitle?: VueNode;
|
|
322
|
+
slots?: Recordable;
|
|
323
|
+
defaultHidden?: boolean;
|
|
324
|
+
helpMessage?: string | string[];
|
|
325
|
+
format?: CellFormat;
|
|
326
|
+
edit?: boolean;
|
|
327
|
+
editRow?: boolean;
|
|
328
|
+
editable?: boolean;
|
|
329
|
+
editComponent?: ComponentType;
|
|
330
|
+
editComponentProps?: ((opt: {
|
|
331
|
+
text: string | number | boolean | Recordable;
|
|
332
|
+
record: Recordable;
|
|
333
|
+
column: BasicColumn;
|
|
334
|
+
index: number;
|
|
335
|
+
}) => Recordable) | Recordable;
|
|
336
|
+
editRule?: boolean | ((text: string, record: Recordable) => Promise<string>);
|
|
337
|
+
editValueMap?: (value: unknown) => string;
|
|
338
|
+
onEditRow?: () => void;
|
|
339
|
+
auth?: RoleEnum | RoleEnum[] | string | string[];
|
|
340
|
+
ifShow?: boolean | ((column: BasicColumn) => boolean);
|
|
341
|
+
editRender?: (opt: {
|
|
342
|
+
text: string | number | boolean | Recordable;
|
|
343
|
+
record: Recordable;
|
|
344
|
+
column: BasicColumn;
|
|
345
|
+
index: number;
|
|
346
|
+
}) => VNodeChild | JSX.Element;
|
|
347
|
+
editDynamicDisabled?: boolean | ((record: Recordable) => boolean);
|
|
348
|
+
}
|
|
349
|
+
export interface ColumnChangeParam {
|
|
350
|
+
dataIndex: string;
|
|
351
|
+
fixed: boolean | 'left' | 'right' | undefined;
|
|
352
|
+
visible: boolean;
|
|
353
|
+
}
|
|
354
|
+
export interface InnerHandlers {
|
|
355
|
+
onColumnsChange: (data: ColumnChangeParam[]) => void;
|
|
356
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ButtonProps } from 'ant-design-vue/es/button/buttonTypes';
|
|
2
|
+
import { TooltipProps } from 'ant-design-vue/es/tooltip/Tooltip';
|
|
3
|
+
import { RoleEnum } from '@gct-paas/core';
|
|
4
|
+
export interface ActionItem extends ButtonProps {
|
|
5
|
+
onClick?: Fn;
|
|
6
|
+
label?: string;
|
|
7
|
+
color?: 'success' | 'error' | 'warning' | 'text';
|
|
8
|
+
icon?: string;
|
|
9
|
+
popConfirm?: PopConfirm;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
divider?: boolean;
|
|
12
|
+
auth?: RoleEnum | string;
|
|
13
|
+
ifShow?: boolean | ((action: ActionItem) => boolean);
|
|
14
|
+
tooltip?: string | TooltipProps;
|
|
15
|
+
}
|
|
16
|
+
export interface PopConfirm {
|
|
17
|
+
title: string;
|
|
18
|
+
okText?: string;
|
|
19
|
+
cancelText?: string;
|
|
20
|
+
confirm: Fn;
|
|
21
|
+
cancel?: Fn;
|
|
22
|
+
icon?: string;
|
|
23
|
+
placement?: 'top' | 'left' | 'right' | 'bottom' | 'topLeft' | 'topRight' | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom' | 'bottomLeft' | 'bottomRight';
|
|
24
|
+
}
|
package/es/index.d.ts
CHANGED
package/es/index.mjs
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
import './components/v-ben-table/src/components/TableActionAuto.css';import './components/v-ben-table/src/components/TableAction.css';export { is, isArray, isBoolean, isClient, isDate, isDef, isElement, isEmpty, isEmptyStr, isFunction, isMap, isNull, isNullAndUnDef, isNullOrUnDef, isNumber, isObject, isPromise, isRegExp, isServer, isString, isUnDef, isUrl, isWindow } from './utils/is.mjs';
|
|
2
|
+
export { default as BasicTable } from './components/v-ben-table/src/BasicTable.vue.mjs';
|
|
3
|
+
export { default as TableAction } from './components/v-ben-table/src/components/TableAction.vue.mjs';
|
|
4
|
+
/* empty css */
|
|
5
|
+
export { default as TableActionAuto } from './components/v-ben-table/src/components/TableActionAuto.vue.mjs';
|
|
6
|
+
/* empty css */
|
|
7
|
+
export { Button, PopConfirmButton } from './components/v-ben-button/index.mjs';
|
|
8
|
+
export { Dropdown } from './components/v-ben-dropdown/index.mjs';
|
|
9
|
+
export { default as CustomButton } from './components/v-ben-button/src/custom-button.vue.mjs';
|
|
10
|
+
|
|
1
11
|
function run() {
|
|
2
12
|
}
|
|
3
13
|
|
package/es/types/index.d.ts
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import '@gct-paas/core/types';
|
|
2
|
+
import type { VNode, ComponentPublicInstance } from 'vue';
|
|
3
|
+
|
|
4
|
+
declare global {
|
|
5
|
+
namespace JSX {
|
|
6
|
+
type Element = VNode;
|
|
7
|
+
type ElementClass = ComponentPublicInstance;
|
|
8
|
+
|
|
9
|
+
interface ElementAttributesProperty {
|
|
10
|
+
$props: IObject;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
type IntrinsicElements = IObject;
|
|
14
|
+
|
|
15
|
+
type IntrinsicAttributes = IObject;
|
|
16
|
+
}
|
|
17
|
+
declare type Recordable<T = unknown> = Record<string, T>;
|
|
18
|
+
}
|
package/es/utils/is.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare function is(val: unknown, type: string): boolean;
|
|
2
|
+
export declare function isDef<T = unknown>(val?: T): val is T;
|
|
3
|
+
export declare function isUnDef<T = unknown>(val?: T): val is T;
|
|
4
|
+
export declare function isObject(val: unknown): boolean;
|
|
5
|
+
export declare function isEmpty<T = unknown>(val: T): val is T;
|
|
6
|
+
export declare function isDate(val: unknown): val is Date;
|
|
7
|
+
export declare function isNull(val: unknown): val is null;
|
|
8
|
+
export declare function isNullAndUnDef(val: unknown): val is null | undefined;
|
|
9
|
+
export declare function isNullOrUnDef(val: unknown): val is null | undefined;
|
|
10
|
+
export declare function isNumber(val: unknown): val is number;
|
|
11
|
+
export declare function isPromise<T = IObject>(val: unknown): val is Promise<T>;
|
|
12
|
+
export declare function isString(val: unknown): val is string;
|
|
13
|
+
export declare function isFunction(val: unknown): val is Fn;
|
|
14
|
+
export declare function isBoolean(val: unknown): val is boolean;
|
|
15
|
+
export declare function isRegExp(val: unknown): val is RegExp;
|
|
16
|
+
export declare function isArray(val: unknown): boolean;
|
|
17
|
+
export declare function isWindow(val: unknown): val is Window;
|
|
18
|
+
export declare function isElement(val: unknown): val is Element;
|
|
19
|
+
export declare function isMap(val: unknown): boolean;
|
|
20
|
+
export declare const isServer: boolean;
|
|
21
|
+
export declare const isClient: boolean;
|
|
22
|
+
export declare function isUrl(path: string): boolean;
|
|
23
|
+
export declare function isEmptyStr(str: unknown): boolean;
|
package/es/utils/is.mjs
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
const toString = Object.prototype.toString;
|
|
2
|
+
function is(val, type) {
|
|
3
|
+
return toString.call(val) === `[object ${type}]`;
|
|
4
|
+
}
|
|
5
|
+
function isDef(val) {
|
|
6
|
+
return typeof val !== "undefined";
|
|
7
|
+
}
|
|
8
|
+
function isUnDef(val) {
|
|
9
|
+
return !isDef(val);
|
|
10
|
+
}
|
|
11
|
+
function isObject(val) {
|
|
12
|
+
return val !== null && is(val, "Object");
|
|
13
|
+
}
|
|
14
|
+
function isEmpty(val) {
|
|
15
|
+
if (isArray(val) || isString(val)) {
|
|
16
|
+
return val.length === 0;
|
|
17
|
+
}
|
|
18
|
+
if (val instanceof Map || val instanceof Set) {
|
|
19
|
+
return val.size === 0;
|
|
20
|
+
}
|
|
21
|
+
if (isObject(val)) {
|
|
22
|
+
return Object.keys(val).length === 0;
|
|
23
|
+
}
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
function isDate(val) {
|
|
27
|
+
return is(val, "Date");
|
|
28
|
+
}
|
|
29
|
+
function isNull(val) {
|
|
30
|
+
return val === null;
|
|
31
|
+
}
|
|
32
|
+
function isNullAndUnDef(val) {
|
|
33
|
+
return isUnDef(val) && isNull(val);
|
|
34
|
+
}
|
|
35
|
+
function isNullOrUnDef(val) {
|
|
36
|
+
return isUnDef(val) || isNull(val);
|
|
37
|
+
}
|
|
38
|
+
function isNumber(val) {
|
|
39
|
+
return is(val, "Number");
|
|
40
|
+
}
|
|
41
|
+
function isPromise(val) {
|
|
42
|
+
return is(val, "Promise") && isObject(val) && isFunction(val.then) && isFunction(val.then);
|
|
43
|
+
}
|
|
44
|
+
function isString(val) {
|
|
45
|
+
return is(val, "String");
|
|
46
|
+
}
|
|
47
|
+
function isFunction(val) {
|
|
48
|
+
return typeof val === "function";
|
|
49
|
+
}
|
|
50
|
+
function isBoolean(val) {
|
|
51
|
+
return is(val, "Boolean");
|
|
52
|
+
}
|
|
53
|
+
function isRegExp(val) {
|
|
54
|
+
return is(val, "RegExp");
|
|
55
|
+
}
|
|
56
|
+
function isArray(val) {
|
|
57
|
+
return !!val && Array.isArray(val);
|
|
58
|
+
}
|
|
59
|
+
function isWindow(val) {
|
|
60
|
+
return typeof window !== "undefined" && is(val, "Window");
|
|
61
|
+
}
|
|
62
|
+
function isElement(val) {
|
|
63
|
+
return isObject(val) && !!val.tagName;
|
|
64
|
+
}
|
|
65
|
+
function isMap(val) {
|
|
66
|
+
return is(val, "Map");
|
|
67
|
+
}
|
|
68
|
+
const isServer = typeof window === "undefined";
|
|
69
|
+
const isClient = !isServer;
|
|
70
|
+
function isUrl(path) {
|
|
71
|
+
const reg = /^http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- ./?%&=]*)?/;
|
|
72
|
+
return reg.test(path);
|
|
73
|
+
}
|
|
74
|
+
function isEmptyStr(str) {
|
|
75
|
+
return str === void 0 || !str && str !== 0 && str !== "0" || !/[^\s]/.test(str + "");
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export { is, isArray, isBoolean, isClient, isDate, isDef, isElement, isEmpty, isEmptyStr, isFunction, isMap, isNull, isNullAndUnDef, isNullOrUnDef, isNumber, isObject, isPromise, isRegExp, isServer, isString, isUnDef, isUrl, isWindow };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gct-paas/v-ben",
|
|
3
|
-
"version": "0.1.4-dev.
|
|
3
|
+
"version": "0.1.4-dev.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "paas 平台历史 v-ben 内容",
|
|
6
6
|
"main": "dist/index.min.cjs",
|
|
@@ -50,14 +50,16 @@
|
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@ant-design/icons-vue": "^6.1.0",
|
|
52
52
|
"@gct-paas/api": "^0.1.1",
|
|
53
|
-
"@gct-paas/core": "
|
|
53
|
+
"@gct-paas/core": "0.1.4-dev.11",
|
|
54
54
|
"@gct-paas/platform-icons": "^0.0.2",
|
|
55
|
-
"@gct-paas/scss": "
|
|
55
|
+
"@gct-paas/scss": "0.1.4-dev.11",
|
|
56
56
|
"@icon-park/vue-next": "^1.4.2",
|
|
57
57
|
"@vueuse/core": "^14.1.0",
|
|
58
58
|
"ant-design-vue": "3.2.20",
|
|
59
59
|
"lodash-es": "^4.17.23",
|
|
60
|
-
"
|
|
60
|
+
"sortablejs": "^1.15.7",
|
|
61
|
+
"vue": "^3.5.29",
|
|
62
|
+
"vue-types": "^6.0.0"
|
|
61
63
|
},
|
|
62
64
|
"devDependencies": {
|
|
63
65
|
"@gct-paas/build": "^0.1.5-dev.9",
|
|
@@ -65,5 +67,6 @@
|
|
|
65
67
|
},
|
|
66
68
|
"peerDependencies": {
|
|
67
69
|
"vue": "^3.x"
|
|
68
|
-
}
|
|
70
|
+
},
|
|
71
|
+
"gitHead": "6b0fd87c1a7799aa228f40b160e53a7358c25186"
|
|
69
72
|
}
|