@next-bricks/presentational-bricks 1.338.0 → 1.339.0
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/deploy/contract.yaml +123 -123
- package/dist/bricks.json +29 -29
- package/dist/index.e0f6d174.js +2 -0
- package/dist/index.e0f6d174.js.map +1 -0
- package/dist-types/agent-status/index.d.ts +24 -0
- package/dist-types/avatar-upload/index.d.ts +21 -0
- package/dist-types/banner-display-card-list/index.d.ts +16 -0
- package/dist-types/basic-icon/index.d.ts +37 -0
- package/dist-types/basic-progress/index.d.ts +55 -0
- package/dist-types/bootstrap.d.ts +78 -0
- package/dist-types/brick-alert/index.d.ts +38 -0
- package/dist-types/brick-alert-level/index.d.ts +13 -0
- package/dist-types/brick-alert-number/index.d.ts +7 -0
- package/dist-types/brick-alert-status/index.d.ts +17 -0
- package/dist-types/brick-alert-value/index.d.ts +9 -0
- package/dist-types/brick-button/index.d.ts +11 -0
- package/dist-types/brick-calendar/index.d.ts +49 -0
- package/dist-types/brick-cluster-type/index.d.ts +17 -0
- package/dist-types/brick-code-display/index.d.ts +15 -0
- package/dist-types/brick-collapse-card/index.d.ts +46 -0
- package/dist-types/brick-conditional-display/index.d.ts +51 -0
- package/dist-types/brick-delete-confirm/index.d.ts +15 -0
- package/dist-types/brick-descriptions/index.d.ts +83 -0
- package/dist-types/brick-display-structs/index.d.ts +20 -0
- package/dist-types/brick-divider/index.d.ts +22 -0
- package/dist-types/brick-form/index.d.ts +95 -0
- package/dist-types/brick-general-search/index.d.ts +73 -0
- package/dist-types/brick-humanize-time/index.d.ts +32 -0
- package/dist-types/brick-illustration/index.d.ts +45 -0
- package/dist-types/brick-input/index.d.ts +25 -0
- package/dist-types/brick-link/index.d.ts +53 -0
- package/dist-types/brick-list/index.d.ts +40 -0
- package/dist-types/brick-placeholder/index.d.ts +15 -0
- package/dist-types/brick-quick-entries/index.d.ts +53 -0
- package/dist-types/brick-rate/index.d.ts +33 -0
- package/dist-types/brick-result/index.d.ts +62 -0
- package/dist-types/brick-table/index.d.ts +313 -0
- package/dist-types/brick-tag/index.d.ts +125 -0
- package/dist-types/brick-timeline/index.d.ts +54 -0
- package/dist-types/brick-tree/index.d.ts +175 -0
- package/dist-types/brick-user/index.d.ts +29 -0
- package/dist-types/brick-user-group/index.d.ts +19 -0
- package/dist-types/brick-utils/index.d.ts +9 -0
- package/dist-types/brick-value-mapping/index.d.ts +71 -0
- package/dist-types/button-wrapper/index.d.ts +11 -0
- package/dist-types/card-item/index.d.ts +169 -0
- package/dist-types/code-editor/index.d.ts +45 -0
- package/dist-types/collapse-info-list/index.d.ts +27 -0
- package/dist-types/collapsible-card-item/index.d.ts +60 -0
- package/dist-types/copyable-text/index.d.ts +25 -0
- package/dist-types/cost-time/index.d.ts +30 -0
- package/dist-types/crontab-display/index.d.ts +11 -0
- package/dist-types/datetime-selector/index.d.ts +63 -0
- package/dist-types/digital-number/index.d.ts +33 -0
- package/dist-types/dropdown-button/index.d.ts +33 -0
- package/dist-types/dropdown-select/index.d.ts +80 -0
- package/dist-types/dynamic-content/index.d.ts +9 -0
- package/dist-types/dynamic-grid-container/index.d.ts +23 -0
- package/dist-types/entry-card-item/index.d.ts +62 -0
- package/dist-types/general-badge/index.d.ts +29 -0
- package/dist-types/general-carousel/index.d.ts +84 -0
- package/dist-types/general-image/index.d.ts +55 -0
- package/dist-types/general-label/index.d.ts +29 -0
- package/dist-types/general-list/index.d.ts +13 -0
- package/dist-types/general-pagination/index.d.ts +35 -0
- package/dist-types/general-preview-image/index.d.ts +23 -0
- package/dist-types/general-slider/index.d.ts +53 -0
- package/dist-types/general-tooltip/index.d.ts +80 -0
- package/dist-types/general-transfer/index.d.ts +44 -0
- package/dist-types/general-video/index.d.ts +13 -0
- package/dist-types/index.d.ts +78 -0
- package/dist-types/info-display-card-list/index.d.ts +50 -0
- package/dist-types/interfaces/common.d.ts +18 -0
- package/dist-types/jsx.d.ts +949 -0
- package/dist-types/log-display/index.d.ts +16 -0
- package/dist-types/markdown-display/index.d.ts +40 -0
- package/dist-types/markdown-editor/index.d.ts +53 -0
- package/dist-types/modal-confirm/index.d.ts +82 -0
- package/dist-types/qrcode-download/index.d.ts +25 -0
- package/dist-types/rank-table/index.d.ts +99 -0
- package/dist-types/single-field-edit/index.d.ts +53 -0
- package/dist-types/statistic-card/index.d.ts +45 -0
- package/dist-types/table-transfer/index.d.ts +46 -0
- package/dist-types/template-breadcrumb/index.d.ts +7 -0
- package/dist-types/text-collapse/index.d.ts +9 -0
- package/dist-types/tree-transfer/index.d.ts +33 -0
- package/package.json +11 -3
- package/dist/index.09485ac8.js +0 -2
- package/dist/index.09485ac8.js.map +0 -1
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import type { TablePaginationConfig, TableProps } from "antd/lib/table";
|
|
3
|
+
import type {
|
|
4
|
+
ExpandableConfig,
|
|
5
|
+
RowSelectionType,
|
|
6
|
+
TableRowSelection,
|
|
7
|
+
} from "antd/lib/table/interface";
|
|
8
|
+
import type {
|
|
9
|
+
MenuIcon,
|
|
10
|
+
UseBrickConf,
|
|
11
|
+
BrickEventsMap,
|
|
12
|
+
} from "@next-core/brick-types";
|
|
13
|
+
import type { SizeType } from "antd/lib/config-provider/SizeContext";
|
|
14
|
+
import type { ColumnProps } from "antd/lib/table";
|
|
15
|
+
import type { BrickWrapperConfig } from "../interfaces/common.js";
|
|
16
|
+
|
|
17
|
+
export interface BrickTableFields {
|
|
18
|
+
dataSource?: string; // 指定 dataSource 从哪里来,默认为列表接口返回格式是{list:[],page:1,pageSize:10,total:20},即默认取自 list
|
|
19
|
+
total?: string; // 指定 total 从哪里来,默认为列表接口返回格式是{list:[],page:1,pageSize:10,total:20},即默认取自 total
|
|
20
|
+
rowKey?: string; // 指定每一行的 key,不指定则默认为 index
|
|
21
|
+
page?: string; // 指定请求后台 page 参数 path
|
|
22
|
+
pageSize?: string; // 指定请求后台 pageSize 参数 path
|
|
23
|
+
ascend?: string | number; // 指定 ascend 排序对应字段,例如有些后台对应为 1 ,有些对应为 "asc"。这里默认为 "ascend"。
|
|
24
|
+
descend?: string | number; // 指定 descend 排序对应字段,例如有些后台对应为 0 ,有些对应为 "desc"。这里默认为 "descend"。
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface RowDisabledProps {
|
|
28
|
+
field: string;
|
|
29
|
+
value: any;
|
|
30
|
+
operator:
|
|
31
|
+
| "$eq"
|
|
32
|
+
| "$ne"
|
|
33
|
+
| "$lt"
|
|
34
|
+
| "$lte"
|
|
35
|
+
| "$gt"
|
|
36
|
+
| "$gte"
|
|
37
|
+
| "$isEqual"
|
|
38
|
+
| "$notEqual"
|
|
39
|
+
| "$in"
|
|
40
|
+
| "$nin"
|
|
41
|
+
| "$exists";
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface CustomColumn extends ColumnProps<Record<string, any>> {
|
|
45
|
+
/**
|
|
46
|
+
* 支持为某列自定义展示构件
|
|
47
|
+
*/
|
|
48
|
+
useBrick?: UseBrickConf;
|
|
49
|
+
/**
|
|
50
|
+
* 字段的值展示时的后缀
|
|
51
|
+
*/
|
|
52
|
+
valueSuffix?: string;
|
|
53
|
+
/**
|
|
54
|
+
* 支持为某列的表头自定义展示构件,可通过 DATA.title 获取标题文本
|
|
55
|
+
*/
|
|
56
|
+
headerBrick?: {
|
|
57
|
+
useBrick: UseBrickConf;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* 在渲染自定义构件的场景下额外设置单元格的状态样式, `dataIndex` 表示取哪一列的字段值作为判断数据,不填的话默认取当前列的字段,`mapping` 表示判断的条件,条件被成功匹配时用当前的样式。目前仅支持单元格 `leftBorderColor` 属性的设置
|
|
61
|
+
*/
|
|
62
|
+
cellStatus?: CellStatusProps;
|
|
63
|
+
/**
|
|
64
|
+
* 设置列的每个单元格样式
|
|
65
|
+
*/
|
|
66
|
+
cellStyle?: React.CSSProperties;
|
|
67
|
+
/**
|
|
68
|
+
* [已废弃]支持为某列的标题自定义展示构件,可通过 DATA.title 获取标题文本
|
|
69
|
+
*/
|
|
70
|
+
titleUseBrick?: UseBrickConf;
|
|
71
|
+
/**
|
|
72
|
+
* [已废弃]支持为某列自定义展示构件
|
|
73
|
+
*/
|
|
74
|
+
component?: CustomColumnComponent;
|
|
75
|
+
/**
|
|
76
|
+
* 单元格内元素的垂直对齐方式
|
|
77
|
+
*/
|
|
78
|
+
verticalAlign?: "top" | "bottom";
|
|
79
|
+
/**
|
|
80
|
+
* 每条记录的控制列合并的值的 key
|
|
81
|
+
*/
|
|
82
|
+
colSpanKey?: string;
|
|
83
|
+
/**
|
|
84
|
+
* 每条记录的控制行合并的值的 key
|
|
85
|
+
*/
|
|
86
|
+
rowSpanKey?: string;
|
|
87
|
+
/**
|
|
88
|
+
* 自定义筛选菜单
|
|
89
|
+
*/
|
|
90
|
+
filterDropdownBrick?: {
|
|
91
|
+
useBrick: UseBrickConf;
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* 自定义筛选图标
|
|
95
|
+
*/
|
|
96
|
+
customFilterIcon?: MenuIcon;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export interface CellStatusProps {
|
|
100
|
+
dataIndex?: string;
|
|
101
|
+
mapping: Array<{
|
|
102
|
+
leftBorderColor: string;
|
|
103
|
+
value: any;
|
|
104
|
+
}>;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export interface CustomColumnComponent {
|
|
108
|
+
/** 构件名称 */
|
|
109
|
+
brick: string | any;
|
|
110
|
+
/** 字段值、列表项和 index 对应所用构件的属性的 key */
|
|
111
|
+
fields?: {
|
|
112
|
+
value?: string;
|
|
113
|
+
item?: string;
|
|
114
|
+
index?: string;
|
|
115
|
+
};
|
|
116
|
+
/** 构件属性 */
|
|
117
|
+
properties?: Record<string, any>;
|
|
118
|
+
/** 事件 */
|
|
119
|
+
events?: BrickEventsMap;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export interface TableDragInfo {
|
|
123
|
+
order: "asc" | "desc";
|
|
124
|
+
dragData: Record<string, any>;
|
|
125
|
+
anchorData: Record<string, any>;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export interface BrickTableProps {
|
|
129
|
+
showCard?: boolean;
|
|
130
|
+
rowSelection?: false | TableRowSelection<any>;
|
|
131
|
+
rowKey?: string;
|
|
132
|
+
hiddenColumns?: Array<string | number>;
|
|
133
|
+
showSelectInfo?: boolean;
|
|
134
|
+
filters?: Record<string, string[]>;
|
|
135
|
+
configProps?: any;
|
|
136
|
+
sort?: string;
|
|
137
|
+
order?: string | number;
|
|
138
|
+
rowDisabledConfig?: RowDisabledProps | RowDisabledProps[];
|
|
139
|
+
expandable?: ExpandableConfig<Record<string, unknown>> | false;
|
|
140
|
+
expandedRowBrick?: {
|
|
141
|
+
useBrick?: UseBrickConf;
|
|
142
|
+
};
|
|
143
|
+
emptyUseBrick?: {
|
|
144
|
+
useBrick?: UseBrickConf;
|
|
145
|
+
};
|
|
146
|
+
expandIcon?: {
|
|
147
|
+
collapsedIcon: MenuIcon;
|
|
148
|
+
expandedIcon: MenuIcon;
|
|
149
|
+
};
|
|
150
|
+
expandIconAsCell?: boolean;
|
|
151
|
+
expandIconColumnIndex?: number;
|
|
152
|
+
expandRowByClick?: boolean;
|
|
153
|
+
optimizedColumns?: Array<string | number>;
|
|
154
|
+
wrapperConfig?: BrickWrapperConfig;
|
|
155
|
+
stripEmptyExpandableChildren?: boolean;
|
|
156
|
+
defaultExpandAllRows?: boolean;
|
|
157
|
+
expandedRowKeys?: string[];
|
|
158
|
+
selectAllChildren?: boolean;
|
|
159
|
+
defaultSelectAll?: boolean;
|
|
160
|
+
ellipsisInfo?: boolean;
|
|
161
|
+
childrenColumnName?: string;
|
|
162
|
+
sortable?: boolean;
|
|
163
|
+
frontSearch?: boolean;
|
|
164
|
+
frontSearchQuery?: string;
|
|
165
|
+
exactSearch?: boolean;
|
|
166
|
+
frontSearchFilterKeys?: string[];
|
|
167
|
+
page?: number;
|
|
168
|
+
pageSize?: number;
|
|
169
|
+
scrollConfigs?: TableProps<unknown>["scroll"];
|
|
170
|
+
qField?: string;
|
|
171
|
+
tableDraggable?: boolean;
|
|
172
|
+
acceptType?: string;
|
|
173
|
+
zebraPattern?: boolean;
|
|
174
|
+
storeCheckedByUrl?: boolean;
|
|
175
|
+
extraRows?: Record<string, unknown>[];
|
|
176
|
+
draggable?: boolean;
|
|
177
|
+
autoSelectParentWhenAllChildrenSelected?: boolean;
|
|
178
|
+
thTransparent?: boolean;
|
|
179
|
+
showHeader?: boolean;
|
|
180
|
+
pagination?: false | TablePaginationConfig;
|
|
181
|
+
size?: SizeType | "x-small";
|
|
182
|
+
type?: RowSelectionType;
|
|
183
|
+
shouldUpdateUrlParams?: boolean;
|
|
184
|
+
shouldRenderWhenUrlParamsUpdate?: boolean;
|
|
185
|
+
selectedRowKeys?: React.Key[];
|
|
186
|
+
showHeaderExpandAll?: boolean;
|
|
187
|
+
columnKeyBrickMap?: Record<string, { useBrick: UseBrickConf }>;
|
|
188
|
+
columns?: CustomColumn[];
|
|
189
|
+
dataSource?: Record<string, any>[];
|
|
190
|
+
fields?: any;
|
|
191
|
+
processedDataSource?: any;
|
|
192
|
+
processConfigProps?: any;
|
|
193
|
+
processedColumns?: any;
|
|
194
|
+
selectUpdateEventName?: string;
|
|
195
|
+
selectUpdateEventDetailKeys?: string[];
|
|
196
|
+
selectUpdateEventDetailField?: string;
|
|
197
|
+
selectUpdateEventDetailExtra?: any;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export interface BrickTableEvents {
|
|
201
|
+
"page.update": CustomEvent<Record<string, number>>;
|
|
202
|
+
"filter.update": CustomEvent<Record<string, number>>;
|
|
203
|
+
"select.update": CustomEvent<Record<string, any>[]>;
|
|
204
|
+
"select.row.keys.update": CustomEvent<string[]>;
|
|
205
|
+
"sort.update": CustomEvent<{
|
|
206
|
+
sort: string;
|
|
207
|
+
order: string | number;
|
|
208
|
+
}>;
|
|
209
|
+
"row.expand": CustomEvent<{
|
|
210
|
+
expanded: boolean;
|
|
211
|
+
record: Record<string, any>;
|
|
212
|
+
}>;
|
|
213
|
+
"expand.rows.change": CustomEvent<{
|
|
214
|
+
expandedRows: React.Key[];
|
|
215
|
+
}>;
|
|
216
|
+
"row.drag": CustomEvent<{
|
|
217
|
+
data: Record<string, any>[];
|
|
218
|
+
info: TableDragInfo;
|
|
219
|
+
}>;
|
|
220
|
+
"column.filters.update": CustomEvent<Record<string, string[]>>;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export interface BrickTableEventsMap {
|
|
224
|
+
onPageUpdate: "page.update";
|
|
225
|
+
onFilterUpdate: "filter.update";
|
|
226
|
+
onSelectUpdate: "select.update";
|
|
227
|
+
onSelectRowKeysUpdate: "select.row.keys.update";
|
|
228
|
+
onSortUpdate: "sort.update";
|
|
229
|
+
onRowExpand: "row.expand";
|
|
230
|
+
onExpandRowsChange: "expand.rows.change";
|
|
231
|
+
onRowDrag: "row.drag";
|
|
232
|
+
onColumnFiltersUpdate: "column.filters.update";
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
export declare class BrickTableElement extends HTMLElement {
|
|
236
|
+
showCard: boolean | undefined;
|
|
237
|
+
rowSelection: false | TableRowSelection<any> | undefined;
|
|
238
|
+
rowKey: string | undefined;
|
|
239
|
+
hiddenColumns: Array<string | number> | undefined;
|
|
240
|
+
showSelectInfo: boolean | undefined;
|
|
241
|
+
filters: Record<string, string[]> | undefined;
|
|
242
|
+
configProps: any | undefined;
|
|
243
|
+
sort: string | undefined;
|
|
244
|
+
order: string | number | undefined;
|
|
245
|
+
rowDisabledConfig: RowDisabledProps | RowDisabledProps[] | undefined;
|
|
246
|
+
expandable: ExpandableConfig<Record<string, unknown>> | false | undefined;
|
|
247
|
+
expandedRowBrick:
|
|
248
|
+
| {
|
|
249
|
+
useBrick?: UseBrickConf;
|
|
250
|
+
}
|
|
251
|
+
| undefined;
|
|
252
|
+
emptyUseBrick:
|
|
253
|
+
| {
|
|
254
|
+
useBrick?: UseBrickConf;
|
|
255
|
+
}
|
|
256
|
+
| undefined;
|
|
257
|
+
expandIcon:
|
|
258
|
+
| {
|
|
259
|
+
collapsedIcon: MenuIcon;
|
|
260
|
+
expandedIcon: MenuIcon;
|
|
261
|
+
}
|
|
262
|
+
| undefined;
|
|
263
|
+
expandIconAsCell: boolean | undefined;
|
|
264
|
+
expandIconColumnIndex: number | undefined;
|
|
265
|
+
expandRowByClick: boolean | undefined;
|
|
266
|
+
optimizedColumns: Array<string | number> | undefined;
|
|
267
|
+
wrapperConfig: BrickWrapperConfig | undefined;
|
|
268
|
+
stripEmptyExpandableChildren: boolean | undefined;
|
|
269
|
+
defaultExpandAllRows: boolean | undefined;
|
|
270
|
+
expandedRowKeys: string[] | undefined;
|
|
271
|
+
selectAllChildren: boolean | undefined;
|
|
272
|
+
defaultSelectAll: boolean | undefined;
|
|
273
|
+
ellipsisInfo: boolean | undefined;
|
|
274
|
+
childrenColumnName: string | undefined;
|
|
275
|
+
sortable: boolean | undefined;
|
|
276
|
+
frontSearch: boolean | undefined;
|
|
277
|
+
frontSearchQuery: string | undefined;
|
|
278
|
+
exactSearch: boolean | undefined;
|
|
279
|
+
frontSearchFilterKeys: string[] | undefined;
|
|
280
|
+
page: number | undefined;
|
|
281
|
+
pageSize: number | undefined;
|
|
282
|
+
scrollConfigs: TableProps<unknown>["scroll"] | undefined;
|
|
283
|
+
qField: string | undefined;
|
|
284
|
+
tableDraggable: boolean | undefined;
|
|
285
|
+
acceptType: string | undefined;
|
|
286
|
+
zebraPattern: boolean | undefined;
|
|
287
|
+
storeCheckedByUrl: boolean | undefined;
|
|
288
|
+
extraRows: Record<string, unknown>[] | undefined;
|
|
289
|
+
draggable: boolean;
|
|
290
|
+
autoSelectParentWhenAllChildrenSelected: boolean | undefined;
|
|
291
|
+
thTransparent: boolean | undefined;
|
|
292
|
+
showHeader: boolean | undefined;
|
|
293
|
+
pagination: false | TablePaginationConfig | undefined;
|
|
294
|
+
size: SizeType | "x-small" | undefined;
|
|
295
|
+
type: RowSelectionType | undefined;
|
|
296
|
+
shouldUpdateUrlParams: boolean | undefined;
|
|
297
|
+
shouldRenderWhenUrlParamsUpdate: boolean | undefined;
|
|
298
|
+
selectedRowKeys: React.Key[] | undefined;
|
|
299
|
+
showHeaderExpandAll: boolean | undefined;
|
|
300
|
+
columnKeyBrickMap: Record<string, { useBrick: UseBrickConf }> | undefined;
|
|
301
|
+
columns: CustomColumn[] | undefined;
|
|
302
|
+
dataSource: Record<string, any>[] | undefined;
|
|
303
|
+
fields: any | undefined;
|
|
304
|
+
processedDataSource: any | undefined;
|
|
305
|
+
processConfigProps: any | undefined;
|
|
306
|
+
processedColumns: any | undefined;
|
|
307
|
+
selectUpdateEventName: string | undefined;
|
|
308
|
+
selectUpdateEventDetailKeys: string[] | undefined;
|
|
309
|
+
selectUpdateEventDetailField: string | undefined;
|
|
310
|
+
selectUpdateEventDetailExtra: any | undefined;
|
|
311
|
+
filterSourceData(event: CustomEvent): void;
|
|
312
|
+
expandAll(): void;
|
|
313
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { TooltipProps } from "antd";
|
|
3
|
+
import type { UseBrickConf } from "@next-core/brick-types";
|
|
4
|
+
import type React from "react";
|
|
5
|
+
import type { MenuIcon } from "@next-core/brick-types";
|
|
6
|
+
|
|
7
|
+
export type TagListType = {
|
|
8
|
+
key: string;
|
|
9
|
+
label: string;
|
|
10
|
+
tooltip?: string;
|
|
11
|
+
icon?: string | MenuIcon;
|
|
12
|
+
checked?: boolean;
|
|
13
|
+
color?: string | Color;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
disabledTooltip?: string;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export enum Color {
|
|
19
|
+
green = "green",
|
|
20
|
+
red = "red",
|
|
21
|
+
blue = "blue",
|
|
22
|
+
orange = "orange",
|
|
23
|
+
cyan = "cyan",
|
|
24
|
+
purple = "purple",
|
|
25
|
+
geekblue = "geekblue",
|
|
26
|
+
gray = "gray",
|
|
27
|
+
yellow = "yellow",
|
|
28
|
+
"green-inverse" = "green-inverse",
|
|
29
|
+
"red-inverse" = "red-inverse",
|
|
30
|
+
"blue-inverse" = "blue-inverse",
|
|
31
|
+
"orange-inverse" = "orange-inverse",
|
|
32
|
+
"cyan-inverse" = "cyan-inverse",
|
|
33
|
+
"purple-inverse" = "purple-inverse",
|
|
34
|
+
"geekblue-inverse" = "geekblue-inverse",
|
|
35
|
+
"gray-inverse" = "gray-inverse",
|
|
36
|
+
"yellow-inverse" = "yellow-inverse",
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export enum TagTypeProps {
|
|
40
|
+
Tag = "Tag",
|
|
41
|
+
CheckableTag = "CheckableTag",
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface BrickTagProps {
|
|
45
|
+
label?: string;
|
|
46
|
+
tagList?: TagListType[] | string[];
|
|
47
|
+
showTagCircle?: boolean;
|
|
48
|
+
showCard?: boolean;
|
|
49
|
+
color?: string | Color;
|
|
50
|
+
multipleCheck?: boolean;
|
|
51
|
+
dataSource?: Record<string, any>;
|
|
52
|
+
closable?: boolean;
|
|
53
|
+
componentType?: TagTypeProps;
|
|
54
|
+
default?: string | string[];
|
|
55
|
+
cancelable?: boolean;
|
|
56
|
+
configProps?: Record<string, any>;
|
|
57
|
+
disabledTooltip?: string;
|
|
58
|
+
tooltipProps?: TooltipProps;
|
|
59
|
+
fields?: {
|
|
60
|
+
label: string;
|
|
61
|
+
key: string;
|
|
62
|
+
icon?: string;
|
|
63
|
+
tagList?: string;
|
|
64
|
+
};
|
|
65
|
+
textEllipsis?: boolean;
|
|
66
|
+
tagStyle?: React.CSSProperties;
|
|
67
|
+
tagCheckedStyle?: React.CSSProperties;
|
|
68
|
+
tagHoverStyle?: React.CSSProperties;
|
|
69
|
+
afterBrick?: {
|
|
70
|
+
useBrick: UseBrickConf;
|
|
71
|
+
data: unknown;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface BrickTagEvents {
|
|
76
|
+
"checked.update": CustomEvent<string[]>;
|
|
77
|
+
"checked.update.v2": CustomEvent<{ label: string; key: string }[]>;
|
|
78
|
+
"tag.close": CustomEvent<{
|
|
79
|
+
current: Record<string, any>;
|
|
80
|
+
tagList: Record<string, any>[];
|
|
81
|
+
}>;
|
|
82
|
+
"tag.click": CustomEvent<TagListType>;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export interface BrickTagEventsMap {
|
|
86
|
+
onCheckedUpdate: "checked.update";
|
|
87
|
+
onCheckedUpdateV2: "checked.update.v2";
|
|
88
|
+
onTagClose: "tag.close";
|
|
89
|
+
onTagClick: "tag.click";
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export declare class BrickTagElement extends HTMLElement {
|
|
93
|
+
label: string | undefined;
|
|
94
|
+
tagList: TagListType[] | string[] | undefined;
|
|
95
|
+
showTagCircle: boolean | undefined;
|
|
96
|
+
showCard: boolean | undefined;
|
|
97
|
+
color: string | Color | undefined;
|
|
98
|
+
multipleCheck: boolean | undefined;
|
|
99
|
+
dataSource: Record<string, any> | undefined;
|
|
100
|
+
closable: boolean | undefined;
|
|
101
|
+
componentType: TagTypeProps | undefined;
|
|
102
|
+
default: string | string[] | undefined;
|
|
103
|
+
cancelable: boolean | undefined;
|
|
104
|
+
configProps: Record<string, any> | undefined;
|
|
105
|
+
disabledTooltip: string | undefined;
|
|
106
|
+
tooltipProps: TooltipProps | undefined;
|
|
107
|
+
fields:
|
|
108
|
+
| {
|
|
109
|
+
label: string;
|
|
110
|
+
key: string;
|
|
111
|
+
icon?: string;
|
|
112
|
+
tagList?: string;
|
|
113
|
+
}
|
|
114
|
+
| undefined;
|
|
115
|
+
textEllipsis: boolean | undefined;
|
|
116
|
+
tagStyle: React.CSSProperties | undefined;
|
|
117
|
+
tagCheckedStyle: React.CSSProperties | undefined;
|
|
118
|
+
tagHoverStyle: React.CSSProperties | undefined;
|
|
119
|
+
afterBrick:
|
|
120
|
+
| {
|
|
121
|
+
useBrick: UseBrickConf;
|
|
122
|
+
data: unknown;
|
|
123
|
+
}
|
|
124
|
+
| undefined;
|
|
125
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { UseBrickConf } from "@next-core/brick-types";
|
|
2
|
+
|
|
3
|
+
export interface BrickTimelineProps {
|
|
4
|
+
itemList: ItemProps[];
|
|
5
|
+
useBrick?: UseBrickConf;
|
|
6
|
+
statusMap?: Record<string, StatusColor>;
|
|
7
|
+
type?: "base" | "extension";
|
|
8
|
+
timeType?: TimeType;
|
|
9
|
+
showCard?: boolean;
|
|
10
|
+
mode?: "left" | "right" | "alternate";
|
|
11
|
+
onClick?: (data: ItemProps) => void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type ItemProps = TimelineItem | Record<string, any>;
|
|
15
|
+
|
|
16
|
+
export interface TimelineItem {
|
|
17
|
+
title: string;
|
|
18
|
+
description: string;
|
|
19
|
+
time: string | number;
|
|
20
|
+
status: string;
|
|
21
|
+
link: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type StatusColor = "green" | "red" | "gray" | "blue";
|
|
25
|
+
|
|
26
|
+
export type TimeType = "second" | "default";
|
|
27
|
+
|
|
28
|
+
export interface BrickTimelinePropsInterface {
|
|
29
|
+
itemList?: BrickTimelineProps["itemList"];
|
|
30
|
+
useBrick?: UseBrickConf;
|
|
31
|
+
statusMap?: BrickTimelineProps["statusMap"];
|
|
32
|
+
type?: BrickTimelineProps["type"];
|
|
33
|
+
timeType?: BrickTimelineProps["timeType"];
|
|
34
|
+
showCard?: boolean;
|
|
35
|
+
mode?: BrickTimelineProps["mode"];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface BrickTimelineEvents {
|
|
39
|
+
"item.click": CustomEvent<ItemProps>;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface BrickTimelineEventsMap {
|
|
43
|
+
onItemClick: "item.click";
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export declare class BrickTimelineElement extends HTMLElement {
|
|
47
|
+
itemList: BrickTimelinePropsInterface["itemList"] | undefined;
|
|
48
|
+
useBrick: UseBrickConf | undefined;
|
|
49
|
+
statusMap: BrickTimelinePropsInterface["statusMap"] | undefined;
|
|
50
|
+
type: BrickTimelinePropsInterface["type"] | undefined;
|
|
51
|
+
timeType: BrickTimelinePropsInterface["timeType"] | undefined;
|
|
52
|
+
showCard: boolean | undefined;
|
|
53
|
+
mode: BrickTimelinePropsInterface["mode"] | undefined;
|
|
54
|
+
}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { DataNode, TreeProps } from "antd/lib/tree";
|
|
3
|
+
import type { EventDataNode } from "rc-tree/lib/interface";
|
|
4
|
+
import type { UseBrickConf } from "@next-core/brick-types";
|
|
5
|
+
import type { MenuIcon } from "@next-core/brick-types";
|
|
6
|
+
import type { TreeNodeProps } from "antd/lib/tree";
|
|
7
|
+
|
|
8
|
+
export type BrickTreeNodeProps = Omit<AntTreeNodeProps, "children"> & {
|
|
9
|
+
title?: string;
|
|
10
|
+
icon?: TreeIcon;
|
|
11
|
+
key?: React.Key;
|
|
12
|
+
children?: BrickTreeNodeProps[];
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type TreeIcon =
|
|
16
|
+
| MenuIcon
|
|
17
|
+
| React.ComponentType<React.SVGAttributes<SVGElement>>;
|
|
18
|
+
|
|
19
|
+
export interface BrickTreeProps {
|
|
20
|
+
selectedKeys?: React.Key[];
|
|
21
|
+
checkedKeys?: React.Key[];
|
|
22
|
+
expandedKeys?: React.Key[];
|
|
23
|
+
configProps?: Omit<
|
|
24
|
+
TreeProps,
|
|
25
|
+
"selectedKeys" | "checkedKeys" | "expandedKeys"
|
|
26
|
+
>;
|
|
27
|
+
dataSource: BrickTreeNodeProps[];
|
|
28
|
+
searchable?: boolean;
|
|
29
|
+
searchQ?: string;
|
|
30
|
+
placeholder?: string;
|
|
31
|
+
searchParent?: boolean;
|
|
32
|
+
checkAllEnabled?: boolean;
|
|
33
|
+
checkedFilterConfig?: checkedFilterProps;
|
|
34
|
+
checkedNotRelevant?: boolean;
|
|
35
|
+
onSelect?(
|
|
36
|
+
selectedKeys: React.Key[],
|
|
37
|
+
info: {
|
|
38
|
+
event: "select";
|
|
39
|
+
selected: boolean;
|
|
40
|
+
node: EventDataNode;
|
|
41
|
+
selectedNodes: DataNode[];
|
|
42
|
+
nativeEvent: MouseEvent;
|
|
43
|
+
}
|
|
44
|
+
): void;
|
|
45
|
+
onCheck?(
|
|
46
|
+
checkedKeys:
|
|
47
|
+
| React.Key[]
|
|
48
|
+
| { checked: React.Key[]; halfChecked: React.Key[] }
|
|
49
|
+
): void;
|
|
50
|
+
onCheckV2?(
|
|
51
|
+
checkedKeys:
|
|
52
|
+
| React.Key[]
|
|
53
|
+
| { checked: React.Key[]; halfChecked: React.Key[] },
|
|
54
|
+
info: {
|
|
55
|
+
event: "check";
|
|
56
|
+
checked: boolean;
|
|
57
|
+
checkedNodes: DataNode[];
|
|
58
|
+
nativeEvent: MouseEvent;
|
|
59
|
+
}
|
|
60
|
+
): void;
|
|
61
|
+
onExpand?(expandedKeys: React.Key[]): void;
|
|
62
|
+
onSearch?(value: string): void;
|
|
63
|
+
suffixBrick?: { useBrick: UseBrickConf };
|
|
64
|
+
suffixStopEvent?: boolean;
|
|
65
|
+
afterSearchBrick?: { useBrick: UseBrickConf };
|
|
66
|
+
beforeTreeBrick?: { useBrick: UseBrickConf };
|
|
67
|
+
showSpecificationTitleStyle?: boolean;
|
|
68
|
+
defaultExpandAll?: boolean;
|
|
69
|
+
deselectable?: boolean;
|
|
70
|
+
alsoSearchByKey?: boolean;
|
|
71
|
+
isFilter?: boolean;
|
|
72
|
+
iconUseBrick?: { useBrick: UseBrickConf };
|
|
73
|
+
isDirectory?: boolean;
|
|
74
|
+
hideSelectedNum?: boolean;
|
|
75
|
+
hideBackground?: boolean;
|
|
76
|
+
onlyHighlightBySearch?: boolean;
|
|
77
|
+
height?: number | "auto";
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface BrickTreeElementProps {
|
|
81
|
+
dataSource?: BrickTreeNodeProps[];
|
|
82
|
+
selectedKeys?: string[];
|
|
83
|
+
checkedKeys?: string[];
|
|
84
|
+
expandedKeys?: string[];
|
|
85
|
+
searchable?: boolean;
|
|
86
|
+
searchQ?: string;
|
|
87
|
+
isFilter?: boolean;
|
|
88
|
+
isDirectory?: boolean;
|
|
89
|
+
alsoSearchByKey?: boolean;
|
|
90
|
+
showSpecificationTitleStyle?: boolean;
|
|
91
|
+
placeholder?: string;
|
|
92
|
+
configProps?: TreeProps;
|
|
93
|
+
searchParent?: boolean;
|
|
94
|
+
checkAllEnabled?: boolean;
|
|
95
|
+
checkedFilterConfig?: checkedFilterProps;
|
|
96
|
+
checkedNotRelevant?: boolean;
|
|
97
|
+
suffixBrick?: { useBrick: UseBrickConf };
|
|
98
|
+
suffixStopEvent?: boolean;
|
|
99
|
+
afterSearchBrick?: { useBrick: UseBrickConf };
|
|
100
|
+
beforeTreeBrick?: { useBrick: UseBrickConf };
|
|
101
|
+
defaultExpandAll?: boolean;
|
|
102
|
+
deselectable?: boolean;
|
|
103
|
+
iconUseBrick?: { useBrick: UseBrickConf };
|
|
104
|
+
hideSelectedNum?: boolean;
|
|
105
|
+
hideBackground?: boolean;
|
|
106
|
+
onlyHighlightBySearch?: boolean;
|
|
107
|
+
virtualScrollHeight?: number | "auto";
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export interface BrickTreeEvents {
|
|
111
|
+
"tree.select": CustomEvent<string[]>;
|
|
112
|
+
"tree.selectV2": CustomEvent<{
|
|
113
|
+
selectedKeys: string[];
|
|
114
|
+
info: {
|
|
115
|
+
event: "select";
|
|
116
|
+
selected: boolean;
|
|
117
|
+
node: EventDataNode;
|
|
118
|
+
selectedNodes: DataNode[];
|
|
119
|
+
nativeEvent: MouseEvent;
|
|
120
|
+
};
|
|
121
|
+
}>;
|
|
122
|
+
"tree.check": CustomEvent<
|
|
123
|
+
string[] | { checked: string[]; halfChecked: string[] }
|
|
124
|
+
>;
|
|
125
|
+
"tree.checkV2": CustomEvent<{
|
|
126
|
+
checkedKeys: string[] | { checked: string[]; halfChecked: string[] };
|
|
127
|
+
info: {
|
|
128
|
+
event: "check";
|
|
129
|
+
checked: boolean;
|
|
130
|
+
checkedNodes: DataNode[];
|
|
131
|
+
nativeEvent: MouseEvent;
|
|
132
|
+
};
|
|
133
|
+
}>;
|
|
134
|
+
"tree.search": CustomEvent<string>;
|
|
135
|
+
"tree.expand": CustomEvent<React.Key[]>;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export interface BrickTreeEventsMap {
|
|
139
|
+
onTreeSelect: "tree.select";
|
|
140
|
+
onTreeSelectV2: "tree.selectV2";
|
|
141
|
+
onTreeCheck: "tree.check";
|
|
142
|
+
onTreeCheckV2: "tree.checkV2";
|
|
143
|
+
onTreeSearch: "tree.search";
|
|
144
|
+
onTreeExpand: "tree.expand";
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export declare class BrickTreeElement extends HTMLElement {
|
|
148
|
+
dataSource: BrickTreeNodeProps[] | undefined;
|
|
149
|
+
selectedKeys: string[] | undefined;
|
|
150
|
+
checkedKeys: string[] | undefined;
|
|
151
|
+
expandedKeys: string[] | undefined;
|
|
152
|
+
searchable: boolean | undefined;
|
|
153
|
+
searchQ: string | undefined;
|
|
154
|
+
isFilter: boolean | undefined;
|
|
155
|
+
isDirectory: boolean | undefined;
|
|
156
|
+
alsoSearchByKey: boolean | undefined;
|
|
157
|
+
showSpecificationTitleStyle: boolean | undefined;
|
|
158
|
+
placeholder: string | undefined;
|
|
159
|
+
configProps: TreeProps | undefined;
|
|
160
|
+
searchParent: boolean | undefined;
|
|
161
|
+
checkAllEnabled: boolean | undefined;
|
|
162
|
+
checkedFilterConfig: checkedFilterProps | undefined;
|
|
163
|
+
checkedNotRelevant: boolean | undefined;
|
|
164
|
+
suffixBrick: { useBrick: UseBrickConf } | undefined;
|
|
165
|
+
suffixStopEvent: boolean | undefined;
|
|
166
|
+
afterSearchBrick: { useBrick: UseBrickConf } | undefined;
|
|
167
|
+
beforeTreeBrick: { useBrick: UseBrickConf } | undefined;
|
|
168
|
+
defaultExpandAll: boolean | undefined;
|
|
169
|
+
deselectable: boolean | undefined;
|
|
170
|
+
iconUseBrick: BrickTreeElementProps["iconUseBrick"] | undefined;
|
|
171
|
+
hideSelectedNum: boolean | undefined;
|
|
172
|
+
hideBackground: boolean | undefined;
|
|
173
|
+
onlyHighlightBySearch: boolean | undefined;
|
|
174
|
+
virtualScrollHeight: number | "auto" | undefined;
|
|
175
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface BrickUserProps {
|
|
2
|
+
username?: string;
|
|
3
|
+
userNameOrId?: string;
|
|
4
|
+
iconUrl?: string;
|
|
5
|
+
hideAvatar?: boolean;
|
|
6
|
+
hideUsername?: boolean;
|
|
7
|
+
size?: "large" | "small" | "default";
|
|
8
|
+
shape?: "circle" | "square";
|
|
9
|
+
showNickname?: boolean;
|
|
10
|
+
showNicknameOrUsername?: boolean;
|
|
11
|
+
displayShowKey?: boolean;
|
|
12
|
+
iconMargin?: number | string;
|
|
13
|
+
customTooltip?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export declare class BrickUserElement extends HTMLElement {
|
|
17
|
+
username: string | undefined;
|
|
18
|
+
userNameOrId: string | undefined;
|
|
19
|
+
iconUrl: string | undefined;
|
|
20
|
+
hideAvatar: boolean | undefined;
|
|
21
|
+
hideUsername: boolean | undefined;
|
|
22
|
+
size: "large" | "small" | "default" | undefined;
|
|
23
|
+
shape: "circle" | "square" | undefined;
|
|
24
|
+
showNickname: boolean | undefined;
|
|
25
|
+
showNicknameOrUsername: boolean | undefined;
|
|
26
|
+
displayShowKey: boolean | undefined;
|
|
27
|
+
iconMargin: number | string | undefined;
|
|
28
|
+
customTooltip: string | undefined;
|
|
29
|
+
}
|