@aoao-y33/ui 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/button/components/button/props.d.ts +43 -0
  2. package/dist/button/components/button/props.d.ts.map +1 -1
  3. package/dist/button/utils/index.d.ts +20 -0
  4. package/dist/button/utils/index.d.ts.map +1 -1
  5. package/dist/common/utils/iconUtils.d.ts +16 -0
  6. package/dist/common/utils/iconUtils.d.ts.map +1 -1
  7. package/dist/form/components/fields/index.d.ts.map +1 -1
  8. package/dist/form/components/form/form.vue.d.ts.map +1 -1
  9. package/dist/form/components/form/props.d.ts +43 -0
  10. package/dist/form/components/form/props.d.ts.map +1 -1
  11. package/dist/form/components/form-item/props.d.ts +29 -0
  12. package/dist/form/components/form-item/props.d.ts.map +1 -1
  13. package/dist/form/hoc/useForm.d.ts +43 -0
  14. package/dist/form/hoc/useForm.d.ts.map +1 -1
  15. package/dist/form/utils/index.d.ts +65 -0
  16. package/dist/form/utils/index.d.ts.map +1 -1
  17. package/dist/index.js +22525 -12090
  18. package/dist/layout/utils/index.d.ts +20 -0
  19. package/dist/layout/utils/index.d.ts.map +1 -1
  20. package/dist/modal/components/form-modal/props.d.ts +36 -1
  21. package/dist/modal/components/form-modal/props.d.ts.map +1 -1
  22. package/dist/modal/components/modal/props.d.ts +43 -1
  23. package/dist/modal/components/modal/props.d.ts.map +1 -1
  24. package/dist/modal/hoc/useFormModal.d.ts +50 -0
  25. package/dist/modal/hoc/useFormModal.d.ts.map +1 -1
  26. package/dist/modal/hoc/useModal.d.ts +55 -0
  27. package/dist/modal/hoc/useModal.d.ts.map +1 -1
  28. package/dist/modal/hoc/useModalExpose.d.ts +24 -0
  29. package/dist/modal/hoc/useModalExpose.d.ts.map +1 -1
  30. package/dist/table/components/table/props.d.ts +75 -0
  31. package/dist/table/components/table/props.d.ts.map +1 -1
  32. package/dist/table/components/table-column/props.d.ts +19 -0
  33. package/dist/table/components/table-column/props.d.ts.map +1 -1
  34. package/dist/table/components/table-page/props.d.ts +31 -0
  35. package/dist/table/components/table-page/props.d.ts.map +1 -1
  36. package/dist/table/components/table-select/props.d.ts +49 -0
  37. package/dist/table/components/table-select/props.d.ts.map +1 -1
  38. package/dist/table/hoc/useTable.d.ts +41 -0
  39. package/dist/table/hoc/useTable.d.ts.map +1 -1
  40. package/dist/table/hoc/useTableExpose.d.ts +27 -0
  41. package/dist/table/hoc/useTableExpose.d.ts.map +1 -1
  42. package/dist/table/utils/index.d.ts +26 -0
  43. package/dist/table/utils/index.d.ts.map +1 -1
  44. package/package.json +5 -4
@@ -1,6 +1,47 @@
1
1
  import { AxTableOptions } from '..';
2
2
  import { AxFormItemOptions } from '../../form';
3
3
  import { AxButtonOptions } from '../../button';
