@morya-ui/mcp 0.3.5 → 0.3.7

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/data/catalog.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
- "generatedAt": "2026-09-25T05:07:42.993Z",
2
+ "generatedAt": "2026-09-29T02:20:54.304Z",
3
3
  "library": {
4
4
  "name": "morya-ui",
5
- "version": "0.3.5"
5
+ "version": "0.3.7"
6
6
  },
7
7
  "mcp": {
8
8
  "name": "@morya-ui/mcp",
9
- "version": "0.3.5"
9
+ "version": "0.3.7"
10
10
  },
11
11
  "components": [
12
12
  {
@@ -6485,6 +6485,10 @@
6485
6485
  {
6486
6486
  "name": "header",
6487
6487
  "description": "自定义标题区。"
6488
+ },
6489
+ {
6490
+ "name": "footer",
6491
+ "description": "底部操作区。"
6488
6492
  }
6489
6493
  ],
6490
6494
  "methods": [],
@@ -6516,6 +6520,15 @@
6516
6520
  "code": "<script setup lang=\"ts\">\nimport { MButton, MDrawer } from 'morya-ui'\nimport { ref } from 'vue'\n\nconst open = ref(false)\nconst position = ref<'left' | 'right' | 'top' | 'bottom'>('right')\n\nfunction openAt(next: 'left' | 'right' | 'top' | 'bottom') {\n position.value = next\n open.value = true\n}\n</script>\n\n<template>\n <div class=\"flex flex-wrap gap-3\">\n <MButton label=\"Left\" size=\"small\" @click=\"openAt('left')\" />\n <MButton label=\"Right\" size=\"small\" severity=\"secondary\" @click=\"openAt('right')\" />\n <MButton label=\"Top\" size=\"small\" severity=\"secondary\" @click=\"openAt('top')\" />\n <MButton label=\"Bottom\" size=\"small\" severity=\"secondary\" @click=\"openAt('bottom')\" />\n <MDrawer v-model=\"open\" :header=\"`Position: ${position}`\" :position=\"position\">\n <p style=\"margin:0\">\n Use <code>dismissable</code> to control mask dismiss.\n </p>\n </MDrawer>\n </div>\n</template>",
6517
6521
  "locale": "zh-CN"
6518
6522
  },
6523
+ {
6524
+ "id": "footer-1",
6525
+ "section": "Footer",
6526
+ "sectionId": "footer",
6527
+ "lang": "vue",
6528
+ "preview": true,
6529
+ "code": "<script setup lang=\"ts\">\nimport { MButton, MDrawer, MSpace } from 'morya-ui'\nimport { ref } from 'vue'\n\nconst open = ref(false)\n</script>\n\n<template>\n <div>\n <MButton label=\"With Footer\" @click=\"open = true\" />\n <MDrawer v-model=\"open\" header=\"Edit details\" position=\"right\" :width=\"360\">\n <p style=\"margin:0\">\n Put primary and secondary actions in the footer slot so the body can scroll independently.\n </p>\n <template #footer>\n <MSpace style=\"justify-content: flex-end; width: 100%\">\n <MButton label=\"Cancel\" severity=\"secondary\" text @click=\"open = false\" />\n <MButton label=\"Save\" @click=\"open = false\" />\n </MSpace>\n </template>\n </MDrawer>\n </div>\n</template>",
6530
+ "locale": "zh-CN"
6531
+ },
6519
6532
  {
6520
6533
  "id": "import-1",
6521
6534
  "section": "Import",
@@ -6542,6 +6555,15 @@
6542
6555
  "preview": true,
6543
6556
  "code": "<script setup lang=\"ts\">\nimport { MButton, MDrawer } from 'morya-ui'\nimport { ref } from 'vue'\n\nconst open = ref(false)\nconst position = ref<'left' | 'right' | 'top' | 'bottom'>('right')\n\nfunction openAt(next: 'left' | 'right' | 'top' | 'bottom') {\n position.value = next\n open.value = true\n}\n</script>\n\n<template>\n <div class=\"flex flex-wrap gap-3\">\n <MButton label=\"Left\" size=\"small\" @click=\"openAt('left')\" />\n <MButton label=\"Right\" size=\"small\" severity=\"secondary\" @click=\"openAt('right')\" />\n <MButton label=\"Top\" size=\"small\" severity=\"secondary\" @click=\"openAt('top')\" />\n <MButton label=\"Bottom\" size=\"small\" severity=\"secondary\" @click=\"openAt('bottom')\" />\n <MDrawer v-model=\"open\" :header=\"`Position: ${position}`\" :position=\"position\">\n <p style=\"margin:0\">\n Use <code>dismissable</code> to control mask dismiss.\n </p>\n </MDrawer>\n </div>\n</template>",
6544
6557
  "locale": "en-US"
6558
+ },
6559
+ {
6560
+ "id": "footer-1",
6561
+ "section": "Footer",
6562
+ "sectionId": "footer",
6563
+ "lang": "vue",
6564
+ "preview": true,
6565
+ "code": "<script setup lang=\"ts\">\nimport { MButton, MDrawer, MSpace } from 'morya-ui'\nimport { ref } from 'vue'\n\nconst open = ref(false)\n</script>\n\n<template>\n <div>\n <MButton label=\"With Footer\" @click=\"open = true\" />\n <MDrawer v-model=\"open\" header=\"Edit details\" position=\"right\" :width=\"360\">\n <p style=\"margin:0\">\n Put primary and secondary actions in the footer slot so the body can scroll independently.\n </p>\n <template #footer>\n <MSpace style=\"justify-content: flex-end; width: 100%\">\n <MButton label=\"Cancel\" severity=\"secondary\" text @click=\"open = false\" />\n <MButton label=\"Save\" @click=\"open = false\" />\n </MSpace>\n </template>\n </MDrawer>\n </div>\n</template>",
6566
+ "locale": "en-US"
6545
6567
  }
6546
6568
  ],
6547
6569
  "locales": {
@@ -6569,6 +6591,11 @@
6569
6591
  "title": "Position",
6570
6592
  "body": "支持 `left` / `right` / `top` / `bottom`。\n\n```vue preview src=\"./demos/Position.vue\"\n```"
6571
6593
  },
6594
+ {
6595
+ "id": "footer",
6596
+ "title": "Footer",
6597
+ "body": "用 `#footer` 放取消 / 保存等操作;正文区可独立滚动。\n\n```vue preview src=\"./demos/Footer.vue\"\n```"
6598
+ },
6572
6599
  {
6573
6600
  "id": "props",
6574
6601
  "title": "Props",
@@ -6582,10 +6609,10 @@
6582
6609
  {
6583
6610
  "id": "slots",
6584
6611
  "title": "Slots",
6585
- "body": "| 插槽名 | 说明 |\n| --- | --- |\n| `default` | 抽屉内容。 |\n| `header` | 自定义标题区。 |"
6612
+ "body": "| 插槽名 | 说明 |\n| --- | --- |\n| `default` | 抽屉内容。 |\n| `header` | 自定义标题区。 |\n| `footer` | 底部操作区。 |"
6586
6613
  }
6587
6614
  ],
6588
- "markdown": "---\ntitle: Drawer\ncategory: 05 / FEEDBACK\ndescription: 侧边抽屉面板。\n---\n\n# Drawer\n\n侧边抽屉,从屏幕边缘滑出,适合导航、筛选或详情面板。\n\n## 引入\n\n```ts\nimport { MButton, MDrawer } from 'morya-ui'\n```\n\n## 基础用法\n\n```vue preview src=\"./demos/Basic.vue\"\n```\n\n## Position\n\n支持 `left` / `right` / `top` / `bottom`。\n\n```vue preview src=\"./demos/Position.vue\"\n```\n\n## Props\n\n| 参数 | 类型 | 默认值 | 说明 |\n| --- | --- | --- | --- |\n| `modelValue` | `boolean` | `false` | 可见性。配合 `v-model` 使用。 |\n| `position` | `'left' \\| 'right' \\| 'top' \\| 'bottom'` | `'left'` | 抽屉出现位置。 |\n| `modal` | `boolean` | `true` | 显示遮罩层。 |\n| `dismissable` | `boolean` | `true` | 点击遮罩关闭。 |\n| `showCloseIcon` | `boolean` | `true` | 显示关闭按钮。 |\n| `header` | `string` | — | 标题文案。 |\n| `width` | `string \\| number` | — | 左右抽屉宽度。 |\n| `height` | `string \\| number` | — | 上下抽屉高度。 |\n| `blockScroll` | `boolean` | `true` | 打开时锁定 `body` 滚动。 |\n| `teleport` | `boolean` | `true` | 浮层 Teleport;默认挂到 `body`。 |\n| `appendTo` | `string \\| HTMLElement \\| 'self' \\| false` | `'body'` | 挂载目标;`'self'` / `false` 就地渲染。 |\n| `transition` | `string \\| false` | `'drawer'` | 进出场动效预设;`false` / `'none'` 关闭。见[动效](/docs/motion)。 |\n| `beforeClose` | [AsyncGuard](/docs/types#AsyncGuard) | — | — |\n| `closeOnEsc` | `boolean` | — | — |\n| `closeOnOutsideClick` | `boolean` | — | — |\n| `pt` | [RootPassThrough](/docs/types#RootPassThrough) `{ root? }` | — | DOM 透传,见 [样式与 attrs](/docs/attrs). |\n\n\n## Events\n\n| 事件名 | 参数 | 说明 |\n| --- | --- | --- |\n| `update:modelValue` | `boolean` | 可见性变化。 |\n| `show` | — | 打开时触发。 |\n| `hide` | — | 关闭后触发。 |\n| `after-leave` | — | 离场动画结束。 |\n| `close` | — | — |\n\n## Slots\n\n| 插槽名 | 说明 |\n| --- | --- |\n| `default` | 抽屉内容。 |\n| `header` | 自定义标题区。 |\n"
6615
+ "markdown": "---\ntitle: Drawer\ncategory: 05 / FEEDBACK\ndescription: 侧边抽屉面板。\n---\n\n# Drawer\n\n侧边抽屉,从屏幕边缘滑出,适合导航、筛选或详情面板。\n\n## 引入\n\n```ts\nimport { MButton, MDrawer } from 'morya-ui'\n```\n\n## 基础用法\n\n```vue preview src=\"./demos/Basic.vue\"\n```\n\n## Position\n\n支持 `left` / `right` / `top` / `bottom`。\n\n```vue preview src=\"./demos/Position.vue\"\n```\n\n## Footer\n\n用 `#footer` 放取消 / 保存等操作;正文区可独立滚动。\n\n```vue preview src=\"./demos/Footer.vue\"\n```\n\n## Props\n\n| 参数 | 类型 | 默认值 | 说明 |\n| --- | --- | --- | --- |\n| `modelValue` | `boolean` | `false` | 可见性。配合 `v-model` 使用。 |\n| `position` | `'left' \\| 'right' \\| 'top' \\| 'bottom'` | `'left'` | 抽屉出现位置。 |\n| `modal` | `boolean` | `true` | 显示遮罩层。 |\n| `dismissable` | `boolean` | `true` | 点击遮罩关闭。 |\n| `showCloseIcon` | `boolean` | `true` | 显示关闭按钮。 |\n| `header` | `string` | — | 标题文案。 |\n| `width` | `string \\| number` | — | 左右抽屉宽度。 |\n| `height` | `string \\| number` | — | 上下抽屉高度。 |\n| `blockScroll` | `boolean` | `true` | 打开时锁定 `body` 滚动。 |\n| `teleport` | `boolean` | `true` | 浮层 Teleport;默认挂到 `body`。 |\n| `appendTo` | `string \\| HTMLElement \\| 'self' \\| false` | `'body'` | 挂载目标;`'self'` / `false` 就地渲染。 |\n| `transition` | `string \\| false` | `'drawer'` | 进出场动效预设;`false` / `'none'` 关闭。见[动效](/docs/motion)。 |\n| `beforeClose` | [AsyncGuard](/docs/types#AsyncGuard) | — | — |\n| `closeOnEsc` | `boolean` | — | — |\n| `closeOnOutsideClick` | `boolean` | — | — |\n| `pt` | [RootPassThrough](/docs/types#RootPassThrough) `{ root? }` | — | DOM 透传,见 [样式与 attrs](/docs/attrs). |\n\n\n## Events\n\n| 事件名 | 参数 | 说明 |\n| --- | --- | --- |\n| `update:modelValue` | `boolean` | 可见性变化。 |\n| `show` | — | 打开时触发。 |\n| `hide` | — | 关闭后触发。 |\n| `after-leave` | — | 离场动画结束。 |\n| `close` | — | — |\n\n## Slots\n\n| 插槽名 | 说明 |\n| --- | --- |\n| `default` | 抽屉内容。 |\n| `header` | 自定义标题区。 |\n| `footer` | 底部操作区。 |\n"
6589
6616
  },
6590
6617
  "en-US": {
6591
6618
  "title": "Drawer",
@@ -6611,6 +6638,11 @@
6611
6638
  "title": "Position",
6612
6639
  "body": "Supports `left` / `right` / `top` / `bottom`.\n\n```vue preview src=\"./demos/Position.vue\"\n```"
6613
6640
  },
6641
+ {
6642
+ "id": "footer",
6643
+ "title": "Footer",
6644
+ "body": "Use `#footer` for cancel / save actions; the body scrolls independently.\n\n```vue preview src=\"./demos/Footer.vue\"\n```"
6645
+ },
6614
6646
  {
6615
6647
  "id": "props",
6616
6648
  "title": "Props",
@@ -6624,10 +6656,10 @@
6624
6656
  {
6625
6657
  "id": "slots",
6626
6658
  "title": "Slots",
6627
- "body": "| Slot | Description |\n| --- | --- |\n| `default` | Drawer content. |\n| `header` | Custom header area. |"
6659
+ "body": "| Slot | Description |\n| --- | --- |\n| `default` | Drawer content. |\n| `header` | Custom header area. |\n| `footer` | Footer actions. |"
6628
6660
  }
6629
6661
  ],
6630
- "markdown": "---\ntitle: Drawer\ncategory: 05 / FEEDBACK\ndescription: Side drawer panel.\n---\n\n# Drawer\n\nSide drawer that slides in from the screen edge. Suited to navigation, filters, or detail panels.\n\n## Import\n\n```ts\nimport { MButton, MDrawer } from 'morya-ui'\n```\n\n## Basic\n\n```vue preview src=\"./demos/Basic.vue\"\n```\n\n## Position\n\nSupports `left` / `right` / `top` / `bottom`.\n\n```vue preview src=\"./demos/Position.vue\"\n```\n\n## Props\n\n| Prop | Type | Default | Description |\n| --- | --- | --- | --- |\n| `modelValue` | `boolean` | `false` | Visibility. Use with `v-model`. |\n| `position` | `'left' \\| 'right' \\| 'top' \\| 'bottom'` | `'left'` | Edge the drawer appears from. |\n| `modal` | `boolean` | `true` | Show the overlay mask. |\n| `dismissable` | `boolean` | `true` | Close when clicking the mask. |\n| `showCloseIcon` | `boolean` | `true` | Show the close button. |\n| `header` | `string` | — | Header text. |\n| `width` | `number \\| string` | — | Width for left/right drawers (`number` = px). |\n| `height` | `number \\| string` | — | Height for top/bottom drawers (`number` = px). |\n| `blockScroll` | `boolean` | `true` | Lock `body` scroll while open. |\n| `teleport` | `boolean` | `true` | Overlay Teleport; mounts to `body` by default. |\n| `appendTo` | `string \\| HTMLElement \\| 'self' \\| false` | `'body'` | Mount target; `'self'` / `false` renders in place. |\n| `transition` | `string \\| false` | `'drawer'` | Enter/exit motion preset; `false` / `'none'` disables. See [Motion](/docs/motion). |\n| `pt` | [RootPassThrough](/docs/types#RootPassThrough) `{ root? }` | — | Pass-through; see [Styling & attrs](/docs/attrs). |\n\n\n## Events\n\n| Event | Prop | Description |\n| --- | --- | --- |\n| `update:modelValue` | `boolean` | Visibility change. |\n| `show` | — | Emitted when opening. |\n| `hide` | — | Emitted after closing. |\n| `after-leave` | — | Emitted when the leave animation finishes. |\n\n## Slots\n\n| Slot | Description |\n| --- | --- |\n| `default` | Drawer content. |\n| `header` | Custom header area. |\n"
6662
+ "markdown": "---\ntitle: Drawer\ncategory: 05 / FEEDBACK\ndescription: Side drawer panel.\n---\n\n# Drawer\n\nSide drawer that slides in from the screen edge. Suited to navigation, filters, or detail panels.\n\n## Import\n\n```ts\nimport { MButton, MDrawer } from 'morya-ui'\n```\n\n## Basic\n\n```vue preview src=\"./demos/Basic.vue\"\n```\n\n## Position\n\nSupports `left` / `right` / `top` / `bottom`.\n\n```vue preview src=\"./demos/Position.vue\"\n```\n\n## Footer\n\nUse `#footer` for cancel / save actions; the body scrolls independently.\n\n```vue preview src=\"./demos/Footer.vue\"\n```\n\n## Props\n\n| Prop | Type | Default | Description |\n| --- | --- | --- | --- |\n| `modelValue` | `boolean` | `false` | Visibility. Use with `v-model`. |\n| `position` | `'left' \\| 'right' \\| 'top' \\| 'bottom'` | `'left'` | Edge the drawer appears from. |\n| `modal` | `boolean` | `true` | Show the overlay mask. |\n| `dismissable` | `boolean` | `true` | Close when clicking the mask. |\n| `showCloseIcon` | `boolean` | `true` | Show the close button. |\n| `header` | `string` | — | Header text. |\n| `width` | `number \\| string` | — | Width for left/right drawers (`number` = px). |\n| `height` | `number \\| string` | — | Height for top/bottom drawers (`number` = px). |\n| `blockScroll` | `boolean` | `true` | Lock `body` scroll while open. |\n| `teleport` | `boolean` | `true` | Overlay Teleport; mounts to `body` by default. |\n| `appendTo` | `string \\| HTMLElement \\| 'self' \\| false` | `'body'` | Mount target; `'self'` / `false` renders in place. |\n| `transition` | `string \\| false` | `'drawer'` | Enter/exit motion preset; `false` / `'none'` disables. See [Motion](/docs/motion). |\n| `pt` | [RootPassThrough](/docs/types#RootPassThrough) `{ root? }` | — | Pass-through; see [Styling & attrs](/docs/attrs). |\n\n\n## Events\n\n| Event | Prop | Description |\n| --- | --- | --- |\n| `update:modelValue` | `boolean` | Visibility change. |\n| `show` | — | Emitted when opening. |\n| `hide` | — | Emitted after closing. |\n| `after-leave` | — | Emitted when the leave animation finishes. |\n\n## Slots\n\n| Slot | Description |\n| --- | --- |\n| `default` | Drawer content. |\n| `header` | Custom header area. |\n| `footer` | Footer actions. |\n"
6631
6663
  }
6632
6664
  }
6633
6665
  },
@@ -18197,7 +18229,7 @@
18197
18229
  {
18198
18230
  "id": "horizontal",
18199
18231
  "title": "Horizontal",
18200
- "body": "内容宽度超出容器时显示横向滚动条。`trigger=\"none\"` 与 `always` 都会常显滑块;默认 `trigger=\"hover\"` 在悬停时显示。\n\n`MLayout`、`MDialog`、`MConfirmDialog`、`MDrawer`、`MSplitter`、`MTable`、`MSelect`、`MTreeSelect`、`MDropdown`、`MContextMenu`、`MPopover`、`MConfirmPopup`、`MMenu`(popup)、`MMenubar`、`MTieredMenu`、`MTabs`、`MGallery`、`MTimeline`(horizontal)、`MTextarea`(autosize `maxRows`)、`MTerminal`、`MOrderList`、`MPickList`、`MTreeTable`、`MVirtualScroller` 等组件已内置本组件。\n\n```vue preview src=\"./demos/Horizontal.vue\"\n```"
18232
+ "body": "内容宽度超出容器时显示横向滚动条。`trigger=\"none\"` 与 `always` 都会常显滑块;默认 `trigger=\"hover\"` 在悬停时显示。\n\n`MLayout`、`MDialog`、`MConfirmDialog`、`MDrawer`、`MSplitter`、`MTable`、`MSelect`、`MTreeSelect`、`MDropdown`、`MContextMenu`、`MPopover`、`MConfirmPopup`、`MMenu`(popup)、`MMenubar`、`MTieredMenu`、`MTabs`、`MGallery`、`MTimeline`(horizontal)、`MTextarea`(autosize `maxRows`)、`MTerminal`、`MOrderList`、`MPickList`、`MVirtualScroller` 等组件已内置本组件。\n\n```vue preview src=\"./demos/Horizontal.vue\"\n```"
18201
18233
  },
18202
18234
  {
18203
18235
  "id": "always-native",
@@ -18235,7 +18267,7 @@
18235
18267
  "body": "<h4 id=\"ScrollbarAriaOrientation\">ScrollbarAriaOrientation</h4>\n\n完整定义见源码 `types.ts`。\n\n```ts\ntype ScrollbarAriaOrientation = 'horizontal' | 'vertical'\n```\n\n<h4 id=\"ScrollbarClassValue\">ScrollbarClassValue</h4>\n\n完整定义见源码 `types.ts`。\n\n```ts\ntype ScrollbarClassValue = | string\n | string[]\n | Record<string, boolean>\n | Array<string | Record<string, boolean> | null | undefined | false>\n```"
18236
18268
  }
18237
18269
  ],
18238
- "markdown": "---\ntitle: Scrollbar\ncategory: 01 / BASIC\ndescription: 可换肤自定义滚动条,提供一致的滚动体验。\n---\n\n# Scrollbar\n\n用于替换浏览器原生滚动条,提供跨浏览器一致的可换肤滚动体验。\n\n## 引入\n\n```ts\nimport { MScrollbar } from 'morya-ui'\n```\n\n## 基础用法\n\n用 `height` 固定可视区域高度;不设时跟随父容器高度。\n\n```vue preview src=\"./demos/Basic.vue\"\n```\n\n## Max height\n\n仅当内容超出 `max-height` 时出现滚动条。\n\n```vue preview src=\"./demos/MaxHeight.vue\"\n```\n\n## Horizontal\n\n内容宽度超出容器时显示横向滚动条。`trigger=\"none\"` 与 `always` 都会常显滑块;默认 `trigger=\"hover\"` 在悬停时显示。\n\n`MLayout`、`MDialog`、`MConfirmDialog`、`MDrawer`、`MSplitter`、`MTable`、`MSelect`、`MTreeSelect`、`MDropdown`、`MContextMenu`、`MPopover`、`MConfirmPopup`、`MMenu`(popup)、`MMenubar`、`MTieredMenu`、`MTabs`、`MGallery`、`MTimeline`(horizontal)、`MTextarea`(autosize `maxRows`)、`MTerminal`、`MOrderList`、`MPickList`、`MTreeTable`、`MVirtualScroller` 等组件已内置本组件。\n\n```vue preview src=\"./demos/Horizontal.vue\"\n```\n\n## Always / Native\n\n`always` 常显自定义滑块;`native` 使用浏览器原生滚动条。\n\n```vue preview src=\"./demos/AlwaysNative.vue\"\n```\n\n## Manual scroll\n\n通过实例方法 `setScrollTop` / `setScrollLeft` / `scrollTo` / `update` 控制滚动。\n\n```vue preview src=\"./demos/ManualScroll.zh.vue\"\n```\n\n## Infinite scroll\n\n滚动到边缘时触发 `end-reached`,可用于无限加载。\n\n```vue preview src=\"./demos/InfiniteScroll.zh.vue\"\n```\n\n## API\n\n### Props\n\n| 参数 | 类型 | 默认值 | 说明 |\n| --- | --- | --- | --- |\n| `always` | `boolean` | — | — |\n| `ariaLabel` | `string` | — | — |\n| `ariaOrientation` | `ScrollbarAriaOrientation` | — | — |\n| `distance` | `number` | — | — |\n| `height` | `string \\| number` | — | — |\n| `id` | `string` | — | — |\n| `maxHeight` | `string \\| number` | — | — |\n| `minSize` | `number` | — | — |\n| `native` | `boolean` | — | — |\n| `noresize` | `boolean` | — | — |\n| `role` | `string` | — | — |\n| `tabindex` | `number \\| string` | — | — |\n| `tag` | `string` | — | — |\n| `trigger` | `'hover' \\| 'none'` | — | — |\n| `viewClass` | `ScrollbarClassValue` | — | — |\n| `viewStyle` | `StyleValue` | — | — |\n| `wrapClass` | `ScrollbarClassValue` | — | — |\n| `wrapStyle` | `StyleValue` | — | — |\n| `width` | `string \\| number` | — | 可视区域宽度。 |\n| `maxWidth` | `string \\| number` | — | 最大宽度。 |\n| `ariaMultiselectable` | `boolean` | — | 内容区 `aria-multiselectable`。 |\n| `pt` | [RootPassThrough](/docs/types#RootPassThrough) `{ root? }` | — | DOM 透传,见 [样式与 attrs](/docs/attrs). |\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| height | `string \\| number` | — | 可视区域高度 |\n| maxHeight | `string \\| number` | — | 最大高度 |\n| fitContent | `boolean` | `false` | 随内容增高,配合根节点 CSS `max-height` 使用(下拉面板) |\n| native | `boolean` | `false` | 使用原生滚动条 |\n| wrapStyle / wrapClass | style / class | — | wrap 容器样式 |\n| viewStyle / viewClass | style / class | — | 内容区样式 |\n| noresize | `boolean` | `false` | 不监听尺寸变化 |\n| tag | `string` | `div` | 内容区标签 |\n| always | `boolean` | `false` | 始终显示滑块 |\n| trigger | `'hover' \\| 'none'` | `'hover'` | `none` 常显滑块;`always` 为 true 时仍常显 |\n| minSize | `number` | `20` | 滑块最小尺寸 |\n| id / role / ariaLabel / ariaOrientation | a11y | — | 内容区无障碍属性 |\n| tabindex | `number \\| string` | — | wrap 的 tabindex |\n| distance | `number` | `0` | 触发 `end-reached` 的边缘距离 |\n\n### Events\n\n| Name | Payload |\n| --- | --- |\n| scroll | `{ scrollTop, scrollLeft }` |\n| end-reached | `'top' \\| 'bottom' \\| 'left' \\| 'right'` |\n\n### Expose\n\n| 方法 / 属性 | 说明 |\n| --- | --- |\n| `wrapRef` | wrap 容器元素引用。 |\n| `update()` | 重新计算滑块尺寸与位置。 |\n| `scrollTo(...)` | 滚动到指定位置(同原生 `scrollTo`)。 |\n| `setScrollTop(y)` | 设置纵向滚动位置。 |\n| `setScrollLeft(x)` | 设置横向滚动位置。 |\n| `handleScroll(event)` | wrap 的 scroll 事件处理,可手动转发。 |\n\n## Events\n\n| 事件名 | 参数 | 说明 |\n| --- | --- | --- |\n| `scroll` | `{ scrollTop, scrollLeft }` | 滚动位置变化。 |\n| `end-reached` | `'top' \\| 'bottom' \\| 'left' \\| 'right'` | 滚动到边缘。 |\n\n## Slots\n\n| 插槽名 | 说明 |\n| --- | --- |\n| `default` | 可滚动内容。 |\n\n## 类型\n\n<h4 id=\"ScrollbarAriaOrientation\">ScrollbarAriaOrientation</h4>\n\n完整定义见源码 `types.ts`。\n\n```ts\ntype ScrollbarAriaOrientation = 'horizontal' | 'vertical'\n```\n\n<h4 id=\"ScrollbarClassValue\">ScrollbarClassValue</h4>\n\n完整定义见源码 `types.ts`。\n\n```ts\ntype ScrollbarClassValue = | string\n | string[]\n | Record<string, boolean>\n | Array<string | Record<string, boolean> | null | undefined | false>\n```\n"
18270
+ "markdown": "---\ntitle: Scrollbar\ncategory: 01 / BASIC\ndescription: 可换肤自定义滚动条,提供一致的滚动体验。\n---\n\n# Scrollbar\n\n用于替换浏览器原生滚动条,提供跨浏览器一致的可换肤滚动体验。\n\n## 引入\n\n```ts\nimport { MScrollbar } from 'morya-ui'\n```\n\n## 基础用法\n\n用 `height` 固定可视区域高度;不设时跟随父容器高度。\n\n```vue preview src=\"./demos/Basic.vue\"\n```\n\n## Max height\n\n仅当内容超出 `max-height` 时出现滚动条。\n\n```vue preview src=\"./demos/MaxHeight.vue\"\n```\n\n## Horizontal\n\n内容宽度超出容器时显示横向滚动条。`trigger=\"none\"` 与 `always` 都会常显滑块;默认 `trigger=\"hover\"` 在悬停时显示。\n\n`MLayout`、`MDialog`、`MConfirmDialog`、`MDrawer`、`MSplitter`、`MTable`、`MSelect`、`MTreeSelect`、`MDropdown`、`MContextMenu`、`MPopover`、`MConfirmPopup`、`MMenu`(popup)、`MMenubar`、`MTieredMenu`、`MTabs`、`MGallery`、`MTimeline`(horizontal)、`MTextarea`(autosize `maxRows`)、`MTerminal`、`MOrderList`、`MPickList`、`MVirtualScroller` 等组件已内置本组件。\n\n```vue preview src=\"./demos/Horizontal.vue\"\n```\n\n## Always / Native\n\n`always` 常显自定义滑块;`native` 使用浏览器原生滚动条。\n\n```vue preview src=\"./demos/AlwaysNative.vue\"\n```\n\n## Manual scroll\n\n通过实例方法 `setScrollTop` / `setScrollLeft` / `scrollTo` / `update` 控制滚动。\n\n```vue preview src=\"./demos/ManualScroll.zh.vue\"\n```\n\n## Infinite scroll\n\n滚动到边缘时触发 `end-reached`,可用于无限加载。\n\n```vue preview src=\"./demos/InfiniteScroll.zh.vue\"\n```\n\n## API\n\n### Props\n\n| 参数 | 类型 | 默认值 | 说明 |\n| --- | --- | --- | --- |\n| `always` | `boolean` | — | — |\n| `ariaLabel` | `string` | — | — |\n| `ariaOrientation` | `ScrollbarAriaOrientation` | — | — |\n| `distance` | `number` | — | — |\n| `height` | `string \\| number` | — | — |\n| `id` | `string` | — | — |\n| `maxHeight` | `string \\| number` | — | — |\n| `minSize` | `number` | — | — |\n| `native` | `boolean` | — | — |\n| `noresize` | `boolean` | — | — |\n| `role` | `string` | — | — |\n| `tabindex` | `number \\| string` | — | — |\n| `tag` | `string` | — | — |\n| `trigger` | `'hover' \\| 'none'` | — | — |\n| `viewClass` | `ScrollbarClassValue` | — | — |\n| `viewStyle` | `StyleValue` | — | — |\n| `wrapClass` | `ScrollbarClassValue` | — | — |\n| `wrapStyle` | `StyleValue` | — | — |\n| `width` | `string \\| number` | — | 可视区域宽度。 |\n| `maxWidth` | `string \\| number` | — | 最大宽度。 |\n| `ariaMultiselectable` | `boolean` | — | 内容区 `aria-multiselectable`。 |\n| `pt` | [RootPassThrough](/docs/types#RootPassThrough) `{ root? }` | — | DOM 透传,见 [样式与 attrs](/docs/attrs). |\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| height | `string \\| number` | — | 可视区域高度 |\n| maxHeight | `string \\| number` | — | 最大高度 |\n| fitContent | `boolean` | `false` | 随内容增高,配合根节点 CSS `max-height` 使用(下拉面板) |\n| native | `boolean` | `false` | 使用原生滚动条 |\n| wrapStyle / wrapClass | style / class | — | wrap 容器样式 |\n| viewStyle / viewClass | style / class | — | 内容区样式 |\n| noresize | `boolean` | `false` | 不监听尺寸变化 |\n| tag | `string` | `div` | 内容区标签 |\n| always | `boolean` | `false` | 始终显示滑块 |\n| trigger | `'hover' \\| 'none'` | `'hover'` | `none` 常显滑块;`always` 为 true 时仍常显 |\n| minSize | `number` | `20` | 滑块最小尺寸 |\n| id / role / ariaLabel / ariaOrientation | a11y | — | 内容区无障碍属性 |\n| tabindex | `number \\| string` | — | wrap 的 tabindex |\n| distance | `number` | `0` | 触发 `end-reached` 的边缘距离 |\n\n### Events\n\n| Name | Payload |\n| --- | --- |\n| scroll | `{ scrollTop, scrollLeft }` |\n| end-reached | `'top' \\| 'bottom' \\| 'left' \\| 'right'` |\n\n### Expose\n\n| 方法 / 属性 | 说明 |\n| --- | --- |\n| `wrapRef` | wrap 容器元素引用。 |\n| `update()` | 重新计算滑块尺寸与位置。 |\n| `scrollTo(...)` | 滚动到指定位置(同原生 `scrollTo`)。 |\n| `setScrollTop(y)` | 设置纵向滚动位置。 |\n| `setScrollLeft(x)` | 设置横向滚动位置。 |\n| `handleScroll(event)` | wrap 的 scroll 事件处理,可手动转发。 |\n\n## Events\n\n| 事件名 | 参数 | 说明 |\n| --- | --- | --- |\n| `scroll` | `{ scrollTop, scrollLeft }` | 滚动位置变化。 |\n| `end-reached` | `'top' \\| 'bottom' \\| 'left' \\| 'right'` | 滚动到边缘。 |\n\n## Slots\n\n| 插槽名 | 说明 |\n| --- | --- |\n| `default` | 可滚动内容。 |\n\n## 类型\n\n<h4 id=\"ScrollbarAriaOrientation\">ScrollbarAriaOrientation</h4>\n\n完整定义见源码 `types.ts`。\n\n```ts\ntype ScrollbarAriaOrientation = 'horizontal' | 'vertical'\n```\n\n<h4 id=\"ScrollbarClassValue\">ScrollbarClassValue</h4>\n\n完整定义见源码 `types.ts`。\n\n```ts\ntype ScrollbarClassValue = | string\n | string[]\n | Record<string, boolean>\n | Array<string | Record<string, boolean> | null | undefined | false>\n```\n"
18239
18271
  },
18240
18272
  "en-US": {
18241
18273
  "title": "Scrollbar",
@@ -18264,7 +18296,7 @@
18264
18296
  {
18265
18297
  "id": "horizontal",
18266
18298
  "title": "Horizontal",
18267
- "body": "A horizontal scrollbar appears when content is wider than the container. `trigger=\"none\"` and `always` keep the thumb visible; the default `trigger=\"hover\"` shows it on hover.\n\n`MLayout`, `MDialog`, `MConfirmDialog`, `MDrawer`, `MSplitter`, `MTable`, `MSelect`, `MTreeSelect`, `MDropdown`, `MContextMenu`, `MPopover`, `MConfirmPopup`, `MMenu` (popup), `MMenubar`, `MTieredMenu`, `MTabs`, `MGallery`, `MTimeline` (horizontal), `MTextarea` (autosize `maxRows`), `MTerminal`, `MOrderList`, `MPickList`, `MTreeTable`, and `MVirtualScroller` integrate this component internally.\n\n```vue preview src=\"./demos/Horizontal.vue\"\n```"
18299
+ "body": "A horizontal scrollbar appears when content is wider than the container. `trigger=\"none\"` and `always` keep the thumb visible; the default `trigger=\"hover\"` shows it on hover.\n\n`MLayout`, `MDialog`, `MConfirmDialog`, `MDrawer`, `MSplitter`, `MTable`, `MSelect`, `MTreeSelect`, `MDropdown`, `MContextMenu`, `MPopover`, `MConfirmPopup`, `MMenu` (popup), `MMenubar`, `MTieredMenu`, `MTabs`, `MGallery`, `MTimeline` (horizontal), `MTextarea` (autosize `maxRows`), `MTerminal`, `MOrderList`, `MPickList`, and `MVirtualScroller` integrate this component internally.\n\n```vue preview src=\"./demos/Horizontal.vue\"\n```"
18268
18300
  },
18269
18301
  {
18270
18302
  "id": "always-native",
@@ -18297,7 +18329,7 @@
18297
18329
  "body": "| Slot | Description |\n| --- | --- |\n| `default` | Scrollable content. |"
18298
18330
  }
18299
18331
  ],
