@blueking/ai-ui-sdk 0.5.1-beta.2 → 0.5.1-beta.4

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 (118) hide show
  1. package/dist/components/render-agent/agent-type.vue.css +4 -4
  2. package/dist/components/render-agent/agent-type.vue.js +1 -1
  3. package/dist/components/render-auth/auth-dialog.script.vue.js.js +4 -4
  4. package/dist/components/render-auto-height-textarea/index.vue.css +11 -11
  5. package/dist/components/render-auto-height-textarea/index.vue.js +1 -1
  6. package/dist/components/render-auto-refresh/index.vue.css +8 -8
  7. package/dist/components/render-auto-refresh/index.vue.js +1 -1
  8. package/dist/components/render-card/agent/prefix-info-tool.vue.css +5 -5
  9. package/dist/components/render-card/agent/prefix-info-tool.vue.js +1 -1
  10. package/dist/components/render-card/agent/upgrade.vue.css +2 -2
  11. package/dist/components/render-card/agent/upgrade.vue.js +1 -1
  12. package/dist/components/render-card/base.vue.css +12 -12
  13. package/dist/components/render-card/base.vue.js +1 -1
  14. package/dist/components/render-card/llm/corner-badge.vue.css +3 -3
  15. package/dist/components/render-card/llm/corner-badge.vue.js +1 -1
  16. package/dist/components/render-card/llm/icons.vue.css +2 -2
  17. package/dist/components/render-card/llm/icons.vue.js +1 -1
  18. package/dist/components/render-card/llm/info.vue.css +1 -1
  19. package/dist/components/render-card/llm/info.vue.js +1 -1
  20. package/dist/components/render-card/llm/tag-prefix.vue.css +2 -2
  21. package/dist/components/render-card/llm/tag-prefix.vue.js +1 -1
  22. package/dist/components/render-card/mcp/name-suffix.vue.css +2 -2
  23. package/dist/components/render-card/mcp/name-suffix.vue.js +1 -1
  24. package/dist/components/render-card/prompt/icons.vue.css +1 -1
  25. package/dist/components/render-card/prompt/icons.vue.js +1 -1
  26. package/dist/components/render-card/skill/scanner.vue.css +3 -3
  27. package/dist/components/render-card/skill/scanner.vue.js +1 -1
  28. package/dist/components/render-checkbox/index.vue.css +9 -9
  29. package/dist/components/render-checkbox/index.vue.js +1 -1
  30. package/dist/components/render-choose-tag/index.vue.css +7 -7
  31. package/dist/components/render-choose-tag/index.vue.js +1 -1
  32. package/dist/components/render-collapse/index.vue.css +2 -2
  33. package/dist/components/render-collapse/index.vue.js +1 -1
  34. package/dist/components/render-collection/content/index.vue.css +4 -4
  35. package/dist/components/render-collection/content/index.vue.js +1 -1
  36. package/dist/components/render-dataset/components/batch-delete-dataset-data/index.script.vue.js +6 -6
  37. package/dist/components/render-dataset/components/batch-delete-dataset-data/index.vue.css +3 -3
  38. package/dist/components/render-dataset/components/batch-delete-dataset-data/index.vue.js +1 -1
  39. package/dist/components/render-dataset/components/dataset-data-tool-icons/index.script.vue.js +1 -1
  40. package/dist/components/render-dataset/components/edit-dataset-data/index.vue.css +3 -3
  41. package/dist/components/render-dataset/components/edit-dataset-data/index.vue.js +1 -1
  42. package/dist/components/render-dataset/components/operation-record/index.vue.css +4 -4
  43. package/dist/components/render-dataset/components/operation-record/index.vue.js +1 -1
  44. package/dist/components/render-dataset/components/operation-record/table/index.script.vue.js +11 -15
  45. package/dist/components/render-dataset/components/operation-record/table/index.vue.css +1 -1
  46. package/dist/components/render-dataset/components/operation-record/table/index.vue.js +1 -1
  47. package/dist/components/render-dataset/components/operation-record/view-op-result/index.vue.css +2 -2
  48. package/dist/components/render-dataset/components/operation-record/view-op-result/index.vue.js +1 -1
  49. package/dist/components/render-dataset/components/plus-dataset/dataset-form.script.vue.js +16 -16
  50. package/dist/components/render-dataset/components/plus-dataset/index.vue.css +1 -1
  51. package/dist/components/render-dataset/components/plus-dataset/index.vue.js +1 -1
  52. package/dist/components/render-dataset/components/plus-dataset-data/form/api.script.vue.js.js +2 -2
  53. package/dist/components/render-dataset/components/plus-dataset-data/form/api.vue.css +2 -2
  54. package/dist/components/render-dataset/components/plus-dataset-data/form/api.vue.js +1 -1
  55. package/dist/components/render-dataset/components/plus-dataset-data/form/footer.vue.css +1 -1
  56. package/dist/components/render-dataset/components/plus-dataset-data/form/footer.vue.js +1 -1
  57. package/dist/components/render-dataset/components/plus-dataset-data/form/index.vue.css +1 -1
  58. package/dist/components/render-dataset/components/plus-dataset-data/form/index.vue.js +1 -1
  59. package/dist/components/render-dataset/components/review-dataset-data/index.vue.css +10 -10
  60. package/dist/components/render-dataset/components/review-dataset-data/index.vue.js +1 -1
  61. package/dist/components/render-dataset-detail-origin-data/components/table/index.script.vue.js +24 -29
  62. package/dist/components/render-dataset-detail-origin-data/index.vue.css +3 -3
  63. package/dist/components/render-dataset-detail-origin-data/index.vue.js +1 -1
  64. package/dist/components/render-dataset-list/components/main.vue.css +3 -3
  65. package/dist/components/render-dataset-list/components/main.vue.js +1 -1
  66. package/dist/components/render-dataset-list/components/table.script.vue.js +24 -26
  67. package/dist/components/render-dataset-list/index.vue.css +2 -2
  68. package/dist/components/render-dataset-list/index.vue.js +1 -1
  69. package/dist/components/render-dialog/choose-resource.vue.css +3 -3
  70. package/dist/components/render-dialog/choose-resource.vue.js +1 -1
  71. package/dist/components/render-dialog/choose-result.vue.css +14 -14
  72. package/dist/components/render-dialog/choose-result.vue.js +1 -1
  73. package/dist/components/render-dialog/choose-space.vue.css +9 -9
  74. package/dist/components/render-dialog/choose-space.vue.js +1 -1
  75. package/dist/components/render-dialog/index.vue.css +6 -6
  76. package/dist/components/render-dialog/index.vue.js +1 -1
  77. package/dist/components/render-dropdown/index.vue.d.ts +1 -1
  78. package/dist/components/render-file-card/index.vue.css +11 -11
  79. package/dist/components/render-file-card/index.vue.js +1 -1
  80. package/dist/components/render-file-type-icon/index.vue.css +6 -6
  81. package/dist/components/render-file-type-icon/index.vue.js +1 -1
  82. package/dist/components/render-generate-tag/index.vue.css +5 -5
  83. package/dist/components/render-generate-tag/index.vue.js +1 -1
  84. package/dist/components/render-knowledge/icon/index.vue.css +1 -1
  85. package/dist/components/render-knowledge/icon/index.vue.js +1 -1
  86. package/dist/components/render-prompt/content/index.vue.css +1 -1
  87. package/dist/components/render-prompt/content/index.vue.js +1 -1
  88. package/dist/components/render-reference/index.script.vue.js +33 -33
  89. package/dist/components/render-reference/index.vue.css +2 -2
  90. package/dist/components/render-reference/index.vue.js +1 -1
  91. package/dist/components/render-resource-version/index.vue.css +2 -2
  92. package/dist/components/render-resource-version/index.vue.js +1 -1
  93. package/dist/components/render-router-tab/index.vue.css +3 -3
  94. package/dist/components/render-router-tab/index.vue.js +1 -1
  95. package/dist/components/render-select-plus-extension/index.vue.css +3 -3
  96. package/dist/components/render-select-plus-extension/index.vue.js +1 -1
  97. package/dist/components/render-t-table/index.script.vue.js.js +437 -0
  98. package/dist/components/render-t-table/index.vue.css +154 -190
  99. package/dist/components/render-t-table/index.vue.d.ts +23 -42
  100. package/dist/components/render-t-table/index.vue.js +2 -2
  101. package/dist/components/render-tag-tree/index.vue.css +7 -7
  102. package/dist/components/render-tag-tree/index.vue.js +1 -1
  103. package/dist/components/render-tags/index.vue.css +6 -6
  104. package/dist/components/render-tags/index.vue.js +1 -1
  105. package/dist/css/g-utilities.css +6 -33
  106. package/dist/css/g-utilities.manifest.json +2 -3
  107. package/dist/hooks/use-dataset-http.d.ts +21 -12
  108. package/dist/hooks/use-dataset-http.ts.js +13 -10
  109. package/dist/hooks/use-t-table.d.ts +11 -31
  110. package/dist/hooks/use-t-table.ts.js +27 -53
  111. package/dist/http/helper/mcp.ts.js +3 -1
  112. package/dist/types/common.d.ts +11 -23
  113. package/dist/types/common.ts.js +1 -1
  114. package/dist/types/enum.d.ts +13 -5
  115. package/dist/types/enum.ts.js +16 -6
  116. package/dist/types/mcp.d.ts +1 -0
  117. package/package.json +2 -2
  118. package/dist/components/render-t-table/index.script.vue.js +0 -365
