@idealyst/mcp-server 1.3.4 → 1.3.5
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/{chunk-TVNRJ4US.js → chunk-4LBZUOEV.js} +7 -3
- package/dist/chunk-4LBZUOEV.js.map +1 -0
- package/dist/index.cjs +6 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/tools/index.cjs +6 -2
- package/dist/tools/index.cjs.map +1 -1
- package/dist/tools/index.js +1 -1
- package/examples/components/Table.examples.tsx +75 -2
- package/package.json +5 -5
- package/dist/chunk-TVNRJ4US.js.map +0 -1
package/dist/tools/index.js
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* to ensure accuracy and correctness.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import React from 'react';
|
|
9
|
-
import { Table, View, Text, Badge, Icon, type TableColumn } from '@idealyst/components';
|
|
8
|
+
import React, { useState } from 'react';
|
|
9
|
+
import { Table, View, Text, Badge, Icon, type TableColumn, type SortDirection } from '@idealyst/components';
|
|
10
10
|
|
|
11
11
|
// ============================================================================
|
|
12
12
|
// Example 1: Basic Table
|
|
@@ -234,3 +234,76 @@ export function ColumnAlignment() {
|
|
|
234
234
|
|
|
235
235
|
return <Table columns={columns} data={products} type="bordered" />;
|
|
236
236
|
}
|
|
237
|
+
|
|
238
|
+
// ============================================================================
|
|
239
|
+
// Example 9: Sortable Columns
|
|
240
|
+
// ============================================================================
|
|
241
|
+
|
|
242
|
+
export function SortableTable() {
|
|
243
|
+
const [data, setData] = useState(products);
|
|
244
|
+
|
|
245
|
+
const handleSort = (columnKey: string, direction: SortDirection) => {
|
|
246
|
+
if (!direction) {
|
|
247
|
+
setData([...products]); // Reset to original order
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
const sorted = [...data].sort((a, b) => {
|
|
251
|
+
const aVal = a[columnKey as keyof Product];
|
|
252
|
+
const bVal = b[columnKey as keyof Product];
|
|
253
|
+
if (typeof aVal === 'number' && typeof bVal === 'number') {
|
|
254
|
+
return direction === 'asc' ? aVal - bVal : bVal - aVal;
|
|
255
|
+
}
|
|
256
|
+
return direction === 'asc'
|
|
257
|
+
? String(aVal).localeCompare(String(bVal))
|
|
258
|
+
: String(bVal).localeCompare(String(aVal));
|
|
259
|
+
});
|
|
260
|
+
setData(sorted);
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
const columns: TableColumn<Product>[] = [
|
|
264
|
+
{ key: 'name', title: 'Product', dataIndex: 'name', sortable: true },
|
|
265
|
+
{ key: 'quantity', title: 'Qty', dataIndex: 'quantity', align: 'right', sortable: true },
|
|
266
|
+
{
|
|
267
|
+
key: 'price',
|
|
268
|
+
title: 'Price',
|
|
269
|
+
dataIndex: 'price',
|
|
270
|
+
align: 'right',
|
|
271
|
+
sortable: true,
|
|
272
|
+
render: (value: number) => `$${value.toFixed(2)}`,
|
|
273
|
+
},
|
|
274
|
+
];
|
|
275
|
+
|
|
276
|
+
return <Table columns={columns} data={data} onSort={handleSort} dividers />;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
// ============================================================================
|
|
280
|
+
// Example 10: Column Options Menu
|
|
281
|
+
// ============================================================================
|
|
282
|
+
|
|
283
|
+
export function ColumnOptionsMenu() {
|
|
284
|
+
const columns: TableColumn<User>[] = [
|
|
285
|
+
{
|
|
286
|
+
key: 'name',
|
|
287
|
+
title: 'Name',
|
|
288
|
+
dataIndex: 'name',
|
|
289
|
+
sortable: true,
|
|
290
|
+
options: [
|
|
291
|
+
{ id: 'sort-asc', label: 'Sort A-Z', icon: 'sort-ascending', onClick: () => console.log('Sort A-Z') },
|
|
292
|
+
{ id: 'sort-desc', label: 'Sort Z-A', icon: 'sort-descending', onClick: () => console.log('Sort Z-A') },
|
|
293
|
+
{ id: 'sep', label: '', separator: true },
|
|
294
|
+
{ id: 'hide', label: 'Hide Column', icon: 'eye-off', onClick: () => console.log('Hide') },
|
|
295
|
+
],
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
key: 'role',
|
|
299
|
+
title: 'Role',
|
|
300
|
+
dataIndex: 'role',
|
|
301
|
+
options: [
|
|
302
|
+
{ id: 'copy', label: 'Copy All', icon: 'content-copy', onClick: () => console.log('Copy') },
|
|
303
|
+
],
|
|
304
|
+
},
|
|
305
|
+
{ key: 'status', title: 'Status', dataIndex: 'status' },
|
|
306
|
+
];
|
|
307
|
+
|
|
308
|
+
return <Table columns={columns} data={users} dividers />;
|
|
309
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@idealyst/mcp-server",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.5",
|
|
4
4
|
"description": "MCP server providing documentation and examples for the Idealyst framework",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -55,13 +55,13 @@
|
|
|
55
55
|
"author": "Idealyst",
|
|
56
56
|
"license": "MIT",
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@idealyst/components": "^1.3.
|
|
59
|
-
"@idealyst/navigation": "^1.3.
|
|
60
|
-
"@idealyst/theme": "^1.3.
|
|
58
|
+
"@idealyst/components": "^1.3.5",
|
|
59
|
+
"@idealyst/navigation": "^1.3.5",
|
|
60
|
+
"@idealyst/theme": "^1.3.5",
|
|
61
61
|
"@modelcontextprotocol/sdk": "^1.0.4"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@idealyst/tooling": "^1.3.
|
|
64
|
+
"@idealyst/tooling": "^1.3.5",
|
|
65
65
|
"@types/better-sqlite3": "^7.6.12",
|
|
66
66
|
"@types/node": "^20.0.0",
|
|
67
67
|
"@types/react": "^19.1.0",
|