18300
- "markdown": "---\ntitle: Scrollbar\ncategory: 01 / BASIC\ndescription: Themeable custom scrollbar for a consistent scrolling experience.\n---\n\n# Scrollbar\n\nReplaces the native browser scrollbar with a themeable, cross-browser scrolling experience.\n\n## Import\n\n```ts\nimport { MScrollbar } from 'morya-ui'\n```\n\n## Basic\n\nUse `height` to fix the viewport height. If omitted, it follows the parent height.\n\n```vue preview src=\"./demos/Basic.vue\"\n```\n\n## Max height\n\nThe scrollbar appears only when content exceeds `max-height`.\n\n```vue preview src=\"./demos/MaxHeight.vue\"\n```\n\n## Horizontal\n\nA horizontal scrollbar appears when content is wider than the container. `trigger=\"none\"` and `always` keep the thumb visible; the default `trigger=\"hover\"` shows it on hover.\n\n`MLayout`, `MDialog`, `MConfirmDialog`, `MDrawer`, `MSplitter`, `MTable`, `MSelect`, `MTreeSelect`, `MDropdown`, `MContextMenu`, `MPopover`, `MConfirmPopup`, `MMenu` (popup), `MMenubar`, `MTieredMenu`, `MTabs`, `MGallery`, `MTimeline` (horizontal), `MTextarea` (autosize `maxRows`), `MTerminal`, `MOrderList`, `MPickList`, `MTreeTable`, and `MVirtualScroller` integrate this component internally.\n\n```vue preview src=\"./demos/Horizontal.vue\"\n```\n\n## Always / Native\n\n`always` keeps the custom thumb visible. `native` uses the browser scrollbar.\n\n```vue preview src=\"./demos/AlwaysNative.vue\"\n```\n\n## Manual scroll\n\nControl scrolling with instance methods `setScrollTop` / `setScrollLeft` / `scrollTo` / `update`.\n\n```vue preview src=\"./demos/ManualScroll.en.vue\"\n```\n\n## Infinite scroll\n\nEmits `end-reached` at the edge. Use it for infinite loading.\n\n```vue preview src=\"./demos/InfiniteScroll.en.vue\"\n```\n\n## API\n\n### Props\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| height | `string \\| number` | — | Viewport height |\n| maxHeight | `string \\| number` | — | Maximum height |\n| fitContent | `boolean` | `false` | Grow with content; pair with CSS `max-height` on the root (dropdown panels) |\n| native | `boolean` | `false` | Use the native scrollbar |\n| wrapStyle / wrapClass | style / class | — | Wrap container styles |\n| viewStyle / viewClass | style / class | — | Content area styles |\n| noresize | `boolean` | `false` | Do not listen for size changes |\n| tag | `string` | `div` | Content area tag |\n| always | `boolean` | `false` | Always show the thumb |\n| trigger | `'hover' \\| 'none'` | `'hover'` | `none` keeps thumbs visible; `always` still wins |\n| minSize | `number` | `20` | Minimum thumb size |\n| id / role / ariaLabel / ariaOrientation | a11y | — | Accessible attributes for the content area |\n| tabindex | `number \\| string` | — | tabindex on the wrap |\n| distance | `number` | `0` | Edge distance that triggers `end-reached` |\n| width | `string \\| number` | — | Viewport width |\n| maxWidth | `string \\| number` | — | Maximum width |\n| ariaMultiselectable | `boolean` | — | `aria-multiselectable` on the content area |\n| pt | [RootPassThrough](/docs/types#RootPassThrough) `{ root? }` | — | Pass-through; see [Styling & attrs](/docs/attrs). |\n\n### Events\n\n| Name | Payload |\n| --- | --- |\n| scroll | `{ scrollTop, scrollLeft }` |\n| end-reached | `'top' \\| 'bottom' \\| 'left' \\| 'right'` |\n\n### Expose\n\n| Method / Property | Description |\n| --- | --- |\n| `wrapRef` | Reference to the wrap element. |\n| `update()` | Recompute thumb size and position. |\n| `scrollTo(...)` | Scroll to a position (same as native `scrollTo`). |\n| `setScrollTop(y)` | Set vertical scroll offset. |\n| `setScrollLeft(x)` | Set horizontal scroll offset. |\n| `handleScroll(event)` | Wrap scroll handler; forward manually when needed. |\n\n## Events\n\n| Event | Payload | Description |\n| --- | --- | --- |\n| `scroll` | `{ scrollTop, scrollLeft }` | Scroll position change. |\n| `end-reached` | `'top' \\| 'bottom' \\| 'left' \\| 'right'` | Scroll boundary reached. |\n\n## Slots\n\n| Slot | Description |\n| --- | --- |\n| `default` | Scrollable content. |\n"
18332
+ "markdown": "---\ntitle: Scrollbar\ncategory: 01 / BASIC\ndescription: Themeable custom scrollbar for a consistent scrolling experience.\n---\n\n# Scrollbar\n\nReplaces the native browser scrollbar with a themeable, cross-browser scrolling experience.\n\n## Import\n\n```ts\nimport { MScrollbar } from 'morya-ui'\n```\n\n## Basic\n\nUse `height` to fix the viewport height. If omitted, it follows the parent height.\n\n```vue preview src=\"./demos/Basic.vue\"\n```\n\n## Max height\n\nThe scrollbar appears only when content exceeds `max-height`.\n\n```vue preview src=\"./demos/MaxHeight.vue\"\n```\n\n## Horizontal\n\nA horizontal scrollbar appears when content is wider than the container. `trigger=\"none\"` and `always` keep the thumb visible; the default `trigger=\"hover\"` shows it on hover.\n\n`MLayout`, `MDialog`, `MConfirmDialog`, `MDrawer`, `MSplitter`, `MTable`, `MSelect`, `MTreeSelect`, `MDropdown`, `MContextMenu`, `MPopover`, `MConfirmPopup`, `MMenu` (popup), `MMenubar`, `MTieredMenu`, `MTabs`, `MGallery`, `MTimeline` (horizontal), `MTextarea` (autosize `maxRows`), `MTerminal`, `MOrderList`, `MPickList`, and `MVirtualScroller` integrate this component internally.\n\n```vue preview src=\"./demos/Horizontal.vue\"\n```\n\n## Always / Native\n\n`always` keeps the custom thumb visible. `native` uses the browser scrollbar.\n\n```vue preview src=\"./demos/AlwaysNative.vue\"\n```\n\n## Manual scroll\n\nControl scrolling with instance methods `setScrollTop` / `setScrollLeft` / `scrollTo` / `update`.\n\n```vue preview src=\"./demos/ManualScroll.en.vue\"\n```\n\n## Infinite scroll\n\nEmits `end-reached` at the edge. Use it for infinite loading.\n\n```vue preview src=\"./demos/InfiniteScroll.en.vue\"\n```\n\n## API\n\n### Props\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| height | `string \\| number` | — | Viewport height |\n| maxHeight | `string \\| number` | — | Maximum height |\n| fitContent | `boolean` | `false` | Grow with content; pair with CSS `max-height` on the root (dropdown panels) |\n| native | `boolean` | `false` | Use the native scrollbar |\n| wrapStyle / wrapClass | style / class | — | Wrap container styles |\n| viewStyle / viewClass | style / class | — | Content area styles |\n| noresize | `boolean` | `false` | Do not listen for size changes |\n| tag | `string` | `div` | Content area tag |\n| always | `boolean` | `false` | Always show the thumb |\n| trigger | `'hover' \\| 'none'` | `'hover'` | `none` keeps thumbs visible; `always` still wins |\n| minSize | `number` | `20` | Minimum thumb size |\n| id / role / ariaLabel / ariaOrientation | a11y | — | Accessible attributes for the content area |\n| tabindex | `number \\| string` | — | tabindex on the wrap |\n| distance | `number` | `0` | Edge distance that triggers `end-reached` |\n| width | `string \\| number` | — | Viewport width |\n| maxWidth | `string \\| number` | — | Maximum width |\n| ariaMultiselectable | `boolean` | — | `aria-multiselectable` on the content area |\n| pt | [RootPassThrough](/docs/types#RootPassThrough) `{ root? }` | — | Pass-through; see [Styling & attrs](/docs/attrs). |\n\n### Events\n\n| Name | Payload |\n| --- | --- |\n| scroll | `{ scrollTop, scrollLeft }` |\n| end-reached | `'top' \\| 'bottom' \\| 'left' \\| 'right'` |\n\n### Expose\n\n| Method / Property | Description |\n| --- | --- |\n| `wrapRef` | Reference to the wrap element. |\n| `update()` | Recompute thumb size and position. |\n| `scrollTo(...)` | Scroll to a position (same as native `scrollTo`). |\n| `setScrollTop(y)` | Set vertical scroll offset. |\n| `setScrollLeft(x)` | Set horizontal scroll offset. |\n| `handleScroll(event)` | Wrap scroll handler; forward manually when needed. |\n\n## Events\n\n| Event | Payload | Description |\n| --- | --- | --- |\n| `scroll` | `{ scrollTop, scrollLeft }` | Scroll position change. |\n| `end-reached` | `'top' \\| 'bottom' \\| 'left' \\| 'right'` | Scroll boundary reached. |\n\n## Slots\n\n| Slot | Description |\n| --- | --- |\n| `default` | Scrollable content. |\n"
18301
18333
  }
18302
18334
  }
18303
18335
  },
@@ -22119,7 +22151,7 @@
22119
22151
  "description": "服务端分页/排序选项。"
22120
22152
  },
22121
22153
  {
22122
- "name": "serverItemsLength",
22154
+ "name": "serverTotal",
22123
22155
  "type": "number",
22124
22156
  "default": "0",
22125
22157
  "description": "服务端总条数。"
@@ -22142,17 +22174,107 @@
22142
22174
  "default": "25",
22143
22175
  "description": "每页条数。"
22144
22176
  },
22177
+ {
22178
+ "name": "pageSizes",
22179
+ "type": "number[]",
22180
+ "default": "[25, 50, 100]",
22181
+ "description": "分页每页条数选项。"
22182
+ },
22183
+ {
22184
+ "name": "showHeader",
22185
+ "type": "boolean",
22186
+ "default": "true",
22187
+ "description": "是否显示表头。"
22188
+ },
22189
+ {
22190
+ "name": "showRowsPerPage",
22191
+ "type": "boolean",
22192
+ "default": "true",
22193
+ "description": "是否显示每页条数选择器。"
22194
+ },
22145
22195
  {
22146
22196
  "name": "fill",
22147
22197
  "type": "boolean",
22148
22198
  "default": "false",
22149
22199
  "description": "撑满父级剩余高度(仅全视口主列表配 `MPageContent fill`);表体滚动,分页贴底。设置 `maxHeight` / `tableHeight` 时忽略。"
22150
22200
  },
22201
+ {
22202
+ "name": "columnWidths",
22203
+ "type": "Record<string, number> | null",
22204
+ "default": "null",
22205
+ "description": "列宽(`v-model:column-widths`)。"
22206
+ },
22207
+ {
22208
+ "name": "virtual",
22209
+ "type": "boolean",
22210
+ "default": "false",
22211
+ "description": "行虚拟滚动(需高度;展开行时跳过)。"
22212
+ },
22213
+ {
22214
+ "name": "virtualRowHeight",
22215
+ "type": "number",
22216
+ "default": "40",
22217
+ "description": "虚拟行高估算。"
22218
+ },
22219
+ {
22220
+ "name": "hiddenColumns",
22221
+ "type": "string[] | null",
22222
+ "default": "null",
22223
+ "description": "隐藏列键(`v-model:hidden-columns`)。"
22224
+ },
22225
+ {
22226
+ "name": "columnOrder",
22227
+ "type": "string[] | null",
22228
+ "default": "null",
22229
+ "description": "叶列顺序(`v-model:column-order`)。"
22230
+ },
22231
+ {
22232
+ "name": "showFooter",
22233
+ "type": "boolean",
22234
+ "default": "false",
22235
+ "description": "显示表尾。"
22236
+ },
22237
+ {
22238
+ "name": "footerMethod",
22239
+ "type": "TableFooterMethod | null",
22240
+ "default": "null",
22241
+ "description": "表尾数据。"
22242
+ },
22243
+ {
22244
+ "name": "spanMethod",
22245
+ "type": "TableSpanMethod | null",
22246
+ "default": "null",
22247
+ "description": "单元格合并。"
22248
+ },
22249
+ {
22250
+ "name": "treeConfig",
22251
+ "type": "TableTreeConfig | null",
22252
+ "default": "null",
22253
+ "description": "树形行。"
22254
+ },
22255
+ {
22256
+ "name": "expandConfig",
22257
+ "type": "TableExpandConfig | null",
22258
+ "default": "null",
22259
+ "description": "详情展开配置(与树互斥)。"
22260
+ },
22261
+ {
22262
+ "name": "checkboxConfig",
22263
+ "type": "TableCheckboxConfig | null",
22264
+ "default": "null",
22265
+ "description": "多选:级联 / `checkMethod` / `checkRowKeys` / `trigger` / `reserve`。"
22266
+ },
22267
+ {
22268
+ "name": "radioConfig",
22269
+ "type": "TableRadioConfig | null",
22270
+ "default": "null",
22271
+ "description": "单选:`strict` / `checkMethod` / `trigger`。"
22272
+ },
22151
22273
  {
22152
22274
  "name": "expandable",
22153
22275
  "type": "boolean",
22154
22276
  "default": "false",
22155
- "description": "显示展开列(也可由 `#expansion` 插槽隐式启用)。"
22277
+ "description": "显示展开列(也可由 `#expansion` 或 `expandConfig` 启用)。"
22156
22278
  },
22157
22279
  {
22158
22280
  "name": "striped",
@@ -22292,12 +22414,6 @@
22292
22414
  "default": "—",
22293
22415
  "description": "—"
22294
22416
  },
22295
- {
22296
- "name": "clickEventType",
22297
- "type": "TableClickEventType",
22298
- "default": "—",
22299
- "description": "—"
22300
- },
22301
22417
  {
22302
22418
  "name": "clickRowToExpand",
22303
22419
  "type": "boolean",
@@ -22370,18 +22486,6 @@
22370
22486
  "default": "—",
22371
22487
  "description": "—"
22372
22488
  },
22373
- {
22374
- "name": "hideHeader",
22375
- "type": "boolean",
22376
- "default": "—",
22377
- "description": "—"
22378
- },
22379
- {
22380
- "name": "hideRowsPerPage",
22381
- "type": "boolean",
22382
- "default": "—",
22383
- "description": "—"
22384
- },
22385
22489
  {
22386
22490
  "name": "indexColumnWidth",
22387
22491
  "type": "number",
@@ -22400,36 +22504,6 @@
22400
22504
  "default": "—",
22401
22505
  "description": "—"
22402
22506
  },
22403
- {
22404
- "name": "preventContextMenuRow",
22405
- "type": "boolean",
22406
- "default": "—",
22407
- "description": "—"
22408
- },
22409
- {
22410
- "name": "rowsItems",
22411
- "type": "number[]",
22412
- "default": "—",
22413
- "description": "—"
22414
- },
22415
- {
22416
- "name": "rowsOfPageSeparatorMessage",
22417
- "type": "string",
22418
- "default": "—",
22419
- "description": "—"
22420
- },
22421
- {
22422
- "name": "rowsPerPageMessage",
22423
- "type": "string",
22424
- "default": "—",
22425
- "description": "—"
22426
- },
22427
- {
22428
- "name": "showHeader",
22429
- "type": "boolean",
22430
- "default": "—",
22431
- "description": "—"
22432
- },
22433
22507
  {
22434
22508
  "name": "showIndex",
22435
22509
  "type": "boolean",
@@ -22460,12 +22534,6 @@
22460
22534
  "default": "—",
22461
22535
  "description": "—"
22462
22536
  },
22463
- {
22464
- "name": "tableNodeId",
22465
- "type": "string",
22466
- "default": "—",
22467
- "description": "—"
22468
- },
22469
22537
  {
22470
22538
  "name": "pt",
22471
22539
  "type": "[RootPassThrough](/docs/types#RootPassThrough) `{ root? }",
@@ -22479,16 +22547,36 @@
22479
22547
  "payload": "{ sortField?, sortOrder? }",
22480
22548
  "description": "排序变化。"
22481
22549
  },
22482
- {
22483
- "name": "page",
22484
- "payload": "number",
22485
- "description": "页码变化。"
22486
- },
22487
22550
  {
22488
22551
  "name": "row-click",
22489
- "payload": "{ row, index }",
22552
+ "payload": "{ row, index }`, `Event",
22490
22553
  "description": "行单击。"
22491
22554
  },
22555
+ {
22556
+ "name": "row-dblclick",
22557
+ "payload": "{ row, index }`, `Event",
22558
+ "description": "行双击。"
22559
+ },
22560
+ {
22561
+ "name": "row-contextmenu",
22562
+ "payload": "item`, `MouseEvent",
22563
+ "description": "行右键。"
22564
+ },
22565
+ {
22566
+ "name": "select-row",
22567
+ "payload": "TableItem",
22568
+ "description": "选中一行。"
22569
+ },
22570
+ {
22571
+ "name": "deselect-row",
22572
+ "payload": "TableItem",
22573
+ "description": "取消选中一行。"
22574
+ },
22575
+ {
22576
+ "name": "select-all",
22577
+ "payload": "—",
22578
+ "description": "全选当前页。"
22579
+ },
22492
22580
  {
22493
22581
  "name": "current-change",
22494
22582
  "payload": "row | null, oldRow | null",
@@ -22519,31 +22607,11 @@
22519
22607
  "payload": "string | number | null",
22520
22608
  "description": "当前行键 v-model。"
22521
22609
  },
22522
- {
22523
- "name": "contextmenuRow",
22524
- "payload": "—",
22525
- "description": "—"
22526
- },
22527
- {
22528
- "name": "deselectRow",
22529
- "payload": "—",
22530
- "description": "—"
22531
- },
22532
22610
  {
22533
22611
  "name": "filter",
22534
22612
  "payload": "—",
22535
22613
  "description": "—"
22536
22614
  },
22537
- {
22538
- "name": "selectAll",
22539
- "payload": "—",
22540
- "description": "—"
22541
- },
22542
- {
22543
- "name": "selectRow",
22544
- "payload": "—",
22545
- "description": "—"
22546
- },
22547
22615
  {
22548
22616
  "name": "update:expandedRowKeys",
22549
22617
  "payload": "—",
@@ -22555,17 +22623,22 @@
22555
22623
  "description": "—"
22556
22624
  },
22557
22625
  {
22558
- "name": "update:selectedItem",
22559
- "payload": "—",
22560
- "description": "—"
22626
+ "name": "update:columnWidths",
22627
+ "payload": "Record<string, number>",
22628
+ "description": "列宽 v-model。"
22561
22629
  },
22562
22630
  {
22563
- "name": "updatePageItems",
22564
- "payload": "—",
22565
- "description": "—"
22631
+ "name": "update:hiddenColumns",
22632
+ "payload": "string[]",
22633
+ "description": "隐藏列 v-model。"
22566
22634
  },
22567
22635
  {
22568
- "name": "updateTotalItems",
22636
+ "name": "update:columnOrder",
22637
+ "payload": "string[]",
22638
+ "description": "列顺序 v-model。"
22639
+ },
22640
+ {
22641
+ "name": "update:selectedItem",
22569
22642
  "payload": "—",
22570
22643
  "description": "—"
22571
22644
  }
@@ -22573,7 +22646,11 @@
22573
22646
  "slots": [
22574
22647
  {
22575
22648
  "name": "cell-{key}",
22576
- "description": "列 `{key}` 单元格,作用域 `{ row, value, column }`。"
22649
+ "description": "列 `{key}` 单元格,作用域 `{ row, value, column }`(可自行实现编辑器)。"
22650
+ },
22651
+ {
22652
+ "name": "footer",
22653
+ "description": "自定义表尾。"
22577
22654
  },
22578
22655
  {
22579
22656
  "name": "body-cell",
@@ -22616,8 +22693,8 @@
22616
22693
  "description": "自定义 `header` 内容。"
22617
22694
  },
22618
22695
  {
22619
- "name": "header-*",
22620
- "description": "动态插槽(前缀 `header-`)。"
22696
+ "name": "header-{key}",
22697
+ "description": "列头插槽(键名大小写与 `columns[].key` 一致)。"
22621
22698
  }
22622
22699
  ],
22623
22700
  "methods": [
@@ -22675,7 +22752,107 @@
22675
22752
  },
22676
22753
  {
22677
22754
  "name": "setFilters",
22678
- "description": "程序化设置筛选条件。"
22755
+ "description": "设置 / 清空筛选。"
22756
+ },
22757
+ {
22758
+ "name": "clearFilter",
22759
+ "description": "设置 / 清空筛选。"
22760
+ },
22761
+ {
22762
+ "name": "setColumnWidths",
22763
+ "description": "设置列宽(等同 `v-model:column-widths`)。"
22764
+ },
22765
+ {
22766
+ "name": "setHiddenColumns",
22767
+ "description": "设置隐藏列键(等同 `v-model:hidden-columns`)。"
22768
+ },
22769
+ {
22770
+ "name": "setColumnOrder",
22771
+ "description": "设置叶列顺序(等同 `v-model:column-order`)。"
22772
+ },
22773
+ {
22774
+ "name": "clearSort",
22775
+ "description": "清空排序。"
22776
+ },
22777
+ {
22778
+ "name": "getCheckboxRecords",
22779
+ "description": "当前多选行。"
22780
+ },
22781
+ {
22782
+ "name": "setCheckboxRow",
22783
+ "description": "设置行选中状态。"
22784
+ },
22785
+ {
22786
+ "name": "clearCheckboxRow",
22787
+ "description": "清空多选。"
22788
+ },
22789
+ {
22790
+ "name": "isCheckedByCheckboxRow",
22791
+ "description": "行是否选中。"
22792
+ },
22793
+ {
22794
+ "name": "isAllCheckboxChecked",
22795
+ "description": "当前页是否全选。"
22796
+ },
22797
+ {
22798
+ "name": "getCheckboxIndeterminateRecords",
22799
+ "description": "半选行(树级联)。"
22800
+ },
22801
+ {
22802
+ "name": "scrollTo",
22803
+ "description": "滚动定位。"
22804
+ },
22805
+ {
22806
+ "name": "scrollToRow",
22807
+ "description": "滚动定位。"
22808
+ },
22809
+ {
22810
+ "name": "setRowExpand",
22811
+ "description": "详情展开(非树模式)。"
22812
+ },
22813
+ {
22814
+ "name": "setAllRowExpand",
22815
+ "description": "详情展开(非树模式)。"
22816
+ },
22817
+ {
22818
+ "name": "toggleRowExpand",
22819
+ "description": "详情展开(非树模式)。"
22820
+ },
22821
+ {
22822
+ "name": "clearRowExpand",
22823
+ "description": "详情展开(非树模式)。"
22824
+ },
22825
+ {
22826
+ "name": "isRowExpandByRow",
22827
+ "description": "详情展开(非树模式)。"
22828
+ },
22829
+ {
22830
+ "name": "getRowExpandRecords",
22831
+ "description": "详情展开(非树模式)。"
22832
+ },
22833
+ {
22834
+ "name": "setTreeExpand",
22835
+ "description": "树节点展开。"
22836
+ },
22837
+ {
22838
+ "name": "setAllTreeExpand",
22839
+ "description": "树节点展开。"
22840
+ },
22841
+ {
22842
+ "name": "toggleTreeExpand",
22843
+ "description": "树节点展开。"
22844
+ },
22845
+ {
22846
+ "name": "clearTreeExpand",
22847
+ "description": "树节点展开。"
22848
+ },
22849
+ {
22850
+ "name": "isTreeExpandByRow",
22851
+ "description": "树节点展开。"
22852
+ },
22853
+ {
22854
+ "name": "getTreeExpandRecords",
22855
+ "description": "树节点展开。"
22679
22856
  }
22680
22857
  ],
22681
22858
  "examples": [
@@ -22721,7 +22898,7 @@
22721
22898
  "sectionId": "固定列",
22722
22899
  "lang": "vue",
22723
22900
  "preview": true,
22724
- "code": "<script setup lang=\"ts\">\nimport { MTable } from 'morya-ui'\n\nconst columns = [\n { key: 'name', label: '姓名', width: 120, fixed: 'left' as const },\n { key: 'q1', label: 'Q1 营收', width: 140 },\n { key: 'q2', label: 'Q2 营收', width: 140 },\n { key: 'q3', label: 'Q3 营收', width: 140 },\n { key: 'action', label: '操作', width: 100 },\n]\nconst rows = [\n { id: 1, name: 'Ada', q1: '12.4万', q2: '13.1万', q3: '14.0万', action: '编辑' },\n { id: 2, name: 'Lin', q1: '9.8万', q2: '10.2万', q3: '11.5万', action: '编辑' },\n]\n</script>\n\n<template>\n <MTable :columns=\"columns\" :rows=\"rows\" bordered :paginator=\"false\" />\n</template>",
22901
+ "code": "<script setup lang=\"ts\">\nimport { MTable } from 'morya-ui'\n\nconst columns = [\n { key: 'name', label: '姓名', width: 120, fixed: 'left' as const },\n { key: 'q1', label: 'Q1 营收', width: 140 },\n { key: 'q2', label: 'Q2 营收', width: 140 },\n { key: 'q3', label: 'Q3 营收', width: 140 },\n { key: 'action', label: '操作', width: 100, fixed: 'right' as const },\n]\nconst rows = [\n { id: 1, name: 'Ada', q1: '12.4万', q2: '13.1万', q3: '14.0万', action: '编辑' },\n { id: 2, name: 'Lin', q1: '9.8万', q2: '10.2万', q3: '11.5万', action: '编辑' },\n]\n</script>\n\n<template>\n <MTable :columns=\"columns\" :rows=\"rows\" bordered :paginator=\"false\" />\n</template>",
22725
22902
  "locale": "zh-CN"
22726
22903
  },
22727
22904
  {
@@ -22730,7 +22907,34 @@
22730
22907
  "sectionId": "展开行与列渲染",
22731
22908
  "lang": "vue",
22732
22909
  "preview": true,
22733
- "code": "<script setup lang=\"ts\">\nimport type { TableColumnDefinition, TableItem } from 'morya-ui'\nimport { MTable } from 'morya-ui'\n\ntype Row = { id: number; name: string; role: string; extra: string }\n\nconst columns: TableColumnDefinition[] = [\n { key: 'name', label: '姓名', render: (row) => `*${(row as Row).name}*` },\n { key: 'role', label: '角色' },\n]\nconst rows: Row[] = [\n { id: 1, name: 'Ada', role: 'Designer', extra: 'Design system' },\n]\n\nfunction extraOf(row: TableItem) {\n return (row as Row).extra\n}\n</script>\n\n<template>\n <MTable :columns=\"columns\" :rows=\"rows\" expandable bordered :paginator=\"false\">\n <template #expansion=\"{ row }\">\n {{ extraOf(row) }}\n </template>\n </MTable>\n</template>",
22910
+ "code": "<script setup lang=\"ts\">\nimport type { TableItem } from 'morya-ui'\nimport { MTable } from 'morya-ui'\n\ntype Row = { id: number; name: string; role: string; extra: string }\n\nconst columns = [\n { key: 'name', label: '姓名' },\n { key: 'role', label: '角色' },\n]\nconst rows: Row[] = [{ id: 1, name: 'Ada', role: '设计师', extra: '设计系统细节' }]\n\nfunction extraOf(row: TableItem) {\n return (row as Row).extra\n}\n</script>\n\n<template>\n <MTable :columns=\"columns\" :rows=\"rows\" expandable bordered :paginator=\"false\">\n <template #expansion=\"{ row }\">\n {{ extraOf(row) }}\n </template>\n </MTable>\n</template>",
22911
+ "locale": "zh-CN"
22912
+ },
22913
+ {
22914
+ "id": "列宽拖拽与表头筛选-1",
22915
+ "section": "列宽拖拽与表头筛选",
22916
+ "sectionId": "列宽拖拽与表头筛选",
22917
+ "lang": "vue",
22918
+ "preview": true,
22919
+ "code": "<script setup lang=\"ts\">\nimport type { TableColumnDefinition } from 'morya-ui'\nimport { MTable } from 'morya-ui'\nimport { ref } from 'vue'\n\nconst columns: TableColumnDefinition[] = [\n {\n key: 'name',\n label: '姓名',\n width: 140,\n resizable: true,\n filterable: true,\n },\n {\n key: 'status',\n label: '状态',\n width: 120,\n resizable: true,\n filterable: true,\n filters: [\n { text: '草稿', value: 'Draft' },\n { text: '上线', value: 'Live' },\n ],\n },\n { key: 'role', label: '角色', minWidth: 120 },\n]\n\nconst rows = [\n { id: 1, name: 'Ada', status: 'Draft', role: 'Designer' },\n { id: 2, name: 'Lin', status: 'Live', role: 'Engineer' },\n { id: 3, name: 'Kai', status: 'Live', role: 'Engineer' },\n { id: 4, name: 'Mia', status: 'Draft', role: 'Designer' },\n]\n\nconst columnWidths = ref<Record<string, number>>({})\n</script>\n\n<template>\n <MTable\n v-model:column-widths=\"columnWidths\"\n :columns=\"columns\"\n :rows=\"rows\"\n bordered\n :paginator=\"false\"\n />\n</template>",
22920
+ "locale": "zh-CN"
22921
+ },
22922
+ {
22923
+ "id": "虚拟滚动-1",
22924
+ "section": "虚拟滚动",
22925
+ "sectionId": "虚拟滚动",
22926
+ "lang": "vue",
22927
+ "preview": true,
22928
+ "code": "<script setup lang=\"ts\">\nimport { MTable } from 'morya-ui'\n\nconst columns = [\n { key: 'id', label: 'ID', width: 80 },\n { key: 'name', label: '姓名', minWidth: 160 },\n]\n\nconst rows = Array.from({ length: 5000 }, (_, i) => ({\n id: i + 1,\n name: `行 ${i + 1}`,\n}))\n</script>\n\n<template>\n <MTable\n :columns=\"columns\"\n :rows=\"rows\"\n virtual\n :virtual-row-height=\"40\"\n :max-height=\"320\"\n bordered\n :paginator=\"false\"\n />\n</template>",
22929
+ "locale": "zh-CN"
22930
+ },
22931
+ {
22932
+ "id": "多级表头-表尾与合并-1",
22933
+ "section": "多级表头、表尾与合并",
22934
+ "sectionId": "多级表头-表尾与合并",
22935
+ "lang": "vue",
22936
+ "preview": true,
22937
+ "code": "<script setup lang=\"ts\">\nimport type { TableColumnDefinition, TableItem } from 'morya-ui'\nimport { MTable } from 'morya-ui'\nimport { ref } from 'vue'\n\nconst columns: TableColumnDefinition[] = [\n {\n key: 'info',\n label: '基本信息',\n children: [\n { key: 'name', label: '姓名' },\n { key: 'role', label: '角色' },\n ],\n },\n { key: 'score', label: '分数', align: 'end' },\n]\n\nconst rows = ref<TableItem[]>([\n { id: 1, name: 'Ada', role: 'Designer', score: 96 },\n { id: 2, name: 'Lin', role: 'Engineer', score: 88 },\n { id: 3, name: 'Kai', role: 'Engineer', score: 91 },\n])\n\nconst hiddenColumns = ref<string[]>([])\n</script>\n\n<template>\n <MTable\n v-model:hidden-columns=\"hiddenColumns\"\n :columns=\"columns\"\n :rows=\"rows\"\n bordered\n show-footer\n :footer-method=\"({ data }) => [[\n '合计',\n '',\n data.reduce((sum, row) => sum + Number(row.score ?? 0), 0),\n ]]\"\n :span-method=\"({ column, rowIndex }) => {\n if (column.value === 'role' && rowIndex === 1) return { rowspan: 2, colspan: 1 }\n if (column.value === 'role' && rowIndex === 2) return { rowspan: 0, colspan: 0 }\n return { rowspan: 1, colspan: 1 }\n }\"\n :paginator=\"false\"\n />\n</template>",
22734
22938
  "locale": "zh-CN"
22735
22939
  },
22736
22940
  {
@@ -22742,13 +22946,22 @@
22742
22946
  "code": "<script setup lang=\"ts\">\nimport { MButton, MTable } from 'morya-ui'\nimport { ref } from 'vue'\n\nconst loading = ref(false)\nconst columns = [\n { key: 'name', label: '姓名', minWidth: 120 },\n { key: 'role', label: '角色', minWidth: 120 },\n]\n</script>\n\n<template>\n <div class=\"grid gap-3\">\n <MButton :label=\"loading ? '结束加载' : '开始加载'\" @click=\"loading = !loading\" />\n <MTable\n :columns=\"columns\"\n :rows=\"[]\"\n :loading=\"loading\"\n empty-text=\"还没有数据\"\n empty-description=\"创建第一条记录后会显示在这里\"\n :paginator=\"false\"\n />\n </div>\n</template>",
22743
22947
  "locale": "zh-CN"
22744
22948
  },
22949
+ {
22950
+ "id": "树形表格-1",
22951
+ "section": "树形表格",
22952
+ "sectionId": "树形表格",
22953
+ "lang": "vue",
22954
+ "preview": true,
22955
+ "code": "<script setup lang=\"ts\">\nimport type { TableColumnDefinition, TableItem } from 'morya-ui'\nimport { MTable } from 'morya-ui'\nimport { ref } from 'vue'\n\nconst columns: TableColumnDefinition[] = [\n { key: 'name', label: '名称' },\n { key: 'size', label: '大小' },\n]\n\nconst rows = ref<TableItem[]>([\n {\n id: 1,\n name: '应用',\n size: '100kb',\n children: [\n { id: 11, name: 'Vue', size: '25kb' },\n { id: 12, name: 'React', size: '30kb' },\n ],\n },\n {\n id: 2,\n name: '文档',\n size: '40kb',\n children: [{ id: 21, name: 'README.md', size: '4kb' }],\n },\n])\n\nconst expandedRowKeys = ref<Array<string | number>>([1])\nconst selection = ref<TableItem[]>([])\n</script>\n\n<template>\n <MTable\n v-model:expanded-row-keys=\"expandedRowKeys\"\n v-model:selection=\"selection\"\n selection-mode=\"multiple\"\n :columns=\"columns\"\n :rows=\"rows\"\n :tree-config=\"{ childrenField: 'children', indent: 16 }\"\n :checkbox-config=\"{ checkStrictly: false }\"\n bordered\n :paginator=\"false\"\n />\n</template>",
22956
+ "locale": "zh-CN"
22957
+ },
22745
22958
  {
22746
22959
  "id": "服务端模式-1",
22747
22960
  "section": "服务端模式",
22748
22961
  "sectionId": "服务端模式",
22749
22962
  "lang": "vue",
22750
22963
  "preview": true,
22751
- "code": "<script setup lang=\"ts\">\nimport { MTable } from 'morya-ui'\nimport { ref } from 'vue'\n\nconst columns = [\n { key: 'name', label: '项目', sortable: true, minWidth: 140 },\n { key: 'owner', label: '负责人', minWidth: 100 },\n]\nconst rows = ref([\n { id: 1, name: 'Landing', owner: 'Ada' },\n { id: 2, name: 'Dashboard', owner: 'Lin' },\n])\nconst serverOptions = ref({ page: 1, rowsPerPage: 10, sortBy: 'name', sortType: 'asc' as const })\nconst total = ref(42)\n</script>\n\n<template>\n <MTable\n v-model:server-options=\"serverOptions\"\n :columns=\"columns\"\n :rows=\"rows\"\n :server-items-length=\"total\"\n :loading=\"false\"\n />\n</template>",
22964
+ "code": "<script setup lang=\"ts\">\nimport { MTable } from 'morya-ui'\nimport { ref } from 'vue'\n\nconst columns = [\n { key: 'name', label: '项目', sortable: true, minWidth: 140 },\n { key: 'owner', label: '负责人', minWidth: 100 },\n]\nconst rows = ref([\n { id: 1, name: 'Landing', owner: 'Ada' },\n { id: 2, name: 'Dashboard', owner: 'Lin' },\n])\nconst serverOptions = ref({ page: 1, rowsPerPage: 10, sortBy: 'name', sortType: 'asc' as const })\nconst total = ref(42)\n</script>\n\n<template>\n <MTable\n v-model:server-options=\"serverOptions\"\n :columns=\"columns\"\n :rows=\"rows\"\n :server-total=\"total\"\n :loading=\"false\"\n />\n</template>",
22752
22965
  "locale": "zh-CN"
22753
22966
  },
22754
22967
  {
@@ -22775,7 +22988,7 @@
22775
22988
  "sectionId": "类型",
22776
22989
  "lang": "ts",
22777
22990
  "preview": false,
22778
- "code": "type TableClickEventType = 'single' | 'double'",
22991
+ "code": "type TableFilterOption = | { field: string; comparison: 'between'; criteria: [number, number] }\n | { field: string; comparison: '=' | '!='; criteria: number | string }\n | { field: string; comparison: '>' | '>=' | '<' | '<='; criteria: number }\n | { field: number | string; comparison: 'in'; criteria: number[] | string[] }\n | { field: string; comparison: (value: unknown, criteria: string) => boolean; criteria: string }",
22779
22992
  "locale": "zh-CN"
22780
22993
  },
22781
22994
  {
@@ -22784,7 +22997,7 @@
22784
22997
  "sectionId": "类型",
22785
22998
  "lang": "ts",
22786
22999
  "preview": false,
22787
- "code": "type TableFilterOption = | { field: string; comparison: 'between'; criteria: [number, number] }\n | { field: string; comparison: '=' | '!='; criteria: number | string }\n | { field: string; comparison: '>' | '>=' | '<' | '<='; criteria: number }\n | { field: number | string; comparison: 'in'; criteria: number[] | string[] }\n | { field: string; comparison: (value: unknown, criteria: string) => boolean; criteria: string }",
23000
+ "code": "type TableHeaderItemClassName = string | ((header: TableHeader, columnNumber: number) => string)",
22788
23001
  "locale": "zh-CN"
22789
23002
  },
22790
23003
  {
@@ -22793,7 +23006,7 @@
22793
23006
  "sectionId": "类型",
22794
23007
  "lang": "ts",
22795
23008
  "preview": false,
22796
- "code": "type TableHeaderItemClassName = string | ((header: TableHeader, columnNumber: number) => string)",
23009
+ "code": "type TableBodyRowClassName = string | ((item: TableItem, rowNumber: number) => string)",
22797
23010
  "locale": "zh-CN"
22798
23011
  },
22799
23012
  {
@@ -22802,7 +23015,7 @@
22802
23015
  "sectionId": "类型",
22803
23016
  "lang": "ts",
22804
23017
  "preview": false,
22805
- "code": "type TableBodyRowClassName = string | ((item: TableItem, rowNumber: number) => string)",
23018
+ "code": "type TableBodyItemClassName = string | ((column: string, rowNumber: number) => string)",
22806
23019
  "locale": "zh-CN"
22807
23020
  },
22808
23021
  {
@@ -22811,7 +23024,7 @@
22811
23024
  "sectionId": "类型",
22812
23025
  "lang": "ts",
22813
23026
  "preview": false,
22814
- "code": "type TableBodyItemClassName = string | ((column: string, rowNumber: number) => string)",
23027
+ "code": "interface TableTreeConfig {\n childrenField?: string // default 'children'\n indent?: number // default 16\n expandAll?: boolean\n accordion?: boolean\n trigger?: 'default' | 'row'\n lazy?: boolean\n hasChildField?: string // default 'hasChild'\n loadMethod?: (row: TableItem) => Promise<TableItem[]> | TableItem[]\n transform?: boolean // flat parentId → tree\n rowField?: string\n parentField?: string // default 'parentId'\n treeNode?: string // column key for toggler; default first column\n showLine?: boolean\n}",
22815
23028
  "locale": "zh-CN"
22816
23029
  },
22817
23030
  {
@@ -22820,7 +23033,7 @@
22820
23033
  "sectionId": "类型",
22821
23034
  "lang": "ts",
22822
23035
  "preview": false,
22823
- "code": "interface TableColumnDefinition {\n key: string\n label: string\n width?: number\n minWidth?: number\n sortable?: boolean\n fixed?: boolean | 'left' | 'right'\n align?: 'start' | 'center' | 'end' | 'left' | 'right'\n render?: (row: TableItem) => unknown\n filterable?: boolean\n filters?: { label: string; value: string | number }[]\n showOverflowTooltip?: boolean\n}",
23036
+ "code": "interface TableColumnDefinition {\n key: string\n label: string\n width?: number\n minWidth?: number\n sortable?: boolean\n fixed?: boolean | 'left' | 'right'\n align?: 'start' | 'center' | 'end'\n render?: (row: TableItem) => unknown\n showOverflowTooltip?: boolean\n}",
22824
23037
  "locale": "zh-CN"
22825
23038
  },
22826
23039
  {
@@ -22877,6 +23090,42 @@
22877
23090
  "code": "<script setup lang=\"ts\">\nimport type { TableItem } from 'morya-ui'\nimport { MTable } from 'morya-ui'\n\ntype Row = { id: number; name: string; role: string; extra: string }\n\nconst columns = [\n { key: 'name', label: 'Name' },\n { key: 'role', label: 'Role' },\n]\nconst rows: Row[] = [{ id: 1, name: 'Ada', role: 'Designer', extra: 'Design system' }]\n\nfunction extraOf(row: TableItem) {\n return (row as Row).extra\n}\n</script>\n\n<template>\n <MTable :columns=\"columns\" :rows=\"rows\" expandable bordered :paginator=\"false\">\n <template #expansion=\"{ row }\">\n {{ extraOf(row) }}\n </template>\n </MTable>\n</template>",
22878
23091
  "locale": "en-US"
22879
23092
  },
