{"_id":"@composy/pivot-table-vue","name":"@composy/pivot-table-vue","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@composy/pivot-table-vue","version":"0.0.1","description":"Vue components for @composy/pivot-table-core","keywords":["pivot-table","vue","vue3","ldesign","component"],"author":{"name":"LDesign Team"},"license":"MIT","type":"module","sideEffects":false,"exports":{".":{"types":"./es/index.d.ts","import":"./es/index.js","require":"./lib/index.cjs","default":"./es/index.js"},"./composables/*":{"types":"./es/composables/*.d.ts","import":"./es/composables/*.js","require":"./lib/composables/*.cjs","default":"./es/composables/*.js"},"./plugins/*":{"types":"./es/plugins/*.d.ts","import":"./es/plugins/*.js","require":"./lib/plugins/*.cjs","default":"./es/plugins/*.js"},"./package.json":"./package.json"},"main":"./lib/index.cjs","module":"./es/index.js","types":"./es/index.d.ts","unpkg":"./dist/index.min.js","jsdelivr":"./dist/index.min.js","scripts":{"build":"ldesign-builder build","lint":"eslint . --cache","lint:check":"eslint . --cache --max-warnings 0","lint:fix":"eslint . --cache --fix","type-check":"tsc --noEmit","test":"ltesting run:unit","test:run":"ltesting run:unit"},"dependencies":{"@composy/pivot-table-core":"^0.0.1"},"peerDependencies":{"vue":"^3.5.32"},"devDependencies":{"@antfu/eslint-config":"9.1.0","@composy/builder":"^0.0.1","@composy/testing":"^0.0.1","eslint":"10.7.0","typescript":"5.9.3","vue":"3.5.39"},"publishConfig":{"registry":"http://npm.longrise.cn:6286/"},"typings":"./es/index.d.ts","browser":"./dist/index.js","_id":"@composy/pivot-table-vue@0.0.1","_nodeVersion":"23.11.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-vkZihh4vPxAbhvFIDlbtAWWob1C6rOmR7nri+4a2VeIwJZzOuknSp43ypf45HHKNjzBWp/w4keYNk+wX078+zQ==","shasum":"fde166af686bf6f517df5fae2ebfb8e4e4ca52f8","tarball":"https://registry.npmjs.org/@composy/pivot-table-vue/-/pivot-table-vue-0.0.1.tgz","fileCount":62,"unpackedSize":115241,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDyJLKgYgLT8gD8gRYunGPSSoA3FY4f1zKIBCHqu7HFtgIga7lsShpeHm9R4eiawT2NKtWE9B3aJqV9yLH/5zWj56E="}]},"_npmUser":{"name":"swimly","email":"979741120@qq.com"},"directories":{},"maintainers":[{"name":"swimly","email":"979741120@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pivot-table-vue_0.0.1_1786949219366_0.48986409254843566"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-17T06:46:59.197Z","0.0.1":"2026-08-17T06:46:59.521Z","modified":"2026-08-17T06:46:59.961Z"},"maintainers":[{"name":"swimly","email":"979741120@qq.com"}],"description":"Vue components for @composy/pivot-table-core","keywords":["pivot-table","vue","vue3","ldesign","component"],"author":{"name":"LDesign Team"},"license":"MIT","readme":"# @composy/pivot-table-vue\n\nLDesign 数据透视表 Vue 3 适配包 — 基于 `@composy/pivot-table-core` 核心库的 Vue 组合式 API。\n\n## 安装\n\n```bash\nnpm install @composy/pivot-table-vue\n```\n\n> 需要同时安装 `@composy/pivot-table-core` 作为依赖。\n\n## 快速开始\n\n### 组件用法\n\n```vue\n<template>\n  <PivotTable\n    :data=\"data\"\n    :rows=\"['region']\"\n    :cols=\"['product']\"\n    :values=\"[{ field: 'sales', aggregator: 'sum' }]\"\n    theme=\"light\"\n    :show-row-totals=\"true\"\n    :sortable=\"true\"\n    @cell-click=\"onCellClick\"\n  />\n</template>\n\n<script setup lang=\"ts\">\nimport { PivotTable } from '@composy/pivot-table-vue'\n\nconst data = [\n  { region: 'East', product: 'Phone', sales: 1000 },\n  { region: 'East', product: 'Laptop', sales: 2000 },\n  { region: 'West', product: 'Phone', sales: 800 },\n]\n\nfunction onCellClick(cell) {\n  console.log('Clicked:', cell)\n}\n</script>\n```\n\n### Composable 用法\n\n```vue\n<template>\n  <div ref=\"container\"></div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, onMounted } from 'vue'\nimport { usePivotTable } from '@composy/pivot-table-vue'\n\nconst container = ref<HTMLElement | null>(null)\nconst { create, result, setSort, setTheme, refresh, destroy } = usePivotTable()\n\nonMounted(() => {\n  if (container.value) {\n    create(container.value, {\n      data: [...],\n      rows: ['region'],\n      cols: ['product'],\n      values: [{ field: 'sales', aggregator: 'sum' }],\n    })\n  }\n})\n</script>\n```\n\n### Plugin 注册\n\n```ts\nimport { PivotTablePlugin } from '@composy/pivot-table-vue'\n\napp.use(PivotTablePlugin)\n// 现在可以全局使用 <PivotTable />\n```\n\n## Props\n\n| Prop | 类型 | 默认值 | 说明 |\n|------|------|--------|------|\n| `data` | `Record<string, unknown>[]` | - | 数据源 |\n| `rows` | `(string \\| FieldConfig)[]` | - | 行字段 |\n| `cols` | `(string \\| FieldConfig)[]` | - | 列字段 |\n| `values` | `(string \\| ValueFieldConfig)[]` | - | 值字段 |\n| `aggregator` | `AggregatorType` | `'sum'` | 默认聚合类型 |\n| `theme` | `'light' \\| 'dark' \\| 'auto'` | `'light'` | 主题模式 |\n| `showRowTotals` | `boolean` | `true` | 显示行合计 |\n| `showColTotals` | `boolean` | `true` | 显示列合计 |\n| `sortable` | `boolean` | `false` | 启用排序 |\n| `sort` | `SortConfig` | - | 排序配置 |\n| `filters` | `FilterConfig[]` | - | 过滤配置 |\n| `striped` | `boolean` | `true` | 斑马纹 |\n| `loading` | `boolean` | `false` | 加载状态 |\n| `emptyText` | `string` | `'No data'` | 空态文本 |\n| `valueFormatter` | `(value: number \\| null) => string` | - | 全局值格式化 |\n\n## Events\n\n| 事件 | 参数 | 说明 |\n|------|------|------|\n| `cell-click` | `CellClickInfo` | 单元格点击 |\n| `cell-hover` | `CellHoverInfo` | 单元格悬停 |\n| `cell-hover-end` | - | 悬停离开 |\n| `sort` | `SortConfig` | 排序变化 |\n\n## Expose\n\n组件实例暴露以下方法：\n\n`instance`、`result`、`setData`、`setTheme`、`setSort`、`setFilters`、`setLoading`、`refresh`\n\n## 构建产物\n\n| 目录 | 格式 | 入口 |\n|------|------|------|\n| `dist/` | UMD | `dist/index.js` / `dist/index.min.js` |\n| `es/` | ESM | `es/index.js` |\n| `esm/` | ESM | `esm/index.js` |\n| `lib/` | CJS | `lib/index.cjs` |\n\n## 验证命令\n\n```bash\npnpm run type-check    # 类型检查\npnpm run build         # 构建\npnpm run lint:check    # Lint 检查\n```\n","readmeFilename":"README.md","_rev":"1-56e5d89c68d8084678ae356d8923d557"}