4
+ /**
5
+ * 表格 Hook,用于创建功能完整的高级表格组件
6
+ *
7
+ * 该 Hook 封装了表格的核心逻辑,包括:
8
+ * - 表格数据展示和分页
9
+ * - 搜索表单(支持动态字段配置)
10
+ * - 工具栏按钮(新增、删除、导出等)
11
+ * - 表格列配置(支持动态列)
12
+ * - 折叠/展开搜索区域
13
+ * - 数据请求和状态管理
14
+ *
15
+ * @param options - 表格初始配置选项
16
+ * @returns [Table 组件, Table API] 元组
17
+ *
18
+ * @example
19
+ * const [Table, tableApi] = useTable({
20
+ * api: getUserList,
21
+ * columnConfig: {
22
+ * username: { label: '用户名', prop: 'username' },
23
+ * email: { label: '邮箱', prop: 'email' }
24
+ * },
25
+ * searchConfig: {
26
+ * fieldConfig: {
27
+ * keyword: { label: '关键词', type: 'input' }
28
+ * },
29
+ * over: 2 // 超过2个字段显示折叠按钮
30
+ * },
31
+ * toolConfig: {
32
+ * add: { text: '新增', onClick: handleAdd }
33
+ * },
34
+ * pageConfig: { pageSize: 10 }
35
+ * })
36
+ *
37
+ * // 在模板中使用
38
+ * <Table />
39
+ *
40
+ * // 通过 API 操作表格
41
+ * tableApi.requestApi.fetch() // 刷新数据
42
+ * tableApi.setTable({ data: [] }) // 更新表格属性
43
+ * tableApi.toolsApi.addField(...) // 动态添加工具栏按钮
44
+ */
4
45
  export declare function useTable<T extends Record<string, any>, R extends Record<string, any> = any>(options?: AxTableOptions<T, R>): readonly [import('vue').DefineComponent<{}, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
5
46
  [key: string]: any;
6
47
  }>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>, {
@@ -1 +1 @@
1
- {"version":3,"file":"useTable.d.ts","sourceRoot":"","sources":["../../../src/table/hoc/useTable.ts"],"names":[],"mappings":"AAAA,OAAO,EAKH,KAAK,cAAc,EAEtB,MAAM,SAAS,CAAC;AAIjB,OAAO,EAAa,KAAK,iBAAiB,EAA8B,MAAM,QAAQ,CAAC;AACvF,OAAO,EAAW,KAAK,eAAe,EAAC,MAAM,UAAU,CAAC;AAExD,wBAAgB,QAAQ,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,OAAO,GAAE,cAAc,CAAC,CAAC,EAAE,CAAC,CAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqG9H"}
1
+ {"version":3,"file":"useTable.d.ts","sourceRoot":"","sources":["../../../src/table/hoc/useTable.ts"],"names":[],"mappings":"AAAA,OAAO,EAKH,KAAK,cAAc,EAEtB,MAAM,SAAS,CAAC;AAIjB,OAAO,EAAa,KAAK,iBAAiB,EAA8B,MAAM,QAAQ,CAAC;AACvF,OAAO,EAAW,KAAK,eAAe,EAAC,MAAM,UAAU,CAAC;AAExD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,OAAO,GAAE,cAAc,CAAC,CAAC,EAAE,CAAC,CAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsJ9H"}
@@ -1,6 +1,33 @@
1
1
  import { Ref } from 'vue';
2
2
  import { AxTableInstance } from '..';
3
+ /**
4
+ * TableApi 类型定义
5
+ * 由 useTableExpose 函数返回的 API 对象类型
6
+ */
3
7
  export type TableApi = ReturnType<typeof useTableExpose>;
8
+ /**
9
+ * 表格暴露 API Hook,用于获取和控制表格实例的方法
10
+ *
11
+ * 该 Hook 提供了访问底层表格实例的能力,包括:
12
+ * - 获取 Element Plus 原生 ElTable 实例
13
+ * - 可调用 ElTable 的所有方法(如 clearSort、clearFilter、toggleRowSelection 等)
14
+ *
15
+ * @param table - 表格组件的 Ref 引用,指向 AxTableInstance 实例
16
+ * @returns 包含表格控制方法的 API 对象
17
+ *
18
+ * @example
19
+ * const tableRef = ref<AxTableInstance>();
20
+ * const tableApi = useTableExpose(tableRef);
21
+ *
22
+ * // 获取原生 ElTable 实例
23
+ * const elTable = tableApi.getElTable()
24
+ *
25
+ * // 调用 ElTable 的原生方法
26
+ * elTable?.clearSort() // 清除排序
27
+ * elTable?.clearFilter() // 清除筛选
28
+ * elTable?.toggleAllSelection() // 切换全选状态
29
+ * elTable?.setCurrentRow(row) // 设置当前行
30
+ */
4
31
  export declare function useTableExpose(table: Ref<AxTableInstance>): {
5
32
  getElTable: () => import('element-plus').TableInstance;
6
33
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useTableExpose.d.ts","sourceRoot":"","sources":["../../../src/table/hoc/useTableExpose.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,SAAS,CAAC;AAE7C,MAAM,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAA;AAExD,wBAAgB,cAAc,CAAC,KAAK,EAAE,GAAG,CAAC,eAAe,CAAC;;EAQzD"}
1
+ {"version":3,"file":"useTableExpose.d.ts","sourceRoot":"","sources":["../../../src/table/hoc/useTableExpose.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,SAAS,CAAC;AAE7C;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAA;AAExD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,GAAG,CAAC,eAAe,CAAC;;EAazD"}
@@ -1,4 +1,30 @@
1
1
  import { Component } from 'vue';
2
+ /**
3
+ * 表格列组件注册表
4
+ * 存储表格列类型与对应 Vue 组件的映射关系
5
+ * 用于扩展表格列的自定义渲染方式
6
+ * @example
7
+ * // 注册自定义列类型
8
+ * addTableColumnField('custom-render', CustomColumnComponent)
9
+ */
2
10
  export declare const tableColumnFields: Record<string, Component>;
11
+ /**
12
+ * 注册新的表格列类型组件
13
+ * 将自定义列组件添加到表格列类型注册表中
14
+ *
15
+ * @param type - 列类型标识符(唯一)
16
+ * @param component - 对应的 Vue 组件,用于渲染该类型的列内容
17
+ *
18
+ * @warning 如果类型已存在,会输出警告信息并阻止重复注册
19
+ *
20
+ * @example
21
+ * import StatusColumn from './StatusColumn.vue'
22
+ * addTableColumnField('status', StatusColumn)
23
+ *
24
+ * // 在表格列配置中使用
25
+ * columnConfig: {
26
+ * status: { type: 'status', label: '状态' }
27
+ * }
28
+ */
3
29
  export declare const addTableColumnField: (type: string, component: Component) => void;
4
30
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/table/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,KAAK,CAAC;AAEnC,eAAO,MAAM,iBAAiB,EAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAI,CAAC;AAE5D,eAAO,MAAM,mBAAmB,GAAE,MAAK,MAAM,EAAC,WAAU,SAAS,SAMhE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/table/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,KAAK,CAAC;AAEnC;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,EAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAI,CAAC;AAE5D;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,mBAAmB,GAAE,MAAK,MAAM,EAAC,WAAU,SAAS,SAMhE,CAAA"}
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@aoao-y33/ui",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "private": false,
5
5
  "description": "elementPlus二次封装组件",
6
+
6
7
  "main": "./dist/index.js",
7
8
  "module": "./dist/index.js",
8
9
  "types": "./dist/index.d.ts",
@@ -23,15 +24,15 @@
23
24
  "scripts": {
24
25
  "build": "vue-tsc && vite build",
25
26
  "ins": "pnpm install",
26
- "pub": "npm publish --access public"
27
+ "pub": "npm publish --access public"
27
28
  },
28
29
  "keywords": [],
29
30
  "author": "",
30
31
  "license": "ISC",
31
32
  "packageManager": "pnpm@10.32.1",
32
33
  "dependencies": {
33
- "@aoao-y33/hooks": "workspace:*",
34
- "@aoao-y33/utils": "workspace:*",
34
+ "@aoao-y33/hooks": "^0.0.3",
35
+ "@aoao-y33/utils": "^0.0.2",
35
36
  "@element-plus/icons-vue": "^2.3.2",
36
37
  "element-plus": "^2.14.0"
37
38
  },