23093
+ {
23094
+ "id": "fixed-columns-1",
23095
+ "section": "Fixed columns",
23096
+ "sectionId": "fixed-columns",
23097
+ "lang": "vue",
23098
+ "preview": true,
23099
+ "code": "<script setup lang=\"ts\">\nimport { MTable } from 'morya-ui'\n\nconst columns = [\n { key: 'name', label: 'Name', width: 120, fixed: 'left' as const },\n { key: 'q1', label: 'Q1 Revenue', width: 140 },\n { key: 'q2', label: 'Q2 Revenue', width: 140 },\n { key: 'q3', label: 'Q3 Revenue', width: 140 },\n { key: 'action', label: 'Action', width: 100, fixed: 'right' as const },\n]\nconst rows = [\n { id: 1, name: 'Ada', q1: '124k', q2: '131k', q3: '140k', action: 'Edit' },\n { id: 2, name: 'Lin', q1: '98k', q2: '102k', q3: '115k', action: 'Edit' },\n]\n</script>\n\n<template>\n <MTable :columns=\"columns\" :rows=\"rows\" bordered :paginator=\"false\" />\n</template>",
23100
+ "locale": "en-US"
23101
+ },
23102
+ {
23103
+ "id": "column-resize-and-header-filters-1",
23104
+ "section": "Column resize and header filters",
23105
+ "sectionId": "column-resize-and-header-filters",
23106
+ "lang": "vue",
23107
+ "preview": true,
23108
+ "code": "<script setup lang=\"ts\">\nimport type { TableColumnDefinition } from 'morya-ui'\nimport { MTable } from 'morya-ui'\nimport { ref } from 'vue'\n\nconst columns: TableColumnDefinition[] = [\n {\n key: 'name',\n label: 'Name',\n width: 140,\n resizable: true,\n filterable: true,\n },\n {\n key: 'status',\n label: 'Status',\n width: 120,\n resizable: true,\n filterable: true,\n filters: [\n { text: 'Draft', value: 'Draft' },\n { text: 'Live', value: 'Live' },\n ],\n },\n { key: 'role', label: 'Role', minWidth: 120 },\n]\n\nconst rows = [\n { id: 1, name: 'Ada', status: 'Draft', role: 'Designer' },\n { id: 2, name: 'Lin', status: 'Live', role: 'Engineer' },\n { id: 3, name: 'Kai', status: 'Live', role: 'Engineer' },\n { id: 4, name: 'Mia', status: 'Draft', role: 'Designer' },\n]\n\nconst columnWidths = ref<Record<string, number>>({})\n</script>\n\n<template>\n <MTable\n v-model:column-widths=\"columnWidths\"\n :columns=\"columns\"\n :rows=\"rows\"\n bordered\n :paginator=\"false\"\n />\n</template>",
23109
+ "locale": "en-US"
23110
+ },
23111
+ {
23112
+ "id": "virtual-scroll-1",
23113
+ "section": "Virtual scroll",
23114
+ "sectionId": "virtual-scroll",
23115
+ "lang": "vue",
23116
+ "preview": true,
23117
+ "code": "<script setup lang=\"ts\">\nimport { MTable } from 'morya-ui'\n\nconst columns = [\n { key: 'id', label: 'ID', width: 80 },\n { key: 'name', label: 'Name', minWidth: 160 },\n]\n\nconst rows = Array.from({ length: 5000 }, (_, i) => ({\n id: i + 1,\n name: `Row ${i + 1}`,\n}))\n</script>\n\n<template>\n <MTable\n :columns=\"columns\"\n :rows=\"rows\"\n virtual\n :virtual-row-height=\"40\"\n :max-height=\"320\"\n bordered\n :paginator=\"false\"\n />\n</template>",
23118
+ "locale": "en-US"
23119
+ },
23120
+ {
23121
+ "id": "multi-header-footer-and-merges-1",
23122
+ "section": "Multi-header, footer, and merges",
23123
+ "sectionId": "multi-header-footer-and-merges",
23124
+ "lang": "vue",
23125
+ "preview": true,
23126
+ "code": "<script setup lang=\"ts\">\nimport type { TableColumnDefinition, TableItem } from 'morya-ui'\nimport { MTable } from 'morya-ui'\nimport { ref } from 'vue'\n\nconst columns: TableColumnDefinition[] = [\n {\n key: 'info',\n label: 'Info',\n children: [\n { key: 'name', label: 'Name' },\n { key: 'role', label: 'Role' },\n ],\n },\n { key: 'score', label: 'Score', align: 'end' },\n]\n\nconst rows = ref<TableItem[]>([\n { id: 1, name: 'Ada', role: 'Designer', score: 96 },\n { id: 2, name: 'Lin', role: 'Engineer', score: 88 },\n { id: 3, name: 'Kai', role: 'Engineer', score: 91 },\n])\n\nconst hiddenColumns = ref<string[]>([])\n</script>\n\n<template>\n <MTable\n v-model:hidden-columns=\"hiddenColumns\"\n :columns=\"columns\"\n :rows=\"rows\"\n bordered\n show-footer\n :footer-method=\"({ data }) => [[\n 'Total',\n '',\n data.reduce((sum, row) => sum + Number(row.score ?? 0), 0),\n ]]\"\n :span-method=\"({ column, rowIndex }) => {\n if (column.value === 'role' && rowIndex === 1) return { rowspan: 2, colspan: 1 }\n if (column.value === 'role' && rowIndex === 2) return { rowspan: 0, colspan: 0 }\n return { rowspan: 1, colspan: 1 }\n }\"\n :paginator=\"false\"\n />\n</template>",
23127
+ "locale": "en-US"
23128
+ },
22880
23129
  {
22881
23130
  "id": "empty-and-loading-1",
22882
23131
  "section": "Empty and loading",
@@ -22886,6 +23135,24 @@
22886
23135
  "code": "<script setup lang=\"ts\">\nimport { MButton, MTable } from 'morya-ui'\nimport { ref } from 'vue'\n\nconst loading = ref(false)\nconst columns = [\n { key: 'name', label: 'Name', minWidth: 120 },\n { key: 'role', label: 'Role', minWidth: 120 },\n]\n</script>\n\n<template>\n <div class=\"grid gap-3\">\n <MButton :label=\"loading ? 'Stop loading' : 'Start loading'\" @click=\"loading = !loading\" />\n <MTable\n :columns=\"columns\"\n :rows=\"[]\"\n :loading=\"loading\"\n empty-text=\"No data yet\"\n empty-description=\"Records will appear here after you create the first one\"\n :paginator=\"false\"\n />\n </div>\n</template>",
22887
23136
  "locale": "en-US"
22888
23137
  },
23138
+ {
23139
+ "id": "tree-table-1",
23140
+ "section": "Tree table",
23141
+ "sectionId": "tree-table",
23142
+ "lang": "vue",
23143
+ "preview": true,
23144
+ "code": "<script setup lang=\"ts\">\nimport type { TableColumnDefinition, TableItem } from 'morya-ui'\nimport { MTable } from 'morya-ui'\nimport { ref } from 'vue'\n\nconst columns: TableColumnDefinition[] = [\n { key: 'name', label: 'Name' },\n { key: 'size', label: 'Size' },\n]\n\nconst rows = ref<TableItem[]>([\n {\n id: 1,\n name: 'Applications',\n size: '100kb',\n children: [\n { id: 11, name: 'Vue', size: '25kb' },\n { id: 12, name: 'React', size: '30kb' },\n ],\n },\n {\n id: 2,\n name: 'Documents',\n size: '40kb',\n children: [{ id: 21, name: 'README.md', size: '4kb' }],\n },\n])\n\nconst expandedRowKeys = ref<Array<string | number>>([1])\nconst selection = ref<TableItem[]>([])\n</script>\n\n<template>\n <MTable\n v-model:expanded-row-keys=\"expandedRowKeys\"\n v-model:selection=\"selection\"\n selection-mode=\"multiple\"\n :columns=\"columns\"\n :rows=\"rows\"\n :tree-config=\"{ childrenField: 'children', indent: 16 }\"\n :checkbox-config=\"{ checkStrictly: false }\"\n bordered\n :paginator=\"false\"\n />\n</template>",
23145
+ "locale": "en-US"
23146
+ },
23147
+ {
23148
+ "id": "server-mode-1",
23149
+ "section": "Server mode",
23150
+ "sectionId": "server-mode",
23151
+ "lang": "vue",
23152
+ "preview": true,
23153
+ "code": "<script setup lang=\"ts\">\nimport { MTable } from 'morya-ui'\nimport { ref } from 'vue'\n\nconst columns = [\n { key: 'name', label: '项目', sortable: true, minWidth: 140 },\n { key: 'owner', label: '负责人', minWidth: 100 },\n]\nconst rows = ref([\n { id: 1, name: 'Landing', owner: 'Ada' },\n { id: 2, name: 'Dashboard', owner: 'Lin' },\n])\nconst serverOptions = ref({ page: 1, rowsPerPage: 10, sortBy: 'name', sortType: 'asc' as const })\nconst total = ref(42)\n</script>\n\n<template>\n <MTable\n v-model:server-options=\"serverOptions\"\n :columns=\"columns\"\n :rows=\"rows\"\n :server-total=\"total\"\n :loading=\"false\"\n />\n</template>",
23154
+ "locale": "en-US"
23155
+ },
22889
23156
  {
22890
23157
  "id": "types-1",
22891
23158
  "section": "Types",
@@ -22901,7 +23168,7 @@
22901
23168
  "sectionId": "types",
22902
23169
  "lang": "ts",
22903
23170
  "preview": false,
22904
- "code": "interface TableColumnDefinition {\n key: string\n label: string\n width?: number\n minWidth?: number\n sortable?: boolean\n fixed?: boolean | 'left' | 'right'\n align?: 'start' | 'center' | 'end' | 'left' | 'right'\n render?: (row: TableItem) => unknown\n filterable?: boolean\n filters?: { label: string; value: string | number }[]\n showOverflowTooltip?: boolean\n}",
23171
+ "code": "interface TableColumnDefinition {\n key: string\n label: string\n width?: number\n minWidth?: number\n sortable?: boolean\n fixed?: boolean | 'left' | 'right'\n align?: 'start' | 'center' | 'end'\n render?: (row: TableItem) => unknown\n filterable?: boolean\n filters?: TableColumnFilter[]\n resizable?: boolean\n children?: TableColumnDefinition[]\n showOverflowTooltip?: boolean\n}",
22905
23172
  "locale": "en-US"
22906
23173
  },