@@ -1,365 +0,0 @@
1
- var __rest = this && this.__rest || function(s, e) {
2
- var t = {};
3
- for(var p in s)if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
4
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for(var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++){
5
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
6
- }
7
- return t;
8
- };
9
- import { defineComponent as _defineComponent, Fragment as _Fragment, createVNode as _createVNode2, createTextVNode as _createTextVNode2 } from 'vue';
10
- import { createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, createElementVNode as _createElementVNode, renderSlot as _renderSlot, unref as _unref, mergeProps as _mergeProps, normalizeClass as _normalizeClass, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, normalizeStyle as _normalizeStyle, createElementBlock as _createElementBlock } from "vue";
11
- const _hoisted_1 = {
12
- class: "t-table-row-height"
13
- };
14
- import { Funnel } from 'bkui-vue/lib/icon';
15
- import { ref, useAttrs, watch } from 'vue';
16
- import RenderSearchEmpty from '../render-search-empty/index.vue.js';
17
- import { isEmpty, isObject } from '../../util.ts.js';
18
- export default /*@__PURE__*/ _defineComponent(Object.assign({
19
- inheritAttrs: false
20
- }, {
21
- props: {
22
- columns: {},
23
- isLoading: {
24
- type: Boolean
25
- },
26
- tableData: {},
27
- pagination: {},
28
- layout: {
29
- default: (props)=>props.pagination ? [
30
- 'total',
31
- 'limit',
32
- 'list'
33
- ] : []
34
- },
35
- containerHeight: {},
36
- search: {},
37
- rowClassName: {},
38
- rowKey: {},
39
- height: {},
40
- paginationBorder: {
41
- type: Boolean
42
- }
43
- },
44
- emits: [
45
- "sort-change",
46
- "page-change",
47
- "page-size-change",
48
- "row-mouseleave",
49
- "select-change",
50
- "row-click",
51
- "row-mouseenter",
52
- "update:search"
53
- ],
54
- setup (__props, { emit: __emit }) {
55
- const props = __props;
56
- const emits = __emit;
57
- const attrs = useAttrs();
58
- const rowHeight = ref('g-h-42');
59
- const columnControllerVisible = ref(false);
60
- const getTableAttrs = ()=>{
61
- const _a = attrs, { class: _class } = _a, rest = __rest(_a, [
62
- "class"
63
- ]);
64
- return rest;
65
- };
66
- const getMaxHeight = ()=>{
67
- return props.pagination ? 'calc(100% - 48px)' : '100%';
68
- };
69
- const getDefaultColumns = ()=>{
70
- // 只要有一项配置了 defaultShow 则需要列配置按钮
71
- const isSetting = props.columns.some((column)=>column.defaultShow);
72
- if (isSetting) {
73
- return props.columns.filter((column)=>column.defaultShow).map((item)=>item.colKey);
74
- }
75
- return props.columns.map((column)=>column.colKey);
76
- };
77
- const displayColumns = ref(getDefaultColumns());
78
- const getRowClassName = ({ row, rowIndex })=>{
79
- if (!row || rowIndex === undefined) {
80
- return;
81
- }
82
- const customRowClass = typeof props.rowClassName === 'function' ? props.rowClassName(row, rowIndex) : props.rowClassName;
83
- const classList = [];
84
- if (typeof customRowClass === 'string') {
85
- classList.push(...customRowClass.split(/\s+/).filter(Boolean));
86
- } else if (Array.isArray(customRowClass)) {
87
- classList.push(...customRowClass.filter((c)=>typeof c === 'string' && c));
88
- } else if (customRowClass && typeof customRowClass === 'object') {
89
- classList.push(...Object.keys(customRowClass).filter((key)=>customRowClass[key]));
90
- }
91
- const heightClass = classList.findLast((item)=>item.includes('g-h-'));
92
- if (heightClass && !rowHeight.value) {
93
- rowHeight.value = heightClass;
94
- }
95
- const classNames = classList.filter((item)=>!item.includes('g-h-'));
96
- return [
97
- ...new Set([
98
- ...classNames,
99
- rowHeight.value
100
- ])
101
- ].join(' ');
102
- };
103
- const getSettingColumns = ()=>{
104
- const columns = [
105
- ...props.columns
106
- ].map((column)=>{
107
- if (isObject(column.filter)) {
108
- return Object.assign(Object.assign({}, column), {
109
- filter: Object.assign(Object.assign({}, column.filter), {
110
- popupProps: Object.assign(Object.assign({}, column.filter.popupProps), {
111
- overlayInnerClassName: 'g-t-table-filter'
112
- })
113
- })
114
- });
115
- }
116
- return column;
117
- });
118
- if (isEmpty(columns.find((column)=>column.defaultShow))) {
119
- return columns;
120
- }
121
- const lastColKey = displayColumns.value[displayColumns.value.length - 1];
122
- const lastIndex = columns.findIndex((col)=>col.colKey === lastColKey);
123
- if (lastIndex === -1) return columns;
124
- const lastColumn = columns[lastIndex];
125
- const newColumn = Object.assign(Object.assign({
126
- minWidth: '120'
127
- }, lastColumn), {
128
- title: (...args)=>{
129
- let originalContent;
130
- if (typeof lastColumn.title === 'function') {
131
- originalContent = lastColumn.title(...args);
132
- } else {
133
- originalContent = lastColumn.title || '--';
134
- }
135
- return _createVNode2(_Fragment, null, [
136
- _createVNode2("span", null, [
137
- originalContent
138
- ]),
139
- _createVNode2("i", {
140
- "class": 'ai-ui-sdk-icon ai-ui-sdk-setting-2 g-text-14 g-text-light-gray hover:!g-text-blue g-ml-4 !g-cursor-pointer',
141
- "onClick": ()=>showSetting()
142
- }, null)
143
- ]);
144
- }
145
- });
146
- columns[lastIndex] = newColumn;
147
- return columns;
148
- };
149
- const handleColumnChange = (columns)=>{
150
- const colKeyColumns = props.columns.filter((column)=>column.colKey);
151
- if (!columns.length) {
152
- return displayColumns.value = colKeyColumns.map((column)=>column.colKey);
153
- }
154
- // 根据 columns 重新定义 展示列顺序
155
- displayColumns.value = colKeyColumns.filter((column)=>columns.includes(column.colKey)).map((item)=>item.colKey);
156
- };
157
- const showSetting = ()=>{
158
- columnControllerVisible.value = true;
159
- };
160
- const getColumnControllerConfig = ()=>({
161
- // 隐藏组件内部的 列配置按钮
162
- hideTriggerButton: true,
163
- // 允许哪些列参与显示-隐藏控制
164
- fields: props.columns.map((item)=>item.colKey),
165
- // 透传弹框组件全部属性
166
- dialogProps: {
167
- preventScrollThrough: true,
168
- dialogClassName: 't-table-dialog',
169
- showOverlay: true,
170
- header: ()=>_createVNode2("span", {
171
- "class": "t-table-dialog-header"
172
- }, [
173
- _createTextVNode2("\u8868\u683C\u8BBE\u7F6E")
174
- ])
175
- }
176
- });
177
- const handleSelectChange = (keys, { selectedRowData })=>{
178
- emits('select-change', keys, selectedRowData);
179
- };
180
- const handlePageChange = (page)=>{
181
- emits('page-change', page);
182
- };
183
- const handlePageSizeChange = (pageSize)=>{
184
- emits('page-size-change', pageSize);
185
- };
186
- const handleSortChange = (config, { col })=>{
187
- emits('sort-change', config, {
188
- col
189
- });
190
- };
191
- const handleRowClick = ({ row })=>{
192
- emits('row-click', row);
193
- };
194
- const handleRowMouseenter = ({ row })=>{
195
- emits('row-mouseenter', row);
196
- };
197
- const handleRowMouseleave = ()=>{
198
- emits('row-mouseleave');
199
- };
200
- const handleUpdateSearch = (search)=>{
201
- emits('update:search', search);
202
- };
203
- const handleFilterChange = (filters)=>{
204
- const searchVal = Object.assign(Object.assign({}, props.search), filters);
205
- Object.keys(searchVal).forEach((item)=>{
206
- const key = item;
207
- if (isEmpty(searchVal[key])) {
208
- delete searchVal[key];
209
- }
210
- });
211
- emits('update:search', searchVal);
212
- };
213
- watch(()=>props.columns.map((col)=>col.colKey), (newColKeys, oldColKeys)=>{
214
- if (newColKeys.some((colKey, index)=>colKey !== oldColKeys[index])) {
215
- displayColumns.value = getDefaultColumns();
216
- }
217
- });
218
- return (_ctx, _cache)=>{
219
- const _component_bk_radio_button = _resolveComponent("bk-radio-button");
220
- const _component_bk_radio_group = _resolveComponent("bk-radio-group");
221
- const _component_bk_loading = _resolveComponent("bk-loading");
222
- const _component_t_enhanced_table = _resolveComponent("t-enhanced-table");
223
- const _component_bk_pagination = _resolveComponent("bk-pagination");
224
- return _openBlock(), _createElementBlock("section", {
225
- class: _normalizeClass(_ctx.$attrs.class),
226
- style: _normalizeStyle({
227
- height: __props.height
228
- })
229
- }, [
230
- _createVNode(_component_t_enhanced_table, _mergeProps(getTableAttrs(), {
231
- "column-controller-visible": columnControllerVisible.value,
232
- "onUpdate:columnControllerVisible": _cache[1] || (_cache[1] = ($event)=>columnControllerVisible.value = $event),
233
- "filter-value": {},
234
- "max-height": getMaxHeight(),
235
- loading: __props.isLoading,
236
- "row-key": __props.rowKey,
237
- "display-columns": displayColumns.value,
238
- data: __props.tableData,
239
- "column-controller": getColumnControllerConfig(),
240
- columns: getSettingColumns(),
241
- "row-class-name": getRowClassName,
242
- "expand-icon": false,
243
- resizable: true,
244
- class: "t-t-table",
245
- "cell-empty-content": "--",
246
- onSortChange: handleSortChange,
247
- onFilterChange: handleFilterChange,
248
- onDisplayColumnsChange: handleColumnChange,
249
- onSelectChange: handleSelectChange,
250
- onRowClick: handleRowClick,
251
- onRowMouseenter: handleRowMouseenter,
252
- onRowMouseleave: handleRowMouseleave
253
- }), {
254
- columnControllerBottomContent: _withCtx(()=>[
255
- _createElementVNode("section", _hoisted_1, [
256
- _cache[5] || (_cache[5] = _createTextVNode(" 表格行高: ", -1 /* CACHED */ )),
257
- _createVNode(_component_bk_radio_group, {
258
- modelValue: rowHeight.value,
259
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event)=>rowHeight.value = $event)
260
- }, {
261
- default: _withCtx(()=>[
262
- _createVNode(_component_bk_radio_button, {
263
- label: "g-h-42"
264
- }, {
265
- default: _withCtx(()=>[
266
- ..._cache[2] || (_cache[2] = [
267
- _createTextVNode(" 小 ", -1 /* CACHED */ )
268
- ])
269
- ]),
270
- _: 1 /* STABLE */
271
- }),
272
- _createVNode(_component_bk_radio_button, {
273
- label: "g-h-60"
274
- }, {
275
- default: _withCtx(()=>[
276
- ..._cache[3] || (_cache[3] = [
277
- _createTextVNode(" 中 ", -1 /* CACHED */ )
278
- ])
279
- ]),
280
- _: 1 /* STABLE */
281
- }),
282
- _createVNode(_component_bk_radio_button, {
283
- label: "g-h-78"
284
- }, {
285
- default: _withCtx(()=>[
286
- ..._cache[4] || (_cache[4] = [
287
- _createTextVNode(" 大 ", -1 /* CACHED */ )
288
- ])
289
- ]),
290
- _: 1 /* STABLE */
291
- })
292
- ]),
293
- _: 1 /* STABLE */
294
- }, 8 /* PROPS */ , [
295
- "modelValue"
296
- ])
297
- ])
298
- ]),
299
- empty: _withCtx(()=>[
300
- _createVNode(RenderSearchEmpty, {
301
- search: __props.search,
302
- scene: "part",
303
- "onUpdate:search": handleUpdateSearch
304
- }, null, 8 /* PROPS */ , [
305
- "search"
306
- ])
307
- ]),
308
- expandedRow: _withCtx(({ row })=>[
309
- _renderSlot(_ctx.$slots, "expandedRow", {
310
- row: row
311
- }, undefined, true)
312
- ]),
313
- sortIcon: _withCtx(()=>[
314
- ..._cache[6] || (_cache[6] = [
315
- _createElementVNode("i", {
316
- class: "ai-ui-sdk-icon ai-ui-sdk-angle-up-fill-3 g-text-light-gray"
317
- }, null, -1 /* CACHED */ )
318
- ])
319
- ]),
320
- loading: _withCtx(()=>[
321
- _createVNode(_component_bk_loading, {
322
- loading: true
323
- })
324
- ]),
325
- filterIcon: _withCtx(()=>[
326
- _createVNode(_unref(Funnel), {
327
- class: "g-text-light-gray g-text-14"
328
- })
329
- ]),
330
- _: 3 /* FORWARDED */
331
- }, 16 /* FULL_PROPS */ , [
332
- "column-controller-visible",
333
- "max-height",
334
- "loading",
335
- "row-key",
336
- "display-columns",
337
- "data",
338
- "column-controller",
339
- "columns"
340
- ]),
341
- __props.pagination ? (_openBlock(), _createBlock(_component_bk_pagination, {
342
- key: 0,
343
- class: _normalizeClass({
344
- 't-t-pagination': true,
345
- 'pagination-loading': __props.isLoading,
346
- 'pagination-border': __props.paginationBorder
347
- }),
348
- "model-value": __props.pagination.current,
349
- count: __props.pagination.count,
350
- limit: __props.pagination.limit,
351
- layout: __props.layout,
352
- size: "small",
353
- onChange: handlePageChange,
354
- onLimitChange: handlePageSizeChange
355
- }, null, 8 /* PROPS */ , [
356
- "class",
357
- "model-value",
358
- "count",
359
- "limit",
360
- "layout"
361
- ])) : _createCommentVNode("v-if", true)
362
- ], 6 /* CLASS, STYLE */ );
363
- };
364
- }
365
- }));