22907
23174
  {
@@ -22922,7 +23189,7 @@
22922
23189
  {
22923
23190
  "id": "overview",
22924
23191
  "title": "",
22925
- "body": "# Table\n\n`MTable` 用于展示结构化行数据。通过 `columns` 定义列、`rows` 传入数据;内置客户端排序、筛选、分页与行选择,也支持服务端分页模式。\n\n列宽规则:\n\n- 设置了 `width` 的列为固定宽度\n- 未设 `width` 的列以 `minWidth`(默认 `80`)为弹性下限;`fit` 为 `true`(默认)时,剩余宽度按比例分配给弹性列\n- 总最小宽度超出容器时出现横向滚动\n- 需要表体自己滚动时用 `maxHeight` / `tableHeight`;与 `MLayout` 根滚动叠用时优先固定表高,避免双层滚动条\n- **全视口主列表(按需)**:`MPageContent fill` + `MTable fill paginator`——表体滚动、分页贴底;嵌入表/短页不要硬套 `fill`"
23192
+ "body": "# Table\n\n`MTable` 用于展示结构化行数据。通过 `columns` 定义列、`rows` 传入数据;内置客户端排序、筛选、分页与行选择,也支持服务端分页模式。多选表头「全选」仅作用于当前页。\n\n列宽规则:\n\n- 设置了 `width` 的列为固定宽度\n- 未设 `width` 的列以 `minWidth`(默认 `80`)为弹性下限;`fit` 为 `true`(默认)时,剩余宽度按比例分配给弹性列\n- 总最小宽度超出容器时出现横向滚动\n- 需要表体自己滚动时用 `maxHeight` / `tableHeight`;与 `MLayout` 根滚动叠用时优先固定表高,避免双层滚动条\n- 全视口主列表可用 `MPageContent fill` + `MTable fill paginator`(表体滚动、分页贴底);嵌入表或短页不必使用 `fill`"
22926
23193
  },
22927
23194
  {
22928
23195
  "id": "引入",
@@ -22937,65 +23204,90 @@
22937
23204
  {
22938
23205
  "id": "行选择",
22939
23206
  "title": "行选择",
22940
- "body": "多选配合 `selection-mode=\"multiple\"` 与 `v-model:selection`;单选使用 `selection-mode=\"single\"` 与 `v-model:selected-item`。\n\n```vue preview src=\"./demos/Selection.zh.vue\"\n```"
23207
+ "body": "多选配合 `selection-mode=\"multiple\"` 与 `v-model:selection`;单选使用 `selection-mode=\"single\"` 与 `v-model:selected-item`。表头全选仅选中当前页。\n\n```vue preview src=\"./demos/Selection.zh.vue\"\n```"
22941
23208
  },
22942
23209
  {
22943
23210
  "id": "筛选与分页",
22944
23211
  "title": "筛选与分页",
22945
- "body": "客户端筛选可通过 `search-value` / `filter-options`;分页开启 `paginator` 并配合 `v-model:page` 与 `rows-per-page`。\n\n```vue preview src=\"./demos/FilterAndPagination.zh.vue\"\n```"
23212
+ "body": "客户端筛选可通过 `search-value` / `filter-options`;分页开启 `paginator` 并配合 `v-model:page` 与 `rows-per-page`(受控同步)。\n\n```vue preview src=\"./demos/FilterAndPagination.zh.vue\"\n```"
22946
23213
  },
22947
23214
  {
22948
23215
  "id": "固定列",
22949
23216
  "title": "固定列",
22950
- "body": "列定义中设置 `fixed: 'left'` 可冻结左侧列(当前批次支持左固定)。\n\n```vue preview src=\"./demos/ExpandableRows.zh.vue\"\n```"
23217
+ "body": "列定义中设置 `fixed: 'left' | 'right'`(或 `fixed: true` 视为左固定)。\n\n```vue preview src=\"./demos/FixedColumns.zh.vue\"\n```"
22951
23218
  },
22952
23219
  {
22953
23220
  "id": "展开行与列渲染",
22954
23221
  "title": "展开行与列渲染",
22955
- "body": "列可通过 `render` 函数渲染;展开行设置 `expandable`,详情内容由插槽 `expansion` 提供。`cell-{key}` 插槽优先于 `render`。\n\n```vue preview src=\"./demos/EmptyAndLoading.zh.vue\"\n```"
23222
+ "body": "列可通过 `render` 或 `#cell-{key}` 自定义单元格。展开行设置 `expandable`(或 `expandConfig`),详情由 `#expansion` 提供。树模式下 `expandedRowKeys` 用于树节点展开,不可同时用于详情展开。\n\n```vue preview src=\"./demos/ExpandableRows.zh.vue\"\n```"
23223
+ },
23224
+ {
23225
+ "id": "列宽拖拽与表头筛选",
23226
+ "title": "列宽拖拽与表头筛选",
23227
+ "body": "列设置 `resizable` 可拖拽改宽(`v-model:column-widths`);`filterable` 显示表头筛选,可选 `filters` 为多选选项,否则为文本包含筛选。\n\n```vue preview src=\"./demos/ResizeAndFilter.zh.vue\"\n```"
23228
+ },
23229
+ {
23230
+ "id": "虚拟滚动",
23231
+ "title": "虚拟滚动",
23232
+ "body": "开启 `virtual`,并提供 `maxHeight` / `tableHeight` / `fill` 之一。展开行场景会自动降级为普通渲染。\n\n```vue preview src=\"./demos/VirtualScroll.zh.vue\"\n```"
23233
+ },
23234
+ {
23235
+ "id": "多级表头-表尾与合并",
23236
+ "title": "多级表头、表尾与合并",
23237
+ "body": "列支持 `children` 多级表头;`show-footer` + `footer-method` 渲染合计;`span-method` 合并单元格。\n\n```vue preview src=\"./demos/GridFeatures.zh.vue\"\n```"
22956
23238
  },
22957
23239
  {
22958
23240
  "id": "空态与加载",
22959
23241
  "title": "空态与加载",
22960
- "body": "```vue preview src=\"./demos/Demo6.vue\"\n```"
23242
+ "body": "```vue preview src=\"./demos/EmptyAndLoading.zh.vue\"\n```"
23243
+ },
23244
+ {
23245
+ "id": "树形表格",
23246
+ "title": "树形表格",
23247
+ "body": "传入 `tree-config` 启用树模式:嵌套 `children`,或 `transform` + `parentId` 扁平数据。展开状态用 `v-model:expanded-row-keys`。支持 `expandAll` / `expandRowKeys`、`accordion`、`trigger`、`toggleMethod`、懒加载 `lazy` + `loadMethod`。\n\n实例方法:`setTreeExpand`、`setAllTreeExpand`、`toggleTreeExpand`、`isTreeExpandByRow`、`getTreeExpandRecords`、`clearTreeExpand`。\n\n树 + 多选时默认父子级联与半选(`checkbox-config.check-strictly=false`);`checkMethod` 可禁用单行勾选。\n\n```vue preview src=\"./demos/Tree.zh.vue\"\n```"
22961
23248
  },
22962
23249
  {
22963
23250
  "id": "服务端模式",
22964
23251
  "title": "服务端模式",
22965
- "body": "传入 `server-options` 与 `server-items-length`,通过 `v-model:server-options` 同步页码、每页条数与排序字段。\n\n```vue preview src=\"./demos/Demo7.vue\"\n```"
23252
+ "body": "传入 `server-options` 与 `server-total`,通过 `v-model:server-options` 同步页码、每页条数与排序字段。\n\n```vue preview src=\"./demos/Demo7.vue\"\n```"
23253
+ },
23254
+ {
23255
+ "id": "breaking-changes",
23256
+ "title": "Breaking changes",
23257
+ "body": "- 移除内置单元格编辑:`editConfig`、列 `editable`、`edit-change`、`#edit-{key}`;请用 `#cell-{key}` / `render` 自定义\n- 移除 `MTreeTable`(含 `morya-ui/tree-table`);树表改用 `MTable` + `treeConfig`\n- `serverItemsLength` → `serverTotal`;`rowsItems` → `pageSizes`\n- `hideHeader` 移除;改用 `showHeader`(默认 `true`)\n- `hideRowsPerPage` 移除;改用 `showRowsPerPage`(默认 `true`)\n- 移除:`clickEventType`、`rowsPerPageMessage`、`rowsOfPageSeparatorMessage`、`preventContextMenuRow`、`tableNodeId`\n- 事件:`contextmenuRow` → `row-contextmenu`;`selectRow` / `deselectRow` / `selectAll` → `select-row` / `deselect-row` / `select-all`\n- 移除事件:`updatePageItems`、`updateTotalItems`、`page`(保留 `update:page`)\n- 行交互:始终同时支持单击 / 双击(`row-click` / `row-dblclick`);右键始终 `preventDefault` 并抛出 `row-contextmenu`"
22966
23258
  },
22967
23259
  {
22968
23260
  "id": "tablecolumndefinition",
22969
23261
  "title": "TableColumnDefinition",
22970
- "body": "| 字段 | 类型 | 说明 |\n| --- | --- | --- |\n| `key` | `string` | 列字段名(绑定行数据的键)。 |\n| `label` | `string` | 列头文案。 |\n| `width` | `number` | 固定列宽(px)。 |\n| `minWidth` | `number` | 弹性列最小宽度,默认 `80`。 |\n| `sortable` | `boolean` | 是否可排序。 |\n| `fixed` | `boolean \\| 'left' \\| 'right'` | 固定列;当前实现左固定。 |\n| `align` | `'start' \\| 'center' \\| 'end'` | 单元格对齐。 |\n| `render` | `(row) => unknown` | 自定义单元格渲染。 |\n| `showOverflowTooltip` | `boolean` | 该列文本溢出时显示 Tooltip。 |"
23262
+ "body": "| 字段 | 类型 | 说明 |\n| --- | --- | --- |\n| `key` | `string` | 列字段名(绑定行数据的键)。 |\n| `label` | `string` | 列头文案。 |\n| `width` | `number` | 固定列宽(px)。 |\n| `minWidth` | `number` | 弹性列最小宽度,默认 `80`。 |\n| `sortable` | `boolean` | 是否可排序。 |\n| `fixed` | `boolean \\| 'left' \\| 'right'` | 固定列;`true` 等同 `'left'`。 |\n| `align` | `'start' \\| 'center' \\| 'end'` | 单元格对齐。 |\n| `render` | `(row) => unknown` | 自定义单元格渲染。 |\n| `showOverflowTooltip` | `boolean` | 该列文本溢出时显示 Tooltip。 |\n| `resizable` | `boolean` | 可拖拽调整列宽。 |\n| `filterable` | `boolean` | 显示表头筛选。 |\n| `filters` | `TableColumnFilter[]` | 表头筛选选项;省略则为文本筛选。 |\n| `children` | `TableColumnDefinition[]` | 多级表头子列。 |"
22971
23263
  },
22972
23264
  {
22973
23265
  "id": "props",
22974
23266
  "title": "Props",
22975
- "body": "| 参数 | 类型 | 默认值 | 说明 |\n| --- | --- | --- | --- |\n| `columns` | `TableColumnDefinition[]` | — | 列定义。 |\n| `rows` | `TableItem[]` | — | 行数据。 |\n| `fit` | `boolean` | `true` | 弹性列是否撑满表格宽度。 |\n| `selectionMode` | `'single' \\| 'multiple' \\| null` | `null` | 行选择模式。 |\n| `selection` | `TableItem[] \\| null` | `null` | 多选绑定(`v-model:selection`)。 |\n| `selectedItem` | `TableItem \\| null` | `null` | 单选绑定(`v-model:selected-item`)。 |\n| `serverOptions` | `TableServerOptions \\| null` | `null` | 服务端分页/排序选项。 |\n| `serverItemsLength` | `number` | `0` | 服务端总条数。 |\n| `paginator` | `boolean` | `false` | 显示内置分页页脚。 |\n| `page` | `number` | `1` | 当前页(`v-model:page`)。 |\n| `rowsPerPage` | `number` | `25` | 每页条数。 |\n| `fill` | `boolean` | `false` | 撑满父级剩余高度(仅全视口主列表配 `MPageContent fill`);表体滚动,分页贴底。设置 `maxHeight` / `tableHeight` 时忽略。 |\n| `expandable` | `boolean` | `false` | 显示展开列(也可由 `#expansion` 插槽隐式启用)。 |\n| `striped` | `boolean` | `false` | 斑马纹行。 |\n| `bordered` | `boolean` | `false` | 单元格边框。 |\n| `highlightCurrent` | `boolean` | `false` | 高亮当前行,配合 `v-model:current-row-key`。 |\n| `rowHover` | `boolean` | `true` | 行 hover 高亮。 |\n| `sortField` / `sortOrder` | — | — | 受控排序字段与方向。 |\n| `sortMode` | `'client' \\| 'emit'` | `'client'` | 客户端排序或仅抛出排序事件。 |\n| `searchField` / `searchValue` | — | — | 客户端搜索。 |\n| `filterOptions` | `TableFilterOption[]` | `null` | 结构化筛选条件。 |\n| `loading` | `boolean` | `false` | 加载中。 |\n| `emptyText` | `string` | — | 空数据文案。 |\n| `emptyDescription` | `string` | — | 空数据补充说明。 |\n| `maxHeight` | `number \\| null` | `null` | 表格最大高度,超出滚动。 |\n| `showOverflowTooltip` | `boolean` | `false` | 全局单元格溢出 Tooltip。 |\n| `rowKey` | `string` | `'id'` | 行唯一键字段。 |\n| `size` | `'sm' \\| 'md' \\| 'lg'` | — | 表格密度。 |\n| `ariaLabel` | `string` | — | — |\n| `bodyExpandRowClassName` | `TableBodyRowClassName` | — | — |\n| `bodyItemClassName` | `TableBodyItemClassName` | — | — |\n| `bodyRowClassName` | `TableBodyRowClassName` | — | — |\n| `bodyTextDirection` | `TableTextDirection` | — | — |\n| `checkboxColumnWidth` | `number \\| null` | — | — |\n| `clickEventType` | `TableClickEventType` | — | — |\n| `clickRowToExpand` | `boolean` | — | — |\n| `currentRowKey` | `string \\| number \\| null` | — | — |\n| `expandColumnWidth` | `number` | — | — |\n| `expandedRowKeys` | `Array<string \\| number>` | — | — |\n| `filters` | `Record<string, unknown> \\| null` | — | — |\n| `fixedCheckbox` | `boolean` | — | — |\n| `fixedExpand` | `boolean` | — | — |\n| `fixedHeader` | `boolean` | — | — |\n| `fixedIndex` | `boolean` | — | — |\n| `headerClassName` | `string` | — | — |\n| `headerItemClassName` | `TableHeaderItemClassName` | — | — |\n| `headerTextDirection` | `TableTextDirection` | — | — |\n| `hideHeader` | `boolean` | — | — |\n| `hideRowsPerPage` | `boolean` | — | — |\n| `indexColumnWidth` | `number` | — | — |\n| `multiSort` | `boolean` | — | — |\n| `mustSort` | `boolean` | — | — |\n| `preventContextMenuRow` | `boolean` | — | — |\n| `rowsItems` | `number[]` | — | — |\n| `rowsOfPageSeparatorMessage` | `string` | — | — |\n| `rowsPerPageMessage` | `string` | — | — |\n| `showHeader` | `boolean` | — | — |\n| `showIndex` | `boolean` | — | — |\n| `showIndexSymbol` | `string` | — | — |\n| `tableClassName` | `string` | — | — |\n| `tableHeight` | `number \\| null` | — | — |\n| `tableMinHeight` | `number` | — | — |\n| `tableNodeId` | `string` | — | — |\n| `pt` | [RootPassThrough](/docs/types#RootPassThrough) `{ root? }` | — | DOM 透传,见 [样式与 attrs](/docs/attrs). |"
23267
+ "body": "| 参数 | 类型 | 默认值 | 说明 |\n| --- | --- | --- | --- |\n| `columns` | `TableColumnDefinition[]` | — | 列定义。 |\n| `rows` | `TableItem[]` | — | 行数据。 |\n| `fit` | `boolean` | `true` | 弹性列是否撑满表格宽度。 |\n| `selectionMode` | `'single' \\| 'multiple' \\| null` | `null` | 行选择模式。 |\n| `selection` | `TableItem[] \\| null` | `null` | 多选绑定(`v-model:selection`)。 |\n| `selectedItem` | `TableItem \\| null` | `null` | 单选绑定(`v-model:selected-item`)。 |\n| `serverOptions` | `TableServerOptions \\| null` | `null` | 服务端分页/排序选项。 |\n| `serverTotal` | `number` | `0` | 服务端总条数。 |\n| `paginator` | `boolean` | `false` | 显示内置分页页脚。 |\n| `page` | `number` | `1` | 当前页(`v-model:page`)。 |\n| `rowsPerPage` | `number` | `25` | 每页条数。 |\n| `pageSizes` | `number[]` | `[25, 50, 100]` | 分页每页条数选项。 |\n| `showHeader` | `boolean` | `true` | 是否显示表头。 |\n| `showRowsPerPage` | `boolean` | `true` | 是否显示每页条数选择器。 |\n| `fill` | `boolean` | `false` | 撑满父级剩余高度(仅全视口主列表配 `MPageContent fill`);表体滚动,分页贴底。设置 `maxHeight` / `tableHeight` 时忽略。 |\n| `columnWidths` | `Record<string, number> \\| null` | `null` | 列宽(`v-model:column-widths`)。 |\n| `virtual` | `boolean` | `false` | 行虚拟滚动(需高度;展开行时跳过)。 |\n| `virtualRowHeight` | `number` | `40` | 虚拟行高估算。 |\n| `hiddenColumns` | `string[] \\| null` | `null` | 隐藏列键(`v-model:hidden-columns`)。 |\n| `columnOrder` | `string[] \\| null` | `null` | 叶列顺序(`v-model:column-order`)。 |\n| `showFooter` | `boolean` | `false` | 显示表尾。 |\n| `footerMethod` | `TableFooterMethod \\| null` | `null` | 表尾数据。 |\n| `spanMethod` | `TableSpanMethod \\| null` | `null` | 单元格合并。 |\n| `treeConfig` | `TableTreeConfig \\| null` | `null` | 树形行。 |\n| `expandConfig` | `TableExpandConfig \\| null` | `null` | 详情展开配置(与树互斥)。 |\n| `checkboxConfig` | `TableCheckboxConfig \\| null` | `null` | 多选:级联 / `checkMethod` / `checkRowKeys` / `trigger` / `reserve`。 |\n| `radioConfig` | `TableRadioConfig \\| null` | `null` | 单选:`strict` / `checkMethod` / `trigger`。 |\n| `expandable` | `boolean` | `false` | 显示展开列(也可由 `#expansion` 或 `expandConfig` 启用)。 |\n| `striped` | `boolean` | `false` | 斑马纹行。 |\n| `bordered` | `boolean` | `false` | 单元格边框。 |\n| `highlightCurrent` | `boolean` | `false` | 高亮当前行,配合 `v-model:current-row-key`。 |\n| `rowHover` | `boolean` | `true` | 行 hover 高亮。 |\n| `sortField` / `sortOrder` | — | — | 受控排序字段与方向。 |\n| `sortMode` | `'client' \\| 'emit'` | `'client'` | 客户端排序或仅抛出排序事件。 |\n| `searchField` / `searchValue` | — | — | 客户端搜索。 |\n| `filterOptions` | `TableFilterOption[]` | `null` | 结构化筛选条件。 |\n| `loading` | `boolean` | `false` | 加载中。 |\n| `emptyText` | `string` | — | 空数据文案。 |\n| `emptyDescription` | `string` | — | 空数据补充说明。 |\n| `maxHeight` | `number \\| null` | `null` | 表格最大高度,超出滚动。 |\n| `showOverflowTooltip` | `boolean` | `false` | 全局单元格溢出 Tooltip。 |\n| `rowKey` | `string` | `'id'` | 行唯一键字段。 |\n| `size` | `'sm' \\| 'md' \\| 'lg'` | — | 表格密度。 |\n| `ariaLabel` | `string` | — | — |\n| `bodyExpandRowClassName` | `TableBodyRowClassName` | — | — |\n| `bodyItemClassName` | `TableBodyItemClassName` | — | — |\n| `bodyRowClassName` | `TableBodyRowClassName` | — | — |\n| `bodyTextDirection` | `TableTextDirection` | — | — |\n| `checkboxColumnWidth` | `number \\| null` | — | — |\n| `clickRowToExpand` | `boolean` | — | — |\n| `currentRowKey` | `string \\| number \\| null` | — | — |\n| `expandColumnWidth` | `number` | — | — |\n| `expandedRowKeys` | `Array<string \\| number>` | — | — |\n| `filters` | `Record<string, unknown> \\| null` | — | — |\n| `fixedCheckbox` | `boolean` | — | — |\n| `fixedExpand` | `boolean` | — | — |\n| `fixedHeader` | `boolean` | — | — |\n| `fixedIndex` | `boolean` | — | — |\n| `headerClassName` | `string` | — | — |\n| `headerItemClassName` | `TableHeaderItemClassName` | — | — |\n| `headerTextDirection` | `TableTextDirection` | — | — |\n| `indexColumnWidth` | `number` | — | — |\n| `multiSort` | `boolean` | — | — |\n| `mustSort` | `boolean` | — | — |\n| `showIndex` | `boolean` | — | — |\n| `showIndexSymbol` | `string` | — | — |\n| `tableClassName` | `string` | — | — |\n| `tableHeight` | `number \\| null` | — | — |\n| `tableMinHeight` | `number` | — | — |\n| `pt` | [RootPassThrough](/docs/types#RootPassThrough) `{ root? }` | — | DOM 透传,见 [样式与 attrs](/docs/attrs). |"
22976
23268
  },
22977
23269
  {
22978
23270
  "id": "slots",
22979
23271
  "title": "Slots",
22980
- "body": "| 插槽 | 说明 |\n| --- | --- |\n| `cell-{key}` | 列 `{key}` 单元格,作用域 `{ row, value, column }`。 |\n| `body-cell` | 任意单元格,作用域 `{ row, column, value }`。 |\n| `expansion` | 展开行内容,作用域 `{ row }`。 |\n| `empty` | 自定义空态。 |\n| `loading` | 自定义加载态。 |\n| `pagination` | 自定义分页区域。 |\n| `body` | 自定义 `body` 内容。 |\n| `body-append` | 自定义 `body-append` 内容。 |\n| `body-prepend` | 自定义 `body-prepend` 内容。 |\n| `customize-headers` | 自定义 `customize-headers` 内容。 |\n| `header` | 自定义 `header` 内容。 |\n| `header-*` | 动态插槽(前缀 `header-`)。 |"
23272
+ "body": "| 插槽 | 说明 |\n| --- | --- |\n| `cell-{key}` | 列 `{key}` 单元格,作用域 `{ row, value, column }`(可自行实现编辑器)。 |\n| `footer` | 自定义表尾。 |\n| `body-cell` | 任意单元格,作用域 `{ row, column, value }`。 |\n| `expansion` | 展开行内容,作用域 `{ row }`。 |\n| `empty` | 自定义空态。 |\n| `loading` | 自定义加载态。 |\n| `pagination` | 自定义分页区域。 |\n| `body` | 自定义 `body` 内容。 |\n| `body-append` | 自定义 `body-append` 内容。 |\n| `body-prepend` | 自定义 `body-prepend` 内容。 |\n| `customize-headers` | 自定义 `customize-headers` 内容。 |\n| `header` | 自定义 `header` 内容。 |\n| `header-{key}` | 列头插槽(键名大小写与 `columns[].key` 一致)。 |"
22981
23273
  },
22982
23274
  {
22983
23275
  "id": "events",
22984
23276
  "title": "Events",
22985
- "body": "| 事件名 | 参数 | 说明 |\n| --- | --- | --- |\n| `sort` | `{ sortField?, sortOrder? }` | 排序变化。 |\n| `page` | `number` | 页码变化。 |\n| `row-click` | `{ row, index }` | 行单击。 |\n| `current-change` | `row \\| null, oldRow \\| null` | 当前高亮行变化。 |\n| `expand` | `{ row, expanded }` | 行展开。 |\n| `update:selection` | `TableItem[]` | 多选 v-model。 |\n| `update:page` | `number` | 页码 v-model。 |\n| `update:server-options` | `TableServerOptions` | 服务端选项 v-model。 |\n| `update:current-row-key` | `string \\| number \\| null` | 当前行键 v-model。 |\n| `contextmenuRow` | — | — |\n| `deselectRow` | — | — |\n| `filter` | — | — |\n| `selectAll` | — | — |\n| `selectRow` | — | — |\n| `update:expandedRowKeys` | — | — |\n| `update:filters` | — | — |\n| `update:selectedItem` | — | — |\n| `updatePageItems` | — | — |\n| `updateTotalItems` | — | — |"
23277
+ "body": "| 事件名 | 参数 | 说明 |\n| --- | --- | --- |\n| `sort` | `{ sortField?, sortOrder? }` | 排序变化。 |\n| `row-click` | `{ row, index }`, `Event` | 行单击。 |\n| `row-dblclick` | `{ row, index }`, `Event` | 行双击。 |\n| `row-contextmenu` | `item`, `MouseEvent` | 行右键。 |\n| `select-row` | `TableItem` | 选中一行。 |\n| `deselect-row` | `TableItem` | 取消选中一行。 |\n| `select-all` | — | 全选当前页。 |\n| `current-change` | `row \\| null, oldRow \\| null` | 当前高亮行变化。 |\n| `expand` | `{ row, expanded }` | 行展开。 |\n| `update:selection` | `TableItem[]` | 多选 v-model。 |\n| `update:page` | `number` | 页码 v-model。 |\n| `update:server-options` | `TableServerOptions` | 服务端选项 v-model。 |\n| `update:current-row-key` | `string \\| number \\| null` | 当前行键 v-model。 |\n| `filter` | — | — |\n| `update:expandedRowKeys` | — | — |\n| `update:filters` | — | — |\n| `update:columnWidths` | `Record<string, number>` | 列宽 v-model。 |\n| `update:hiddenColumns` | `string[]` | 隐藏列 v-model。 |\n| `update:columnOrder` | `string[]` | 列顺序 v-model。 |\n| `update:selectedItem` | — | — |"
22986
23278
  },
22987
23279
  {
22988
23280
  "id": "实例方法",
22989
23281
  "title": "实例方法",
22990
- "body": "通过 `ref` 可访问以下分页与筛选控制:\n\n| 方法 / 属性 | 说明 |\n| --- | --- |\n| `currentPageFirstIndex` | 当前页首条记录的索引(无数据时为 `-1`)。 |\n| `currentPageLastIndex` | 当前页末条记录的索引。 |\n| `clientItemsLength` | 数据总条数(服务端模式下为服务端总数)。 |\n| `maxPaginationNumber` | 最大页码。 |\n| `currentPaginationNumber` | 当前页码。 |\n| `isLastPage` / `isFirstPage` | 是否末页 / 首页。 |\n| `nextPage()` / `prevPage()` | 下一页 / 上一页。 |\n| `updatePage(page)` | 跳到指定页码。 |\n| `rowsPerPageOptions` | 每页条数选项。 |\n| `rowsPerPageActiveOption` | 当前生效的每页条数。 |\n| `updateRowsPerPageActiveOption(n)` | 修改每页条数。 |\n| `setFilters(filters)` | 程序化设置筛选条件。 |"
23282
+ "body": "通过 `ref` 可访问分页、筛选、选择、滚动与展开控制:\n\n| 方法 / 属性 | 说明 |\n| --- | --- |\n| `currentPageFirstIndex` | 当前页首条记录的索引(无数据时为 `-1`)。 |\n| `currentPageLastIndex` | 当前页末条记录的索引。 |\n| `clientItemsLength` | 数据总条数(服务端模式下为服务端总数)。 |\n| `maxPaginationNumber` | 最大页码。 |\n| `currentPaginationNumber` | 当前页码。 |\n| `isLastPage` / `isFirstPage` | 是否末页 / 首页。 |\n| `nextPage()` / `prevPage()` | 下一页 / 上一页。 |\n| `updatePage(page)` | 跳到指定页码。 |\n| `rowsPerPageOptions` | 每页条数选项。 |\n| `rowsPerPageActiveOption` | 当前生效的每页条数。 |\n| `updateRowsPerPageActiveOption(n)` | 修改每页条数。 |\n| `setFilters(filters)` / `clearFilter()` | 设置 / 清空筛选。 |\n| `setColumnWidths(widths)` | 设置列宽(等同 `v-model:column-widths`)。 |\n| `setHiddenColumns(keys)` | 设置隐藏列键(等同 `v-model:hidden-columns`)。 |\n| `setColumnOrder(keys)` | 设置叶列顺序(等同 `v-model:column-order`)。 |\n| `clearSort()` | 清空排序。 |\n| `getCheckboxRecords()` | 当前多选行。 |\n| `setCheckboxRow(rows, checked)` | 设置行选中状态。 |\n| `clearCheckboxRow()` | 清空多选。 |\n| `isCheckedByCheckboxRow(row)` | 行是否选中。 |\n| `isAllCheckboxChecked()` | 当前页是否全选。 |\n| `getCheckboxIndeterminateRecords()` | 半选行(树级联)。 |\n| `scrollTo(...)` / `scrollToRow(row)` | 滚动定位。 |\n| `setRowExpand` / `setAllRowExpand` / `toggleRowExpand` / `clearRowExpand` / `isRowExpandByRow` / `getRowExpandRecords` | 详情展开(非树模式)。 |\n| `setTreeExpand` / `setAllTreeExpand` / `toggleTreeExpand` / `clearTreeExpand` / `isTreeExpandByRow` / `getTreeExpandRecords` | 树节点展开。 |"
22991
23283
  },
22992
23284
  {
22993
23285
  "id": "类型",
22994
23286
  "title": "类型",
22995
- "body": "<h4 id=\"TableItem\">TableItem</h4>\n\n完整定义见源码 `types.ts`。\n\n```ts\ntype TableItem = Record<string, unknown>\n```\n\n<h4 id=\"TableTextDirection\">TableTextDirection</h4>\n\n完整定义见源码 `types.ts`。\n\n```ts\ntype TableTextDirection = 'left' | 'center' | 'right'\n```\n\n<h4 id=\"TableClickEventType\">TableClickEventType</h4>\n\n完整定义见源码 `types.ts`。\n\n```ts\ntype TableClickEventType = 'single' | 'double'\n```\n\n<h4 id=\"TableFilterOption\">TableFilterOption</h4>\n\n完整定义见源码 `types.ts`。\n\n```ts\ntype TableFilterOption = | { field: string; comparison: 'between'; criteria: [number, number] }\n | { field: string; comparison: '=' | '!='; criteria: number | string }\n | { field: string; comparison: '>' | '>=' | '<' | '<='; criteria: number }\n | { field: number | string; comparison: 'in'; criteria: number[] | string[] }\n | { field: string; comparison: (value: unknown, criteria: string) => boolean; criteria: string }\n```\n\n<h4 id=\"TableHeaderItemClassName\">TableHeaderItemClassName</h4>\n\n完整定义见源码 `types.ts`。\n\n```ts\ntype TableHeaderItemClassName = string | ((header: TableHeader, columnNumber: number) => string)\n```\n\n<h4 id=\"TableBodyRowClassName\">TableBodyRowClassName</h4>\n\n完整定义见源码 `types.ts`。\n\n```ts\ntype TableBodyRowClassName = string | ((item: TableItem, rowNumber: number) => string)\n```\n\n<h4 id=\"TableBodyItemClassName\">TableBodyItemClassName</h4>\n\n完整定义见源码 `types.ts`。\n\n```ts\ntype TableBodyItemClassName = string | ((column: string, rowNumber: number) => string)\n```\n\n\n\n<h4 id=\"TableColumnDefinition\">TableColumnDefinition</h4>\n\n列定义,传给 `columns`:\n\n```ts\ninterface TableColumnDefinition {\n key: string\n label: string\n width?: number\n minWidth?: number\n sortable?: boolean\n fixed?: boolean | 'left' | 'right'\n align?: 'start' | 'center' | 'end' | 'left' | 'right'\n render?: (row: TableItem) => unknown\n filterable?: boolean\n filters?: { label: string; value: string | number }[]\n showOverflowTooltip?: boolean\n}\n```\n\n<h4 id=\"TableServerOptions\">TableServerOptions</h4>\n\n服务端分页/排序时传给 `serverOptions`,配合 `serverItemsLength`:\n\n```ts\ninterface TableServerOptions {\n page: number\n rowsPerPage: number\n sortBy?: string | string[]\n sortType?: 'asc' | 'desc' | ('asc' | 'desc')[]\n}\n```\n\n更多见 [API 类型](/docs/types)。"
23287
+ "body": "<h4 id=\"TableItem\">TableItem</h4>\n\n完整定义见源码 `types.ts`。\n\n```ts\ntype TableItem = Record<string, unknown>\n```\n\n<h4 id=\"TableTextDirection\">TableTextDirection</h4>\n\n完整定义见源码 `types.ts`。\n\n```ts\ntype TableTextDirection = 'left' | 'center' | 'right'\n```\n\n<h4 id=\"TableFilterOption\">TableFilterOption</h4>\n\n完整定义见源码 `types.ts`。\n\n```ts\ntype TableFilterOption = | { field: string; comparison: 'between'; criteria: [number, number] }\n | { field: string; comparison: '=' | '!='; criteria: number | string }\n | { field: string; comparison: '>' | '>=' | '<' | '<='; criteria: number }\n | { field: number | string; comparison: 'in'; criteria: number[] | string[] }\n | { field: string; comparison: (value: unknown, criteria: string) => boolean; criteria: string }\n```\n\n<h4 id=\"TableHeaderItemClassName\">TableHeaderItemClassName</h4>\n\n完整定义见源码 `types.ts`。\n\n```ts\ntype TableHeaderItemClassName = string | ((header: TableHeader, columnNumber: number) => string)\n```\n\n<h4 id=\"TableBodyRowClassName\">TableBodyRowClassName</h4>\n\n完整定义见源码 `types.ts`。\n\n```ts\ntype TableBodyRowClassName = string | ((item: TableItem, rowNumber: number) => string)\n```\n\n<h4 id=\"TableBodyItemClassName\">TableBodyItemClassName</h4>\n\n完整定义见源码 `types.ts`。\n\n```ts\ntype TableBodyItemClassName = string | ((column: string, rowNumber: number) => string)\n```\n\n\n\n<h4 id=\"TableTreeConfig\">TableTreeConfig</h4>\n\n```ts\ninterface TableTreeConfig {\n childrenField?: string // default 'children'\n indent?: number // default 16\n expandAll?: boolean\n accordion?: boolean\n trigger?: 'default' | 'row'\n lazy?: boolean\n hasChildField?: string // default 'hasChild'\n loadMethod?: (row: TableItem) => Promise<TableItem[]> | TableItem[]\n transform?: boolean // flat parentId → tree\n rowField?: string\n parentField?: string // default 'parentId'\n treeNode?: string // column key for toggler; default first column\n showLine?: boolean\n}\n```\n\n<h4 id=\"TableColumnDefinition\">TableColumnDefinition</h4>\n\n列定义,传给 `columns`:\n\n```ts\ninterface TableColumnDefinition {\n key: string\n label: string\n width?: number\n minWidth?: number\n sortable?: boolean\n fixed?: boolean | 'left' | 'right'\n align?: 'start' | 'center' | 'end'\n render?: (row: TableItem) => unknown\n showOverflowTooltip?: boolean\n}\n```\n\n<h4 id=\"TableServerOptions\">TableServerOptions</h4>\n\n服务端分页/排序时传给 `serverOptions`,配合 `serverTotal`:\n\n```ts\ninterface TableServerOptions {\n page: number\n rowsPerPage: number\n sortBy?: string | string[]\n sortType?: 'asc' | 'desc' | ('asc' | 'desc')[]\n}\n```\n\n更多见 [API 类型](/docs/types)。"
22996
23288
  }
22997
23289
  ],
22998
- "markdown": "---\ntitle: Table\ncategory: 03 / DATA\ndescription: 数据表格。支持排序、筛选、选择、分页、固定列与空/加载态。列宽支持 width / minWidth / fit。\n---\n\n# Table\n\n`MTable` 用于展示结构化行数据。通过 `columns` 定义列、`rows` 传入数据;内置客户端排序、筛选、分页与行选择,也支持服务端分页模式。\n\n列宽规则:\n\n- 设置了 `width` 的列为固定宽度\n- 未设 `width` 的列以 `minWidth`(默认 `80`)为弹性下限;`fit` 为 `true`(默认)时,剩余宽度按比例分配给弹性列\n- 总最小宽度超出容器时出现横向滚动\n- 需要表体自己滚动时用 `maxHeight` / `tableHeight`;与 `MLayout` 根滚动叠用时优先固定表高,避免双层滚动条\n- **全视口主列表(按需)**:`MPageContent fill` + `MTable fill paginator`——表体滚动、分页贴底;嵌入表/短页不要硬套 `fill`\n\n## 引入\n\n```ts\nimport type { TableColumnDefinition, TableItem } from 'morya-ui'\nimport { MTable, MTag } from 'morya-ui'\n```\n\n## 基础用法\n\n```vue preview src=\"./demos/Basic.zh.vue\"\n```\n\n## 行选择\n\n多选配合 `selection-mode=\"multiple\"` 与 `v-model:selection`;单选使用 `selection-mode=\"single\"` 与 `v-model:selected-item`。\n\n```vue preview src=\"./demos/Selection.zh.vue\"\n```\n\n## 筛选与分页\n\n客户端筛选可通过 `search-value` / `filter-options`;分页开启 `paginator` 并配合 `v-model:page` 与 `rows-per-page`。\n\n```vue preview src=\"./demos/FilterAndPagination.zh.vue\"\n```\n\n## 固定列\n\n列定义中设置 `fixed: 'left'` 可冻结左侧列(当前批次支持左固定)。\n\n```vue preview src=\"./demos/ExpandableRows.zh.vue\"\n```\n\n## 展开行与列渲染\n\n列可通过 `render` 函数渲染;展开行设置 `expandable`,详情内容由插槽 `expansion` 提供。`cell-{key}` 插槽优先于 `render`。\n\n```vue preview src=\"./demos/EmptyAndLoading.zh.vue\"\n```\n\n## 空态与加载\n\n```vue preview src=\"./demos/Demo6.vue\"\n```\n\n## 服务端模式\n\n传入 `server-options` 与 `server-items-length`,通过 `v-model:server-options` 同步页码、每页条数与排序字段。\n\n```vue preview src=\"./demos/Demo7.vue\"\n```\n\n## TableColumnDefinition\n\n| 字段 | 类型 | 说明 |\n| --- | --- | --- |\n| `key` | `string` | 列字段名(绑定行数据的键)。 |\n| `label` | `string` | 列头文案。 |\n| `width` | `number` | 固定列宽(px)。 |\n| `minWidth` | `number` | 弹性列最小宽度,默认 `80`。 |\n| `sortable` | `boolean` | 是否可排序。 |\n| `fixed` | `boolean \\| 'left' \\| 'right'` | 固定列;当前实现左固定。 |\n| `align` | `'start' \\| 'center' \\| 'end'` | 单元格对齐。 |\n| `render` | `(row) => unknown` | 自定义单元格渲染。 |\n| `showOverflowTooltip` | `boolean` | 该列文本溢出时显示 Tooltip。 |\n\n## Props\n\n| 参数 | 类型 | 默认值 | 说明 |\n| --- | --- | --- | --- |\n| `columns` | `TableColumnDefinition[]` | — | 列定义。 |\n| `rows` | `TableItem[]` | — | 行数据。 |\n| `fit` | `boolean` | `true` | 弹性列是否撑满表格宽度。 |\n| `selectionMode` | `'single' \\| 'multiple' \\| null` | `null` | 行选择模式。 |\n| `selection` | `TableItem[] \\| null` | `null` | 多选绑定(`v-model:selection`)。 |\n| `selectedItem` | `TableItem \\| null` | `null` | 单选绑定(`v-model:selected-item`)。 |\n| `serverOptions` | `TableServerOptions \\| null` | `null` | 服务端分页/排序选项。 |\n| `serverItemsLength` | `number` | `0` | 服务端总条数。 |\n| `paginator` | `boolean` | `false` | 显示内置分页页脚。 |\n| `page` | `number` | `1` | 当前页(`v-model:page`)。 |\n| `rowsPerPage` | `number` | `25` | 每页条数。 |\n| `fill` | `boolean` | `false` | 撑满父级剩余高度(仅全视口主列表配 `MPageContent fill`);表体滚动,分页贴底。设置 `maxHeight` / `tableHeight` 时忽略。 |\n| `expandable` | `boolean` | `false` | 显示展开列(也可由 `#expansion` 插槽隐式启用)。 |\n| `striped` | `boolean` | `false` | 斑马纹行。 |\n| `bordered` | `boolean` | `false` | 单元格边框。 |\n| `highlightCurrent` | `boolean` | `false` | 高亮当前行,配合 `v-model:current-row-key`。 |\n| `rowHover` | `boolean` | `true` | 行 hover 高亮。 |\n| `sortField` / `sortOrder` | — | — | 受控排序字段与方向。 |\n| `sortMode` | `'client' \\| 'emit'` | `'client'` | 客户端排序或仅抛出排序事件。 |\n| `searchField` / `searchValue` | — | — | 客户端搜索。 |\n| `filterOptions` | `TableFilterOption[]` | `null` | 结构化筛选条件。 |\n| `loading` | `boolean` | `false` | 加载中。 |\n| `emptyText` | `string` | — | 空数据文案。 |\n| `emptyDescription` | `string` | — | 空数据补充说明。 |\n| `maxHeight` | `number \\| null` | `null` | 表格最大高度,超出滚动。 |\n| `showOverflowTooltip` | `boolean` | `false` | 全局单元格溢出 Tooltip。 |\n| `rowKey` | `string` | `'id'` | 行唯一键字段。 |\n| `size` | `'sm' \\| 'md' \\| 'lg'` | — | 表格密度。 |\n| `ariaLabel` | `string` | — | — |\n| `bodyExpandRowClassName` | `TableBodyRowClassName` | — | — |\n| `bodyItemClassName` | `TableBodyItemClassName` | — | — |\n| `bodyRowClassName` | `TableBodyRowClassName` | — | — |\n| `bodyTextDirection` | `TableTextDirection` | — | — |\n| `checkboxColumnWidth` | `number \\| null` | — | — |\n| `clickEventType` | `TableClickEventType` | — | — |\n| `clickRowToExpand` | `boolean` | — | — |\n| `currentRowKey` | `string \\| number \\| null` | — | — |\n| `expandColumnWidth` | `number` | — | — |\n| `expandedRowKeys` | `Array<string \\| number>` | — | — |\n| `filters` | `Record<string, unknown> \\| null` | — | — |\n| `fixedCheckbox` | `boolean` | — | — |\n| `fixedExpand` | `boolean` | — | — |\n| `fixedHeader` | `boolean` | — | — |\n| `fixedIndex` | `boolean` | — | — |\n| `headerClassName` | `string` | — | — |\n| `headerItemClassName` | `TableHeaderItemClassName` | — | — |\n| `headerTextDirection` | `TableTextDirection` | — | — |\n| `hideHeader` | `boolean` | — | — |\n| `hideRowsPerPage` | `boolean` | — | — |\n| `indexColumnWidth` | `number` | — | — |\n| `multiSort` | `boolean` | — | — |\n| `mustSort` | `boolean` | — | — |\n| `preventContextMenuRow` | `boolean` | — | — |\n| `rowsItems` | `number[]` | — | — |\n| `rowsOfPageSeparatorMessage` | `string` | — | — |\n| `rowsPerPageMessage` | `string` | — | — |\n| `showHeader` | `boolean` | — | — |\n| `showIndex` | `boolean` | — | — |\n| `showIndexSymbol` | `string` | — | — |\n| `tableClassName` | `string` | — | — |\n| `tableHeight` | `number \\| null` | — | — |\n| `tableMinHeight` | `number` | — | — |\n| `tableNodeId` | `string` | — | — |\n| `pt` | [RootPassThrough](/docs/types#RootPassThrough) `{ root? }` | — | DOM 透传,见 [样式与 attrs](/docs/attrs). |\n\n\n## Slots\n\n| 插槽 | 说明 |\n| --- | --- |\n| `cell-{key}` | 列 `{key}` 单元格,作用域 `{ row, value, column }`。 |\n| `body-cell` | 任意单元格,作用域 `{ row, column, value }`。 |\n| `expansion` | 展开行内容,作用域 `{ row }`。 |\n| `empty` | 自定义空态。 |\n| `loading` | 自定义加载态。 |\n| `pagination` | 自定义分页区域。 |\n| `body` | 自定义 `body` 内容。 |\n| `body-append` | 自定义 `body-append` 内容。 |\n| `body-prepend` | 自定义 `body-prepend` 内容。 |\n| `customize-headers` | 自定义 `customize-headers` 内容。 |\n| `header` | 自定义 `header` 内容。 |\n| `header-*` | 动态插槽(前缀 `header-`)。 |\n\n## Events\n\n| 事件名 | 参数 | 说明 |\n| --- | --- | --- |\n| `sort` | `{ sortField?, sortOrder? }` | 排序变化。 |\n| `page` | `number` | 页码变化。 |\n| `row-click` | `{ row, index }` | 行单击。 |\n| `current-change` | `row \\| null, oldRow \\| null` | 当前高亮行变化。 |\n| `expand` | `{ row, expanded }` | 行展开。 |\n| `update:selection` | `TableItem[]` | 多选 v-model。 |\n| `update:page` | `number` | 页码 v-model。 |\n| `update:server-options` | `TableServerOptions` | 服务端选项 v-model。 |\n| `update:current-row-key` | `string \\| number \\| null` | 当前行键 v-model。 |\n| `contextmenuRow` | — | — |\n| `deselectRow` | — | — |\n| `filter` | — | — |\n| `selectAll` | — | — |\n| `selectRow` | — | — |\n| `update:expandedRowKeys` | — | — |\n| `update:filters` | — | — |\n| `update:selectedItem` | — | — |\n| `updatePageItems` | — | — |\n| `updateTotalItems` | — | — |\n\n## 实例方法\n\n通过 `ref` 可访问以下分页与筛选控制:\n\n| 方法 / 属性 | 说明 |\n| --- | --- |\n| `currentPageFirstIndex` | 当前页首条记录的索引(无数据时为 `-1`)。 |\n| `currentPageLastIndex` | 当前页末条记录的索引。 |\n| `clientItemsLength` | 数据总条数(服务端模式下为服务端总数)。 |\n| `maxPaginationNumber` | 最大页码。 |\n| `currentPaginationNumber` | 当前页码。 |\n| `isLastPage` / `isFirstPage` | 是否末页 / 首页。 |\n| `nextPage()` / `prevPage()` | 下一页 / 上一页。 |\n| `updatePage(page)` | 跳到指定页码。 |\n| `rowsPerPageOptions` | 每页条数选项。 |\n| `rowsPerPageActiveOption` | 当前生效的每页条数。 |\n| `updateRowsPerPageActiveOption(n)` | 修改每页条数。 |\n| `setFilters(filters)` | 程序化设置筛选条件。 |\n\n## 类型\n\n<h4 id=\"TableItem\">TableItem</h4>\n\n完整定义见源码 `types.ts`。\n\n```ts\ntype TableItem = Record<string, unknown>\n```\n\n<h4 id=\"TableTextDirection\">TableTextDirection</h4>\n\n完整定义见源码 `types.ts`。\n\n```ts\ntype TableTextDirection = 'left' | 'center' | 'right'\n```\n\n<h4 id=\"TableClickEventType\">TableClickEventType</h4>\n\n完整定义见源码 `types.ts`。\n\n```ts\ntype TableClickEventType = 'single' | 'double'\n```\n\n<h4 id=\"TableFilterOption\">TableFilterOption</h4>\n\n完整定义见源码 `types.ts`。\n\n```ts\ntype TableFilterOption = | { field: string; comparison: 'between'; criteria: [number, number] }\n | { field: string; comparison: '=' | '!='; criteria: number | string }\n | { field: string; comparison: '>' | '>=' | '<' | '<='; criteria: number }\n | { field: number | string; comparison: 'in'; criteria: number[] | string[] }\n | { field: string; comparison: (value: unknown, criteria: string) => boolean; criteria: string }\n```\n\n<h4 id=\"TableHeaderItemClassName\">TableHeaderItemClassName</h4>\n\n完整定义见源码 `types.ts`。\n\n```ts\ntype TableHeaderItemClassName = string | ((header: TableHeader, columnNumber: number) => string)\n```\n\n<h4 id=\"TableBodyRowClassName\">TableBodyRowClassName</h4>\n\n完整定义见源码 `types.ts`。\n\n```ts\ntype TableBodyRowClassName = string | ((item: TableItem, rowNumber: number) => string)\n```\n\n<h4 id=\"TableBodyItemClassName\">TableBodyItemClassName</h4>\n\n完整定义见源码 `types.ts`。\n\n```ts\ntype TableBodyItemClassName = string | ((column: string, rowNumber: number) => string)\n```\n\n\n\n<h4 id=\"TableColumnDefinition\">TableColumnDefinition</h4>\n\n列定义,传给 `columns`:\n\n```ts\ninterface TableColumnDefinition {\n key: string\n label: string\n width?: number\n minWidth?: number\n sortable?: boolean\n fixed?: boolean | 'left' | 'right'\n align?: 'start' | 'center' | 'end' | 'left' | 'right'\n render?: (row: TableItem) => unknown\n filterable?: boolean\n filters?: { label: string; value: string | number }[]\n showOverflowTooltip?: boolean\n}\n```\n\n<h4 id=\"TableServerOptions\">TableServerOptions</h4>\n\n服务端分页/排序时传给 `serverOptions`,配合 `serverItemsLength`:\n\n```ts\ninterface TableServerOptions {\n page: number\n rowsPerPage: number\n sortBy?: string | string[]\n sortType?: 'asc' | 'desc' | ('asc' | 'desc')[]\n}\n```\n\n更多见 [API 类型](/docs/types)。\n"
23290
+ "markdown": "---\ntitle: Table\ncategory: 03 / DATA\ndescription: 数据表格。支持排序、筛选、选择、分页、固定列与空/加载态。列宽支持 width / minWidth / fit。\n---\n\n# Table\n\n`MTable` 用于展示结构化行数据。通过 `columns` 定义列、`rows` 传入数据;内置客户端排序、筛选、分页与行选择,也支持服务端分页模式。多选表头「全选」仅作用于当前页。\n\n列宽规则:\n\n- 设置了 `width` 的列为固定宽度\n- 未设 `width` 的列以 `minWidth`(默认 `80`)为弹性下限;`fit` 为 `true`(默认)时,剩余宽度按比例分配给弹性列\n- 总最小宽度超出容器时出现横向滚动\n- 需要表体自己滚动时用 `maxHeight` / `tableHeight`;与 `MLayout` 根滚动叠用时优先固定表高,避免双层滚动条\n- 全视口主列表可用 `MPageContent fill` + `MTable fill paginator`(表体滚动、分页贴底);嵌入表或短页不必使用 `fill`\n\n## 引入\n\n```ts\nimport type { TableColumnDefinition, TableItem } from 'morya-ui'\nimport { MTable, MTag } from 'morya-ui'\n```\n\n## 基础用法\n\n```vue preview src=\"./demos/Basic.zh.vue\"\n```\n\n## 行选择\n\n多选配合 `selection-mode=\"multiple\"` 与 `v-model:selection`;单选使用 `selection-mode=\"single\"` 与 `v-model:selected-item`。表头全选仅选中当前页。\n\n```vue preview src=\"./demos/Selection.zh.vue\"\n```\n\n## 筛选与分页\n\n客户端筛选可通过 `search-value` / `filter-options`;分页开启 `paginator` 并配合 `v-model:page` 与 `rows-per-page`(受控同步)。\n\n```vue preview src=\"./demos/FilterAndPagination.zh.vue\"\n```\n\n## 固定列\n\n列定义中设置 `fixed: 'left' | 'right'`(或 `fixed: true` 视为左固定)。\n\n```vue preview src=\"./demos/FixedColumns.zh.vue\"\n```\n\n## 展开行与列渲染\n\n列可通过 `render` 或 `#cell-{key}` 自定义单元格。展开行设置 `expandable`(或 `expandConfig`),详情由 `#expansion` 提供。树模式下 `expandedRowKeys` 用于树节点展开,不可同时用于详情展开。\n\n```vue preview src=\"./demos/ExpandableRows.zh.vue\"\n```\n\n## 列宽拖拽与表头筛选\n\n列设置 `resizable` 可拖拽改宽(`v-model:column-widths`);`filterable` 显示表头筛选,可选 `filters` 为多选选项,否则为文本包含筛选。\n\n```vue preview src=\"./demos/ResizeAndFilter.zh.vue\"\n```\n\n## 虚拟滚动\n\n开启 `virtual`,并提供 `maxHeight` / `tableHeight` / `fill` 之一。展开行场景会自动降级为普通渲染。\n\n```vue preview src=\"./demos/VirtualScroll.zh.vue\"\n```\n\n## 多级表头、表尾与合并\n\n列支持 `children` 多级表头;`show-footer` + `footer-method` 渲染合计;`span-method` 合并单元格。\n\n```vue preview src=\"./demos/GridFeatures.zh.vue\"\n```\n\n## 空态与加载\n\n```vue preview src=\"./demos/EmptyAndLoading.zh.vue\"\n```\n\n## 树形表格\n\n传入 `tree-config` 启用树模式:嵌套 `children`,或 `transform` + `parentId` 扁平数据。展开状态用 `v-model:expanded-row-keys`。支持 `expandAll` / `expandRowKeys`、`accordion`、`trigger`、`toggleMethod`、懒加载 `lazy` + `loadMethod`。\n\n实例方法:`setTreeExpand`、`setAllTreeExpand`、`toggleTreeExpand`、`isTreeExpandByRow`、`getTreeExpandRecords`、`clearTreeExpand`。\n\n树 + 多选时默认父子级联与半选(`checkbox-config.check-strictly=false`);`checkMethod` 可禁用单行勾选。\n\n```vue preview src=\"./demos/Tree.zh.vue\"\n```\n\n## 服务端模式\n\n传入 `server-options` 与 `server-total`,通过 `v-model:server-options` 同步页码、每页条数与排序字段。\n\n```vue preview src=\"./demos/Demo7.vue\"\n```\n\n## Breaking changes\n\n- 移除内置单元格编辑:`editConfig`、列 `editable`、`edit-change`、`#edit-{key}`;请用 `#cell-{key}` / `render` 自定义\n- 移除 `MTreeTable`(含 `morya-ui/tree-table`);树表改用 `MTable` + `treeConfig`\n- `serverItemsLength` → `serverTotal`;`rowsItems` → `pageSizes`\n- `hideHeader` 移除;改用 `showHeader`(默认 `true`)\n- `hideRowsPerPage` 移除;改用 `showRowsPerPage`(默认 `true`)\n- 移除:`clickEventType`、`rowsPerPageMessage`、`rowsOfPageSeparatorMessage`、`preventContextMenuRow`、`tableNodeId`\n- 事件:`contextmenuRow` → `row-contextmenu`;`selectRow` / `deselectRow` / `selectAll` → `select-row` / `deselect-row` / `select-all`\n- 移除事件:`updatePageItems`、`updateTotalItems`、`page`(保留 `update:page`)\n- 行交互:始终同时支持单击 / 双击(`row-click` / `row-dblclick`);右键始终 `preventDefault` 并抛出 `row-contextmenu`\n\n## TableColumnDefinition\n\n| 字段 | 类型 | 说明 |\n| --- | --- | --- |\n| `key` | `string` | 列字段名(绑定行数据的键)。 |\n| `label` | `string` | 列头文案。 |\n| `width` | `number` | 固定列宽(px)。 |\n| `minWidth` | `number` | 弹性列最小宽度,默认 `80`。 |\n| `sortable` | `boolean` | 是否可排序。 |\n| `fixed` | `boolean \\| 'left' \\| 'right'` | 固定列;`true` 等同 `'left'`。 |\n| `align` | `'start' \\| 'center' \\| 'end'` | 单元格对齐。 |\n| `render` | `(row) => unknown` | 自定义单元格渲染。 |\n| `showOverflowTooltip` | `boolean` | 该列文本溢出时显示 Tooltip。 |\n| `resizable` | `boolean` | 可拖拽调整列宽。 |\n| `filterable` | `boolean` | 显示表头筛选。 |\n| `filters` | `TableColumnFilter[]` | 表头筛选选项;省略则为文本筛选。 |\n| `children` | `TableColumnDefinition[]` | 多级表头子列。 |\n\n## Props\n\n| 参数 | 类型 | 默认值 | 说明 |\n| --- | --- | --- | --- |\n| `columns` | `TableColumnDefinition[]` | — | 列定义。 |\n| `rows` | `TableItem[]` | — | 行数据。 |\n| `fit` | `boolean` | `true` | 弹性列是否撑满表格宽度。 |\n| `selectionMode` | `'single' \\| 'multiple' \\| null` | `null` | 行选择模式。 |\n| `selection` | `TableItem[] \\| null` | `null` | 多选绑定(`v-model:selection`)。 |\n| `selectedItem` | `TableItem \\| null` | `null` | 单选绑定(`v-model:selected-item`)。 |\n| `serverOptions` | `TableServerOptions \\| null` | `null` | 服务端分页/排序选项。 |\n| `serverTotal` | `number` | `0` | 服务端总条数。 |\n| `paginator` | `boolean` | `false` | 显示内置分页页脚。 |\n| `page` | `number` | `1` | 当前页(`v-model:page`)。 |\n| `rowsPerPage` | `number` | `25` | 每页条数。 |\n| `pageSizes` | `number[]` | `[25, 50, 100]` | 分页每页条数选项。 |\n| `showHeader` | `boolean` | `true` | 是否显示表头。 |\n| `showRowsPerPage` | `boolean` | `true` | 是否显示每页条数选择器。 |\n| `fill` | `boolean` | `false` | 撑满父级剩余高度(仅全视口主列表配 `MPageContent fill`);表体滚动,分页贴底。设置 `maxHeight` / `tableHeight` 时忽略。 |\n| `columnWidths` | `Record<string, number> \\| null` | `null` | 列宽(`v-model:column-widths`)。 |\n| `virtual` | `boolean` | `false` | 行虚拟滚动(需高度;展开行时跳过)。 |\n| `virtualRowHeight` | `number` | `40` | 虚拟行高估算。 |\n| `hiddenColumns` | `string[] \\| null` | `null` | 隐藏列键(`v-model:hidden-columns`)。 |\n| `columnOrder` | `string[] \\| null` | `null` | 叶列顺序(`v-model:column-order`)。 |\n| `showFooter` | `boolean` | `false` | 显示表尾。 |\n| `footerMethod` | `TableFooterMethod \\| null` | `null` | 表尾数据。 |\n| `spanMethod` | `TableSpanMethod \\| null` | `null` | 单元格合并。 |\n| `treeConfig` | `TableTreeConfig \\| null` | `null` | 树形行。 |\n| `expandConfig` | `TableExpandConfig \\| null` | `null` | 详情展开配置(与树互斥)。 |\n| `checkboxConfig` | `TableCheckboxConfig \\| null` | `null` | 多选:级联 / `checkMethod` / `checkRowKeys` / `trigger` / `reserve`。 |\n| `radioConfig` | `TableRadioConfig \\| null` | `null` | 单选:`strict` / `checkMethod` / `trigger`。 |\n| `expandable` | `boolean` | `false` | 显示展开列(也可由 `#expansion` 或 `expandConfig` 启用)。 |\n| `striped` | `boolean` | `false` | 斑马纹行。 |\n| `bordered` | `boolean` | `false` | 单元格边框。 |\n| `highlightCurrent` | `boolean` | `false` | 高亮当前行,配合 `v-model:current-row-key`。 |\n| `rowHover` | `boolean` | `true` | 行 hover 高亮。 |\n| `sortField` / `sortOrder` | — | — | 受控排序字段与方向。 |\n| `sortMode` | `'client' \\| 'emit'` | `'client'` | 客户端排序或仅抛出排序事件。 |\n| `searchField` / `searchValue` | — | — | 客户端搜索。 |\n| `filterOptions` | `TableFilterOption[]` | `null` | 结构化筛选条件。 |\n| `loading` | `boolean` | `false` | 加载中。 |\n| `emptyText` | `string` | — | 空数据文案。 |\n| `emptyDescription` | `string` | — | 空数据补充说明。 |\n| `maxHeight` | `number \\| null` | `null` | 表格最大高度,超出滚动。 |\n| `showOverflowTooltip` | `boolean` | `false` | 全局单元格溢出 Tooltip。 |\n| `rowKey` | `string` | `'id'` | 行唯一键字段。 |\n| `size` | `'sm' \\| 'md' \\| 'lg'` | — | 表格密度。 |\n| `ariaLabel` | `string` | — | — |\n| `bodyExpandRowClassName` | `TableBodyRowClassName` | — | — |\n| `bodyItemClassName` | `TableBodyItemClassName` | — | — |\n| `bodyRowClassName` | `TableBodyRowClassName` | — | — |\n| `bodyTextDirection` | `TableTextDirection` | — | — |\n| `checkboxColumnWidth` | `number \\| null` | — | — |\n| `clickRowToExpand` | `boolean` | — | — |\n| `currentRowKey` | `string \\| number \\| null` | — | — |\n| `expandColumnWidth` | `number` | — | — |\n| `expandedRowKeys` | `Array<string \\| number>` | — | — |\n| `filters` | `Record<string, unknown> \\| null` | — | — |\n| `fixedCheckbox` | `boolean` | — | — |\n| `fixedExpand` | `boolean` | — | — |\n| `fixedHeader` | `boolean` | — | — |\n| `fixedIndex` | `boolean` | — | — |\n| `headerClassName` | `string` | — | — |\n| `headerItemClassName` | `TableHeaderItemClassName` | — | — |\n| `headerTextDirection` | `TableTextDirection` | — | — |\n| `indexColumnWidth` | `number` | — | — |\n| `multiSort` | `boolean` | — | — |\n| `mustSort` | `boolean` | — | — |\n| `showIndex` | `boolean` | — | — |\n| `showIndexSymbol` | `string` | — | — |\n| `tableClassName` | `string` | — | — |\n| `tableHeight` | `number \\| null` | — | — |\n| `tableMinHeight` | `number` | — | — |\n| `pt` | [RootPassThrough](/docs/types#RootPassThrough) `{ root? }` | — | DOM 透传,见 [样式与 attrs](/docs/attrs). |\n\n\n## Slots\n\n| 插槽 | 说明 |\n| --- | --- |\n| `cell-{key}` | 列 `{key}` 单元格,作用域 `{ row, value, column }`(可自行实现编辑器)。 |\n| `footer` | 自定义表尾。 |\n| `body-cell` | 任意单元格,作用域 `{ row, column, value }`。 |\n| `expansion` | 展开行内容,作用域 `{ row }`。 |\n| `empty` | 自定义空态。 |\n| `loading` | 自定义加载态。 |\n| `pagination` | 自定义分页区域。 |\n| `body` | 自定义 `body` 内容。 |\n| `body-append` | 自定义 `body-append` 内容。 |\n| `body-prepend` | 自定义 `body-prepend` 内容。 |\n| `customize-headers` | 自定义 `customize-headers` 内容。 |\n| `header` | 自定义 `header` 内容。 |\n| `header-{key}` | 列头插槽(键名大小写与 `columns[].key` 一致)。 |\n\n## Events\n\n| 事件名 | 参数 | 说明 |\n| --- | --- | --- |\n| `sort` | `{ sortField?, sortOrder? }` | 排序变化。 |\n| `row-click` | `{ row, index }`, `Event` | 行单击。 |\n| `row-dblclick` | `{ row, index }`, `Event` | 行双击。 |\n| `row-contextmenu` | `item`, `MouseEvent` | 行右键。 |\n| `select-row` | `TableItem` | 选中一行。 |\n| `deselect-row` | `TableItem` | 取消选中一行。 |\n| `select-all` | — | 全选当前页。 |\n| `current-change` | `row \\| null, oldRow \\| null` | 当前高亮行变化。 |\n| `expand` | `{ row, expanded }` | 行展开。 |\n| `update:selection` | `TableItem[]` | 多选 v-model。 |\n| `update:page` | `number` | 页码 v-model。 |\n| `update:server-options` | `TableServerOptions` | 服务端选项 v-model。 |\n| `update:current-row-key` | `string \\| number \\| null` | 当前行键 v-model。 |\n| `filter` | — | — |\n| `update:expandedRowKeys` | — | — |\n| `update:filters` | — | — |\n| `update:columnWidths` | `Record<string, number>` | 列宽 v-model。 |\n| `update:hiddenColumns` | `string[]` | 隐藏列 v-model。 |\n| `update:columnOrder` | `string[]` | 列顺序 v-model。 |\n| `update:selectedItem` | — | — |\n\n## 实例方法\n\n通过 `ref` 可访问分页、筛选、选择、滚动与展开控制:\n\n| 方法 / 属性 | 说明 |\n| --- | --- |\n| `currentPageFirstIndex` | 当前页首条记录的索引(无数据时为 `-1`)。 |\n| `currentPageLastIndex` | 当前页末条记录的索引。 |\n| `clientItemsLength` | 数据总条数(服务端模式下为服务端总数)。 |\n| `maxPaginationNumber` | 最大页码。 |\n| `currentPaginationNumber` | 当前页码。 |\n| `isLastPage` / `isFirstPage` | 是否末页 / 首页。 |\n| `nextPage()` / `prevPage()` | 下一页 / 上一页。 |\n| `updatePage(page)` | 跳到指定页码。 |\n| `rowsPerPageOptions` | 每页条数选项。 |\n| `rowsPerPageActiveOption` | 当前生效的每页条数。 |\n| `updateRowsPerPageActiveOption(n)` | 修改每页条数。 |\n| `setFilters(filters)` / `clearFilter()` | 设置 / 清空筛选。 |\n| `setColumnWidths(widths)` | 设置列宽(等同 `v-model:column-widths`)。 |\n| `setHiddenColumns(keys)` | 设置隐藏列键(等同 `v-model:hidden-columns`)。 |\n| `setColumnOrder(keys)` | 设置叶列顺序(等同 `v-model:column-order`)。 |\n| `clearSort()` | 清空排序。 |\n| `getCheckboxRecords()` | 当前多选行。 |\n| `setCheckboxRow(rows, checked)` | 设置行选中状态。 |\n| `clearCheckboxRow()` | 清空多选。 |\n| `isCheckedByCheckboxRow(row)` | 行是否选中。 |\n| `isAllCheckboxChecked()` | 当前页是否全选。 |\n| `getCheckboxIndeterminateRecords()` | 半选行(树级联)。 |\n| `scrollTo(...)` / `scrollToRow(row)` | 滚动定位。 |\n| `setRowExpand` / `setAllRowExpand` / `toggleRowExpand` / `clearRowExpand` / `isRowExpandByRow` / `getRowExpandRecords` | 详情展开(非树模式)。 |\n| `setTreeExpand` / `setAllTreeExpand` / `toggleTreeExpand` / `clearTreeExpand` / `isTreeExpandByRow` / `getTreeExpandRecords` | 树节点展开。 |\n\n## 类型\n\n<h4 id=\"TableItem\">TableItem</h4>\n\n完整定义见源码 `types.ts`。\n\n```ts\ntype TableItem = Record<string, unknown>\n```\n\n<h4 id=\"TableTextDirection\">TableTextDirection</h4>\n\n完整定义见源码 `types.ts`。\n\n```ts\ntype TableTextDirection = 'left' | 'center' | 'right'\n```\n\n<h4 id=\"TableFilterOption\">TableFilterOption</h4>\n\n完整定义见源码 `types.ts`。\n\n```ts\ntype TableFilterOption = | { field: string; comparison: 'between'; criteria: [number, number] }\n | { field: string; comparison: '=' | '!='; criteria: number | string }\n | { field: string; comparison: '>' | '>=' | '<' | '<='; criteria: number }\n | { field: number | string; comparison: 'in'; criteria: number[] | string[] }\n | { field: string; comparison: (value: unknown, criteria: string) => boolean; criteria: string }\n```\n\n<h4 id=\"TableHeaderItemClassName\">TableHeaderItemClassName</h4>\n\n完整定义见源码 `types.ts`。\n\n```ts\ntype TableHeaderItemClassName = string | ((header: TableHeader, columnNumber: number) => string)\n```\n\n<h4 id=\"TableBodyRowClassName\">TableBodyRowClassName</h4>\n\n完整定义见源码 `types.ts`。\n\n```ts\ntype TableBodyRowClassName = string | ((item: TableItem, rowNumber: number) => string)\n```\n\n<h4 id=\"TableBodyItemClassName\">TableBodyItemClassName</h4>\n\n完整定义见源码 `types.ts`。\n\n```ts\ntype TableBodyItemClassName = string | ((column: string, rowNumber: number) => string)\n```\n\n\n\n<h4 id=\"TableTreeConfig\">TableTreeConfig</h4>\n\n```ts\ninterface TableTreeConfig {\n childrenField?: string // default 'children'\n indent?: number // default 16\n expandAll?: boolean\n accordion?: boolean\n trigger?: 'default' | 'row'\n lazy?: boolean\n hasChildField?: string // default 'hasChild'\n loadMethod?: (row: TableItem) => Promise<TableItem[]> | TableItem[]\n transform?: boolean // flat parentId → tree\n rowField?: string\n parentField?: string // default 'parentId'\n treeNode?: string // column key for toggler; default first column\n showLine?: boolean\n}\n```\n\n<h4 id=\"TableColumnDefinition\">TableColumnDefinition</h4>\n\n列定义,传给 `columns`:\n\n```ts\ninterface TableColumnDefinition {\n key: string\n label: string\n width?: number\n minWidth?: number\n sortable?: boolean\n fixed?: boolean | 'left' | 'right'\n align?: 'start' | 'center' | 'end'\n render?: (row: TableItem) => unknown\n showOverflowTooltip?: boolean\n}\n```\n\n<h4 id=\"TableServerOptions\">TableServerOptions</h4>\n\n服务端分页/排序时传给 `serverOptions`,配合 `serverTotal`:\n\n```ts\ninterface TableServerOptions {\n page: number\n rowsPerPage: number\n sortBy?: string | string[]\n sortType?: 'asc' | 'desc' | ('asc' | 'desc')[]\n}\n```\n\n更多见 [API 类型](/docs/types)。\n"
22999
23291
  },
23000
23292
  "en-US": {
23001
23293
  "title": "Table",
@@ -23004,7 +23296,7 @@
23004
23296
  {
23005
23297
  "id": "overview",
23006
23298
  "title": "",
23007
- "body": "# Table\n\n`MTable` displays structured row data. Define columns with `columns`, pass data with `rows`, and use built-in client-side sort, filter, pagination, and row selection—or switch to server-driven pagination.\n\nColumn width rules:\n\n- Columns with `width` use a fixed width\n- Columns without `width` are flexible with a `minWidth` lower bound (default `80`); when `fit` is `true` (default), remaining width is distributed proportionally\n- Horizontal scrolling appears when the total minimum width exceeds the container\n- Prefer `maxHeight` / `tableHeight` when the table body should scroll on its own; when nested under `MLayout` root scroll, fix the table height to avoid stacked scrollbars\n- **Full-viewport main lists (when it fits):** `MPageContent fill` + `MTable fill paginator` — body scrolls; pagination at the page bottom. Skip `fill` for embedded/short tables"
23299
+ "body": "# Table\n\n`MTable` displays structured row data. Define columns with `columns`, pass data with `rows`, and use built-in client-side sort, filter, pagination, and row selection—or switch to server-driven pagination. Header “select all” applies to the current page only.\n\nColumn width rules:\n\n- Columns with `width` use a fixed width\n- Columns without `width` are flexible with a `minWidth` lower bound (default `80`); when `fit` is `true` (default), remaining width is distributed proportionally\n- Horizontal scrolling appears when the total minimum width exceeds the container\n- Prefer `maxHeight` / `tableHeight` when the table body should scroll on its own; when nested under `MLayout` root scroll, fix the table height to avoid stacked scrollbars\n- For full-viewport main lists, use `MPageContent fill` + `MTable fill paginator` (body scrolls; pagination at the bottom). Skip `fill` for embedded or short tables."
23008
23300
  },
23009
23301
  {
23010
23302
  "id": "import",
@@ -23029,45 +23321,80 @@
23029
23321
  {
23030
23322
  "id": "expandable-rows",
23031
23323
  "title": "Expandable rows",
23032
- "body": "Set `expandable` and provide the `expansion` slot. Column `render` works for custom cells; a `cell-{key}` slot overrides `render`.\n\n```vue preview src=\"./demos/ExpandableRows.en.vue\"\n```"
23324
+ "body": "Customize cells with `render` or `#cell-{key}`. Set `expandable` (or `expandConfig`) and provide the `#expansion` slot. In tree mode, `expandedRowKeys` controls tree nodes and cannot be used for detail expansion at the same time.\n\n```vue preview src=\"./demos/ExpandableRows.en.vue\"\n```"
23325
+ },
23326
+ {
23327
+ "id": "fixed-columns",
23328
+ "title": "Fixed columns",
23329
+ "body": "Set `fixed: 'left' | 'right'` on a column (or `fixed: true` for left).\n\n```vue preview src=\"./demos/FixedColumns.en.vue\"\n```"
23330
+ },
23331
+ {
23332
+ "id": "column-resize-and-header-filters",
23333
+ "title": "Column resize and header filters",
23334
+ "body": "Set `resizable` to drag column widths (`v-model:column-widths`). Set `filterable` for a header filter; optional `filters` for checkbox options, otherwise free-text contains.\n\n```vue preview src=\"./demos/ResizeAndFilter.en.vue\"\n```"
23335
+ },
23336
+ {
23337
+ "id": "virtual-scroll",
23338
+ "title": "Virtual scroll",
23339
+ "body": "Enable `virtual` with `maxHeight` / `tableHeight` / `fill`. Expandable tables skip virtualization.\n\n```vue preview src=\"./demos/VirtualScroll.en.vue\"\n```"
23340
+ },
23341
+ {
23342
+ "id": "multi-header-footer-and-merges",
23343
+ "title": "Multi-header, footer, and merges",
23344
+ "body": "Use column `children` for grouped headers; `show-footer` + `footer-method` for summaries; `span-method` for merges.\n\n```vue preview src=\"./demos/GridFeatures.en.vue\"\n```"
23033
23345
  },
23034
23346
  {
23035
23347
  "id": "empty-and-loading",
23036
23348
  "title": "Empty and loading",
23037
23349
  "body": "```vue preview src=\"./demos/EmptyAndLoading.en.vue\"\n```"
23038
23350
  },
23351
+ {
23352
+ "id": "tree-table",
23353
+ "title": "Tree table",
23354
+ "body": "Pass `tree-config` for hierarchical rows: nested `children`, or flat `parentId` with `transform`. Bind expand state with `v-model:expanded-row-keys`. Supports `expandAll` / `expandRowKeys`, `accordion`, `trigger`, `toggleMethod`, and lazy `loadMethod`.\n\nInstance methods: `setTreeExpand`, `setAllTreeExpand`, `toggleTreeExpand`, `isTreeExpandByRow`, `getTreeExpandRecords`, `clearTreeExpand`.\n\nWith multi-select, parent/child cascade and indeterminate are on by default (`checkbox-config.check-strictly=false`). Use `checkMethod` to disable specific rows.\n\n```vue preview src=\"./demos/Tree.en.vue\"\n```"
23355
+ },
23356
+ {
23357
+ "id": "server-mode",
23358
+ "title": "Server mode",
23359
+ "body": "Pass `server-options` with `server-total`, and sync page / page size / sort via `v-model:server-options`.\n\n```vue preview src=\"./demos/Demo7.vue\"\n```"
23360
+ },
23361
+ {
23362
+ "id": "breaking-changes",
23363
+ "title": "Breaking changes",
23364
+ "body": "- Removed built-in cell editing: `editConfig`, column `editable`, `edit-change`, `#edit-{key}`; use `#cell-{key}` / `render` instead\n- Removed `MTreeTable` (including `morya-ui/tree-table`); use `MTable` + `treeConfig`\n- `serverItemsLength` → `serverTotal`\n- `rowsItems` → `pageSizes`\n- Removed `hideHeader`; use `showHeader` (default `true`)\n- Removed `hideRowsPerPage`; use `showRowsPerPage` (default `true`)\n- Removed: `clickEventType`, `rowsPerPageMessage`, `rowsOfPageSeparatorMessage`, `preventContextMenuRow`, `tableNodeId`\n- Events: `contextmenuRow` → `row-contextmenu`; `selectRow` / `deselectRow` / `selectAll` → `select-row` / `deselect-row` / `select-all`\n- Removed events: `updatePageItems`, `updateTotalItems`, `page` (keep `update:page`)\n- Row interaction: click and dblclick always emit (`row-click` / `row-dblclick`); context menu always `preventDefault`s and emits `row-contextmenu`"
23365
+ },
23039
23366
  {
23040
23367
  "id": "tablecolumndefinition",
23041
23368
  "title": "TableColumnDefinition",
23042
- "body": "| Field | Type | Description |\n| --- | --- | --- |\n| `key` | `string` | Field name bound to row data. |\n| `label` | `string` | Column header text. |\n| `width` | `number` | Fixed width in px. |\n| `minWidth` | `number` | Flex column minimum width; default `80`. |\n| `sortable` | `boolean` | Enable sorting. |\n| `fixed` | `boolean \\| 'left' \\| 'right'` | Freeze column (left freeze supported). |\n| `align` | `'start' \\| 'center' \\| 'end'` | Cell alignment. |\n| `render` | `(row) => unknown` | Custom cell renderer. |\n| `showOverflowTooltip` | `boolean` | Tooltip when cell text overflows. |"
23369
+ "body": "| Field | Type | Description |\n| --- | --- | --- |\n| `key` | `string` | Field name bound to row data. |\n| `label` | `string` | Column header text. |\n| `width` | `number` | Fixed width in px. |\n| `minWidth` | `number` | Flex column minimum width; default `80`. |\n| `sortable` | `boolean` | Enable sorting. |\n| `fixed` | `boolean \\| 'left' \\| 'right'` | Freeze column (left freeze supported). |\n| `align` | `'start' \\| 'center' \\| 'end'` | Cell alignment. |\n| `render` | `(row) => unknown` | Custom cell renderer. |\n| `showOverflowTooltip` | `boolean` | Tooltip when cell text overflows. |\n| `resizable` | `boolean` | Drag to resize column width. |\n| `filterable` | `boolean` | Show header filter trigger. |\n| `filters` | `TableColumnFilter[]` | Header filter options; omit for text filter. |\n| `children` | `TableColumnDefinition[]` | Nested columns for multi-level headers. |"
23043
23370
  },
23044
23371
  {
23045
23372
  "id": "props",
23046
23373
  "title": "Props",
23047
- "body": "| Prop | Type | Default | Description |\n| --- | --- | --- | --- |\n| `columns` | `TableColumnDefinition[]` | — | Column definitions. |\n| `rows` | `TableItem[]` | — | Row data. |\n| `fit` | `boolean` | `true` | Flexible columns fill remaining width. |\n| `selectionMode` | `'single' \\| 'multiple' \\| null` | `null` | Row selection mode. |\n| `selection` | `TableItem[] \\| null` | `null` | Multi-select (`v-model:selection`). |\n| `paginator` | `boolean` | `false` | Built-in pagination footer. |\n| `page` | `number` | `1` | Current page (`v-model:page`). |\n| `rowsPerPage` | `number` | `25` | Page size. |\n| `fill` | `boolean` | `false` | Fill remaining parent height (only for full-viewport main lists with `MPageContent fill`). Body scrolls; paginator stays at the bottom. Ignored when `maxHeight` / `tableHeight` is set. |\n| `striped` / `bordered` | `boolean` | `false` | Striped rows / cell borders. |\n| `highlightCurrent` | `boolean` | `false` | Highlight current row. |\n| `loading` / `emptyText` / `emptyDescription` | — | — | Loading and empty states. |\n| `maxHeight` | `number \\| null` | `null` | Scrollable body max height. |\n| `rowKey` | `string` | `'id'` | Stable row key field. |\n| `size` | `'sm' \\| 'md' \\| 'lg'` | — | Table density. |\n| `pt` | [RootPassThrough](/docs/types#RootPassThrough) `{ root? }` | — | Pass-through; see [Styling & attrs](/docs/attrs). |"
23374
+ "body": "| Prop | Type | Default | Description |\n| --- | --- | --- | --- |\n| `columns` | `TableColumnDefinition[]` | — | Column definitions. |\n| `rows` | `TableItem[]` | — | Row data. |\n| `fit` | `boolean` | `true` | Flexible columns fill remaining width. |\n| `selectionMode` | `'single' \\| 'multiple' \\| null` | `null` | Row selection mode. |\n| `selection` | `TableItem[] \\| null` | `null` | Multi-select (`v-model:selection`). |\n| `selectedItem` | `TableItem \\| null` | `null` | Single-select (`v-model:selected-item`). |\n| `serverOptions` | `TableServerOptions \\| null` | `null` | Server paging/sort options. |\n| `serverTotal` | `number` | `0` | Total row count in server mode. |\n| `paginator` | `boolean` | `false` | Built-in pagination footer. |\n| `page` | `number` | `1` | Current page (`v-model:page`). |\n| `rowsPerPage` | `number` | `25` | Page size. |\n| `pageSizes` | `number[]` | `[25, 50, 100]` | Page size options. |\n| `showHeader` | `boolean` | `true` | Show table header. |\n| `showRowsPerPage` | `boolean` | `true` | Show page-size picker. |\n| `fill` | `boolean` | `false` | Fill remaining parent height (only for full-viewport main lists with `MPageContent fill`). Body scrolls; paginator stays at the bottom. Ignored when `maxHeight` / `tableHeight` is set. |\n| `treeConfig` | `TableTreeConfig \\| null` | `null` | Tree rows. |\n| `expandConfig` | `TableExpandConfig \\| null` | `null` | Detail expand (mutually exclusive with tree). |\n| `checkboxConfig` | `TableCheckboxConfig \\| null` | `null` | Multi-select options. |\n| `radioConfig` | `TableRadioConfig \\| null` | `null` | Single-select options. |\n| `striped` / `bordered` | `boolean` | `false` | Striped rows / cell borders. |\n| `highlightCurrent` | `boolean` | `false` | Highlight current row. |\n| `loading` / `emptyText` / `emptyDescription` | — | — | Loading and empty states. |\n| `maxHeight` | `number \\| null` | `null` | Scrollable body max height. |\n| `rowKey` | `string` | `'id'` | Stable row key field. |\n| `size` | `'sm' \\| 'md' \\| 'lg'` | — | Table density. |\n| `pt` | [RootPassThrough](/docs/types#RootPassThrough) `{ root? }` | — | Pass-through; see [Styling & attrs](/docs/attrs). |"
23048
23375
  },
23049
23376
  {
23050
23377
  "id": "slots",
23051
23378
  "title": "Slots",
23052
- "body": "| Slot | Description |\n| --- | --- |\n| `cell-{key}` | Cell for column `{key}`; scope `{ row, value, column }`. |\n| `body-cell` | Any cell; scope `{ row, column, value }`. |\n| `expansion` | Expanded row; scope `{ row }`. |\n| `empty` / `loading` | Empty and loading placeholders. |"
23379
+ "body": "| Slot | Description |\n| --- | --- |\n| `cell-{key}` | Cell for column `{key}`; scope `{ row, value, column }` (use this for custom editors). |\n| `body-cell` | Any cell; scope `{ row, column, value }`. |\n| `expansion` | Expanded row; scope `{ row }`. |\n| `empty` / `loading` | Empty and loading placeholders. |\n| `header-{key}` | Header slot (exact key case). |"
23053
23380
  },
23054
23381
  {
23055
23382
  "id": "events",
23056
23383
  "title": "Events",
23057
- "body": "| Event | Payload | Description |\n| --- | --- | --- |\n| `sort` | `{ sortField?, sortOrder? }` | Sort changed. |\n| `page` | `number` | Page changed. |\n| `row-click` | `{ row, index }` | Row clicked. |\n| `current-change` | `row \\| null, oldRow \\| null` | Current row changed. |\n| `update:selection` | `TableItem[]` | Selection v-model. |\n| `update:page` | `number` | Page v-model. |"
23384
+ "body": "| Event | Payload | Description |\n| --- | --- | --- |\n| `sort` | `{ sortField?, sortOrder? }` | Sort changed. |\n| `row-click` | `{ row, index }`, `Event` | Row clicked. |\n| `row-dblclick` | `{ row, index }`, `Event` | Row double-clicked. |\n| `row-contextmenu` | `item`, `MouseEvent` | Row context menu. |\n| `select-row` / `deselect-row` | `TableItem` | Row selection toggled. |\n| `select-all` | — | Select all on current page. |\n| `current-change` | `row \\| null, oldRow \\| null` | Current row changed. |\n| `update:selection` | `TableItem[]` | Selection v-model. |\n| `update:page` | `number` | Page v-model. |"
23058
23385
  },
23059
23386
  {
23060
23387
  "id": "instance",
23061
23388
  "title": "Instance",
23062
- "body": "Pagination and filter controls exposed via `ref`:\n\n| Method / Property | Description |\n| --- | --- |\n| `currentPageFirstIndex` | Index of the first record on the current page (`-1` when empty). |\n| `currentPageLastIndex` | Index of the last record on the current page. |\n| `clientItemsLength` | Total item count (server total in server mode). |\n| `maxPaginationNumber` | Last page number. |\n| `currentPaginationNumber` | Current page number. |\n| `isLastPage` / `isFirstPage` | Whether the current page is the last / first. |\n| `nextPage()` / `prevPage()` | Go to the next / previous page. |\n| `updatePage(page)` | Jump to a page. |\n| `rowsPerPageOptions` | Rows-per-page options. |\n| `rowsPerPageActiveOption` | Active rows-per-page value. |\n| `updateRowsPerPageActiveOption(n)` | Change rows per page. |\n| `setFilters(filters)` | Set filters programmatically. |"
23389
+ "body": "Pagination, filter, selection, scroll, and expand controls via `ref`:\n\n| Method / Property | Description |\n| --- | --- |\n| `currentPageFirstIndex` | Index of the first record on the current page (`-1` when empty). |\n| `currentPageLastIndex` | Index of the last record on the current page. |\n| `clientItemsLength` | Total item count (server total in server mode). |\n| `maxPaginationNumber` | Last page number. |\n| `currentPaginationNumber` | Current page number. |\n| `isLastPage` / `isFirstPage` | Whether the current page is the last / first. |\n| `nextPage()` / `prevPage()` | Go to the next / previous page. |\n| `updatePage(page)` | Jump to a page. |\n| `rowsPerPageOptions` | Rows-per-page options. |\n| `rowsPerPageActiveOption` | Active rows-per-page value. |\n| `updateRowsPerPageActiveOption(n)` | Change rows per page. |\n| `setFilters(filters)` / `clearFilter()` | Set / clear filters. |\n| `setColumnWidths(widths)` | Set column widths (same as `v-model:column-widths`). |\n| `setHiddenColumns(keys)` | Set hidden column keys (same as `v-model:hidden-columns`). |\n| `setColumnOrder(keys)` | Set leaf column order (same as `v-model:column-order`). |\n| `clearSort()` | Clear sort. |\n| `getCheckboxRecords()` / `setCheckboxRow` / `clearCheckboxRow` / `isCheckedByCheckboxRow` / `isAllCheckboxChecked` | Selection APIs. |\n| `scrollTo(...)` / `scrollToRow(row)` | Scroll helpers. |\n| `setRowExpand` / `toggleRowExpand` / `clearRowExpand` / … | Detail expand (non-tree). |\n| `setTreeExpand` / `toggleTreeExpand` / `clearTreeExpand` / … | Tree expand. |"
23063
23390
  },
23064
23391
  {
23065
23392
  "id": "types",
23066
23393
  "title": "Types",
23067
- "body": "<h4 id=\"TableItem\">TableItem</h4>\n\nSee source `types.ts` for the full definition.\n\n```ts\ntype TableItem = Record<string, unknown>\n```\n\n\n\n<h4 id=\"TableColumnDefinition\">TableColumnDefinition</h4>\n\nColumn definition passed to `columns`:\n\n```ts\ninterface TableColumnDefinition {\n key: string\n label: string\n width?: number\n minWidth?: number\n sortable?: boolean\n fixed?: boolean | 'left' | 'right'\n align?: 'start' | 'center' | 'end' | 'left' | 'right'\n render?: (row: TableItem) => unknown\n filterable?: boolean\n filters?: { label: string; value: string | number }[]\n showOverflowTooltip?: boolean\n}\n```\n\n<h4 id=\"TableServerOptions\">TableServerOptions</h4>\n\nServer-side paging/sorting payload for `serverOptions`, with `serverItemsLength`:\n\n```ts\ninterface TableServerOptions {\n page: number\n rowsPerPage: number\n sortBy?: string | string[]\n sortType?: 'asc' | 'desc' | ('asc' | 'desc')[]\n}\n```\n\n`TableItem` is `Record<string, unknown>`. See also [API types](/docs/types)."
23394
+ "body": "<h4 id=\"TableItem\">TableItem</h4>\n\nSee source `types.ts` for the full definition.\n\n```ts\ntype TableItem = Record<string, unknown>\n```\n\n\n\n<h4 id=\"TableColumnDefinition\">TableColumnDefinition</h4>\n\nColumn definition passed to `columns`:\n\n```ts\ninterface TableColumnDefinition {\n key: string\n label: string\n width?: number\n minWidth?: number\n sortable?: boolean\n fixed?: boolean | 'left' | 'right'\n align?: 'start' | 'center' | 'end'\n render?: (row: TableItem) => unknown\n filterable?: boolean\n filters?: TableColumnFilter[]\n resizable?: boolean\n children?: TableColumnDefinition[]\n showOverflowTooltip?: boolean\n}\n```\n\n<h4 id=\"TableServerOptions\">TableServerOptions</h4>\n\nServer-side paging/sorting payload for `serverOptions`, with `serverTotal`:\n\n```ts\ninterface TableServerOptions {\n page: number\n rowsPerPage: number\n sortBy?: string | string[]\n sortType?: 'asc' | 'desc' | ('asc' | 'desc')[]\n}\n```\n\n`TableItem` is `Record<string, unknown>`. See also [API types](/docs/types)."
23068
23395
  }
23069
23396
  ],
23070
- "markdown": "---\ntitle: Table\ncategory: 03 / DATA\ndescription: Data table with sorting, filtering, selection, pagination, frozen columns, and empty/loading states. Column width supports width / minWidth / fit.\n---\n\n# Table\n\n`MTable` displays structured row data. Define columns with `columns`, pass data with `rows`, and use built-in client-side sort, filter, pagination, and row selection—or switch to server-driven pagination.\n\nColumn width rules:\n\n- Columns with `width` use a fixed width\n- Columns without `width` are flexible with a `minWidth` lower bound (default `80`); when `fit` is `true` (default), remaining width is distributed proportionally\n- Horizontal scrolling appears when the total minimum width exceeds the container\n- Prefer `maxHeight` / `tableHeight` when the table body should scroll on its own; when nested under `MLayout` root scroll, fix the table height to avoid stacked scrollbars\n- **Full-viewport main lists (when it fits):** `MPageContent fill` + `MTable fill paginator` — body scrolls; pagination at the page bottom. Skip `fill` for embedded/short tables\n\n## Import\n\n```ts\nimport type { TableColumnDefinition, TableItem } from 'morya-ui'\nimport { MTable, MTag } from 'morya-ui'\n```\n\n## Basic\n\n```vue preview src=\"./demos/Basic.en.vue\"\n```\n\n## Selection\n\nUse `selection-mode=\"multiple\"` with `v-model:selection`, or `selection-mode=\"single\"` with `v-model:selected-item`.\n\n```vue preview src=\"./demos/Selection.en.vue\"\n```\n\n## Filter and pagination\n\nUse `search-value` / `filter-options` for client filtering. Enable `paginator` with `v-model:page` and `rows-per-page`.\n\n```vue preview src=\"./demos/FilterAndPagination.en.vue\"\n```\n\n## Expandable rows\n\nSet `expandable` and provide the `expansion` slot. Column `render` works for custom cells; a `cell-{key}` slot overrides `render`.\n\n```vue preview src=\"./demos/ExpandableRows.en.vue\"\n```\n\n## Empty and loading\n\n```vue preview src=\"./demos/EmptyAndLoading.en.vue\"\n```\n\n## TableColumnDefinition\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `key` | `string` | Field name bound to row data. |\n| `label` | `string` | Column header text. |\n| `width` | `number` | Fixed width in px. |\n| `minWidth` | `number` | Flex column minimum width; default `80`. |\n| `sortable` | `boolean` | Enable sorting. |\n| `fixed` | `boolean \\| 'left' \\| 'right'` | Freeze column (left freeze supported). |\n| `align` | `'start' \\| 'center' \\| 'end'` | Cell alignment. |\n| `render` | `(row) => unknown` | Custom cell renderer. |\n| `showOverflowTooltip` | `boolean` | Tooltip when cell text overflows. |\n\n## Props\n\n| Prop | Type | Default | Description |\n| --- | --- | --- | --- |\n| `columns` | `TableColumnDefinition[]` | — | Column definitions. |\n| `rows` | `TableItem[]` | — | Row data. |\n| `fit` | `boolean` | `true` | Flexible columns fill remaining width. |\n| `selectionMode` | `'single' \\| 'multiple' \\| null` | `null` | Row selection mode. |\n| `selection` | `TableItem[] \\| null` | `null` | Multi-select (`v-model:selection`). |\n| `paginator` | `boolean` | `false` | Built-in pagination footer. |\n| `page` | `number` | `1` | Current page (`v-model:page`). |\n| `rowsPerPage` | `number` | `25` | Page size. |\n| `fill` | `boolean` | `false` | Fill remaining parent height (only for full-viewport main lists with `MPageContent fill`). Body scrolls; paginator stays at the bottom. Ignored when `maxHeight` / `tableHeight` is set. |\n| `striped` / `bordered` | `boolean` | `false` | Striped rows / cell borders. |\n| `highlightCurrent` | `boolean` | `false` | Highlight current row. |\n| `loading` / `emptyText` / `emptyDescription` | — | — | Loading and empty states. |\n| `maxHeight` | `number \\| null` | `null` | Scrollable body max height. |\n| `rowKey` | `string` | `'id'` | Stable row key field. |\n| `size` | `'sm' \\| 'md' \\| 'lg'` | — | Table density. |\n| `pt` | [RootPassThrough](/docs/types#RootPassThrough) `{ root? }` | — | Pass-through; see [Styling & attrs](/docs/attrs). |\n\n\n## Slots\n\n| Slot | Description |\n| --- | --- |\n| `cell-{key}` | Cell for column `{key}`; scope `{ row, value, column }`. |\n| `body-cell` | Any cell; scope `{ row, column, value }`. |\n| `expansion` | Expanded row; scope `{ row }`. |\n| `empty` / `loading` | Empty and loading placeholders. |\n\n## Events\n\n| Event | Payload | Description |\n| --- | --- | --- |\n| `sort` | `{ sortField?, sortOrder? }` | Sort changed. |\n| `page` | `number` | Page changed. |\n| `row-click` | `{ row, index }` | Row clicked. |\n| `current-change` | `row \\| null, oldRow \\| null` | Current row changed. |\n| `update:selection` | `TableItem[]` | Selection v-model. |\n| `update:page` | `number` | Page v-model. |\n\n## Instance\n\nPagination and filter controls exposed via `ref`:\n\n| Method / Property | Description |\n| --- | --- |\n| `currentPageFirstIndex` | Index of the first record on the current page (`-1` when empty). |\n| `currentPageLastIndex` | Index of the last record on the current page. |\n| `clientItemsLength` | Total item count (server total in server mode). |\n| `maxPaginationNumber` | Last page number. |\n| `currentPaginationNumber` | Current page number. |\n| `isLastPage` / `isFirstPage` | Whether the current page is the last / first. |\n| `nextPage()` / `prevPage()` | Go to the next / previous page. |\n| `updatePage(page)` | Jump to a page. |\n| `rowsPerPageOptions` | Rows-per-page options. |\n| `rowsPerPageActiveOption` | Active rows-per-page value. |\n| `updateRowsPerPageActiveOption(n)` | Change rows per page. |\n| `setFilters(filters)` | Set filters programmatically. |\n\n## Types\n\n<h4 id=\"TableItem\">TableItem</h4>\n\nSee source `types.ts` for the full definition.\n\n```ts\ntype TableItem = Record<string, unknown>\n```\n\n\n\n<h4 id=\"TableColumnDefinition\">TableColumnDefinition</h4>\n\nColumn definition passed to `columns`:\n\n```ts\ninterface TableColumnDefinition {\n key: string\n label: string\n width?: number\n minWidth?: number\n sortable?: boolean\n fixed?: boolean | 'left' | 'right'\n align?: 'start' | 'center' | 'end' | 'left' | 'right'\n render?: (row: TableItem) => unknown\n filterable?: boolean\n filters?: { label: string; value: string | number }[]\n showOverflowTooltip?: boolean\n}\n```\n\n<h4 id=\"TableServerOptions\">TableServerOptions</h4>\n\nServer-side paging/sorting payload for `serverOptions`, with `serverItemsLength`:\n\n```ts\ninterface TableServerOptions {\n page: number\n rowsPerPage: number\n sortBy?: string | string[]\n sortType?: 'asc' | 'desc' | ('asc' | 'desc')[]\n}\n```\n\n`TableItem` is `Record<string, unknown>`. See also [API types](/docs/types).\n"
23397
+ "markdown": "---\ntitle: Table\ncategory: 03 / DATA\ndescription: Data table with sorting, filtering, selection, pagination, frozen columns, and empty/loading states. Column width supports width / minWidth / fit.\n---\n\n# Table\n\n`MTable` displays structured row data. Define columns with `columns`, pass data with `rows`, and use built-in client-side sort, filter, pagination, and row selection—or switch to server-driven pagination. Header “select all” applies to the current page only.\n\nColumn width rules:\n\n- Columns with `width` use a fixed width\n- Columns without `width` are flexible with a `minWidth` lower bound (default `80`); when `fit` is `true` (default), remaining width is distributed proportionally\n- Horizontal scrolling appears when the total minimum width exceeds the container\n- Prefer `maxHeight` / `tableHeight` when the table body should scroll on its own; when nested under `MLayout` root scroll, fix the table height to avoid stacked scrollbars\n- For full-viewport main lists, use `MPageContent fill` + `MTable fill paginator` (body scrolls; pagination at the bottom). Skip `fill` for embedded or short tables.\n\n## Import\n\n```ts\nimport type { TableColumnDefinition, TableItem } from 'morya-ui'\nimport { MTable, MTag } from 'morya-ui'\n```\n\n## Basic\n\n```vue preview src=\"./demos/Basic.en.vue\"\n```\n\n## Selection\n\nUse `selection-mode=\"multiple\"` with `v-model:selection`, or `selection-mode=\"single\"` with `v-model:selected-item`.\n\n```vue preview src=\"./demos/Selection.en.vue\"\n```\n\n## Filter and pagination\n\nUse `search-value` / `filter-options` for client filtering. Enable `paginator` with `v-model:page` and `rows-per-page`.\n\n```vue preview src=\"./demos/FilterAndPagination.en.vue\"\n```\n\n## Expandable rows\n\nCustomize cells with `render` or `#cell-{key}`. Set `expandable` (or `expandConfig`) and provide the `#expansion` slot. In tree mode, `expandedRowKeys` controls tree nodes and cannot be used for detail expansion at the same time.\n\n```vue preview src=\"./demos/ExpandableRows.en.vue\"\n```\n\n## Fixed columns\n\nSet `fixed: 'left' | 'right'` on a column (or `fixed: true` for left).\n\n```vue preview src=\"./demos/FixedColumns.en.vue\"\n```\n\n## Column resize and header filters\n\nSet `resizable` to drag column widths (`v-model:column-widths`). Set `filterable` for a header filter; optional `filters` for checkbox options, otherwise free-text contains.\n\n```vue preview src=\"./demos/ResizeAndFilter.en.vue\"\n```\n\n## Virtual scroll\n\nEnable `virtual` with `maxHeight` / `tableHeight` / `fill`. Expandable tables skip virtualization.\n\n```vue preview src=\"./demos/VirtualScroll.en.vue\"\n```\n\n## Multi-header, footer, and merges\n\nUse column `children` for grouped headers; `show-footer` + `footer-method` for summaries; `span-method` for merges.\n\n```vue preview src=\"./demos/GridFeatures.en.vue\"\n```\n\n## Empty and loading\n\n```vue preview src=\"./demos/EmptyAndLoading.en.vue\"\n```\n\n## Tree table\n\nPass `tree-config` for hierarchical rows: nested `children`, or flat `parentId` with `transform`. Bind expand state with `v-model:expanded-row-keys`. Supports `expandAll` / `expandRowKeys`, `accordion`, `trigger`, `toggleMethod`, and lazy `loadMethod`.\n\nInstance methods: `setTreeExpand`, `setAllTreeExpand`, `toggleTreeExpand`, `isTreeExpandByRow`, `getTreeExpandRecords`, `clearTreeExpand`.\n\nWith multi-select, parent/child cascade and indeterminate are on by default (`checkbox-config.check-strictly=false`). Use `checkMethod` to disable specific rows.\n\n```vue preview src=\"./demos/Tree.en.vue\"\n```\n\n## Server mode\n\nPass `server-options` with `server-total`, and sync page / page size / sort via `v-model:server-options`.\n\n```vue preview src=\"./demos/Demo7.vue\"\n```\n\n## Breaking changes\n\n- Removed built-in cell editing: `editConfig`, column `editable`, `edit-change`, `#edit-{key}`; use `#cell-{key}` / `render` instead\n- Removed `MTreeTable` (including `morya-ui/tree-table`); use `MTable` + `treeConfig`\n- `serverItemsLength` → `serverTotal`\n- `rowsItems` → `pageSizes`\n- Removed `hideHeader`; use `showHeader` (default `true`)\n- Removed `hideRowsPerPage`; use `showRowsPerPage` (default `true`)\n- Removed: `clickEventType`, `rowsPerPageMessage`, `rowsOfPageSeparatorMessage`, `preventContextMenuRow`, `tableNodeId`\n- Events: `contextmenuRow` → `row-contextmenu`; `selectRow` / `deselectRow` / `selectAll` → `select-row` / `deselect-row` / `select-all`\n- Removed events: `updatePageItems`, `updateTotalItems`, `page` (keep `update:page`)\n- Row interaction: click and dblclick always emit (`row-click` / `row-dblclick`); context menu always `preventDefault`s and emits `row-contextmenu`\n\n## TableColumnDefinition\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `key` | `string` | Field name bound to row data. |\n| `label` | `string` | Column header text. |\n| `width` | `number` | Fixed width in px. |\n| `minWidth` | `number` | Flex column minimum width; default `80`. |\n| `sortable` | `boolean` | Enable sorting. |\n| `fixed` | `boolean \\| 'left' \\| 'right'` | Freeze column (left freeze supported). |\n| `align` | `'start' \\| 'center' \\| 'end'` | Cell alignment. |\n| `render` | `(row) => unknown` | Custom cell renderer. |\n| `showOverflowTooltip` | `boolean` | Tooltip when cell text overflows. |\n| `resizable` | `boolean` | Drag to resize column width. |\n| `filterable` | `boolean` | Show header filter trigger. |\n| `filters` | `TableColumnFilter[]` | Header filter options; omit for text filter. |\n| `children` | `TableColumnDefinition[]` | Nested columns for multi-level headers. |\n\n## Props\n\n| Prop | Type | Default | Description |\n| --- | --- | --- | --- |\n| `columns` | `TableColumnDefinition[]` | — | Column definitions. |\n| `rows` | `TableItem[]` | — | Row data. |\n| `fit` | `boolean` | `true` | Flexible columns fill remaining width. |\n| `selectionMode` | `'single' \\| 'multiple' \\| null` | `null` | Row selection mode. |\n| `selection` | `TableItem[] \\| null` | `null` | Multi-select (`v-model:selection`). |\n| `selectedItem` | `TableItem \\| null` | `null` | Single-select (`v-model:selected-item`). |\n| `serverOptions` | `TableServerOptions \\| null` | `null` | Server paging/sort options. |\n| `serverTotal` | `number` | `0` | Total row count in server mode. |\n| `paginator` | `boolean` | `false` | Built-in pagination footer. |\n| `page` | `number` | `1` | Current page (`v-model:page`). |\n| `rowsPerPage` | `number` | `25` | Page size. |\n| `pageSizes` | `number[]` | `[25, 50, 100]` | Page size options. |\n| `showHeader` | `boolean` | `true` | Show table header. |\n| `showRowsPerPage` | `boolean` | `true` | Show page-size picker. |\n| `fill` | `boolean` | `false` | Fill remaining parent height (only for full-viewport main lists with `MPageContent fill`). Body scrolls; paginator stays at the bottom. Ignored when `maxHeight` / `tableHeight` is set. |\n| `treeConfig` | `TableTreeConfig \\| null` | `null` | Tree rows. |\n| `expandConfig` | `TableExpandConfig \\| null` | `null` | Detail expand (mutually exclusive with tree). |\n| `checkboxConfig` | `TableCheckboxConfig \\| null` | `null` | Multi-select options. |\n| `radioConfig` | `TableRadioConfig \\| null` | `null` | Single-select options. |\n| `striped` / `bordered` | `boolean` | `false` | Striped rows / cell borders. |\n| `highlightCurrent` | `boolean` | `false` | Highlight current row. |\n| `loading` / `emptyText` / `emptyDescription` | — | — | Loading and empty states. |\n| `maxHeight` | `number \\| null` | `null` | Scrollable body max height. |\n| `rowKey` | `string` | `'id'` | Stable row key field. |\n| `size` | `'sm' \\| 'md' \\| 'lg'` | — | Table density. |\n| `pt` | [RootPassThrough](/docs/types#RootPassThrough) `{ root? }` | — | Pass-through; see [Styling & attrs](/docs/attrs). |\n\n\n## Slots\n\n| Slot | Description |\n| --- | --- |\n| `cell-{key}` | Cell for column `{key}`; scope `{ row, value, column }` (use this for custom editors). |\n| `body-cell` | Any cell; scope `{ row, column, value }`. |\n| `expansion` | Expanded row; scope `{ row }`. |\n| `empty` / `loading` | Empty and loading placeholders. |\n| `header-{key}` | Header slot (exact key case). |\n\n## Events\n\n| Event | Payload | Description |\n| --- | --- | --- |\n| `sort` | `{ sortField?, sortOrder? }` | Sort changed. |\n| `row-click` | `{ row, index }`, `Event` | Row clicked. |\n| `row-dblclick` | `{ row, index }`, `Event` | Row double-clicked. |\n| `row-contextmenu` | `item`, `MouseEvent` | Row context menu. |\n| `select-row` / `deselect-row` | `TableItem` | Row selection toggled. |\n| `select-all` | — | Select all on current page. |\n| `current-change` | `row \\| null, oldRow \\| null` | Current row changed. |\n| `update:selection` | `TableItem[]` | Selection v-model. |\n| `update:page` | `number` | Page v-model. |\n\n## Instance\n\nPagination, filter, selection, scroll, and expand controls via `ref`:\n\n| Method / Property | Description |\n| --- | --- |\n| `currentPageFirstIndex` | Index of the first record on the current page (`-1` when empty). |\n| `currentPageLastIndex` | Index of the last record on the current page. |\n| `clientItemsLength` | Total item count (server total in server mode). |\n| `maxPaginationNumber` | Last page number. |\n| `currentPaginationNumber` | Current page number. |\n| `isLastPage` / `isFirstPage` | Whether the current page is the last / first. |\n| `nextPage()` / `prevPage()` | Go to the next / previous page. |\n| `updatePage(page)` | Jump to a page. |\n| `rowsPerPageOptions` | Rows-per-page options. |\n| `rowsPerPageActiveOption` | Active rows-per-page value. |\n| `updateRowsPerPageActiveOption(n)` | Change rows per page. |\n| `setFilters(filters)` / `clearFilter()` | Set / clear filters. |\n| `setColumnWidths(widths)` | Set column widths (same as `v-model:column-widths`). |\n| `setHiddenColumns(keys)` | Set hidden column keys (same as `v-model:hidden-columns`). |\n| `setColumnOrder(keys)` | Set leaf column order (same as `v-model:column-order`). |\n| `clearSort()` | Clear sort. |\n| `getCheckboxRecords()` / `setCheckboxRow` / `clearCheckboxRow` / `isCheckedByCheckboxRow` / `isAllCheckboxChecked` | Selection APIs. |\n| `scrollTo(...)` / `scrollToRow(row)` | Scroll helpers. |\n| `setRowExpand` / `toggleRowExpand` / `clearRowExpand` / … | Detail expand (non-tree). |\n| `setTreeExpand` / `toggleTreeExpand` / `clearTreeExpand` / … | Tree expand. |\n\n## Types\n\n<h4 id=\"TableItem\">TableItem</h4>\n\nSee source `types.ts` for the full definition.\n\n```ts\ntype TableItem = Record<string, unknown>\n```\n\n\n\n<h4 id=\"TableColumnDefinition\">TableColumnDefinition</h4>\n\nColumn definition passed to `columns`:\n\n```ts\ninterface TableColumnDefinition {\n key: string\n label: string\n width?: number\n minWidth?: number\n sortable?: boolean\n fixed?: boolean | 'left' | 'right'\n align?: 'start' | 'center' | 'end'\n render?: (row: TableItem) => unknown\n filterable?: boolean\n filters?: TableColumnFilter[]\n resizable?: boolean\n children?: TableColumnDefinition[]\n showOverflowTooltip?: boolean\n}\n```\n\n<h4 id=\"TableServerOptions\">TableServerOptions</h4>\n\nServer-side paging/sorting payload for `serverOptions`, with `serverTotal`:\n\n```ts\ninterface TableServerOptions {\n page: number\n rowsPerPage: number\n sortBy?: string | string[]\n sortType?: 'asc' | 'desc' | ('asc' | 'desc')[]\n}\n```\n\n`TableItem` is `Record<string, unknown>`. See also [API types](/docs/types).\n"
23071
23398
  }
23072
23399
  }
23073
23400
  },
@@ -26376,235 +26703,6 @@
26376
26703
  }
26377
26704
  }
26378
26705
  },
26379
- {
26380
- "id": "TreeTable",
26381
- "name": "TreeTable",
26382
- "exportName": "MTreeTable",
26383
- "category": "03 / DATA",
26384
- "description": "可展开的树形表格。",
26385
- "descriptionEn": "Expandable tree table.",
26386
- "import": "import { MTreeTable } from 'morya-ui'",
26387
- "props": [
26388
- {
26389
- "name": "value",
26390
- "type": "TreeTableNode[]",
26391
- "default": "—",
26392
- "description": "树形行数据。"
26393
- },
26394
- {
26395
- "name": "columns",
26396
- "type": "TreeTableColumn[]",
26397
- "default": "—",
26398
- "description": "列定义。"
26399
- },
26400
- {
26401
- "name": "emptyMessage",
26402
- "type": "string",
26403
- "default": "—",
26404
- "description": "—"
26405
- },
26406
- {
26407
- "name": "expandedKeys",
26408
- "type": "Record<string, boolean>",
26409
- "default": "—",
26410
- "description": "—"
26411
- },
26412
- {
26413
- "name": "pt",
26414
- "type": "[RootPassThrough](/docs/types#RootPassThrough) `{ root? }",
26415
- "default": "—",
26416
- "description": "DOM 透传,见 [样式与 attrs](/docs/attrs)."
26417
- }
26418
- ],
26419
- "events": [
26420
- {
26421
- "name": "node-expand",
26422
- "payload": "TreeTableNode",
26423
- "description": "节点展开。"
26424
- },
26425
- {
26426
- "name": "node-collapse",
26427
- "payload": "TreeTableNode",
26428
- "description": "节点折叠。"
26429
- },
26430
- {
26431
- "name": "update:expandedKeys",
26432
- "payload": "—",
26433
- "description": "—"
26434
- }
26435
- ],
26436
- "slots": [
26437
- {
26438
- "name": "expansion",
26439
- "description": "展开行 `{ row }`。"
26440
- },
26441
- {
26442
- "name": "empty",
26443
- "description": "自定义 `empty` 内容。"
26444
- }
26445
- ],
26446
- "methods": [],
26447
- "examples": [
26448
- {
26449
- "id": "引入-1",
26450
- "section": "引入",
26451
- "sectionId": "引入",
26452
- "lang": "ts",
26453
- "preview": false,
26454
- "code": "import { MTreeTable } from 'morya-ui'",
26455
- "locale": "zh-CN"
26456
- },
26457
- {
26458
- "id": "基础用法-1",
26459
- "section": "基础用法",
26460
- "sectionId": "基础用法",
26461
- "lang": "vue",
26462
- "preview": true,
26463
- "code": "<script setup lang=\"ts\">\nimport { MTreeTable } from 'morya-ui'\n\nconst columns = [\n { field: 'name', header: '名称' },\n { field: 'size', header: '大小' },\n]\nconst value = [\n {\n key: '0',\n data: { name: '应用', size: '100kb' },\n children: [\n { key: '0-0', data: { name: 'Vue', size: '25kb' } },\n { key: '0-1', data: { name: 'React', size: '30kb' } },\n ],\n },\n]\n</script>\n\n<template>\n <MTreeTable :value=\"value\" :columns=\"columns\" />\n</template>",
26464
- "locale": "zh-CN"
26465
- },
26466
- {
26467
- "id": "类型-1",
26468
- "section": "类型",
26469
- "sectionId": "类型",
26470
- "lang": "ts",
26471
- "preview": false,
26472
- "code": "interface TreeTableColumn {\n field: string\n header: string\n}",
26473
- "locale": "zh-CN"
26474
- },
26475
- {
26476
- "id": "类型-2",
26477
- "section": "类型",
26478
- "sectionId": "类型",
26479
- "lang": "ts",
26480
- "preview": false,
26481
- "code": "interface TreeTableNode {\n key: string\n data: Record<string, unknown>\n children?: TreeTableNode[]\n}",
26482
- "locale": "zh-CN"
26483
- },
26484
- {
26485
- "id": "import-1",
26486
- "section": "Import",
26487
- "sectionId": "import",
26488
- "lang": "ts",
26489
- "preview": false,
26490
- "code": "import { MTreeTable } from 'morya-ui'",
26491
- "locale": "en-US"
26492
- },
26493
- {
26494
- "id": "basic-1",
26495
- "section": "Basic",
26496
- "sectionId": "basic",
26497
- "lang": "vue",
26498
- "preview": true,
26499
- "code": "<script setup lang=\"ts\">\nimport { MTreeTable } from 'morya-ui'\n\nconst columns = [\n { field: 'name', header: 'Name' },\n { field: 'size', header: 'Size' },\n]\nconst value = [\n {\n key: '0',\n data: { name: 'Applications', size: '100kb' },\n children: [\n { key: '0-0', data: { name: 'Vue', size: '25kb' } },\n { key: '0-1', data: { name: 'React', size: '30kb' } },\n ],\n },\n]\n</script>\n\n<template>\n <MTreeTable :value=\"value\" :columns=\"columns\" />\n</template>",
26500
- "locale": "en-US"
26501
- },
26502
- {
26503
- "id": "types-1",
26504
- "section": "Types",
26505
- "sectionId": "types",
26506
- "lang": "ts",
26507
- "preview": false,
26508
- "code": "interface TreeTableColumn {\n field: string\n header: string\n}",
26509
- "locale": "en-US"
26510
- },
26511
- {
26512
- "id": "types-2",
26513
- "section": "Types",
26514
- "sectionId": "types",
26515
- "lang": "ts",
26516
- "preview": false,
26517
- "code": "interface TreeTableNode {\n key: string\n data: Record<string, unknown>\n children?: TreeTableNode[]\n}",
26518
- "locale": "en-US"
26519
- }
26520
- ],
26521
- "locales": {
26522
- "zh-CN": {
26523
- "title": "TreeTable",
26524
- "description": "可展开的树形表格。",
26525
- "sections": [
26526
- {
26527
- "id": "overview",
26528
- "title": "",
26529
- "body": "# TreeTable\n\n用列配置展示带 children 的树形数据。"
26530
- },
26531
- {
26532
- "id": "引入",
26533
- "title": "引入",
26534
- "body": "```ts\nimport { MTreeTable } from 'morya-ui'\n```"
26535
- },
26536
- {
26537
- "id": "基础用法",
26538
- "title": "基础用法",
26539
- "body": "```vue preview src=\"./demos/Basic.zh.vue\"\n```"
26540
- },
26541
- {
26542
- "id": "props",
26543
- "title": "Props",
26544
- "body": "| 参数 | 类型 | 默认值 | 说明 |\n| --- | --- | --- | --- |\n| `value` | `TreeTableNode[]` | — | 树形行数据。 |\n| `columns` | `TreeTableColumn[]` | — | 列定义。 |\n| `emptyMessage` | `string` | — | — |\n| `expandedKeys` | `Record<string, boolean>` | — | — |\n| `pt` | [RootPassThrough](/docs/types#RootPassThrough) `{ root? }` | — | DOM 透传,见 [样式与 attrs](/docs/attrs). |"
26545
- },
26546
- {
26547
- "id": "events",
26548
- "title": "Events",
26549
- "body": "| 事件名 | 参数 | 说明 |\n| --- | --- | --- |\n| `node-expand` | `TreeTableNode` | 节点展开。 |\n| `node-collapse` | `TreeTableNode` | 节点折叠。 |\n| `update:expandedKeys` | — | — |"
26550
- },
26551
- {
26552
- "id": "slots",
26553
- "title": "Slots",
26554
- "body": "| 插槽名 | 说明 |\n| --- | --- |\n| `expansion` | 展开行 `{ row }`。 |\n| `empty` | 自定义 `empty` 内容。 |"
26555
- },
26556
- {
26557
- "id": "类型",
26558
- "title": "类型",
26559
- "body": "<h4 id=\"TreeTableColumn\">TreeTableColumn</h4>\n\n完整定义见源码 `types.ts`。\n\n```ts\ninterface TreeTableColumn {\n field: string\n header: string\n}\n```\n\n<h4 id=\"TreeTableNode\">TreeTableNode</h4>\n\n完整定义见源码 `types.ts`。\n\n```ts\ninterface TreeTableNode {\n key: string\n data: Record<string, unknown>\n children?: TreeTableNode[]\n}\n```"
26560
- }
26561
- ],
26562
- "markdown": "---\ntitle: TreeTable\ncategory: 03 / DATA\ndescription: 可展开的树形表格。\n---\n\n# TreeTable\n\n用列配置展示带 children 的树形数据。\n\n## 引入\n\n```ts\nimport { MTreeTable } from 'morya-ui'\n```\n\n## 基础用法\n\n```vue preview src=\"./demos/Basic.zh.vue\"\n```\n\n## Props\n\n| 参数 | 类型 | 默认值 | 说明 |\n| --- | --- | --- | --- |\n| `value` | `TreeTableNode[]` | — | 树形行数据。 |\n| `columns` | `TreeTableColumn[]` | — | 列定义。 |\n| `emptyMessage` | `string` | — | — |\n| `expandedKeys` | `Record<string, boolean>` | — | — |\n| `pt` | [RootPassThrough](/docs/types#RootPassThrough) `{ root? }` | — | DOM 透传,见 [样式与 attrs](/docs/attrs). |\n\n\n## Events\n\n| 事件名 | 参数 | 说明 |\n| --- | --- | --- |\n| `node-expand` | `TreeTableNode` | 节点展开。 |\n| `node-collapse` | `TreeTableNode` | 节点折叠。 |\n| `update:expandedKeys` | — | — |\n\n## Slots\n\n| 插槽名 | 说明 |\n| --- | --- |\n| `expansion` | 展开行 `{ row }`。 |\n| `empty` | 自定义 `empty` 内容。 |\n\n## 类型\n\n<h4 id=\"TreeTableColumn\">TreeTableColumn</h4>\n\n完整定义见源码 `types.ts`。\n\n```ts\ninterface TreeTableColumn {\n field: string\n header: string\n}\n```\n\n<h4 id=\"TreeTableNode\">TreeTableNode</h4>\n\n完整定义见源码 `types.ts`。\n\n```ts\ninterface TreeTableNode {\n key: string\n data: Record<string, unknown>\n children?: TreeTableNode[]\n}\n```\n"
26563
- },
26564
- "en-US": {
26565
- "title": "TreeTable",
26566
- "description": "Expandable tree table.",
26567
- "sections": [
26568
- {
26569
- "id": "overview",
26570
- "title": "",
26571
- "body": "# TreeTable\n\nDisplay tree data with children using column configuration."
26572
- },
26573
- {
26574
- "id": "import",
26575
- "title": "Import",
26576
- "body": "```ts\nimport { MTreeTable } from 'morya-ui'\n```"
26577
- },
26578
- {
26579
- "id": "basic",
26580
- "title": "Basic",
26581
- "body": "```vue preview src=\"./demos/Basic.en.vue\"\n```"
26582
- },
26583
- {
26584
- "id": "props",
26585
- "title": "Props",
26586
- "body": "| Prop | Type | Default | Description |\n| --- | --- | --- | --- |\n| `value` | `TreeTableNode[]` | — | Tree row data. |\n| `columns` | `TreeTableColumn[]` | — | Column definitions. |\n| `pt` | [RootPassThrough](/docs/types#RootPassThrough) `{ root? }` | — | Pass-through; see [Styling & attrs](/docs/attrs). |"
26587
- },
26588
- {
26589
- "id": "events",
26590
- "title": "Events",
26591
- "body": "| Event | Prop | Description |\n| --- | --- | --- |\n| `node-expand` | `TreeTableNode` | Emitted when a node expands. |\n| `node-collapse` | `TreeTableNode` | Emitted when a node collapses. |"
26592
- },
26593
- {
26594
- "id": "slots",
26595
- "title": "Slots",
26596
- "body": "| Slot | Description |\n| --- | --- |\n| `expansion` | Expanded row `{ row }`. |"
26597
- },
26598
- {
26599
- "id": "types",
26600
- "title": "Types",
26601
- "body": "<h4 id=\"TreeTableColumn\">TreeTableColumn</h4>\n\nSee source `types.ts` for the full definition.\n\n```ts\ninterface TreeTableColumn {\n field: string\n header: string\n}\n```\n\n<h4 id=\"TreeTableNode\">TreeTableNode</h4>\n\nSee source `types.ts` for the full definition.\n\n```ts\ninterface TreeTableNode {\n key: string\n data: Record<string, unknown>\n children?: TreeTableNode[]\n}\n```"
26602
- }
26603
- ],
26604
- "markdown": "---\ntitle: TreeTable\ncategory: 03 / DATA\ndescription: Expandable tree table.\n---\n\n# TreeTable\n\nDisplay tree data with children using column configuration.\n\n## Import\n\n```ts\nimport { MTreeTable } from 'morya-ui'\n```\n\n## Basic\n\n```vue preview src=\"./demos/Basic.en.vue\"\n```\n\n## Props\n\n| Prop | Type | Default | Description |\n| --- | --- | --- | --- |\n| `value` | `TreeTableNode[]` | — | Tree row data. |\n| `columns` | `TreeTableColumn[]` | — | Column definitions. |\n| `pt` | [RootPassThrough](/docs/types#RootPassThrough) `{ root? }` | — | Pass-through; see [Styling & attrs](/docs/attrs). |\n\n\n## Events\n\n| Event | Prop | Description |\n| --- | --- | --- |\n| `node-expand` | `TreeTableNode` | Emitted when a node expands. |\n| `node-collapse` | `TreeTableNode` | Emitted when a node collapses. |\n\n## Slots\n\n| Slot | Description |\n| --- | --- |\n| `expansion` | Expanded row `{ row }`. |\n\n## Types\n\n<h4 id=\"TreeTableColumn\">TreeTableColumn</h4>\n\nSee source `types.ts` for the full definition.\n\n```ts\ninterface TreeTableColumn {\n field: string\n header: string\n}\n```\n\n<h4 id=\"TreeTableNode\">TreeTableNode</h4>\n\nSee source `types.ts` for the full definition.\n\n```ts\ninterface TreeTableNode {\n key: string\n data: Record<string, unknown>\n children?: TreeTableNode[]\n}\n```\n"
26605
- }
26606
- }
26607
- },
26608
26706
  {
26609
26707
  "id": "VirtualScroller",
26610
26708
  "name": "VirtualScroller",
@@ -27016,32 +27114,32 @@
27016
27114
  "zh-CN": {
27017
27115
  "title": "一键接入",
27018
27116
  "description": "用 @morya-ui/setup 安装组件库,并按需写入样式、Agent 配置与 MCP。",
27019
- "markdown": "---\ntitle: 一键接入\norder: 3\ndescription: 用 @morya-ui/setup 安装组件库,并按需写入样式、Agent 配置与 MCP。\n---\n\n# 一键接入\n\n[`@morya-ui/setup`](https://www.npmjs.com/package/@morya-ui/setup) 用于在业务 Vue 项目中接入 `morya-ui`:安装依赖、注入样式,并可一并写入 Agent Skill、Cursor 规则与 MCP。手写安装见 [快速上手](/docs/quick-start);AI 生成页面的约定见 [AI 接入](/docs/ai-setup)。\n\n## 命令\n\n在业务项目根目录执行:\n\n```bash\nnpx @morya-ui/setup\n```\n\n默认会:\n\n1. 将 `morya-ui`(以及项目中已有的 `@morya-ui/*`,如 `@morya-ui/nuxt`)升级到 npm `latest`(按锁文件选用 pnpm / yarn / npm)\n2. 复制 `DESIGN.md`、Agent Skill、Cursor rules 与检查脚本\n3. 合并 `.cursor/mcp.json`,接入 [`@morya-ui/mcp@latest`](https://www.npmjs.com/package/@morya-ui/mcp)\n4. 尝试在入口注入 `import 'morya-ui/styles.css'`\n5. 若缺失则追加 `check:colors` 脚本\n\n也可以按场景选用:\n\n```bash\n# 只升级依赖并注入样式\nnpx @morya-ui/setup app\n\n# 升级依赖 + 写入 AI 配置与 MCP(不注入样式)\nnpx @morya-ui/setup ai\n\n# 非交互:默认 skill / 指定 / 全部\nnpx @morya-ui/setup ai --yes\nnpx @morya-ui/setup ai --skills=morya-ui-pages,frontend-design,impeccable\nnpx @morya-ui/setup ai --skills=all\n\n# 只刷新 AI 模板 / MCP,不改动依赖\nnpx @morya-ui/setup ai --skip-install\n```\n\n在 TTY 下,`full` / `ai` 会提示勾选可选 Agent Skill(必选 `morya-ui-pages` 始终写入)。可选 companion 通过 [skills CLI](https://skills.sh/) 安装**最新版**。完成后若写入了 MCP,请 **重启 Cursor**(或重载 MCP)。生成页面前让 Agent 先读 `DESIGN.md`。\n\n## 选项\n\n| Flag | 说明 |\n| --- | --- |\n| `--cwd <dir>` | 目标项目根(默认当前目录) |\n| `--pm pnpm\\|yarn\\|npm` | 指定包管理器 |\n| `--skills <list>` | 逗号分隔的 skill id,或 `all`(跳过交互提示) |\n| `--yes` / `-y` | 使用默认 skill,不提示 |\n| `--force` | 覆盖已有模板文件与 `morya-ui` MCP 条目 |\n| `--dry-run` | 只打印将要执行的操作 |\n| `--skip-install` | 不安装 / 升级 `morya-ui` 与 `@morya-ui/*` |\n| `--skip-template` | 不复制 skill / rules / docs(也不装 companion) |\n| `--skip-mcp` | 不写 MCP 配置 |\n| `--skip-styles` | 不注入样式 import |\n| `--skip-scripts` | 不改 `package.json` scripts |\n\n模板文件默认 **不覆盖**;只有 `--force` 才会覆盖模板与 MCP 条目。勾选的 companion skill 会始终拉取最新版。执行时默认会把相关依赖升到最新;需要跳过时加 `--skip-install`。\n\n### Skills\n\n| Id | 默认 | 安装方式 | 作用 |\n| --- | --- | --- | --- |\n| `morya-ui-pages` | 必选 | 包内 template | 用 `M*` + 黄金布局生成页面 |\n| `frontend-design` | 可选 | skills CLI(`anthropics/skills` 最新) | Express / 品牌向视觉味觉 |\n| `fixing-accessibility` | 可选 | skills CLI(`ibelick/ui-skills` 最新) | 无障碍审计与定向修复 |\n| `impeccable` | 可选 | skills CLI(`pbakaus/impeccable` 最新) | 命名化 polish / 审计 / 改版 |\n\n目录:[`packages/setup/catalog/skills.json`](https://github.com/morya-space/morya-ui/blob/main/packages/setup/catalog/skills.json)。\n\n示例:只补 MCP:\n\n```bash\nnpx @morya-ui/setup ai --skip-template --skip-scripts\n```\n\n## 会落到项目里的内容\n\n| 路径 | 作用 |\n| --- | --- |\n| `DESIGN.md` | AI 设计第一信源(原则、应用根、令牌摘要、禁止项) |\n| `.agents/skills/morya-ui-pages/` | 页面生成 Agent Skill(见 [Agent Skill](/docs/agent-skill)) |\n| `.agents/skills/<optional>/` | 勾选时由 skills CLI 写入的最新 companion |\n| `.cursor/rules/` | Cursor 常驻规则 |\n| `scripts/check-raw-colors.mjs` | 裸色值扫描 |\n| `.cursor/mcp.json` | Cursor MCP(`npx -y @morya-ui/mcp@latest`) |\n\n模板源在仓库 [`design-kit/`](https://github.com/morya-space/morya-ui/tree/main/design-kit)。CLI 不调用 `app.use(MoryaUI)`,也不改 `App.vue`。\n\n## 冲突策略\n\n- 依赖:默认将 `morya-ui@latest` 以及项目中已有的 `@morya-ui/*` 升到最新(可用 `--skip-install` 跳过)\n- 模板文件与 `.cursor/rules/*`:目标已存在则跳过(除非 `--force`)\n- Companion skills(skills CLI):勾选时始终安装/更新为最新版\n- `.cursor/mcp.json`:合并其它 server;已有 `morya-ui` 条目则跳过(除非 `--force`);新建或强制覆盖时使用 `@morya-ui/mcp@latest`\n- `check:colors`:仅在缺失时追加(除非 `--force`)\n- 样式:找到入口且尚未引入时才注入\n\n## 下一步\n\n- [快速上手](/docs/quick-start):组件用法与最小示例 \n- [AI 接入](/docs/ai-setup):用 AI 生成业务页面时如何配合 Skill / MCP \n- [Agent Skill](/docs/agent-skill) · [Agent MCP](/docs/mcp) \n- [组件](/components):浏览 API 与预览\n",
27117
+ "markdown": "---\ntitle: 一键接入\norder: 3\ndescription: 用 @morya-ui/setup 安装组件库,并按需写入样式、Agent 配置与 MCP。\n---\n\n# 一键接入\n\n[`@morya-ui/setup`](https://www.npmjs.com/package/@morya-ui/setup) 用于在业务 Vue 项目中接入 `morya-ui`:安装依赖、注入样式,并可一并写入 Agent Skill、Cursor 规则、便携 `AGENTS.md` 与多编辑器 MCP。手写安装见 [快速上手](/docs/quick-start);AI 生成页面的约定见 [AI 接入](/docs/ai-setup)。\n\n## 命令\n\n在业务项目根目录执行:\n\n```bash\nnpx @morya-ui/setup\n```\n\n默认会:\n\n1. 将 `morya-ui`(以及项目中已有的 `@morya-ui/*`,如 `@morya-ui/nuxt`)升级到 npm `latest`(按锁文件选用 pnpm / yarn / npm)\n2. 复制 `DESIGN.md`、`AGENTS.md`、Agent Skill、Cursor rules 与检查脚本\n3. 合并 MCP 配置(Cursor / VS Code / Zed + 根目录 `.mcp.json`),接入 [`@morya-ui/mcp@latest`](https://www.npmjs.com/package/@morya-ui/mcp)\n4. 尝试在入口注入 `import 'morya-ui/styles.css'`\n5. 若缺失则追加 `check:colors` 脚本\n\n也可以按场景选用:\n\n```bash\n# 只升级依赖并注入样式\nnpx @morya-ui/setup app\n\n# 升级依赖 + 写入 AI 配置与 MCP(不注入样式)\nnpx @morya-ui/setup ai\n\n# 非交互:默认 skill / 指定 / 全部\nnpx @morya-ui/setup ai --yes\nnpx @morya-ui/setup ai --skills=morya-ui-pages,frontend-design,impeccable\nnpx @morya-ui/setup ai --skills=all\n\n# 只写部分编辑器的 MCP(仍会写 .mcp.json)\nnpx @morya-ui/setup ai --editors=cursor,vscode\n\n# 只刷新 AI 模板 / MCP,不改动依赖\nnpx @morya-ui/setup ai --skip-install\n```\n\n在 TTY 下,`full` / `ai` 会提示勾选可选 Agent Skill(必选 `morya-ui-pages` 始终写入)。可选 companion 通过 [skills CLI](https://skills.sh/) 安装**最新版**。完成后若写入了 MCP,请 **重启编辑器或重载 MCP**。生成页面前让 Agent 先读 `DESIGN.md`(及 `AGENTS.md`)。\n\n## 选项\n\n| Flag | 说明 |\n| --- | --- |\n| `--cwd <dir>` | 目标项目根(默认当前目录) |\n| `--pm pnpm\\|yarn\\|npm` | 指定包管理器 |\n| `--skills <list>` | 逗号分隔的 skill id,或 `all`(跳过交互提示) |\n| `--editors <list>` | MCP 目标:`cursor`、`vscode`、`zed` 或 `all`(默认三者;始终另写 `.mcp.json`) |\n| `--yes` / `-y` | 使用默认 skill,不提示 |\n| `--force` | 覆盖已有模板文件与 `morya-ui` MCP 条目 |\n| `--dry-run` | 只打印将要执行的操作 |\n| `--skip-install` | 不安装 / 升级 `morya-ui` 与 `@morya-ui/*` |\n| `--skip-template` | 不复制 skill / rules / docs(也不装 companion) |\n| `--skip-mcp` | 不写 MCP 配置 |\n| `--skip-styles` | 不注入样式 import |\n| `--skip-scripts` | 不改 `package.json` scripts |\n\n模板文件默认 **不覆盖**;只有 `--force` 才会覆盖模板与 MCP 条目。勾选的 companion skill 会始终拉取最新版。执行时默认会把相关依赖升到最新;需要跳过时加 `--skip-install`。\n\n### Skills\n\n| Id | 默认 | 安装方式 | 作用 |\n| --- | --- | --- | --- |\n| `morya-ui-pages` | 必选 | 包内 template | 用 `M*` + 黄金布局生成页面 |\n| `frontend-design` | 可选 | skills CLI(`anthropics/skills` 最新) | Express / 品牌向视觉味觉 |\n| `fixing-accessibility` | 可选 | skills CLI(`ibelick/ui-skills` 最新) | 无障碍审计与定向修复 |\n| `impeccable` | 可选 | skills CLI(`pbakaus/impeccable` 最新) | 命名化 polish / 审计 / 改版 |\n\n目录:[`packages/setup/catalog/skills.json`](https://github.com/morya-space/morya-ui/blob/main/packages/setup/catalog/skills.json)。\n\n示例:只补 MCP:\n\n```bash\nnpx @morya-ui/setup ai --skip-template --skip-scripts\n```\n\n## 会落到项目里的内容\n\n| 路径 | 作用 |\n| --- | --- |\n| `DESIGN.md` | AI 设计第一信源(原则、应用根、令牌摘要、禁止项) |\n| `AGENTS.md` | 编辑器无关的常驻清单(VS Code / Zed / CLI 等) |\n| `.agents/skills/morya-ui-pages/` | 页面生成 Agent Skill(见 [Agent Skill](/docs/agent-skill)) |\n| `.agents/skills/<optional>/` | 勾选时由 skills CLI 写入的最新 companion |\n| `.cursor/rules/` | Cursor 常驻规则 |\n| `scripts/check-raw-colors.mjs` | 裸色值扫描 |\n| `.cursor/mcp.json` | Cursor MCP |\n| `.vscode/mcp.json` | VS Code MCP |\n| `.zed/settings.json` | Zed `context_servers`(合并,不覆盖其它设置) |\n| `.mcp.json` | 便携 MCP(Agent Host / 跨工具发现) |\n\n模板源在仓库 [`design-kit/`](https://github.com/morya-space/morya-ui/tree/main/design-kit)。CLI 不调用 `app.use(MoryaUI)`,也不改 `App.vue`。\n\n## 冲突策略\n\n- 依赖:默认将 `morya-ui@latest` 以及项目中已有的 `@morya-ui/*` 升到最新(可用 `--skip-install` 跳过)\n- 模板文件与 `.cursor/rules/*`:目标已存在则跳过(除非 `--force`)\n- Companion skills(skills CLI):勾选时始终安装/更新为最新版\n- MCP 配置:合并其它 server / 设置;已有 `morya-ui` 条目则跳过(除非 `--force`);新建或强制覆盖时使用 `@morya-ui/mcp@latest`\n- `check:colors`:仅在缺失时追加(除非 `--force`)\n- 样式:找到入口且尚未引入时才注入\n\n## 下一步\n\n- [快速上手](/docs/quick-start):组件用法与最小示例 \n- [AI 接入](/docs/ai-setup):用 AI 生成业务页面时如何配合 Skill / MCP \n- [Agent Skill](/docs/agent-skill) · [Agent MCP](/docs/mcp) \n- [组件](/components):浏览 API 与预览\n",
27020
27118
  "sections": [
27021
27119
  {
27022
27120
  "title": "",
27023
27121
  "id": "overview",
27024
- "body": "# 一键接入\n\n[`@morya-ui/setup`](https://www.npmjs.com/package/@morya-ui/setup) 用于在业务 Vue 项目中接入 `morya-ui`:安装依赖、注入样式,并可一并写入 Agent Skill、Cursor 规则与 MCP。手写安装见 [快速上手](/docs/quick-start);AI 生成页面的约定见 [AI 接入](/docs/ai-setup)。"
27122
+ "body": "# 一键接入\n\n[`@morya-ui/setup`](https://www.npmjs.com/package/@morya-ui/setup) 用于在业务 Vue 项目中接入 `morya-ui`:安装依赖、注入样式,并可一并写入 Agent Skill、Cursor 规则、便携 `AGENTS.md` 与多编辑器 MCP。手写安装见 [快速上手](/docs/quick-start);AI 生成页面的约定见 [AI 接入](/docs/ai-setup)。"
27025
27123
  },
27026
27124
  {
27027
27125
  "title": "命令",
27028
27126
  "id": "命令",
27029
- "body": "在业务项目根目录执行:\n\n```bash\nnpx @morya-ui/setup\n```\n\n默认会:\n\n1. 将 `morya-ui`(以及项目中已有的 `@morya-ui/*`,如 `@morya-ui/nuxt`)升级到 npm `latest`(按锁文件选用 pnpm / yarn / npm)\n2. 复制 `DESIGN.md`、Agent Skill、Cursor rules 与检查脚本\n3. 合并 `.cursor/mcp.json`,接入 [`@morya-ui/mcp@latest`](https://www.npmjs.com/package/@morya-ui/mcp)\n4. 尝试在入口注入 `import 'morya-ui/styles.css'`\n5. 若缺失则追加 `check:colors` 脚本\n\n也可以按场景选用:\n\n```bash\n# 只升级依赖并注入样式\nnpx @morya-ui/setup app\n\n# 升级依赖 + 写入 AI 配置与 MCP(不注入样式)\nnpx @morya-ui/setup ai\n\n# 非交互:默认 skill / 指定 / 全部\nnpx @morya-ui/setup ai --yes\nnpx @morya-ui/setup ai --skills=morya-ui-pages,frontend-design,impeccable\nnpx @morya-ui/setup ai --skills=all\n\n# 只刷新 AI 模板 / MCP,不改动依赖\nnpx @morya-ui/setup ai --skip-install\n```\n\n在 TTY 下,`full` / `ai` 会提示勾选可选 Agent Skill(必选 `morya-ui-pages` 始终写入)。可选 companion 通过 [skills CLI](https://skills.sh/) 安装**最新版**。完成后若写入了 MCP,请 **重启 Cursor**(或重载 MCP)。生成页面前让 Agent 先读 `DESIGN.md`。"
27127
+ "body": "在业务项目根目录执行:\n\n```bash\nnpx @morya-ui/setup\n```\n\n默认会:\n\n1. 将 `morya-ui`(以及项目中已有的 `@morya-ui/*`,如 `@morya-ui/nuxt`)升级到 npm `latest`(按锁文件选用 pnpm / yarn / npm)\n2. 复制 `DESIGN.md`、`AGENTS.md`、Agent Skill、Cursor rules 与检查脚本\n3. 合并 MCP 配置(Cursor / VS Code / Zed + 根目录 `.mcp.json`),接入 [`@morya-ui/mcp@latest`](https://www.npmjs.com/package/@morya-ui/mcp)\n4. 尝试在入口注入 `import 'morya-ui/styles.css'`\n5. 若缺失则追加 `check:colors` 脚本\n\n也可以按场景选用:\n\n```bash\n# 只升级依赖并注入样式\nnpx @morya-ui/setup app\n\n# 升级依赖 + 写入 AI 配置与 MCP(不注入样式)\nnpx @morya-ui/setup ai\n\n# 非交互:默认 skill / 指定 / 全部\nnpx @morya-ui/setup ai --yes\nnpx @morya-ui/setup ai --skills=morya-ui-pages,frontend-design,impeccable\nnpx @morya-ui/setup ai --skills=all\n\n# 只写部分编辑器的 MCP(仍会写 .mcp.json)\nnpx @morya-ui/setup ai --editors=cursor,vscode\n\n# 只刷新 AI 模板 / MCP,不改动依赖\nnpx @morya-ui/setup ai --skip-install\n```\n\n在 TTY 下,`full` / `ai` 会提示勾选可选 Agent Skill(必选 `morya-ui-pages` 始终写入)。可选 companion 通过 [skills CLI](https://skills.sh/) 安装**最新版**。完成后若写入了 MCP,请 **重启编辑器或重载 MCP**。生成页面前让 Agent 先读 `DESIGN.md`(及 `AGENTS.md`)。"
27030
27128
  },
27031
27129
  {
27032
27130
  "title": "选项",
27033
27131
  "id": "选项",
27034
- "body": "| Flag | 说明 |\n| --- | --- |\n| `--cwd <dir>` | 目标项目根(默认当前目录) |\n| `--pm pnpm\\|yarn\\|npm` | 指定包管理器 |\n| `--skills <list>` | 逗号分隔的 skill id,或 `all`(跳过交互提示) |\n| `--yes` / `-y` | 使用默认 skill,不提示 |\n| `--force` | 覆盖已有模板文件与 `morya-ui` MCP 条目 |\n| `--dry-run` | 只打印将要执行的操作 |\n| `--skip-install` | 不安装 / 升级 `morya-ui` 与 `@morya-ui/*` |\n| `--skip-template` | 不复制 skill / rules / docs(也不装 companion) |\n| `--skip-mcp` | 不写 MCP 配置 |\n| `--skip-styles` | 不注入样式 import |\n| `--skip-scripts` | 不改 `package.json` scripts |\n\n模板文件默认 **不覆盖**;只有 `--force` 才会覆盖模板与 MCP 条目。勾选的 companion skill 会始终拉取最新版。执行时默认会把相关依赖升到最新;需要跳过时加 `--skip-install`。\n\n### Skills\n\n| Id | 默认 | 安装方式 | 作用 |\n| --- | --- | --- | --- |\n| `morya-ui-pages` | 必选 | 包内 template | 用 `M*` + 黄金布局生成页面 |\n| `frontend-design` | 可选 | skills CLI(`anthropics/skills` 最新) | Express / 品牌向视觉味觉 |\n| `fixing-accessibility` | 可选 | skills CLI(`ibelick/ui-skills` 最新) | 无障碍审计与定向修复 |\n| `impeccable` | 可选 | skills CLI(`pbakaus/impeccable` 最新) | 命名化 polish / 审计 / 改版 |\n\n目录:[`packages/setup/catalog/skills.json`](https://github.com/morya-space/morya-ui/blob/main/packages/setup/catalog/skills.json)。\n\n示例:只补 MCP:\n\n```bash\nnpx @morya-ui/setup ai --skip-template --skip-scripts\n```"
27132
+ "body": "| Flag | 说明 |\n| --- | --- |\n| `--cwd <dir>` | 目标项目根(默认当前目录) |\n| `--pm pnpm\\|yarn\\|npm` | 指定包管理器 |\n| `--skills <list>` | 逗号分隔的 skill id,或 `all`(跳过交互提示) |\n| `--editors <list>` | MCP 目标:`cursor`、`vscode`、`zed` 或 `all`(默认三者;始终另写 `.mcp.json`) |\n| `--yes` / `-y` | 使用默认 skill,不提示 |\n| `--force` | 覆盖已有模板文件与 `morya-ui` MCP 条目 |\n| `--dry-run` | 只打印将要执行的操作 |\n| `--skip-install` | 不安装 / 升级 `morya-ui` 与 `@morya-ui/*` |\n| `--skip-template` | 不复制 skill / rules / docs(也不装 companion) |\n| `--skip-mcp` | 不写 MCP 配置 |\n| `--skip-styles` | 不注入样式 import |\n| `--skip-scripts` | 不改 `package.json` scripts |\n\n模板文件默认 **不覆盖**;只有 `--force` 才会覆盖模板与 MCP 条目。勾选的 companion skill 会始终拉取最新版。执行时默认会把相关依赖升到最新;需要跳过时加 `--skip-install`。\n\n### Skills\n\n| Id | 默认 | 安装方式 | 作用 |\n| --- | --- | --- | --- |\n| `morya-ui-pages` | 必选 | 包内 template | 用 `M*` + 黄金布局生成页面 |\n| `frontend-design` | 可选 | skills CLI(`anthropics/skills` 最新) | Express / 品牌向视觉味觉 |\n| `fixing-accessibility` | 可选 | skills CLI(`ibelick/ui-skills` 最新) | 无障碍审计与定向修复 |\n| `impeccable` | 可选 | skills CLI(`pbakaus/impeccable` 最新) | 命名化 polish / 审计 / 改版 |\n\n目录:[`packages/setup/catalog/skills.json`](https://github.com/morya-space/morya-ui/blob/main/packages/setup/catalog/skills.json)。\n\n示例:只补 MCP:\n\n```bash\nnpx @morya-ui/setup ai --skip-template --skip-scripts\n```"
27035
27133
  },
27036
27134
  {
27037
27135
  "title": "会落到项目里的内容",
27038
27136
  "id": "会落到项目里的内容",
27039
- "body": "| 路径 | 作用 |\n| --- | --- |\n| `DESIGN.md` | AI 设计第一信源(原则、应用根、令牌摘要、禁止项) |\n| `.agents/skills/morya-ui-pages/` | 页面生成 Agent Skill(见 [Agent Skill](/docs/agent-skill)) |\n| `.agents/skills/<optional>/` | 勾选时由 skills CLI 写入的最新 companion |\n| `.cursor/rules/` | Cursor 常驻规则 |\n| `scripts/check-raw-colors.mjs` | 裸色值扫描 |\n| `.cursor/mcp.json` | Cursor MCP(`npx -y @morya-ui/mcp@latest`) |\n\n模板源在仓库 [`design-kit/`](https://github.com/morya-space/morya-ui/tree/main/design-kit)。CLI 不调用 `app.use(MoryaUI)`,也不改 `App.vue`。"
27137
+ "body": "| 路径 | 作用 |\n| --- | --- |\n| `DESIGN.md` | AI 设计第一信源(原则、应用根、令牌摘要、禁止项) |\n| `AGENTS.md` | 编辑器无关的常驻清单(VS Code / Zed / CLI 等) |\n| `.agents/skills/morya-ui-pages/` | 页面生成 Agent Skill(见 [Agent Skill](/docs/agent-skill)) |\n| `.agents/skills/<optional>/` | 勾选时由 skills CLI 写入的最新 companion |\n| `.cursor/rules/` | Cursor 常驻规则 |\n| `scripts/check-raw-colors.mjs` | 裸色值扫描 |\n| `.cursor/mcp.json` | Cursor MCP |\n| `.vscode/mcp.json` | VS Code MCP |\n| `.zed/settings.json` | Zed `context_servers`(合并,不覆盖其它设置) |\n| `.mcp.json` | 便携 MCP(Agent Host / 跨工具发现) |\n\n模板源在仓库 [`design-kit/`](https://github.com/morya-space/morya-ui/tree/main/design-kit)。CLI 不调用 `app.use(MoryaUI)`,也不改 `App.vue`。"
27040
27138
  },
27041
27139
  {
27042
27140
  "title": "冲突策略",
27043
27141
  "id": "冲突策略",
27044
- "body": "- 依赖:默认将 `morya-ui@latest` 以及项目中已有的 `@morya-ui/*` 升到最新(可用 `--skip-install` 跳过)\n- 模板文件与 `.cursor/rules/*`:目标已存在则跳过(除非 `--force`)\n- Companion skills(skills CLI):勾选时始终安装/更新为最新版\n- `.cursor/mcp.json`:合并其它 server;已有 `morya-ui` 条目则跳过(除非 `--force`);新建或强制覆盖时使用 `@morya-ui/mcp@latest`\n- `check:colors`:仅在缺失时追加(除非 `--force`)\n- 样式:找到入口且尚未引入时才注入"
27142
+ "body": "- 依赖:默认将 `morya-ui@latest` 以及项目中已有的 `@morya-ui/*` 升到最新(可用 `--skip-install` 跳过)\n- 模板文件与 `.cursor/rules/*`:目标已存在则跳过(除非 `--force`)\n- Companion skills(skills CLI):勾选时始终安装/更新为最新版\n- MCP 配置:合并其它 server / 设置;已有 `morya-ui` 条目则跳过(除非 `--force`);新建或强制覆盖时使用 `@morya-ui/mcp@latest`\n- `check:colors`:仅在缺失时追加(除非 `--force`)\n- 样式:找到入口且尚未引入时才注入"
27045
27143
  },
27046
27144
  {
27047
27145
  "title": "下一步",
@@ -27053,32 +27151,32 @@
27053
27151
  "en-US": {
27054
27152
  "title": "One-shot setup",
27055
27153
  "description": "Use @morya-ui/setup to install the library and optionally write styles, Agent config, and MCP.",
27056
- "markdown": "---\ntitle: One-shot setup\norder: 3\ndescription: Use @morya-ui/setup to install the library and optionally write styles, Agent config, and MCP.\n---\n\n# One-shot setup\n\n[`@morya-ui/setup`](https://www.npmjs.com/package/@morya-ui/setup) onboards a consumer Vue app to `morya-ui`: install the dependency, inject styles, and optionally write the Agent skill, Cursor rules, and MCP. For manual install see [Quick start](/docs/quick-start). For AI page-generation workflow see [AI setup](/docs/ai-setup).\n\n## Commands\n\nFrom the app project root:\n\n```bash\nnpx @morya-ui/setup\n```\n\nBy default this will:\n\n1. Install / upgrade `morya-ui` and any existing `@morya-ui/*` (e.g. `@morya-ui/nuxt`) to npm `latest` (pnpm / yarn / npm from the lockfile)\n2. Copy `DESIGN.md`, Agent skill, Cursor rules, and check scripts\n3. Merge `.cursor/mcp.json` for [`@morya-ui/mcp@latest`](https://www.npmjs.com/package/@morya-ui/mcp)\n4. Try to inject `import 'morya-ui/styles.css'`\n5. Add a `check:colors` script when missing\n\nOther common commands:\n\n```bash\n# Upgrade deps + styles only\nnpx @morya-ui/setup app\n\n# Upgrade deps + AI config + MCP (skips styles injection)\nnpx @morya-ui/setup ai\n\n# Non-interactive skill selection\nnpx @morya-ui/setup ai --yes\nnpx @morya-ui/setup ai --skills=morya-ui-pages,frontend-design,impeccable\nnpx @morya-ui/setup ai --skills=all\n\n# Refresh AI template / MCP without touching dependencies\nnpx @morya-ui/setup ai --skip-install\n```\n\nOn a TTY, `full` / `ai` prompts for optional Agent skills (required `morya-ui-pages` is always included). Optional companions are installed at **latest** via the [skills CLI](https://skills.sh/). If MCP was written, **restart Cursor** (or reload MCP). Have the agent read `DESIGN.md` before generating pages.\n\n## Options\n\n| Flag | Meaning |\n| --- | --- |\n| `--cwd <dir>` | Target project root (default: cwd) |\n| `--pm pnpm\\|yarn\\|npm` | Package manager |\n| `--skills <list>` | Comma-separated skill ids, or `all` (skips the prompt) |\n| `--yes` / `-y` | Use default skills without prompting |\n| `--force` | Overwrite existing template files and the `morya-ui` MCP entry |\n| `--dry-run` | Print actions only |\n| `--skip-install` | Skip install / upgrade of `morya-ui` and `@morya-ui/*` |\n| `--skip-template` | Skip copying skill / rules / docs (also skips companion install) |\n| `--skip-mcp` | Skip writing MCP config |\n| `--skip-styles` | Skip styles import injection |\n| `--skip-scripts` | Skip `package.json` scripts |\n\nTemplate files are **not** overwritten by default; use `--force` for templates and the MCP entry. Selected companion skills always refresh to latest. Dependencies are bumped to latest by default; pass `--skip-install` to leave them alone.\n\n### Skills\n\n| Id | Default | Install | Role |\n| --- | --- | --- | --- |\n| `morya-ui-pages` | required | package template | Page generation with `M*` + golden layouts |\n| `frontend-design` | optional | skills CLI (`anthropics/skills`, latest) | Express / brand visual taste |\n| `fixing-accessibility` | optional | skills CLI (`ibelick/ui-skills`, latest) | A11y audit and targeted fixes |\n| `impeccable` | optional | skills CLI (`pbakaus/impeccable`, latest) | Named polish / audit / redesign |\n\nCatalog: [`packages/setup/catalog/skills.json`](https://github.com/morya-space/morya-ui/blob/main/packages/setup/catalog/skills.json).\n\nExample: MCP only:\n\n```bash\nnpx @morya-ui/setup ai --skip-template --skip-scripts\n```\n\n## What lands in the project\n\n| Path | Role |\n| --- | --- |\n| `DESIGN.md` | Primary design brief (principles, app root, token summary, bans) |\n| `.agents/skills/morya-ui-pages/` | Page-generation Agent skill (see [Agent Skill](/docs/agent-skill)) |\n| `.agents/skills/<optional>/` | Latest companion skills via skills CLI when selected |\n| `.cursor/rules/` | Cursor always-on rules |\n| `scripts/check-raw-colors.mjs` | Raw color scan |\n| `.cursor/mcp.json` | Cursor MCP (`npx -y @morya-ui/mcp@latest`) |\n\nTemplate source: [`design-kit/`](https://github.com/morya-space/morya-ui/tree/main/design-kit). The CLI does not call `app.use(MoryaUI)` or edit `App.vue`.\n\n## Conflict policy\n\n- Dependencies: always install / upgrade `morya-ui@latest` and any existing `@morya-ui/*` to `@latest` unless `--skip-install`\n- Template files and `.cursor/rules/*`: skip if the destination exists (unless `--force`)\n- Companion skills (skills CLI): always install/update to latest when selected\n- `.cursor/mcp.json`: merge other servers; skip an existing `morya-ui` entry unless `--force`; new or forced entries use `@morya-ui/mcp@latest`\n- `check:colors`: add only if missing (unless `--force`)\n- Styles: inject only when an entry is found and the import is not already present\n\n## Next steps\n\n- [Quick start](/docs/quick-start): component usage and a minimal example \n- [AI setup](/docs/ai-setup): how setup relates to Skill / MCP for AI page generation \n- [Agent Skill](/docs/agent-skill) · [Agent MCP](/docs/mcp) \n- [Components](/components): browse APIs and previews\n",
27154
+ "markdown": "---\ntitle: One-shot setup\norder: 3\ndescription: Use @morya-ui/setup to install the library and optionally write styles, Agent config, and MCP.\n---\n\n# One-shot setup\n\n[`@morya-ui/setup`](https://www.npmjs.com/package/@morya-ui/setup) onboards a consumer Vue app to `morya-ui`: install the dependency, inject styles, and optionally write the Agent skill, Cursor rules, portable `AGENTS.md`, and multi-editor MCP. For manual install see [Quick start](/docs/quick-start). For AI page-generation workflow see [AI setup](/docs/ai-setup).\n\n## Commands\n\nFrom the app project root:\n\n```bash\nnpx @morya-ui/setup\n```\n\nBy default this will:\n\n1. Install / upgrade `morya-ui` and any existing `@morya-ui/*` (e.g. `@morya-ui/nuxt`) to npm `latest` (pnpm / yarn / npm from the lockfile)\n2. Copy `DESIGN.md`, `AGENTS.md`, Agent skill, Cursor rules, and check scripts\n3. Merge MCP configs (Cursor / VS Code / Zed + root `.mcp.json`) for [`@morya-ui/mcp@latest`](https://www.npmjs.com/package/@morya-ui/mcp)\n4. Try to inject `import 'morya-ui/styles.css'`\n5. Add a `check:colors` script when missing\n\nOther common commands:\n\n```bash\n# Upgrade deps + styles only\nnpx @morya-ui/setup app\n\n# Upgrade deps + AI config + MCP (skips styles injection)\nnpx @morya-ui/setup ai\n\n# Non-interactive skill selection\nnpx @morya-ui/setup ai --yes\nnpx @morya-ui/setup ai --skills=morya-ui-pages,frontend-design,impeccable\nnpx @morya-ui/setup ai --skills=all\n\n# Subset of MCP editor targets (still writes .mcp.json)\nnpx @morya-ui/setup ai --editors=cursor,vscode\n\n# Refresh AI template / MCP without touching dependencies\nnpx @morya-ui/setup ai --skip-install\n```\n\nOn a TTY, `full` / `ai` prompts for optional Agent skills (required `morya-ui-pages` is always included). Optional companions are installed at **latest** via the [skills CLI](https://skills.sh/). If MCP was written, **restart your editor or reload MCP**. Have the agent read `DESIGN.md` (and `AGENTS.md`) before generating pages.\n\n## Options\n\n| Flag | Meaning |\n| --- | --- |\n| `--cwd <dir>` | Target project root (default: cwd) |\n| `--pm pnpm\\|yarn\\|npm` | Package manager |\n| `--skills <list>` | Comma-separated skill ids, or `all` (skips the prompt) |\n| `--editors <list>` | MCP targets: `cursor`, `vscode`, `zed`, or `all` (default: all three; always also writes `.mcp.json`) |\n| `--yes` / `-y` | Use default skills without prompting |\n| `--force` | Overwrite existing template files and the `morya-ui` MCP entry |\n| `--dry-run` | Print actions only |\n| `--skip-install` | Skip install / upgrade of `morya-ui` and `@morya-ui/*` |\n| `--skip-template` | Skip copying skill / rules / docs (also skips companion install) |\n| `--skip-mcp` | Skip writing MCP config |\n| `--skip-styles` | Skip styles import injection |\n| `--skip-scripts` | Skip `package.json` scripts |\n\nTemplate files are **not** overwritten by default; use `--force` for templates and the MCP entry. Selected companion skills always refresh to latest. Dependencies are bumped to latest by default; pass `--skip-install` to leave them alone.\n\n### Skills\n\n| Id | Default | Install | Role |\n| --- | --- | --- | --- |\n| `morya-ui-pages` | required | package template | Page generation with `M*` + golden layouts |\n| `frontend-design` | optional | skills CLI (`anthropics/skills`, latest) | Express / brand visual taste |\n| `fixing-accessibility` | optional | skills CLI (`ibelick/ui-skills`, latest) | A11y audit and targeted fixes |\n| `impeccable` | optional | skills CLI (`pbakaus/impeccable`, latest) | Named polish / audit / redesign |\n\nCatalog: [`packages/setup/catalog/skills.json`](https://github.com/morya-space/morya-ui/blob/main/packages/setup/catalog/skills.json).\n\nExample: MCP only:\n\n```bash\nnpx @morya-ui/setup ai --skip-template --skip-scripts\n```\n\n## What lands in the project\n\n| Path | Role |\n| --- | --- |\n| `DESIGN.md` | Primary design brief (principles, app root, token summary, bans) |\n| `AGENTS.md` | Portable always-on checklist (VS Code / Zed / CLI agents) |\n| `.agents/skills/morya-ui-pages/` | Page-generation Agent skill (see [Agent Skill](/docs/agent-skill)) |\n| `.agents/skills/<optional>/` | Latest companion skills via skills CLI when selected |\n| `.cursor/rules/` | Cursor always-on rules |\n| `scripts/check-raw-colors.mjs` | Raw color scan |\n| `.cursor/mcp.json` | Cursor MCP |\n| `.vscode/mcp.json` | VS Code MCP |\n| `.zed/settings.json` | Zed `context_servers` (merged; other settings kept) |\n| `.mcp.json` | Portable MCP (Agent Host / cross-tool discovery) |\n\nTemplate source: [`design-kit/`](https://github.com/morya-space/morya-ui/tree/main/design-kit). The CLI does not call `app.use(MoryaUI)` or edit `App.vue`.\n\n## Conflict policy\n\n- Dependencies: always install / upgrade `morya-ui@latest` and any existing `@morya-ui/*` to `@latest` unless `--skip-install`\n- Template files and `.cursor/rules/*`: skip if the destination exists (unless `--force`)\n- Companion skills (skills CLI): always install/update to latest when selected\n- MCP configs: merge other servers / settings; skip an existing `morya-ui` entry unless `--force`; new or forced entries use `@morya-ui/mcp@latest`\n- `check:colors`: add only if missing (unless `--force`)\n- Styles: inject only when an entry is found and the import is not already present\n\n## Next steps\n\n- [Quick start](/docs/quick-start): component usage and a minimal example \n- [AI setup](/docs/ai-setup): how setup relates to Skill / MCP for AI page generation \n- [Agent Skill](/docs/agent-skill) · [Agent MCP](/docs/mcp) \n- [Components](/components): browse APIs and previews\n",
27057
27155
  "sections": [
27058
27156
  {
27059
27157
  "title": "",
27060
27158
  "id": "overview",
27061
- "body": "# One-shot setup\n\n[`@morya-ui/setup`](https://www.npmjs.com/package/@morya-ui/setup) onboards a consumer Vue app to `morya-ui`: install the dependency, inject styles, and optionally write the Agent skill, Cursor rules, and MCP. For manual install see [Quick start](/docs/quick-start). For AI page-generation workflow see [AI setup](/docs/ai-setup)."
27159
+ "body": "# One-shot setup\n\n[`@morya-ui/setup`](https://www.npmjs.com/package/@morya-ui/setup) onboards a consumer Vue app to `morya-ui`: install the dependency, inject styles, and optionally write the Agent skill, Cursor rules, portable `AGENTS.md`, and multi-editor MCP. For manual install see [Quick start](/docs/quick-start). For AI page-generation workflow see [AI setup](/docs/ai-setup)."
27062
27160
  },
27063
27161
  {
27064
27162
  "title": "Commands",
27065
27163
  "id": "commands",
27066
- "body": "From the app project root:\n\n```bash\nnpx @morya-ui/setup\n```\n\nBy default this will:\n\n1. Install / upgrade `morya-ui` and any existing `@morya-ui/*` (e.g. `@morya-ui/nuxt`) to npm `latest` (pnpm / yarn / npm from the lockfile)\n2. Copy `DESIGN.md`, Agent skill, Cursor rules, and check scripts\n3. Merge `.cursor/mcp.json` for [`@morya-ui/mcp@latest`](https://www.npmjs.com/package/@morya-ui/mcp)\n4. Try to inject `import 'morya-ui/styles.css'`\n5. Add a `check:colors` script when missing\n\nOther common commands:\n\n```bash\n# Upgrade deps + styles only\nnpx @morya-ui/setup app\n\n# Upgrade deps + AI config + MCP (skips styles injection)\nnpx @morya-ui/setup ai\n\n# Non-interactive skill selection\nnpx @morya-ui/setup ai --yes\nnpx @morya-ui/setup ai --skills=morya-ui-pages,frontend-design,impeccable\nnpx @morya-ui/setup ai --skills=all\n\n# Refresh AI template / MCP without touching dependencies\nnpx @morya-ui/setup ai --skip-install\n```\n\nOn a TTY, `full` / `ai` prompts for optional Agent skills (required `morya-ui-pages` is always included). Optional companions are installed at **latest** via the [skills CLI](https://skills.sh/). If MCP was written, **restart Cursor** (or reload MCP). Have the agent read `DESIGN.md` before generating pages."
27164
+ "body": "From the app project root:\n\n```bash\nnpx @morya-ui/setup\n```\n\nBy default this will:\n\n1. Install / upgrade `morya-ui` and any existing `@morya-ui/*` (e.g. `@morya-ui/nuxt`) to npm `latest` (pnpm / yarn / npm from the lockfile)\n2. Copy `DESIGN.md`, `AGENTS.md`, Agent skill, Cursor rules, and check scripts\n3. Merge MCP configs (Cursor / VS Code / Zed + root `.mcp.json`) for [`@morya-ui/mcp@latest`](https://www.npmjs.com/package/@morya-ui/mcp)\n4. Try to inject `import 'morya-ui/styles.css'`\n5. Add a `check:colors` script when missing\n\nOther common commands:\n\n```bash\n# Upgrade deps + styles only\nnpx @morya-ui/setup app\n\n# Upgrade deps + AI config + MCP (skips styles injection)\nnpx @morya-ui/setup ai\n\n# Non-interactive skill selection\nnpx @morya-ui/setup ai --yes\nnpx @morya-ui/setup ai --skills=morya-ui-pages,frontend-design,impeccable\nnpx @morya-ui/setup ai --skills=all\n\n# Subset of MCP editor targets (still writes .mcp.json)\nnpx @morya-ui/setup ai --editors=cursor,vscode\n\n# Refresh AI template / MCP without touching dependencies\nnpx @morya-ui/setup ai --skip-install\n```\n\nOn a TTY, `full` / `ai` prompts for optional Agent skills (required `morya-ui-pages` is always included). Optional companions are installed at **latest** via the [skills CLI](https://skills.sh/). If MCP was written, **restart your editor or reload MCP**. Have the agent read `DESIGN.md` (and `AGENTS.md`) before generating pages."
27067
27165
  },
27068
27166
  {
27069
27167
  "title": "Options",
27070
27168
  "id": "options",
27071
- "body": "| Flag | Meaning |\n| --- | --- |\n| `--cwd <dir>` | Target project root (default: cwd) |\n| `--pm pnpm\\|yarn\\|npm` | Package manager |\n| `--skills <list>` | Comma-separated skill ids, or `all` (skips the prompt) |\n| `--yes` / `-y` | Use default skills without prompting |\n| `--force` | Overwrite existing template files and the `morya-ui` MCP entry |\n| `--dry-run` | Print actions only |\n| `--skip-install` | Skip install / upgrade of `morya-ui` and `@morya-ui/*` |\n| `--skip-template` | Skip copying skill / rules / docs (also skips companion install) |\n| `--skip-mcp` | Skip writing MCP config |\n| `--skip-styles` | Skip styles import injection |\n| `--skip-scripts` | Skip `package.json` scripts |\n\nTemplate files are **not** overwritten by default; use `--force` for templates and the MCP entry. Selected companion skills always refresh to latest. Dependencies are bumped to latest by default; pass `--skip-install` to leave them alone.\n\n### Skills\n\n| Id | Default | Install | Role |\n| --- | --- | --- | --- |\n| `morya-ui-pages` | required | package template | Page generation with `M*` + golden layouts |\n| `frontend-design` | optional | skills CLI (`anthropics/skills`, latest) | Express / brand visual taste |\n| `fixing-accessibility` | optional | skills CLI (`ibelick/ui-skills`, latest) | A11y audit and targeted fixes |\n| `impeccable` | optional | skills CLI (`pbakaus/impeccable`, latest) | Named polish / audit / redesign |\n\nCatalog: [`packages/setup/catalog/skills.json`](https://github.com/morya-space/morya-ui/blob/main/packages/setup/catalog/skills.json).\n\nExample: MCP only:\n\n```bash\nnpx @morya-ui/setup ai --skip-template --skip-scripts\n```"
27169
+ "body": "| Flag | Meaning |\n| --- | --- |\n| `--cwd <dir>` | Target project root (default: cwd) |\n| `--pm pnpm\\|yarn\\|npm` | Package manager |\n| `--skills <list>` | Comma-separated skill ids, or `all` (skips the prompt) |\n| `--editors <list>` | MCP targets: `cursor`, `vscode`, `zed`, or `all` (default: all three; always also writes `.mcp.json`) |\n| `--yes` / `-y` | Use default skills without prompting |\n| `--force` | Overwrite existing template files and the `morya-ui` MCP entry |\n| `--dry-run` | Print actions only |\n| `--skip-install` | Skip install / upgrade of `morya-ui` and `@morya-ui/*` |\n| `--skip-template` | Skip copying skill / rules / docs (also skips companion install) |\n| `--skip-mcp` | Skip writing MCP config |\n| `--skip-styles` | Skip styles import injection |\n| `--skip-scripts` | Skip `package.json` scripts |\n\nTemplate files are **not** overwritten by default; use `--force` for templates and the MCP entry. Selected companion skills always refresh to latest. Dependencies are bumped to latest by default; pass `--skip-install` to leave them alone.\n\n### Skills\n\n| Id | Default | Install | Role |\n| --- | --- | --- | --- |\n| `morya-ui-pages` | required | package template | Page generation with `M*` + golden layouts |\n| `frontend-design` | optional | skills CLI (`anthropics/skills`, latest) | Express / brand visual taste |\n| `fixing-accessibility` | optional | skills CLI (`ibelick/ui-skills`, latest) | A11y audit and targeted fixes |\n| `impeccable` | optional | skills CLI (`pbakaus/impeccable`, latest) | Named polish / audit / redesign |\n\nCatalog: [`packages/setup/catalog/skills.json`](https://github.com/morya-space/morya-ui/blob/main/packages/setup/catalog/skills.json).\n\nExample: MCP only:\n\n```bash\nnpx @morya-ui/setup ai --skip-template --skip-scripts\n```"
27072
27170
  },
27073
27171
  {
27074
27172
  "title": "What lands in the project",
27075
27173
  "id": "what-lands-in-the-project",
27076
- "body": "| Path | Role |\n| --- | --- |\n| `DESIGN.md` | Primary design brief (principles, app root, token summary, bans) |\n| `.agents/skills/morya-ui-pages/` | Page-generation Agent skill (see [Agent Skill](/docs/agent-skill)) |\n| `.agents/skills/<optional>/` | Latest companion skills via skills CLI when selected |\n| `.cursor/rules/` | Cursor always-on rules |\n| `scripts/check-raw-colors.mjs` | Raw color scan |\n| `.cursor/mcp.json` | Cursor MCP (`npx -y @morya-ui/mcp@latest`) |\n\nTemplate source: [`design-kit/`](https://github.com/morya-space/morya-ui/tree/main/design-kit). The CLI does not call `app.use(MoryaUI)` or edit `App.vue`."
27174
+ "body": "| Path | Role |\n| --- | --- |\n| `DESIGN.md` | Primary design brief (principles, app root, token summary, bans) |\n| `AGENTS.md` | Portable always-on checklist (VS Code / Zed / CLI agents) |\n| `.agents/skills/morya-ui-pages/` | Page-generation Agent skill (see [Agent Skill](/docs/agent-skill)) |\n| `.agents/skills/<optional>/` | Latest companion skills via skills CLI when selected |\n| `.cursor/rules/` | Cursor always-on rules |\n| `scripts/check-raw-colors.mjs` | Raw color scan |\n| `.cursor/mcp.json` | Cursor MCP |\n| `.vscode/mcp.json` | VS Code MCP |\n| `.zed/settings.json` | Zed `context_servers` (merged; other settings kept) |\n| `.mcp.json` | Portable MCP (Agent Host / cross-tool discovery) |\n\nTemplate source: [`design-kit/`](https://github.com/morya-space/morya-ui/tree/main/design-kit). The CLI does not call `app.use(MoryaUI)` or edit `App.vue`."
27077
27175
  },
27078
27176
  {
27079
27177
  "title": "Conflict policy",
27080
27178
  "id": "conflict-policy",
27081
- "body": "- Dependencies: always install / upgrade `morya-ui@latest` and any existing `@morya-ui/*` to `@latest` unless `--skip-install`\n- Template files and `.cursor/rules/*`: skip if the destination exists (unless `--force`)\n- Companion skills (skills CLI): always install/update to latest when selected\n- `.cursor/mcp.json`: merge other servers; skip an existing `morya-ui` entry unless `--force`; new or forced entries use `@morya-ui/mcp@latest`\n- `check:colors`: add only if missing (unless `--force`)\n- Styles: inject only when an entry is found and the import is not already present"
27179
+ "body": "- Dependencies: always install / upgrade `morya-ui@latest` and any existing `@morya-ui/*` to `@latest` unless `--skip-install`\n- Template files and `.cursor/rules/*`: skip if the destination exists (unless `--force`)\n- Companion skills (skills CLI): always install/update to latest when selected\n- MCP configs: merge other servers / settings; skip an existing `morya-ui` entry unless `--force`; new or forced entries use `@morya-ui/mcp@latest`\n- `check:colors`: add only if missing (unless `--force`)\n- Styles: inject only when an entry is found and the import is not already present"
27082
27180
  },
27083
27181
  {
27084
27182
  "title": "Next steps",
@@ -27812,7 +27910,7 @@
27812
27910
  "zh-CN": {
27813
27911
  "title": "AI 接入",
27814
27912
  "description": "用 AI 生成业务页面时,如何配合 @morya-ui/setup、Agent Skill 与 MCP。",
27815
- "markdown": "---\ntitle: AI 接入\norder: 12\ndescription: 用 AI 生成业务页面时,如何配合 @morya-ui/setup、Agent Skill 与 MCP。\n---\n\n# AI 接入\n\n面向 **用 AI 生成业务页面** 的业务项目。先用 [`@morya-ui/setup`](https://www.npmjs.com/package/@morya-ui/setup) 把库与 AI 配置装进项目(命令与选项见 [一键接入](/docs/setup)),再按本文约定生成页面。\n\n日常手写代码仍可只 `pnpm add morya-ui`,见 [快速上手](/docs/quick-start)。\n\n## 推荐流程\n\n1. 在业务项目根目录执行 `npx @morya-ui/setup`(会把 `morya-ui` / 已有 `@morya-ui/*` 升到最新;只要写 AI 配置可用 `npx @morya-ui/setup ai`)\n2. **重启 Cursor**(或重载 MCP)\n3. 生成页面前让 Agent 先读 `DESIGN.md`,需要时再读黄金样例与 [Agent Skill](/docs/agent-skill)\n4. 不确定组件 API 时走 [Agent MCP](/docs/mcp),不要臆造 props\n\n## 与 Skill / MCP 的关系\n\n- **[一键接入](/docs/setup)**:把库与 AI 配置写入项目 \n- **[Agent Skill](/docs/agent-skill)**:按需指导如何用 `morya-ui` 做页面 \n- **MCP**:运行时检索真实组件 API / 示例 \n\n工具列表与多客户端配置见 [Agent MCP](/docs/mcp)。也可以不跑 setup,按该页手写 MCP。\n\n## 下一步\n\n- [一键接入](/docs/setup):`@morya-ui/setup` 命令与落地文件 \n- [Agent Skill](/docs/agent-skill):`morya-ui-pages` 何时用、表面地图 \n- [Agent MCP](/docs/mcp):工具与客户端配置 \n- [快速上手](/docs/quick-start):手写安装与最小示例 \n- [组件](/components):浏览 API 与预览\n",
27913
+ "markdown": "---\ntitle: AI 接入\norder: 12\ndescription: 用 AI 生成业务页面时,如何配合 @morya-ui/setup、Agent Skill 与 MCP。\n---\n\n# AI 接入\n\n面向 **用 AI 生成业务页面** 的业务项目。先用 [`@morya-ui/setup`](https://www.npmjs.com/package/@morya-ui/setup) 把库与 AI 配置装进项目(命令与选项见 [一键接入](/docs/setup)),再按本文约定生成页面。\n\n日常手写代码仍可只 `pnpm add morya-ui`,见 [快速上手](/docs/quick-start)。\n\n## 推荐流程\n\n1. 在业务项目根目录执行 `npx @morya-ui/setup`(会把 `morya-ui` / 已有 `@morya-ui/*` 升到最新;只要写 AI 配置可用 `npx @morya-ui/setup ai`)\n2. **重启编辑器或重载 MCP**(Cursor / VS Code / Zed 等)\n3. 生成页面前让 Agent 先读 `DESIGN.md` 与 `AGENTS.md`,需要时再读 [Agent Skill](/docs/agent-skill) 与 MCP 片段\n4. 不确定组件 API 时走 [Agent MCP](/docs/mcp),不要臆造 props\n\n## 与 Skill / MCP 的关系\n\n- **[一键接入](/docs/setup)**:把库与 AI 配置写入项目 \n- **[Agent Skill](/docs/agent-skill)**:按需指导如何用 `morya-ui` 做页面 \n- **MCP**:运行时检索真实组件 API / 示例 \n\n工具列表与多客户端配置见 [Agent MCP](/docs/mcp)。也可以不跑 setup,按该页手写 MCP。\n\n## 下一步\n\n- [一键接入](/docs/setup):`@morya-ui/setup` 命令与落地文件 \n- [Agent Skill](/docs/agent-skill):`morya-ui-pages` 何时用、表面地图 \n- [Agent MCP](/docs/mcp):工具与客户端配置 \n- [快速上手](/docs/quick-start):手写安装与最小示例 \n- [组件](/components):浏览 API 与预览\n",
27816
27914
  "sections": [
27817
27915
  {
27818
27916
  "title": "",
@@ -27822,7 +27920,7 @@
27822
27920
  {
27823
27921
  "title": "推荐流程",
27824
27922
  "id": "推荐流程",
27825
- "body": "1. 在业务项目根目录执行 `npx @morya-ui/setup`(会把 `morya-ui` / 已有 `@morya-ui/*` 升到最新;只要写 AI 配置可用 `npx @morya-ui/setup ai`)\n2. **重启 Cursor**(或重载 MCP)\n3. 生成页面前让 Agent 先读 `DESIGN.md`,需要时再读黄金样例与 [Agent Skill](/docs/agent-skill)\n4. 不确定组件 API 时走 [Agent MCP](/docs/mcp),不要臆造 props"
27923
+ "body": "1. 在业务项目根目录执行 `npx @morya-ui/setup`(会把 `morya-ui` / 已有 `@morya-ui/*` 升到最新;只要写 AI 配置可用 `npx @morya-ui/setup ai`)\n2. **重启编辑器或重载 MCP**(Cursor / VS Code / Zed 等)\n3. 生成页面前让 Agent 先读 `DESIGN.md` 与 `AGENTS.md`,需要时再读 [Agent Skill](/docs/agent-skill) 与 MCP 片段\n4. 不确定组件 API 时走 [Agent MCP](/docs/mcp),不要臆造 props"
27826
27924
  },
27827
27925
  {
27828
27926
  "title": "与 Skill / MCP 的关系",
@@ -27839,7 +27937,7 @@
27839
27937
  "en-US": {
27840
27938
  "title": "AI setup",
27841
27939
  "description": "How @morya-ui/setup, Agent skill, and MCP work together for AI-assisted pages.",
27842
- "markdown": "---\ntitle: AI setup\norder: 12\ndescription: How @morya-ui/setup, Agent skill, and MCP work together for AI-assisted pages.\n---\n\n# AI setup\n\nFor **AI-assisted page generation** in consumer apps. Install the library and AI config with [`@morya-ui/setup`](https://www.npmjs.com/package/@morya-ui/setup) (commands and options: [One-shot setup](/docs/setup)), then follow this page when generating pages.\n\nHand-written apps can still use only `pnpm add morya-ui` — see [Quick start](/docs/quick-start).\n\n## Recommended flow\n\n1. From the app root run `npx @morya-ui/setup` (upgrades `morya-ui` / existing `@morya-ui/*` to latest; use `npx @morya-ui/setup ai` when you mainly need the AI pack)\n2. **Restart Cursor** (or reload MCP)\n3. Have the agent read `DESIGN.md` before generating pages; use golden pages and [Agent Skill](/docs/agent-skill) as needed\n4. Look up real APIs via [Agent MCP](/docs/mcp) — do not invent props\n\n## Relation to Skill / MCP\n\n- **[One-shot setup](/docs/setup)**: write the library and AI config into the project \n- **[Agent Skill](/docs/agent-skill)**: on-demand guidance for building pages with `morya-ui` \n- **MCP**: runtime doc lookup for AI clients \n\nTools and multi-client configs: [Agent MCP](/docs/mcp). You can configure MCP by hand from that page without running setup.\n\n## Next steps\n\n- [One-shot setup](/docs/setup): `@morya-ui/setup` commands and files \n- [Agent Skill](/docs/agent-skill): when to use `morya-ui-pages`, surface map \n- [Agent MCP](/docs/mcp): tools and client config \n- [Quick start](/docs/quick-start): manual install and a minimal example \n- [Components](/components): browse APIs and previews\n",
27940
+ "markdown": "---\ntitle: AI setup\norder: 12\ndescription: How @morya-ui/setup, Agent skill, and MCP work together for AI-assisted pages.\n---\n\n# AI setup\n\nFor **AI-assisted page generation** in consumer apps. Install the library and AI config with [`@morya-ui/setup`](https://www.npmjs.com/package/@morya-ui/setup) (commands and options: [One-shot setup](/docs/setup)), then follow this page when generating pages.\n\nHand-written apps can still use only `pnpm add morya-ui` — see [Quick start](/docs/quick-start).\n\n## Recommended flow\n\n1. From the app root run `npx @morya-ui/setup` (upgrades `morya-ui` / existing `@morya-ui/*` to latest; use `npx @morya-ui/setup ai` when you mainly need the AI pack)\n2. **Restart your editor or reload MCP** (Cursor / VS Code / Zed, …)\n3. Have the agent read `DESIGN.md` and `AGENTS.md` before generating pages; use [Agent Skill](/docs/agent-skill) and MCP snippets as needed\n4. Look up real APIs via [Agent MCP](/docs/mcp) — do not invent props\n\n## Relation to Skill / MCP\n\n- **[One-shot setup](/docs/setup)**: write the library and AI config into the project \n- **[Agent Skill](/docs/agent-skill)**: on-demand guidance for building pages with `morya-ui` \n- **MCP**: runtime doc lookup for AI clients \n\nTools and multi-client configs: [Agent MCP](/docs/mcp). You can configure MCP by hand from that page without running setup.\n\n## Next steps\n\n- [One-shot setup](/docs/setup): `@morya-ui/setup` commands and files \n- [Agent Skill](/docs/agent-skill): when to use `morya-ui-pages`, surface map \n- [Agent MCP](/docs/mcp): tools and client config \n- [Quick start](/docs/quick-start): manual install and a minimal example \n- [Components](/components): browse APIs and previews\n",
27843
27941
  "sections": [
27844
27942
  {
27845
27943
  "title": "",
@@ -27849,7 +27947,7 @@
27849
27947
  {
27850
27948
  "title": "Recommended flow",
27851
27949
  "id": "recommended-flow",
27852
- "body": "1. From the app root run `npx @morya-ui/setup` (upgrades `morya-ui` / existing `@morya-ui/*` to latest; use `npx @morya-ui/setup ai` when you mainly need the AI pack)\n2. **Restart Cursor** (or reload MCP)\n3. Have the agent read `DESIGN.md` before generating pages; use golden pages and [Agent Skill](/docs/agent-skill) as needed\n4. Look up real APIs via [Agent MCP](/docs/mcp) — do not invent props"
27950
+ "body": "1. From the app root run `npx @morya-ui/setup` (upgrades `morya-ui` / existing `@morya-ui/*` to latest; use `npx @morya-ui/setup ai` when you mainly need the AI pack)\n2. **Restart your editor or reload MCP** (Cursor / VS Code / Zed, …)\n3. Have the agent read `DESIGN.md` and `AGENTS.md` before generating pages; use [Agent Skill](/docs/agent-skill) and MCP snippets as needed\n4. Look up real APIs via [Agent MCP](/docs/mcp) — do not invent props"
27853
27951
  },
27854
27952
  {
27855
27953
  "title": "Relation to Skill / MCP",
@@ -27970,17 +28068,17 @@
27970
28068
  "zh-CN": {
27971
28069
  "title": "Agent MCP",
27972
28070
  "description": "可选的 MCP 服务,供支持 Model Context Protocol 的 AI 客户端检索本库文档。",
27973
- "markdown": "---\ntitle: Agent MCP\norder: 14\ndescription: 可选的 MCP 服务,供支持 Model Context Protocol 的 AI 客户端检索本库文档。\n---\n\n# Agent MCP\n\n[`@morya-ui/mcp`](https://www.npmjs.com/package/@morya-ui/mcp) 是可选的 [Model Context Protocol](https://modelcontextprotocol.io/)(stdio)服务。它把本站组件文档、示例与指南做成可检索工具,方便 **支持 MCP 的 AI 客户端** 按真实 API 生成代码。\n\n日常使用组件库 **不需要** 安装或配置 MCP。应用里仍然只依赖:\n\n```bash\npnpm add morya-ui\n```\n\n```ts\nimport 'morya-ui/styles.css'\n```\n\n若要连同 Agent Skill、Cursor 规则一起装好,见 [一键接入](/docs/setup);AI 流程见 [AI 接入](/docs/ai-setup);Skill 本身说明见 [Agent Skill](/docs/agent-skill)。\n\n## 接入方式\n\nMCP 客户端通过 stdio 启动本包即可:\n\n```bash\nnpx -y @morya-ui/mcp\n```\n\n通用写法:\n\n```json\n{\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n}\n```\n\n字段名因客户端而异,只要支持 MCP stdio 即可接入。\n\n### 常见客户端配置示例\n\n以下为常见产品的配置片段,键名可能随版本变化,以各产品官方文档为准。\n\n**Cursor**(`.cursor/mcp.json` 或用户级 MCP 配置):\n\n```json\n{\n \"mcpServers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**Claude Desktop / Claude Code**(`claude_desktop_config.json` 等):\n\n```json\n{\n \"mcpServers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**Windsurf**(MCP 设置中的 servers 配置):\n\n```json\n{\n \"mcpServers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**Cline**(VS Code 扩展设置中的 MCP servers):\n\n```json\n{\n \"mcpServers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**Zed**(`settings.json` → `context_servers`):\n\n```json\n{\n \"context_servers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**Continue**(`config.json` / YAML 中的 MCP servers,字段名以当前版本为准):\n\n```json\n{\n \"mcpServers\": [\n {\n \"name\": \"morya-ui\",\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n ]\n}\n```\n\n## 可用工具\n\n### 基础 — 查组件文档\n\n| 工具 | 作用 |\n| --- | --- |\n| `list` | 列出组件 / 指南 / 示例 / 分类 / 页面模式 |\n| `search` | 搜索文档、示例、页面模式与组件选型指南 |\n| `get_component` | 读取组件说明与 API |\n| `get_example` | 获取源码示例 |\n| `get_guide` | 读取指南 |\n| `get_setup` | 安装与初始化说明 |\n| `validate_usage` | 对照文档粗检 props / events 用法 |\n| `version` | 版本与目录状态 |\n\n### 高级 — 页面组合(可选)\n\n| 工具 | 作用 |\n| --- | --- |\n| `list_patterns` | 列出可复用的页面组合模式 |\n| `get_pattern` | 读取模式的结构、布局与交互规则 |\n| `recommend_page` | 根据页面意图推荐模式;可附带 starter 脚手架 |\n| `get_design_rules` | 设计令牌与 MPage* 组合配方 |\n| `recommend_component` | 列出、阅读或推荐组件选型指南 |\n| `list_golden_pages` | 列出黄金样例页面 |\n| `get_golden_page` | 读取黄金样例 Vue 源码(含 settings / wizard / result / detail / form-in-dialog 等;`includeScaffold` 有样例时返回样例源码) |\n| `list_page_snippets` | 列出可复用的页面区块 snippet |\n| `get_page_snippet` | 读取局部区块 snippet(筛选区、工具栏等) |\n| `validate_page` | 校验页面组合、间距、双边框,以及 rows / message / MStatus 等契约 |\n\n多数工具支持 `mode`:`zh`(默认)或 `en`。\n\n### 推荐工作流\n\n**查单个组件:** `search` / `get_component` → `get_example` → `validate_usage`\n\n**规划整页:** `recommend_page` → `get_golden_page` → `get_pattern` → `get_design_rules` → `get_component` / `get_example` → **`validate_usage`** → `validate_page`\n\n**改局部区块:** `get_page_snippet(section)` → `get_component` / `get_example` → `validate_usage` → `validate_page`\n\n需要 starter 代码时,给 `recommend_page` 传 `includeScaffold: true`(有黄金样例时返回样例源码,不是另一套模板):\n\n```json\n{\n \"intent\": \"油井管理列表\",\n \"pageType\": \"list\",\n \"features\": [\"筛选\", \"新增\", \"分页\"],\n \"includeScaffold\": true\n}\n```\n\n`recommend_component` 用法:\n\n- 不传 `query` 和 `decision` → 列出全部选型指南\n- 只传 `decision` → 阅读某一指南\n- 传 `query` → 根据问题推荐组件\n\n当前指南包括:`form-surface-choice`、`overlay-choice`、`data-display-choice`、`selection-choice`(含 Select / TreeSelect / CascadeSelect / Listbox / SelectButton / Radio / AutoComplete)、`status-label-choice`、`empty-result-choice`、`action-menu-choice`、`loading-choice`、`page-scroll-choice`、`surface-choice`、`page-section-choice`、`layout-spacing-choice`、`surface-nesting-choice`。\n\n## 对话示例\n\n接入后,可直接让助手调用本服务,例如:\n\n> 用 morya-ui 的 MCP 查一下 Dialog 的 props,并给一个带确认 / 取消按钮的示例。\n\n> 搜索和「日期」相关的组件,选一个适合表单的,按文档写出最小用法。\n\n> 根据 MCP 里 Button 的文档,写一个 `severity=\"danger\"` 的删除按钮,并校验 props 是否合法。\n\n助手应先调用工具,再基于返回内容生成类似:\n\n```vue\n<script setup lang=\"ts\">\nimport { MButton } from 'morya-ui'\n</script>\n\n<template>\n <MButton label=\"删除\" severity=\"danger\" />\n</template>\n```\n\n## 与文档站的关系\n\n目录与本站同源(组件 `docs/` + 指南 Markdown)。官网文档更新后,维护者重新发布 `@morya-ui/mcp`,客户端通过 `npx -y` 即可拿到新版本。\n\n更多实现细节见仓库内 [packages/ui-mcp/README.md](https://github.com/morya-space/morya-ui/tree/main/packages/ui-mcp)。\n\n## 下一步\n\n- [AI 接入](/docs/ai-setup):`npx @morya-ui/setup`、skill 与 Cursor MCP\n- [Agent Skill](/docs/agent-skill):`morya-ui-pages` 何时用、表面地图\n- [快速上手](/docs/quick-start):在应用中安装并使用组件\n- [组件](/components):浏览全部组件与交互示例\n",
28071
+ "markdown": "---\ntitle: Agent MCP\norder: 14\ndescription: 可选的 MCP 服务,供支持 Model Context Protocol 的 AI 客户端检索本库文档。\n---\n\n# Agent MCP\n\n[`@morya-ui/mcp`](https://www.npmjs.com/package/@morya-ui/mcp) 是可选的 [Model Context Protocol](https://modelcontextprotocol.io/)(stdio)服务。它把本站组件文档、示例与指南做成可检索工具,方便 **支持 MCP 的 AI 客户端** 按真实 API 生成代码。\n\n日常使用组件库 **不需要** 安装或配置 MCP。应用里仍然只依赖:\n\n```bash\npnpm add morya-ui\n```\n\n```ts\nimport 'morya-ui/styles.css'\n```\n\n若要连同 Agent Skill、规则与多编辑器 MCP 一起装好,见 [一键接入](/docs/setup)(默认写入 Cursor / VS Code / Zed 与 `.mcp.json`);AI 流程见 [AI 接入](/docs/ai-setup);Skill 本身说明见 [Agent Skill](/docs/agent-skill)。\n\n## 接入方式\n\nMCP 客户端通过 stdio 启动本包即可:\n\n```bash\nnpx -y @morya-ui/mcp\n```\n\n通用写法:\n\n```json\n{\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n}\n```\n\n字段名因客户端而异,只要支持 MCP stdio 即可接入。\n\n### 常见客户端配置示例\n\n以下为常见产品的配置片段,键名可能随版本变化,以各产品官方文档为准。\n\n**Cursor**(`.cursor/mcp.json` 或用户级 MCP 配置;setup 会写入):\n\n```json\n{\n \"mcpServers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**VS Code**(工作区 `.vscode/mcp.json`;setup 会写入):\n\n```json\n{\n \"servers\": {\n \"morya-ui\": {\n \"type\": \"stdio\",\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**便携**(项目根 `.mcp.json`;setup 会写入,供 Agent Host / 跨工具发现):\n\n```json\n{\n \"mcpServers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**Claude Desktop / Claude Code**(`claude_desktop_config.json` 等;需手写,setup 不自动写):\n\n```json\n{\n \"mcpServers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**Windsurf**(MCP 设置中的 servers 配置):\n\n```json\n{\n \"mcpServers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**Cline**(VS Code 扩展设置中的 MCP servers):\n\n```json\n{\n \"mcpServers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**Zed**(项目 `.zed/settings.json` → `context_servers`;setup 会合并写入):\n\n```json\n{\n \"context_servers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**Continue**(`config.json` / YAML 中的 MCP servers,字段名以当前版本为准):\n\n```json\n{\n \"mcpServers\": [\n {\n \"name\": \"morya-ui\",\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n ]\n}\n```\n\n## 可用工具\n\n### 基础 — 查组件文档\n\n| 工具 | 作用 |\n| --- | --- |\n| `list` | 列出组件 / 指南 / 示例 / 分类 / 页面模式 |\n| `search` | 搜索文档、示例、页面模式与组件选型指南 |\n| `get_component` | 读取组件说明与 API |\n| `get_example` | 获取源码示例 |\n| `get_guide` | 读取指南 |\n| `get_setup` | 安装与初始化说明 |\n| `validate_usage` | 对照文档粗检 props / events 用法 |\n| `version` | 版本与目录状态 |\n\n### 高级 — 页面组合(可选)\n\n| 工具 | 作用 |\n| --- | --- |\n| `list_patterns` | 列出可复用的页面组合模式 |\n| `get_pattern` | 读取模式的结构、布局与交互规则 |\n| `recommend_page` | 根据页面意图推荐模式;可附带 starter 脚手架 |\n| `get_design_rules` | 设计令牌与 MPage* 组合配方 |\n| `recommend_component` | 列出、阅读或推荐组件选型指南 |\n| `list_golden_pages` | 列出黄金样例页面 |\n| `get_golden_page` | 读取黄金样例 Vue 源码(含 settings / wizard / result / detail / form-in-dialog 等;`includeScaffold` 有样例时返回样例源码) |\n| `list_page_snippets` | 列出可复用的页面区块 snippet |\n| `get_page_snippet` | 读取局部区块 snippet(筛选区、工具栏等) |\n| `validate_page` | 校验页面组合、间距、双边框,以及 rows / message / MStatus 等契约 |\n\n多数工具支持 `mode`:`zh`(默认)或 `en`。\n\n### 推荐工作流\n\n**查单个组件:** `search` / `get_component` → `get_example` → `validate_usage`\n\n**规划整页:** `recommend_page` → `get_golden_page` → `get_pattern` → `get_design_rules` → `get_component` / `get_example` → **`validate_usage`** → `validate_page`\n\n**改局部区块:** `get_page_snippet(section)` → `get_component` / `get_example` → `validate_usage` → `validate_page`\n\n需要 starter 代码时,给 `recommend_page` 传 `includeScaffold: true`(有黄金样例时返回样例源码,不是另一套模板):\n\n```json\n{\n \"intent\": \"油井管理列表\",\n \"pageType\": \"list\",\n \"features\": [\"筛选\", \"新增\", \"分页\"],\n \"includeScaffold\": true\n}\n```\n\n`recommend_component` 用法:\n\n- 不传 `query` 和 `decision` → 列出全部选型指南\n- 只传 `decision` → 阅读某一指南\n- 传 `query` → 根据问题推荐组件\n\n当前指南包括:`form-surface-choice`、`overlay-choice`、`data-display-choice`、`selection-choice`(含 Select / TreeSelect / CascadeSelect / Listbox / SelectButton / Radio / AutoComplete)、`status-label-choice`、`empty-result-choice`、`action-menu-choice`、`loading-choice`、`page-scroll-choice`、`surface-choice`、`page-section-choice`、`layout-spacing-choice`、`surface-nesting-choice`。\n\n## 对话示例\n\n接入后,可直接让助手调用本服务,例如:\n\n> 用 morya-ui 的 MCP 查一下 Dialog 的 props,并给一个带确认 / 取消按钮的示例。\n\n> 搜索和「日期」相关的组件,选一个适合表单的,按文档写出最小用法。\n\n> 根据 MCP 里 Button 的文档,写一个 `severity=\"danger\"` 的删除按钮,并校验 props 是否合法。\n\n助手应先调用工具,再基于返回内容生成类似:\n\n```vue\n<script setup lang=\"ts\">\nimport { MButton } from 'morya-ui'\n</script>\n\n<template>\n <MButton label=\"删除\" severity=\"danger\" />\n</template>\n```\n\n## 与文档站的关系\n\n目录与本站同源(组件 `docs/` + 指南 Markdown)。官网文档更新后,维护者重新发布 `@morya-ui/mcp`,客户端通过 `npx -y` 即可拿到新版本。\n\n更多实现细节见仓库内 [packages/ui-mcp/README.md](https://github.com/morya-space/morya-ui/tree/main/packages/ui-mcp)。\n\n## 下一步\n\n- [AI 接入](/docs/ai-setup):`npx @morya-ui/setup`、skill 与多编辑器 MCP\n- [Agent Skill](/docs/agent-skill):`morya-ui-pages` 何时用、表面地图\n- [快速上手](/docs/quick-start):在应用中安装并使用组件\n- [组件](/components):浏览全部组件与交互示例\n",
27974
28072
  "sections": [
27975
28073
  {
27976
28074
  "title": "",
27977
28075
  "id": "overview",
27978
- "body": "# Agent MCP\n\n[`@morya-ui/mcp`](https://www.npmjs.com/package/@morya-ui/mcp) 是可选的 [Model Context Protocol](https://modelcontextprotocol.io/)(stdio)服务。它把本站组件文档、示例与指南做成可检索工具,方便 **支持 MCP 的 AI 客户端** 按真实 API 生成代码。\n\n日常使用组件库 **不需要** 安装或配置 MCP。应用里仍然只依赖:\n\n```bash\npnpm add morya-ui\n```\n\n```ts\nimport 'morya-ui/styles.css'\n```\n\n若要连同 Agent Skill、Cursor 规则一起装好,见 [一键接入](/docs/setup);AI 流程见 [AI 接入](/docs/ai-setup);Skill 本身说明见 [Agent Skill](/docs/agent-skill)。"
28076
+ "body": "# Agent MCP\n\n[`@morya-ui/mcp`](https://www.npmjs.com/package/@morya-ui/mcp) 是可选的 [Model Context Protocol](https://modelcontextprotocol.io/)(stdio)服务。它把本站组件文档、示例与指南做成可检索工具,方便 **支持 MCP 的 AI 客户端** 按真实 API 生成代码。\n\n日常使用组件库 **不需要** 安装或配置 MCP。应用里仍然只依赖:\n\n```bash\npnpm add morya-ui\n```\n\n```ts\nimport 'morya-ui/styles.css'\n```\n\n若要连同 Agent Skill、规则与多编辑器 MCP 一起装好,见 [一键接入](/docs/setup)(默认写入 Cursor / VS Code / Zed 与 `.mcp.json`);AI 流程见 [AI 接入](/docs/ai-setup);Skill 本身说明见 [Agent Skill](/docs/agent-skill)。"
27979
28077
  },
27980
28078
  {
27981
28079
  "title": "接入方式",
27982
28080
  "id": "接入方式",
27983
- "body": "MCP 客户端通过 stdio 启动本包即可:\n\n```bash\nnpx -y @morya-ui/mcp\n```\n\n通用写法:\n\n```json\n{\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n}\n```\n\n字段名因客户端而异,只要支持 MCP stdio 即可接入。\n\n### 常见客户端配置示例\n\n以下为常见产品的配置片段,键名可能随版本变化,以各产品官方文档为准。\n\n**Cursor**(`.cursor/mcp.json` 或用户级 MCP 配置):\n\n```json\n{\n \"mcpServers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**Claude Desktop / Claude Code**(`claude_desktop_config.json` 等):\n\n```json\n{\n \"mcpServers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**Windsurf**(MCP 设置中的 servers 配置):\n\n```json\n{\n \"mcpServers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**Cline**(VS Code 扩展设置中的 MCP servers):\n\n```json\n{\n \"mcpServers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**Zed**(`settings.json` → `context_servers`):\n\n```json\n{\n \"context_servers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**Continue**(`config.json` / YAML 中的 MCP servers,字段名以当前版本为准):\n\n```json\n{\n \"mcpServers\": [\n {\n \"name\": \"morya-ui\",\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n ]\n}\n```"
28081
+ "body": "MCP 客户端通过 stdio 启动本包即可:\n\n```bash\nnpx -y @morya-ui/mcp\n```\n\n通用写法:\n\n```json\n{\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n}\n```\n\n字段名因客户端而异,只要支持 MCP stdio 即可接入。\n\n### 常见客户端配置示例\n\n以下为常见产品的配置片段,键名可能随版本变化,以各产品官方文档为准。\n\n**Cursor**(`.cursor/mcp.json` 或用户级 MCP 配置;setup 会写入):\n\n```json\n{\n \"mcpServers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**VS Code**(工作区 `.vscode/mcp.json`;setup 会写入):\n\n```json\n{\n \"servers\": {\n \"morya-ui\": {\n \"type\": \"stdio\",\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**便携**(项目根 `.mcp.json`;setup 会写入,供 Agent Host / 跨工具发现):\n\n```json\n{\n \"mcpServers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**Claude Desktop / Claude Code**(`claude_desktop_config.json` 等;需手写,setup 不自动写):\n\n```json\n{\n \"mcpServers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**Windsurf**(MCP 设置中的 servers 配置):\n\n```json\n{\n \"mcpServers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**Cline**(VS Code 扩展设置中的 MCP servers):\n\n```json\n{\n \"mcpServers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**Zed**(项目 `.zed/settings.json` → `context_servers`;setup 会合并写入):\n\n```json\n{\n \"context_servers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**Continue**(`config.json` / YAML 中的 MCP servers,字段名以当前版本为准):\n\n```json\n{\n \"mcpServers\": [\n {\n \"name\": \"morya-ui\",\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n ]\n}\n```"
27984
28082
  },
27985
28083
  {
27986
28084
  "title": "可用工具",
@@ -28000,24 +28098,24 @@
28000
28098
  {
28001
28099
  "title": "下一步",
28002
28100
  "id": "下一步",
28003
- "body": "- [AI 接入](/docs/ai-setup):`npx @morya-ui/setup`、skill 与 Cursor MCP\n- [Agent Skill](/docs/agent-skill):`morya-ui-pages` 何时用、表面地图\n- [快速上手](/docs/quick-start):在应用中安装并使用组件\n- [组件](/components):浏览全部组件与交互示例"
28101
+ "body": "- [AI 接入](/docs/ai-setup):`npx @morya-ui/setup`、skill 与多编辑器 MCP\n- [Agent Skill](/docs/agent-skill):`morya-ui-pages` 何时用、表面地图\n- [快速上手](/docs/quick-start):在应用中安装并使用组件\n- [组件](/components):浏览全部组件与交互示例"
28004
28102
  }
28005
28103
  ]
28006
28104
  },
28007
28105
  "en-US": {
28008
28106
  "title": "Agent MCP",
28009
28107
  "description": "Optional MCP server for AI clients that support the Model Context Protocol.",
28010
- "markdown": "---\ntitle: Agent MCP\norder: 14\ndescription: Optional MCP server for AI clients that support the Model Context Protocol.\n---\n\n# Agent MCP\n\n[`@morya-ui/mcp`](https://www.npmjs.com/package/@morya-ui/mcp) is an optional [Model Context Protocol](https://modelcontextprotocol.io/) (stdio) server. It indexes this site’s component docs, examples, and guides so **any MCP-capable AI client** can look up the real API.\n\nYou do **not** need MCP to use the component library. Apps still only depend on:\n\n```bash\npnpm add morya-ui\n```\n\n```ts\nimport 'morya-ui/styles.css'\n```\n\nFor Agent skill, Cursor rules, and writing MCP in one step, see [One-shot setup](/docs/setup). AI workflow: [AI setup](/docs/ai-setup). Skill behavior: [Agent Skill](/docs/agent-skill).\n\n## How to connect\n\nMCP clients start the package over stdio:\n\n```bash\nnpx -y @morya-ui/mcp\n```\n\nGeneric shape:\n\n```json\n{\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n}\n```\n\nField names differ by client. Any client that supports MCP stdio can connect.\n\n### Common client config examples\n\nSnippets for popular products. Key names may change across versions — check each product’s docs.\n\n**Cursor** (`.cursor/mcp.json` or user-level MCP settings):\n\n```json\n{\n \"mcpServers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**Claude Desktop / Claude Code** (`claude_desktop_config.json`, etc.):\n\n```json\n{\n \"mcpServers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**Windsurf** (MCP servers in settings):\n\n```json\n{\n \"mcpServers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**Cline** (MCP servers in the VS Code extension settings):\n\n```json\n{\n \"mcpServers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**Zed** (`settings.json` → `context_servers`):\n\n```json\n{\n \"context_servers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**Continue** (`config.json` / YAML MCP servers — follow the current schema):\n\n```json\n{\n \"mcpServers\": [\n {\n \"name\": \"morya-ui\",\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n ]\n}\n```\n\n## Tools\n\n### Core — component docs\n\n| Tool | Purpose |\n| --- | --- |\n| `list` | List components / guides / examples / categories / patterns |\n| `search` | Search docs, examples, patterns, and decision guides |\n| `get_component` | Read component docs and API |\n| `get_example` | Return a source example |\n| `get_guide` | Read a guide |\n| `get_setup` | Install and setup guidance |\n| `validate_usage` | Soft-check usage against documented props/events |\n| `version` | Version and catalog status |\n\n### Advanced — page composition (optional)\n\n| Tool | Purpose |\n| --- | --- |\n| `list_patterns` | List reusable page composition patterns |\n| `get_pattern` | Read a pattern's structure, layout, and rules |\n| `recommend_page` | Recommend a pattern from page intent; optional starter scaffold |\n| `get_design_rules` | Design-token and MPage* composition rules |\n| `recommend_component` | List, read, or recommend component selection guides |\n| `list_golden_pages` | List golden page samples |\n| `get_golden_page` | Read a golden page Vue source (`list-page` … `settings-page`, `wizard-form`, …) |\n| `list_page_snippets` | List reusable page section snippets |\n| `get_page_snippet` | Read a local section snippet (filters, toolbar, …) |\n| `validate_page` | Check page composition, spacing, double-border, and contract hints (`rows`, message, MStatus) |\n\nMost tools accept `mode`: `zh` (default) or `en`.\n\nComponent lookup accepts common aliases such as `DataTable`, `数据表格`, `Pager`, and `确认弹窗`.\n\n### Recommended workflow\n\n**Look up a component:** `search` / `get_component` → `get_example` → `validate_usage`\n\n**Plan a page:** `recommend_page` → `get_golden_page` → `get_pattern` → `get_design_rules` → `get_component` / `get_example` → **`validate_usage`** → `validate_page`. Use `recommend_component` when choosing between similar components.\n\n**Edit one section:** `list_page_snippets` → `get_page_snippet` → `get_component` / `get_example` → `validate_usage` → `validate_page`\n\nPass `includeScaffold: true` to `recommend_page` for starter Vue code (returns the golden page source when one exists):\n\n```json\n{\n \"intent\": \"Oil well management list\",\n \"pageType\": \"list\",\n \"features\": [\"filters\", \"create\", \"pagination\"],\n \"mode\": \"en\",\n \"includeScaffold\": true\n}\n```\n\n`recommend_component` modes:\n\n- omit `query` and `decision` → list decision guides\n- `decision` only → read one guide\n- `query` → recommend a component for a UI question\n\nCurrent guides include `form-surface-choice`, `overlay-choice`, `data-display-choice`, `selection-choice` (Select / TreeSelect / CascadeSelect / Listbox / SelectButton / Radio / AutoComplete), `status-label-choice`, `empty-result-choice`, `action-menu-choice`, `loading-choice`, `page-scroll-choice`, `surface-choice`, `page-section-choice`, `layout-spacing-choice`, and `surface-nesting-choice`.\n\n## Prompt examples\n\nAfter connecting, you can ask the assistant to use this server, for example:\n\n> Use the morya-ui MCP to look up Dialog props and give an example with confirm / cancel actions.\n\n> Search for date-related components, pick one suitable for forms, and write a minimal usage from the docs.\n\n> Following the Button docs from MCP, write a delete button with `severity=\"danger\"` and validate the props.\n\nThe assistant should call tools first, then produce something like:\n\n```vue\n<script setup lang=\"ts\">\nimport { MButton } from 'morya-ui'\n</script>\n\n<template>\n <MButton label=\"Delete\" severity=\"danger\" />\n</template>\n```\n\n## Relation to this site\n\nThe catalog is generated from the same sources as this site (component `docs/` + guide Markdown). After docs change, maintainers republish `@morya-ui/mcp`; clients using `npx -y` pick up the new release.\n\nImplementation notes live in [packages/ui-mcp/README.md](https://github.com/morya-space/morya-ui/tree/main/packages/ui-mcp).\n\n## Next steps\n\n- [One-shot setup](/docs/setup): `npx @morya-ui/setup`\n- [AI setup](/docs/ai-setup): Agent skill and MCP workflow\n- [Agent Skill](/docs/agent-skill): when to use `morya-ui-pages`\n- [Quick start](/docs/quick-start): install and use components in an app\n- [Components](/components): browse live examples and APIs\n",
28108
+ "markdown": "---\ntitle: Agent MCP\norder: 14\ndescription: Optional MCP server for AI clients that support the Model Context Protocol.\n---\n\n# Agent MCP\n\n[`@morya-ui/mcp`](https://www.npmjs.com/package/@morya-ui/mcp) is an optional [Model Context Protocol](https://modelcontextprotocol.io/) (stdio) server. It indexes this site’s component docs, examples, and guides so **any MCP-capable AI client** can look up the real API.\n\nYou do **not** need MCP to use the component library. Apps still only depend on:\n\n```bash\npnpm add morya-ui\n```\n\n```ts\nimport 'morya-ui/styles.css'\n```\n\nFor Agent skill, rules, and multi-editor MCP in one step, see [One-shot setup](/docs/setup) (writes Cursor / VS Code / Zed plus `.mcp.json` by default). AI workflow: [AI setup](/docs/ai-setup). Skill behavior: [Agent Skill](/docs/agent-skill).\n\n## How to connect\n\nMCP clients start the package over stdio:\n\n```bash\nnpx -y @morya-ui/mcp\n```\n\nGeneric shape:\n\n```json\n{\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n}\n```\n\nField names differ by client. Any client that supports MCP stdio can connect.\n\n### Common client config examples\n\nSnippets for popular products. Key names may change across versions — check each product’s docs.\n\n**Cursor** (`.cursor/mcp.json` or user-level MCP settings; written by setup):\n\n```json\n{\n \"mcpServers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**VS Code** (workspace `.vscode/mcp.json`; written by setup):\n\n```json\n{\n \"servers\": {\n \"morya-ui\": {\n \"type\": \"stdio\",\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**Portable** (project-root `.mcp.json`; written by setup for Agent Host / cross-tool discovery):\n\n```json\n{\n \"mcpServers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**Claude Desktop / Claude Code** (`claude_desktop_config.json`, etc.; configure manually — setup does not write these):\n\n```json\n{\n \"mcpServers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**Windsurf** (MCP servers in settings):\n\n```json\n{\n \"mcpServers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**Cline** (MCP servers in the VS Code extension settings):\n\n```json\n{\n \"mcpServers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**Zed** (project `.zed/settings.json` → `context_servers`; merged by setup):\n\n```json\n{\n \"context_servers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**Continue** (`config.json` / YAML MCP servers — follow the current schema):\n\n```json\n{\n \"mcpServers\": [\n {\n \"name\": \"morya-ui\",\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n ]\n}\n```\n\n## Tools\n\n### Core — component docs\n\n| Tool | Purpose |\n| --- | --- |\n| `list` | List components / guides / examples / categories / patterns |\n| `search` | Search docs, examples, patterns, and decision guides |\n| `get_component` | Read component docs and API |\n| `get_example` | Return a source example |\n| `get_guide` | Read a guide |\n| `get_setup` | Install and setup guidance |\n| `validate_usage` | Soft-check usage against documented props/events |\n| `version` | Version and catalog status |\n\n### Advanced — page composition (optional)\n\n| Tool | Purpose |\n| --- | --- |\n| `list_patterns` | List reusable page composition patterns |\n| `get_pattern` | Read a pattern's structure, layout, and rules |\n| `recommend_page` | Recommend a pattern from page intent; optional starter scaffold |\n| `get_design_rules` | Design-token and MPage* composition rules |\n| `recommend_component` | List, read, or recommend component selection guides |\n| `list_golden_pages` | List golden page samples |\n| `get_golden_page` | Read a golden page Vue source (`list-page` … `settings-page`, `wizard-form`, …) |\n| `list_page_snippets` | List reusable page section snippets |\n| `get_page_snippet` | Read a local section snippet (filters, toolbar, …) |\n| `validate_page` | Check page composition, spacing, double-border, and contract hints (`rows`, message, MStatus) |\n\nMost tools accept `mode`: `zh` (default) or `en`.\n\nComponent lookup accepts common aliases such as `DataTable`, `数据表格`, `Pager`, and `确认弹窗`.\n\n### Recommended workflow\n\n**Look up a component:** `search` / `get_component` → `get_example` → `validate_usage`\n\n**Plan a page:** `recommend_page` → `get_golden_page` → `get_pattern` → `get_design_rules` → `get_component` / `get_example` → **`validate_usage`** → `validate_page`. Use `recommend_component` when choosing between similar components.\n\n**Edit one section:** `list_page_snippets` → `get_page_snippet` → `get_component` / `get_example` → `validate_usage` → `validate_page`\n\nPass `includeScaffold: true` to `recommend_page` for starter Vue code (returns the golden page source when one exists):\n\n```json\n{\n \"intent\": \"Oil well management list\",\n \"pageType\": \"list\",\n \"features\": [\"filters\", \"create\", \"pagination\"],\n \"mode\": \"en\",\n \"includeScaffold\": true\n}\n```\n\n`recommend_component` modes:\n\n- omit `query` and `decision` → list decision guides\n- `decision` only → read one guide\n- `query` → recommend a component for a UI question\n\nCurrent guides include `form-surface-choice`, `overlay-choice`, `data-display-choice`, `selection-choice` (Select / TreeSelect / CascadeSelect / Listbox / SelectButton / Radio / AutoComplete), `status-label-choice`, `empty-result-choice`, `action-menu-choice`, `loading-choice`, `page-scroll-choice`, `surface-choice`, `page-section-choice`, `layout-spacing-choice`, and `surface-nesting-choice`.\n\n## Prompt examples\n\nAfter connecting, you can ask the assistant to use this server, for example:\n\n> Use the morya-ui MCP to look up Dialog props and give an example with confirm / cancel actions.\n\n> Search for date-related components, pick one suitable for forms, and write a minimal usage from the docs.\n\n> Following the Button docs from MCP, write a delete button with `severity=\"danger\"` and validate the props.\n\nThe assistant should call tools first, then produce something like:\n\n```vue\n<script setup lang=\"ts\">\nimport { MButton } from 'morya-ui'\n</script>\n\n<template>\n <MButton label=\"Delete\" severity=\"danger\" />\n</template>\n```\n\n## Relation to this site\n\nThe catalog is generated from the same sources as this site (component `docs/` + guide Markdown). After docs change, maintainers republish `@morya-ui/mcp`; clients using `npx -y` pick up the new release.\n\nImplementation notes live in [packages/ui-mcp/README.md](https://github.com/morya-space/morya-ui/tree/main/packages/ui-mcp).\n\n## Next steps\n\n- [One-shot setup](/docs/setup): `npx @morya-ui/setup`\n- [AI setup](/docs/ai-setup): Agent skill and MCP workflow\n- [Agent Skill](/docs/agent-skill): when to use `morya-ui-pages`\n- [Quick start](/docs/quick-start): install and use components in an app\n- [Components](/components): browse live examples and APIs\n",
28011
28109
  "sections": [
28012
28110
  {
28013
28111
  "title": "",
28014
28112
  "id": "overview",
28015
- "body": "# Agent MCP\n\n[`@morya-ui/mcp`](https://www.npmjs.com/package/@morya-ui/mcp) is an optional [Model Context Protocol](https://modelcontextprotocol.io/) (stdio) server. It indexes this site’s component docs, examples, and guides so **any MCP-capable AI client** can look up the real API.\n\nYou do **not** need MCP to use the component library. Apps still only depend on:\n\n```bash\npnpm add morya-ui\n```\n\n```ts\nimport 'morya-ui/styles.css'\n```\n\nFor Agent skill, Cursor rules, and writing MCP in one step, see [One-shot setup](/docs/setup). AI workflow: [AI setup](/docs/ai-setup). Skill behavior: [Agent Skill](/docs/agent-skill)."
28113
+ "body": "# Agent MCP\n\n[`@morya-ui/mcp`](https://www.npmjs.com/package/@morya-ui/mcp) is an optional [Model Context Protocol](https://modelcontextprotocol.io/) (stdio) server. It indexes this site’s component docs, examples, and guides so **any MCP-capable AI client** can look up the real API.\n\nYou do **not** need MCP to use the component library. Apps still only depend on:\n\n```bash\npnpm add morya-ui\n```\n\n```ts\nimport 'morya-ui/styles.css'\n```\n\nFor Agent skill, rules, and multi-editor MCP in one step, see [One-shot setup](/docs/setup) (writes Cursor / VS Code / Zed plus `.mcp.json` by default). AI workflow: [AI setup](/docs/ai-setup). Skill behavior: [Agent Skill](/docs/agent-skill)."
28016
28114
  },
28017
28115
  {
28018
28116
  "title": "How to connect",
28019
28117
  "id": "how-to-connect",
28020
- "body": "MCP clients start the package over stdio:\n\n```bash\nnpx -y @morya-ui/mcp\n```\n\nGeneric shape:\n\n```json\n{\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n}\n```\n\nField names differ by client. Any client that supports MCP stdio can connect.\n\n### Common client config examples\n\nSnippets for popular products. Key names may change across versions — check each product’s docs.\n\n**Cursor** (`.cursor/mcp.json` or user-level MCP settings):\n\n```json\n{\n \"mcpServers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**Claude Desktop / Claude Code** (`claude_desktop_config.json`, etc.):\n\n```json\n{\n \"mcpServers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**Windsurf** (MCP servers in settings):\n\n```json\n{\n \"mcpServers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**Cline** (MCP servers in the VS Code extension settings):\n\n```json\n{\n \"mcpServers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**Zed** (`settings.json` → `context_servers`):\n\n```json\n{\n \"context_servers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**Continue** (`config.json` / YAML MCP servers — follow the current schema):\n\n```json\n{\n \"mcpServers\": [\n {\n \"name\": \"morya-ui\",\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n ]\n}\n```"
28118
+ "body": "MCP clients start the package over stdio:\n\n```bash\nnpx -y @morya-ui/mcp\n```\n\nGeneric shape:\n\n```json\n{\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n}\n```\n\nField names differ by client. Any client that supports MCP stdio can connect.\n\n### Common client config examples\n\nSnippets for popular products. Key names may change across versions — check each product’s docs.\n\n**Cursor** (`.cursor/mcp.json` or user-level MCP settings; written by setup):\n\n```json\n{\n \"mcpServers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**VS Code** (workspace `.vscode/mcp.json`; written by setup):\n\n```json\n{\n \"servers\": {\n \"morya-ui\": {\n \"type\": \"stdio\",\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**Portable** (project-root `.mcp.json`; written by setup for Agent Host / cross-tool discovery):\n\n```json\n{\n \"mcpServers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**Claude Desktop / Claude Code** (`claude_desktop_config.json`, etc.; configure manually — setup does not write these):\n\n```json\n{\n \"mcpServers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**Windsurf** (MCP servers in settings):\n\n```json\n{\n \"mcpServers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**Cline** (MCP servers in the VS Code extension settings):\n\n```json\n{\n \"mcpServers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**Zed** (project `.zed/settings.json` → `context_servers`; merged by setup):\n\n```json\n{\n \"context_servers\": {\n \"morya-ui\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n }\n}\n```\n\n**Continue** (`config.json` / YAML MCP servers — follow the current schema):\n\n```json\n{\n \"mcpServers\": [\n {\n \"name\": \"morya-ui\",\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@morya-ui/mcp\"]\n }\n ]\n}\n```"
28021
28119
  },
28022
28120
  {
28023
28121
  "title": "Tools",