@qin-ui/antdv-next-pro 1.1.14 → 1.2.0

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 (129) hide show
  1. package/AI-CONTEXT.md +281 -23
  2. package/LICENSE +9 -0
  3. package/README.md +75 -58
  4. package/api.json +70 -28
  5. package/bin/init-ai.mjs +404 -49
  6. package/es/antdv-next-pro.css +9 -9
  7. package/es/component-provider/{index-Daiw7IxY.js → index-Tesc9NuK.js} +2 -1
  8. package/es/component-provider/index-Tesc9NuK.js.map +1 -0
  9. package/es/component-provider/index.js +2 -1
  10. package/es/component-provider/index.js.map +1 -0
  11. package/es/components/component-provider/components/index.vue.d.ts +27 -0
  12. package/es/components/component-provider/components/index.vue.d.ts.map +1 -0
  13. package/es/components/component-provider/constants/index.d.ts +16 -0
  14. package/es/components/component-provider/constants/index.d.ts.map +1 -0
  15. package/es/components/component-provider/index.d.ts +4 -0
  16. package/es/components/component-provider/index.d.ts.map +1 -0
  17. package/es/components/component-provider/types/index.d.ts +26 -0
  18. package/es/components/component-provider/types/index.d.ts.map +1 -0
  19. package/es/components/form/components/BaseField/index.vue.d.ts +13 -0
  20. package/es/components/form/components/BaseField/index.vue.d.ts.map +1 -0
  21. package/es/components/form/components/BaseField/utils/index.d.ts +3 -0
  22. package/es/components/form/components/BaseField/utils/index.d.ts.map +1 -0
  23. package/es/components/form/components/BaseFormItem/index.vue.d.ts +9 -0
  24. package/es/components/form/components/BaseFormItem/index.vue.d.ts.map +1 -0
  25. package/es/components/form/components/ContainerFragment/index.vue.d.ts +23 -0
  26. package/es/components/form/components/ContainerFragment/index.vue.d.ts.map +1 -0
  27. package/es/components/form/components/GroupedFieldAttrs/index.vue.d.ts +31 -0
  28. package/es/components/form/components/GroupedFieldAttrs/index.vue.d.ts.map +1 -0
  29. package/es/components/form/components/PathProvider/index.vue.d.ts +24 -0
  30. package/es/components/form/components/PathProvider/index.vue.d.ts.map +1 -0
  31. package/es/components/form/components/ProForm/index.vue.d.ts +36 -0
  32. package/es/components/form/components/ProForm/index.vue.d.ts.map +1 -0
  33. package/es/components/form/components/SlotComponent/index.vue.d.ts +7 -0
  34. package/es/components/form/components/SlotComponent/index.vue.d.ts.map +1 -0
  35. package/es/components/form/components/index.d.ts +12 -0
  36. package/es/components/form/components/index.d.ts.map +1 -0
  37. package/es/components/form/constants/index.d.ts +81 -0
  38. package/es/components/form/constants/index.d.ts.map +1 -0
  39. package/es/components/form/hooks/index.d.ts +5 -0
  40. package/es/components/form/hooks/index.d.ts.map +1 -0
  41. package/es/components/form/hooks/useFields.d.ts +57 -0
  42. package/es/components/form/hooks/useFields.d.ts.map +1 -0
  43. package/es/components/form/hooks/useForm.d.ts +93 -0
  44. package/es/components/form/hooks/useForm.d.ts.map +1 -0
  45. package/es/components/form/hooks/useFormRef.d.ts +30 -0
  46. package/es/components/form/hooks/useFormRef.d.ts.map +1 -0
  47. package/es/components/form/index.d.ts +7 -0
  48. package/es/components/form/index.d.ts.map +1 -0
  49. package/es/components/form/types/index.d.ts +251 -0
  50. package/es/components/form/types/index.d.ts.map +1 -0
  51. package/es/components/table/components/ColumnControl.vue.d.ts +9 -0
  52. package/es/components/table/components/ColumnControl.vue.d.ts.map +1 -0
  53. package/es/components/table/components/DefaultSearchFormContainer.vue.d.ts +18 -0
  54. package/es/components/table/components/DefaultSearchFormContainer.vue.d.ts.map +1 -0
  55. package/es/components/table/components/DefaultTableContainer.vue.d.ts +18 -0
  56. package/es/components/table/components/DefaultTableContainer.vue.d.ts.map +1 -0
  57. package/es/components/table/components/ProTable.vue.d.ts +118 -0
  58. package/es/components/table/components/ProTable.vue.d.ts.map +1 -0
  59. package/es/components/table/components/SearchForm.vue.d.ts +48 -0
  60. package/es/components/table/components/SearchForm.vue.d.ts.map +1 -0
  61. package/es/components/table/components/SizeControl.vue.d.ts +12 -0
  62. package/es/components/table/components/SizeControl.vue.d.ts.map +1 -0
  63. package/es/components/table/components/icons/ColumnHeightOutlined.vue.d.ts +3 -0
  64. package/es/components/table/components/icons/ColumnHeightOutlined.vue.d.ts.map +1 -0
  65. package/es/components/table/components/icons/DownOutlined.vue.d.ts +3 -0
  66. package/es/components/table/components/icons/DownOutlined.vue.d.ts.map +1 -0
  67. package/es/components/table/components/icons/FilterOutlined.vue.d.ts +3 -0
  68. package/es/components/table/components/icons/FilterOutlined.vue.d.ts.map +1 -0
  69. package/es/components/table/components/index.d.ts +5 -0
  70. package/es/components/table/components/index.d.ts.map +1 -0
  71. package/es/components/table/index.d.ts +8 -0
  72. package/es/components/table/index.d.ts.map +1 -0
  73. package/es/components/table/types/index.d.ts +48 -0
  74. package/es/components/table/types/index.d.ts.map +1 -0
  75. package/es/components/table/useTable.d.ts +111 -0
  76. package/es/components/table/useTable.d.ts.map +1 -0
  77. package/es/form/{index-7clzY8ZD.js → index-CcP5OaUd.js} +12 -6
  78. package/es/form/index-CcP5OaUd.js.map +1 -0
  79. package/es/form/index.js +4 -3
  80. package/es/form/index.js.map +1 -0
  81. package/es/index.d.ts +76 -1522
  82. package/es/index.d.ts.map +1 -0
  83. package/es/index.js +14 -23
  84. package/es/index.js.map +1 -0
  85. package/es/shared/core/index.d.ts +6 -0
  86. package/es/shared/core/index.d.ts.map +1 -0
  87. package/es/shared/ui/index.d.ts +9 -0
  88. package/es/shared/ui/index.d.ts.map +1 -0
  89. package/es/table/index.js +11 -9
  90. package/es/table/index.js.map +1 -0
  91. package/package.json +10 -11
  92. package/src/components/component-provider/components/index.vue +67 -0
  93. package/src/components/component-provider/constants/index.ts +177 -0
  94. package/src/components/component-provider/index.ts +6 -0
  95. package/src/components/component-provider/types/index.ts +59 -0
  96. package/src/components/form/components/BaseField/index.vue +181 -0
  97. package/src/components/form/components/BaseField/utils/index.ts +16 -0
  98. package/src/components/form/components/BaseFormItem/index.vue +158 -0
  99. package/src/components/form/components/ContainerFragment/index.vue +24 -0
  100. package/src/components/form/components/GroupedFieldAttrs/index.vue +119 -0
  101. package/src/components/form/components/PathProvider/index.vue +19 -0
  102. package/src/components/form/components/ProForm/index.vue +104 -0
  103. package/src/components/form/components/SlotComponent/index.vue +26 -0
  104. package/src/components/form/components/index.ts +15 -0
  105. package/src/components/form/constants/index.ts +140 -0
  106. package/src/components/form/hooks/index.ts +5 -0
  107. package/src/components/form/hooks/useFields.ts +67 -0
  108. package/src/components/form/hooks/useForm.ts +110 -0
  109. package/src/components/form/hooks/useFormRef.ts +35 -0
  110. package/src/components/form/index.ts +29 -0
  111. package/src/components/form/types/index.ts +317 -0
  112. package/src/components/table/components/ColumnControl.vue +142 -0
  113. package/src/components/table/components/DefaultSearchFormContainer.vue +22 -0
  114. package/src/components/table/components/DefaultTableContainer.vue +19 -0
  115. package/src/components/table/components/ProTable.vue +372 -0
  116. package/src/components/table/components/SearchForm.vue +296 -0
  117. package/src/components/table/components/SizeControl.vue +54 -0
  118. package/src/components/table/components/icons/ColumnHeightOutlined.vue +4 -0
  119. package/src/components/table/components/icons/DownOutlined.vue +4 -0
  120. package/src/components/table/components/icons/FilterOutlined.vue +4 -0
  121. package/src/components/table/components/index.ts +4 -0
  122. package/src/components/table/index.ts +14 -0
  123. package/src/components/table/types/index.ts +52 -0
  124. package/src/components/table/useTable.ts +129 -0
  125. package/src/index.ts +81 -0
  126. package/src/shared/core/index.ts +37 -0
  127. package/src/shared/ui/index.ts +55 -0
  128. package/es/core/index-ghYuQ3Sy.js +0 -360
  129. package/es/vendor/utils/lodash-es-p6jau26B.js +0 -1120
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC/B,OAAO,OAAO,MAAM,mBAAmB,CAAC;AACxC,OAAO,QAAQ,MAAM,oBAAoB,CAAC;AAC1C,OAAO,oBAAoB,MAAM,iCAAiC,CAAC;AAEnE,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iCAAiC,CAAC;AAEhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,CAAC;;IAGjD;;;;;;;;;;;;;OAaG;iBACU,GAAG;;AAflB,wBAoBE"}
package/es/index.js CHANGED
@@ -1,23 +1,13 @@
1
1
  import "./antdv-next-pro.css";
2
- import { _ as _sfc_main } from "./form/index-7clzY8ZD.js";
3
- import { a, b, c, u, d } from "./form/index-7clzY8ZD.js";
2
+ import { _ as _sfc_main } from "./form/index-CcP5OaUd.js";
3
+ import { a, b, c, u, d } from "./form/index-CcP5OaUd.js";
4
4
  import "vue";
5
- import { e } from "./core/index-ghYuQ3Sy.js";
5
+ import { useFormData } from "@qin-ui/pro-components-core";
6
6
  import "antdv-next";
7
7
  import "antdv-next/dist/config-provider/DisabledContext";
8
- import BaseTable from "./table/index.js";
8
+ import ProTable from "./table/index.js";
9
9
  import { useTable } from "./table/index.js";
10
- import { _ as _sfc_main$1 } from "./component-provider/index-Daiw7IxY.js";
11
- const withInstall = (comp) => {
12
- comp.install = (app) => {
13
- app.component(comp.name, comp);
14
- };
15
- return comp;
16
- };
17
- const ProForm = withInstall(_sfc_main);
18
- const ProTable = withInstall(BaseTable);
19
- const ProComponentProvider = withInstall(_sfc_main$1);
20
- const components = [ProForm, ProTable, ProComponentProvider];
10
+ import { _ as _sfc_main$1 } from "./component-provider/index-Tesc9NuK.js";
21
11
  const index = {
22
12
  /**
23
13
  * @qin-ui/antdv-next-pro 安装方法
@@ -28,27 +18,28 @@ const index = {
28
18
  * @example
29
19
  * ```ts
30
20
  * import { createApp } from 'vue'
31
- * import QinUI from '@qin-ui/antdv-next-pro'
21
+ * import ProComponents from '@qin-ui/antdv-next-pro'
32
22
  * const app = createApp(App)
33
- * app.use(QinUI)
23
+ * app.use(ProComponents)
34
24
  * ```
35
25
  */
36
26
  install(app) {
37
- components.forEach((component) => {
38
- app.component(component.name, component);
39
- });
27
+ app.component(_sfc_main.name, _sfc_main);
28
+ app.component(ProTable.name, ProTable);
29
+ app.component(_sfc_main$1.name, _sfc_main$1);
40
30
  }
41
31
  };
42
32
  export {
43
33
  a as ContainerFragment,
44
- ProComponentProvider,
45
- ProForm,
34
+ _sfc_main$1 as ProComponentProvider,
35
+ _sfc_main as ProForm,
46
36
  ProTable,
47
37
  b as SlotComponent,
48
38
  index as default,
49
39
  c as useFields,
50
40
  u as useForm,
51
- e as useFormData,
41
+ useFormData,
52
42
  d as useFormRef,
53
43
  useTable
54
44
  };
45
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import type { App } from 'vue';\nimport ProForm from './components/form';\nimport ProTable from './components/table';\nimport ProComponentProvider from './components/component-provider';\n\nexport * from './components/form';\nexport * from './components/table';\nexport * from './components/component-provider';\n\n/**\n * Schema 驱动的表单组件,基于 antdv-next Form 封装\n *\n * @description 通过声明式 JSON Schema 配置即可快速生成表单,\n * 提供极致的 TypeScript 类型推导与组件库插槽扩展能力。\n *\n * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { ProForm, useForm } from '@qin-ui/antdv-next-pro'\n * const form = useForm<User>({ name: '' }, [\n * { path: 'name', label: '姓名', component: 'input' }\n * ])\n * </script>\n * <template>\n * <ProForm :form=\"form\" />\n * </template>\n * ```\n *\n * Schema 驱动的表格组件,基于 antdv-next Table 封装\n *\n * @description 通过声明式列配置即可生成功能完整的表格,\n * 支持列动态控制、搜索表单集成、分页管理等企业级能力。\n *\n * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { ProTable, useTable } from '@qin-ui/antdv-next-pro'\n * const table = useTable<User>({ columns: [{ key: 'name', title: '姓名' }] })\n * </script>\n * <template>\n * <ProTable :table=\"table\" />\n * </template>\n * ```\n *\n * 组件提供者,用于全局配置 ProForm 和 ProTable 的默认行为\n *\n * @description 通过 `ProComponentProvider` 包裹应用根组件,\n * 可以全局覆盖组件的默认属性(如表单布局、表格尺寸等)。\n *\n * @example\n * ```vue\n * <template>\n * <ProComponentProvider :component-props=\"customProps\">\n * <App />\n * </ProComponentProvider>\n * </template>\n * ```\n */\nexport { ProForm, ProTable, ProComponentProvider };\n\nexport default {\n /**\n * @qin-ui/antdv-next-pro 安装方法\n * @description 全局注册所有组件(ProForm、ProTable、ProComponentProvider)\n *\n * @param {App} app - Vue 应用实例\n *\n * @example\n * ```ts\n * import { createApp } from 'vue'\n * import ProComponents from '@qin-ui/antdv-next-pro'\n * const app = createApp(App)\n * app.use(ProComponents)\n * ```\n */\n install(app: App) {\n app.component(ProForm.name, ProForm);\n app.component(ProTable.name, ProTable);\n app.component(ProComponentProvider.name!, ProComponentProvider);\n },\n};\n"],"names":["ProForm","ProComponentProvider"],"mappings":";;;;;;;;;;AA4DA,MAAA,QAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAeb,QAAQ,KAAU;AAChB,QAAI,UAAUA,UAAQ,MAAMA,SAAO;AACnC,QAAI,UAAU,SAAS,MAAM,QAAQ;AACrC,QAAI,UAAUC,YAAqB,MAAOA,WAAoB;AAAA,EAChE;AACF;"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 统一 re-export @qin-ui/pro-components-core,包内所有文件通过此文件引入 core 内容,
3
+ * 避免直接散列依赖 @qin-ui/pro-components-core,便于将来统一维护。
4
+ */
5
+ export { useForm, useTable, useFields, useFormData, useFormRef, InjectionFormKey, InjectionPathKey, getObject, toPath, camelizeProperties, cloneDeep, omit, pick, isPlainObject, type Data, type Path, type Paths, type KeyExpandString, type ExtendWithAny, type DeepPartial, type PageParam, type Fields, type Form, type Table, type UseFieldsReturn, type UseFormDataReturn, type UseFormRefReturn, } from '@qin-ui/pro-components-core';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shared/core/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAEL,OAAO,EACP,QAAQ,EACR,SAAS,EACT,WAAW,EACX,UAAU,EAEV,gBAAgB,EAChB,gBAAgB,EAEhB,SAAS,EACT,MAAM,EACN,kBAAkB,EAClB,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,aAAa,EAEb,KAAK,IAAI,EACT,KAAK,IAAI,EACT,KAAK,KAAK,EACV,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,MAAM,EACX,KAAK,IAAI,EACT,KAAK,KAAK,EACV,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,GACtB,MAAM,6BAA6B,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { FormItem } from 'antdv-next';
2
+ export { theme, useConfig, Form, FormItem, Row as Grid, Col as GridItem, Table, Space, Dropdown, Menu, RadioGroup, Checkbox, CheckboxGroup, Button, AutoComplete, Cascader, DatePicker, DateRangePicker as RangePicker, Input, InputOTP, TextArea, InputPassword, InputNumber, InputSearch, Select, Slider, Switch, TimePicker, TimeRangePicker, Transfer, TreeSelect, type FormProps, type FormItemProps, type FormInstance, type TableProps, type PaginationProps, type RowProps as GridProps, type ColProps as GridItemProps, type TableColumnType as ColumnType, } from 'antdv-next';
3
+ export type FormItemInstance = InstanceType<typeof FormItem>;
4
+ export declare const tableProps: () => any;
5
+ export declare const gridItemProps: () => any;
6
+ export declare const formItemProps: () => any;
7
+ export { useDisabledContext, useDisabledContextProvider, } from 'antdv-next/dist/config-provider/DisabledContext';
8
+ export type NamePath = string | number | (string | number)[];
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shared/ui/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,QAAQ,EAAE,MAAM,YAAY,CAAC;AAElD,OAAO,EACL,KAAK,EACL,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,GAAG,IAAI,IAAI,EACX,GAAG,IAAI,QAAQ,EACf,KAAK,EACL,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,UAAU,EACV,QAAQ,EACR,aAAa,EACb,MAAM,EACN,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,eAAe,IAAI,WAAW,EAC9B,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,aAAa,EACb,WAAW,EACX,WAAW,EACX,MAAM,EACN,MAAM,EACN,MAAM,EACN,UAAU,EACV,eAAe,EACf,QAAQ,EACR,UAAU,EACV,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,QAAQ,IAAI,SAAS,EAC1B,KAAK,QAAQ,IAAI,aAAa,EAC9B,KAAK,eAAe,IAAI,UAAU,GACnC,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC7D,eAAO,MAAM,UAAU,WAAmC,CAAC;AAC3D,eAAO,MAAM,aAAa,WAAiC,CAAC;AAC5D,eAAO,MAAM,aAAa,WAAsC,CAAC;AAEjE,OAAO,EACL,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,iDAAiD,CAAC;AAEzD,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC"}
package/es/table/index.js CHANGED
@@ -1,10 +1,9 @@
1
1
  import { createElementBlock, openBlock, createElementVNode, defineComponent, ref, computed, watch, watchEffect, createBlock, unref, mergeProps, withCtx, createVNode, renderSlot, createCommentVNode, Fragment, resolveDynamicComponent, createTextVNode, toDisplayString, normalizeStyle, useModel, h, mergeModels, inject, useAttrs, useSlots, onMounted, normalizeClass, createSlots, renderList, normalizeProps, guardReactiveProps, nextTick } from "vue";
2
2
  import { Space, Button, theme, useConfig, Dropdown, Menu, Checkbox, Table } from "antdv-next";
3
3
  import "antdv-next/dist/config-provider/DisabledContext";
4
- import { _ as _sfc_main$9, t as tableProps, a as _sfc_main$a } from "../form/index-7clzY8ZD.js";
5
- import { I as INJECT_CONFIG } from "../component-provider/index-Daiw7IxY.js";
6
- import { g as getObject, c as camelizeProperties, f as useTable$1 } from "../core/index-ghYuQ3Sy.js";
7
- import { p as pick } from "../vendor/utils/lodash-es-p6jau26B.js";
4
+ import { _ as _sfc_main$9, t as tableProps, a as _sfc_main$a } from "../form/index-CcP5OaUd.js";
5
+ import { I as INJECT_CONFIG } from "../component-provider/index-Tesc9NuK.js";
6
+ import { pick, getObject, camelizeProperties, useTable as useTable$1 } from "@qin-ui/pro-components-core";
8
7
  const _export_sfc = (sfc, props) => {
9
8
  const target = sfc.__vccOpts || sfc;
10
9
  for (const [key, val] of props) {
@@ -229,7 +228,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
229
228
  };
230
229
  }
231
230
  });
232
- const SearchForm = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-3b60234a"]]);
231
+ const SearchForm = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-46276239"]]);
233
232
  const _sfc_main$6 = /* @__PURE__ */ defineComponent({
234
233
  __name: "DefaultSearchFormContainer",
235
234
  setup(__props) {
@@ -480,7 +479,7 @@ const _hoisted_5 = {
480
479
  };
481
480
  const _sfc_main = /* @__PURE__ */ defineComponent({
482
481
  ...{ name: "ProTable", inheritAttrs: false },
483
- __name: "BaseTable",
482
+ __name: "ProTable",
484
483
  props: /* @__PURE__ */ mergeModels({
485
484
  table: { default: () => void 0 },
486
485
  search: { type: Function, default: void 0 },
@@ -684,9 +683,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
684
683
  };
685
684
  }
686
685
  });
687
- const BaseTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-060985c7"]]);
688
- const useTable = useTable$1;
686
+ const ProTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-2f644dd7"]]);
687
+ function useTable(params) {
688
+ return useTable$1(params);
689
+ }
689
690
  export {
690
- BaseTable as default,
691
+ ProTable as default,
691
692
  useTable
692
693
  };
694
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/components/table/components/icons/DownOutlined.vue","../../src/components/table/components/SearchForm.vue","../../src/components/table/components/DefaultSearchFormContainer.vue","../../src/components/table/components/DefaultTableContainer.vue","../../src/components/table/components/icons/ColumnHeightOutlined.vue","../../src/components/table/components/SizeControl.vue","../../src/components/table/components/icons/FilterOutlined.vue","../../src/components/table/components/ColumnControl.vue","../../src/components/table/components/ProTable.vue","../../src/components/table/useTable.ts"],"sourcesContent":["<template>\n <!-- prettier-ignore -->\n <svg focusable=\"false\" data-icon=\"down\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\" viewBox=\"64 64 896 896\"><path d=\"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z\"></path></svg>\n</template>\n","<script lang=\"ts\">\ntype Expand = {\n // 网格布局时默认展开行数量\n minExpandRows?: number;\n // 网格布局时展开状态\n expandStatus?: boolean;\n};\n\ntype _FormProps = Pick<\n Partial<FormProps>,\n | 'colon'\n | 'disabled'\n | 'labelAlign'\n | 'labelCol'\n | 'labelWrap'\n | 'name'\n | 'wrapperCol'\n>;\n\ntype ButtonProps = { onClick: () => void };\ntype ExpandButtonProps = ButtonProps & { expandStatus: boolean };\n\nexport type SearchFormProps = {\n form: Form;\n layout?: 'grid' | 'inline';\n expand?: boolean | Expand;\n searchButton?: Component<ButtonProps> | DefineComponent<ButtonProps> | false;\n resetButton?: Component<ButtonProps> | DefineComponent<ButtonProps> | false;\n expandButton?:\n | Component<ExpandButtonProps>\n | DefineComponent<ExpandButtonProps>\n | false;\n rowGap?: number;\n columnGap?: number;\n} & /* @vue-ignore */ _FormProps &\n AllowedComponentProps;\n</script>\n\n<script lang=\"ts\" setup>\n/**\n * @component SearchForm\n * @description ProTable 的搜索表单子组件\n *\n * ## 核心功能\n *\n * 1. 内部渲染 ProForm,使用 table.searchForm 管理搜索条件\n * 2. 支持 grid(网格)和 inline(行内)两种布局\n * 3. 网格布局下支持展开/折叠:通过 IntersectionObserver 自动检测哪些字段溢出\n * 4. 提供搜索、重置、展开/折叠按钮(支持自定义)\n *\n * ## 展开/折叠机制\n *\n * 1. 首次渲染后,测量 ProForm 的实际高度\n * 2. 根据 minExpandRows 计算折叠高度(默认 2 行)\n * 3. 如果实际高度 > 折叠高度,显示展开/折叠按钮\n * 4. 使用 IntersectionObserver 检测隐藏字段是否有值,有值则自动展开\n */\n\nimport { Space, Button, FormProps } from '../../../shared/ui';\nimport {\n AllowedComponentProps,\n computed,\n ref,\n watch,\n watchEffect,\n type Component,\n type DefineComponent,\n} from 'vue';\nimport ProForm from '../../form';\nimport { type Form } from '../../form';\nimport DownOutlined from './icons/DownOutlined.vue';\n\ndefineOptions({ name: 'SearchForm' });\n\nconst {\n layout = 'grid',\n expand = true,\n searchButton = undefined,\n resetButton = undefined,\n expandButton = undefined,\n rowGap = 16,\n columnGap = 24,\n form,\n} = defineProps<SearchFormProps>();\n\ntype Emits = {\n (e: 'search'): void;\n (e: 'reset'): void;\n};\nconst emit = defineEmits<Emits>();\n\nconst proFormHeight = ref<'unset' | number>('unset');\nconst collapseHeight = ref(0);\nlet rowHeight = 32;\n\nconst computedExpand = computed(() => {\n if (!expand) return false;\n if (expand === true) return { minExpandRows: 2, expandStatus: false };\n return {\n minExpandRows: Math.max(Math.floor(expand.minExpandRows ?? 2), 1),\n expandStatus: expand.expandStatus ?? false,\n };\n});\n\nconst showExpandToggle = ref(false);\n\nconst expandStatus = ref(true);\n\nconst changeExpandStatus = () => {\n expandStatus.value = !expandStatus.value;\n};\n\nconst { formRef, getFormData } = form;\n\n/*\n * 使用 IntersectionObserver 检测折叠状态下隐藏字段是否有值\n * 如果有值则自动展开,让用户看到已填写的搜索条件\n */\nconst setInitExpandStatus = () => {\n expandStatus.value = false;\n if (formRef.value && expand) {\n const formEl = (formRef.value as any).$el;\n const formItemsEl = formEl.querySelectorAll(\n \"[class*='-form-item'] > [path]\"\n );\n const observer = new IntersectionObserver(\n entries => {\n // 如果隐藏字段(intersectionRatio === 0)有值,则自动展开\n expandStatus.value = entries.some(e => {\n if (e.intersectionRatio === 0) {\n const path = e.target.getAttribute('path');\n const searchFieldValue = path ? getFormData?.(path) : undefined;\n return ![null, undefined].includes(searchFieldValue);\n }\n return (expand as any).expandStatus;\n });\n observer.disconnect();\n },\n { root: formEl }\n );\n formItemsEl.forEach((element: Element) => {\n observer.observe(element);\n });\n }\n};\n\nwatch(\n [\n () => form?.fields.value?.filter(f => !f.hidden)?.length,\n () => formRef.value,\n () => expand,\n ],\n () => {\n if (!expand || !expandStatus.value || !formRef.value) return;\n const proFormEl = (formRef.value as any)?.$el;\n const { height = 0 } = proFormEl?.getBoundingClientRect?.() || {};\n proFormHeight.value = height;\n rowHeight = proFormEl\n ?.querySelector(\"[class*='-form-item']\")\n ?.getBoundingClientRect?.()?.height;\n },\n { flush: 'post', immediate: true }\n);\n\n/*\n * 计算折叠高度和是否显示展开按钮\n * 折叠高度 = minExpandRows * 行高 + (minExpandRows - 1) * 行间距\n * 如果实际高度与折叠高度差异 > 1px,说明有字段溢出,显示展开按钮\n */\nwatchEffect(\n () => {\n if (typeof proFormHeight.value !== 'number') return;\n if (layout === 'grid' && computedExpand.value) {\n const { minExpandRows } = computedExpand.value;\n collapseHeight.value = Math.min(\n minExpandRows * rowHeight + (minExpandRows - 1) * rowGap,\n +proFormHeight.value\n );\n showExpandToggle.value = +proFormHeight.value - collapseHeight.value > 1;\n if (showExpandToggle.value) {\n setInitExpandStatus();\n }\n } else {\n showExpandToggle.value = false;\n }\n },\n { flush: 'post' }\n);\n\nconst layoutProps = computed(() =>\n layout === 'grid'\n ? {\n grid: {\n gutter: [columnGap, rowGap] as [number, number],\n style: { flex: 1, marginRight: '12px' },\n },\n style: {\n display: 'flex',\n overflow: 'hidden',\n height: `${expandStatus.value ? proFormHeight.value : collapseHeight.value}px`,\n },\n }\n : {\n layout: 'inline' as any,\n style: { gap: `${rowGap}px ${columnGap}px` },\n grid: false,\n }\n);\n\nconst onReset = () => {\n emit('reset');\n};\n\nconst onSearch = () => {\n emit('search');\n};\n</script>\n\n<template>\n <ProForm\n v-bind=\"layoutProps\"\n :form=\"form\"\n class=\"pro-table_search-form transition\"\n >\n <Space align=\"start\" class=\"pro-table_search-form_button-group\">\n <slot name=\"reset-button\" @click=\"onReset\">\n <template v-if=\"resetButton !== false\">\n <component :is=\"resetButton\" v-if=\"resetButton\" @click=\"onReset\" />\n <Button\n v-else\n class=\"pro-table_search-form_reset-button\"\n @click=\"onReset\"\n >重置</Button\n >\n </template>\n </slot>\n <slot name=\"search-button\" @click=\"onSearch\">\n <template v-if=\"searchButton !== false\">\n <component :is=\"searchButton\" v-if=\"searchButton\" @click=\"onSearch\" />\n <Button\n v-else\n class=\"pro-table_search-form_search-button\"\n type=\"primary\"\n html-type=\"submit\"\n @click=\"onSearch\"\n >\n 查询\n </Button>\n </template>\n </slot>\n <slot name=\"expand-button\" @click=\"changeExpandStatus\">\n <template v-if=\"expandButton !== false && showExpandToggle\">\n <component\n :is=\"expandButton\"\n v-if=\"expandButton\"\n :expand-status=\"expandStatus\"\n @click=\"changeExpandStatus\"\n />\n <Button\n v-else\n type=\"link\"\n class=\"pro-table_search-form_expand-toggle-button\"\n @click=\"changeExpandStatus\"\n >\n {{ expandStatus ? '收起' : '展开' }}\n <DownOutlined\n class=\"transition\"\n style=\"margin-left: 4px\"\n :style=\"{ transform: `rotate(${expandStatus ? -180 : 0}deg)` }\"\n />\n </Button>\n </template>\n </slot>\n </Space>\n </ProForm>\n</template>\n\n<style scoped lang=\"less\">\n.pro-table_search-form {\n :deep {\n [class*='-form-item'] {\n margin: 0;\n }\n }\n &_expand-toggle-button {\n display: flex;\n align-items: center;\n padding: 0;\n padding-left: 4px;\n }\n\n .transition {\n transition: all 0.25s;\n }\n}\n</style>\n","<script lang=\"ts\" setup>\nimport { computed } from 'vue';\nimport { theme } from '../../../shared/ui';\nconst { token } = theme.useToken();\nconst bgColor = computed(() => token.value?.colorBgContainer);\n</script>\n\n<template>\n <div\n class=\"pro-table_search-form-container\"\n :style=\"{ backgroundColor: bgColor }\"\n >\n <slot />\n </div>\n</template>\n\n<style scoped lang=\"less\">\n.pro-table_search-form-container {\n margin-bottom: 24px;\n padding: 24px;\n}\n</style>\n","<script lang=\"ts\" setup>\nimport { computed } from 'vue';\nimport { theme } from '../../../shared/ui';\nconst { token } = theme.useToken();\nconst bgColor = computed(() => token.value?.colorBgContainer);\n</script>\n\n<template>\n <div class=\"pro-table_table-container\" :style=\"{ backgroundColor: bgColor }\">\n <slot />\n </div>\n</template>\n\n<style scoped lang=\"less\">\n.pro-table_table-container {\n flex: 1;\n padding: 24px 24px 0;\n}\n</style>\n","<template>\n <!-- prettier-ignore -->\n <svg focusable=\"false\" data-icon=\"column-height\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\" viewBox=\"64 64 896 896\"><path d=\"M840 836H184c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h656c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm0-724H184c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h656c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zM610.8 378c6 0 9.4-7 5.7-11.7L515.7 238.7a7.14 7.14 0 00-11.3 0L403.6 366.3a7.23 7.23 0 005.7 11.7H476v268h-62.8c-6 0-9.4 7-5.7 11.7l100.8 127.5c2.9 3.7 8.5 3.7 11.3 0l100.8-127.5c3.7-4.7.4-11.7-5.7-11.7H548V378h62.8z\"></path></svg>\n</template>\n","<script lang=\"ts\" setup>\nimport {\n Dropdown,\n Menu,\n Button,\n type TableProps,\n useConfig,\n} from '../../../shared/ui';\nimport ColumnHeightOutlined from './icons/ColumnHeightOutlined.vue';\n\ntype Size = TableProps['size'];\n\nconst config = useConfig();\n\nconst size = defineModel<Size>('size');\n\nsize.value = size.value ?? config.componentSize?.value ?? 'large';\n\nconst items = [\n { label: '默认', key: 'large' },\n { label: '中等', key: 'middle' },\n { label: '紧凑', key: 'small' },\n];\n</script>\n\n<template>\n <Dropdown arrow placement=\"bottomRight\">\n <Button type=\"text\" class=\"pro-table_size-control_button\">\n <ColumnHeightOutlined />\n </Button>\n <template #popupRender>\n <Menu\n :selected-keys=\"[size as string]\"\n style=\"min-width: 80px\"\n :items=\"items\"\n @click=\"({ key }) => (size = key as any)\"\n >\n </Menu>\n </template>\n </Dropdown>\n</template>\n\n<style scoped lang=\"less\">\n.pro-table_size-control_button {\n display: flex;\n align-items: center;\n padding-right: 12px;\n padding-left: 12px;\n\n :deep(svg) {\n transform: scale(1.3);\n }\n}\n</style>\n","<template>\n <!-- prettier-ignore -->\n <svg focusable=\"false\" data-icon=\"filter\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\" viewBox=\"64 64 896 896\"><path d=\"M880.1 154H143.9c-24.5 0-39.8 26.7-27.5 48L349 597.4V838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V597.4L907.7 202c12.2-21.3-3.1-48-27.6-48zM603.4 798H420.6V642h182.9v156zm9.6-236.6l-9.5 16.6h-183l-9.5-16.6L212.7 226h598.6L613 561.4z\"></path></svg>\n</template>\n","<script lang=\"ts\" setup>\nimport { Button, Dropdown, Checkbox } from '../../../shared/ui';\nimport { computed, h, ref, watch } from 'vue';\nimport type { Columns } from '../types';\nimport { type Table } from '../useTable';\nimport FilterOutlined from './icons/FilterOutlined.vue';\n\ntype Props = {\n columns: Columns;\n table?: Table;\n};\nconst { columns, table = undefined } = defineProps<Props>();\n\nconst open = ref(false);\n\nconst checkAll = ref(false);\nconst indeterminate = ref(false);\n\nconst checkedColumnsOptions = computed<\n Array<{ label: string; value: string; checked: boolean }>\n>(() =>\n columns.flatMap(item =>\n item.key && item.title\n ? {\n label: item.title as string,\n value: item.key,\n checked: !item.hidden,\n }\n : []\n )\n);\n\nconst checkedColumnKeys = computed({\n get() {\n return (\n checkedColumnsOptions.value.flatMap(item =>\n item.checked ? item.value : []\n ) || []\n );\n },\n set(val) {\n checkedColumnsOptions.value?.forEach(item => {\n table?.setColumn?.(item.value, {\n hidden: !val.includes(item.value),\n });\n });\n },\n});\n\nconst onCheckAllChange = (e: any) => {\n checkedColumnKeys.value = e.target.checked\n ? checkedColumnsOptions.value.map(item => item.value)\n : [];\n indeterminate.value = false;\n};\n\nconst checkColumnsMenuItemClick = (val: string) => {\n if (checkedColumnKeys.value.includes(val)) {\n checkedColumnKeys.value = checkedColumnKeys.value.filter(\n item => item !== val\n );\n } else {\n checkedColumnKeys.value = [...checkedColumnKeys.value, val];\n }\n};\n\nwatch(\n checkedColumnKeys,\n val => {\n indeterminate.value =\n !!val.length && val.length < checkedColumnsOptions.value.length;\n checkAll.value =\n val.length > 0 && val.length === checkedColumnsOptions.value.length;\n },\n { immediate: true }\n);\n\nconst items = computed<any>(() => [\n {\n key: 'all',\n label: h(\n Checkbox,\n {\n style: { width: '100%' },\n checked: checkAll.value,\n indeterminate: indeterminate.value,\n onChange: onCheckAllChange,\n },\n () => '全选'\n ),\n },\n { type: 'divider' },\n ...checkedColumnsOptions.value.map(item => ({\n key: item.value,\n label: h(\n Checkbox,\n {\n style: { width: '100%' },\n checked: item.checked,\n onChange: () => checkColumnsMenuItemClick(item.value),\n },\n () => item.label\n ),\n })),\n]);\n\nfunction handleOpenChange(\n nextOpen: boolean,\n info: { source: 'trigger' | 'menu' }\n) {\n if (info.source === 'trigger' || nextOpen) {\n open.value = nextOpen;\n }\n}\n</script>\n\n<template>\n <Dropdown\n :open=\"open\"\n arrow\n placement=\"bottomRight\"\n :menu=\"{ items }\"\n @open-change=\"handleOpenChange\"\n >\n <Button type=\"text\" class=\"pro-table_column-control_button\">\n <FilterOutlined />\n </Button>\n </Dropdown>\n</template>\n\n<style scoped lang=\"less\">\n.pro-table_column-control_button {\n display: flex;\n align-items: center;\n padding-right: 12px;\n padding-left: 12px;\n\n :deep(svg) {\n transform: scale(1.2, 1.4);\n }\n}\n</style>\n","<script lang=\"ts\" setup generic=\"T extends Table<any> = Table\">\n/**\n * @component ProTable\n * @description 配置驱动的表格组件\n *\n * ## 架构概览\n *\n * ProTable 是表格系统的顶层容器,负责:\n * 1. 接收 useTable() 创建的表格实例,驱动列、数据源、分页的渲染\n * 2. 内部集成 SearchForm 搜索区域(基于 ProForm)\n * 3. 支持列动态控制(显示/隐藏)和尺寸控制\n * 4. 将分页变化和搜索事件串联到数据查询流程\n *\n * ## 数据流\n *\n * ```\n * useTable({ columns, dataSource, searchFields, ... })\n * ↓ 传入 :table prop\n * ProTable\n * ├── SearchForm (使用 table.searchForm 管理搜索条件)\n * │ └── ProForm\n * ├── SizeControl (表格尺寸切换)\n * ├── ColumnControl (列显示/隐藏)\n * └── ATable (antdv-next Table)\n * └── 转发所有 table 插槽\n * ```\n *\n * ## 搜索流程\n *\n * 1. 用户点击搜索 → SearchForm @search → searchPage1st()\n * 2. searchPage1st 重置分页到第一页,触发 _search()\n * 3. 分页变化 → onTableChange → setPageParam + _search()\n * 4. 重置 → reset() → resetQueryParams + _search()\n */\n\nimport {\n PaginationProps,\n Table as ATable,\n TableProps,\n ColumnType,\n tableProps,\n} from '../../../shared/ui';\nimport {\n computed,\n nextTick,\n useAttrs,\n onMounted,\n inject,\n type Slot,\n} from 'vue';\nimport { INJECT_CONFIG } from '../../component-provider/constants';\nimport { ContainerFragment } from '../../form';\nimport type { ContainerComponent } from '../../form/types';\nimport SearchForm from './SearchForm.vue';\nimport { SearchFormProps } from './SearchForm.vue';\nimport type { Table } from '../useTable';\nimport { camelizeProperties, getObject, pick } from '../../../shared/core';\nimport { ComponentSlots } from 'vue-component-type-helpers';\nimport {\n DefaultSearchFormContainer,\n DefaultTableContainer,\n SizeControl,\n ColumnControl,\n} from '.';\nimport { Column, Columns } from '../types';\n\ndefineOptions({ name: 'ProTable', inheritAttrs: false });\n\ntype Control = { sizeControl: boolean; columnControl: boolean };\n\ntype SearchFormConfig = Omit<SearchFormProps, 'form'> & {\n // 是否隐藏搜索表单\n hidden?: boolean;\n // 搜索区域包裹容器\n container?: ContainerComponent | false;\n};\n\ntype Props = {\n // 列表表格对象,returns from useTable\n table?: T;\n // 列表数据查询方法\n search?: () => Promise<unknown>;\n // 是否在首列插入index列\n addIndexColumn?: boolean;\n // onMounted 时立即触发一次search事件\n immediateSearch?: boolean;\n // 是否展示表格 size 和 column 控制按钮\n control?: boolean | Partial<Control>;\n // 搜索栏查询字段表单配置\n searchFormConfig?: SearchFormConfig;\n // 表格区域包裹容器\n tableContainer?: ContainerComponent | false;\n} & /* @vue-ignore */ TableProps;\n\nconst {\n table = undefined,\n search = undefined,\n addIndexColumn = undefined,\n control = undefined,\n tableContainer = undefined,\n immediateSearch = undefined,\n searchFormConfig = undefined,\n} = defineProps<Props>();\n\n// 从 ProComponentProvider 获取全局配置,与 props 合并\nconst config = INJECT_CONFIG['pro-table'];\nconst injectProps = inject(config.injectionKey, config.default);\n\nconst tableProperties = Object.keys(tableProps());\n\nconst injectAttrs = pick(injectProps, tableProperties) as TableProps;\n\nconst computedSearchFormConfig = computed(() => {\n const container =\n searchFormConfig?.container ??\n injectProps.searchFormConfig?.container ??\n DefaultSearchFormContainer;\n return {\n ...injectProps.searchFormConfig,\n ...getObject(searchFormConfig),\n container: container ? container : undefined,\n };\n});\n\nconst attrs: Record<string, any> = useAttrs();\nconst tableAttrs = computed<TableProps>(() => {\n return pick(camelizeProperties(attrs), tableProperties);\n});\n\nconst { columns, dataSource, searchForm, pageParam, setPageParam } =\n table || {};\n\nconst size = defineModel<TableProps['size']>('size');\nconst loading = defineModel<boolean>('loading');\n\n// 核心搜索方法:设置 loading 状态,调用外部 search 函数\nconst _search = async () => {\n try {\n loading.value = true;\n await search?.();\n } finally {\n loading.value = false;\n }\n};\n\n// 重置:恢复查询参数到初始值,重新搜索\nconst reset = () => {\n table?.resetQueryParams();\n nextTick(() => {\n _search();\n });\n};\n\ntype CustomSlots = Readonly<\n Partial<Record<'search-form' | 'button-bar' | 'toolbar' | 'table', Slot>>\n>;\ntype TableSlots = Omit<ComponentSlots<typeof ATable>, 'bodyCell'> &\n Readonly<{\n bodyCell?: (props: {\n text: any;\n value: any;\n record: RecordType;\n index: number;\n column: Column<RecordType>;\n }) => void;\n }>;\ntype Slots = Omit<TableSlots & CustomSlots, 'default'>;\n\nconst slots = defineSlots<Slots>();\nconst {\n 'search-form': searchFormSlot,\n 'button-bar': buttonBarSlot,\n toolbar: toolbarSlot,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n table: tableSlot,\n ...tableSlots\n} = slots;\n\nconst searchPage1st = () => {\n setPageParam?.({ current: 1 });\n _search();\n};\n\nconst computedTableProps = computed<TableProps>(() => {\n return {\n ...injectAttrs,\n ...tableAttrs.value,\n pagination: undefined,\n onChange: undefined,\n };\n});\n\nconst computedTableContainer = computed(() => {\n const container =\n tableContainer ?? injectProps.tableContainer ?? DefaultTableContainer;\n return container ? container : undefined;\n});\n\ntype ReturnGenericParameterTypes<V> = V extends Table<any, infer R> ? R : never;\ntype RecordType = ReturnGenericParameterTypes<T>;\n\nconst indexColumn: ColumnType = {\n title: '序号',\n dataIndex: '_index',\n width: 80,\n render: (_, __, index) => index + 1,\n};\n\nconst computedColumns = computed(\n () =>\n [\n ...((addIndexColumn ?? injectProps.addIndexColumn) ? [indexColumn] : []),\n ...(tableAttrs.value.columns ?? columns?.value ?? []).flatMap(\n (item: any, index) => {\n if (item.key) return [{ ...item, key: item.key }];\n if (item.dataIndex) {\n const dataIndexKey = Array.isArray(item.dataIndex)\n ? item.dataIndex.join('.')\n : (item.dataIndex as string);\n return [{ ...item, key: dataIndexKey }];\n }\n return [{ ...item, key: index }];\n }\n ),\n ] as Columns<RecordType>\n);\n\nconst visibleComputedColumns = computed(() => {\n return computedColumns.value.filter(item => !(item as Column).hidden);\n});\n\nconst computedDataSource = computed<RecordType[]>(() => {\n return (tableAttrs.value.dataSource as any[]) ?? dataSource?.value;\n});\n\nconst computedPagination = computed<PaginationProps | false>(() => {\n if (tableAttrs.value.pagination === false) return false;\n return {\n ...injectAttrs.pagination,\n ...pageParam,\n ...tableAttrs.value.pagination,\n };\n});\n\nconst onTableChange: any = (...args: any[]) => {\n setPageParam?.(args[0]);\n attrs.onChange?.(...args);\n _search();\n};\n\nconst showSearch = computed(() => {\n return !!(\n searchFormSlot ||\n (computedSearchFormConfig.value?.hidden !== true &&\n searchForm &&\n searchForm.fields.value.filter(item => !item.hidden)?.length > 0)\n );\n});\n\nconst computedControl = computed<Control>(() => {\n const mergedControl = control ?? injectProps.control;\n const sizeControl = (mergedControl as Control)?.sizeControl ?? mergedControl;\n const columnControl =\n (mergedControl as Control)?.columnControl ?? mergedControl;\n return { sizeControl, columnControl };\n});\n\nonMounted(() => {\n if (immediateSearch ?? injectProps.immediateSearch) {\n _search();\n }\n});\n</script>\n\n<template>\n <div\n class=\"pro-table\"\n :class=\"($attrs as any).class\"\n :style=\"($attrs as any).style\"\n >\n <ContainerFragment\n v-if=\"showSearch\"\n :component=\"computedSearchFormConfig.container\"\n >\n <slot name=\"search-form\">\n <SearchForm\n v-if=\"searchForm\"\n :form=\"searchForm\"\n v-bind=\"computedSearchFormConfig\"\n @search=\"searchPage1st\"\n @reset=\"reset\"\n />\n </slot>\n </ContainerFragment>\n\n <ContainerFragment :component=\"computedTableContainer\">\n <div class=\"pro-table_header\">\n <div v-if=\"buttonBarSlot\" class=\"pro-table_header_button-bar\">\n <slot name=\"button-bar\" />\n </div>\n <div v-if=\"toolbarSlot\" class=\"pro-table_header_toolbar\">\n <slot name=\"toolbar\" />\n </div>\n <div\n v-if=\"computedControl.sizeControl\"\n class=\"pro-table_header_size-control\"\n >\n <SizeControl v-model:size=\"size\" />\n </div>\n <div\n v-if=\"computedControl.columnControl\"\n class=\"pro-table_header_column-control\"\n >\n <ColumnControl :columns=\"computedColumns\" :table=\"table\" />\n </div>\n </div>\n\n <slot name=\"table\">\n <ATable\n class=\"pro-table_content\"\n v-bind=\"computedTableProps\"\n :size=\"size\"\n :loading=\"loading\"\n :columns=\"visibleComputedColumns\"\n :data-source=\"computedDataSource\"\n :pagination=\"computedPagination\"\n @change=\"onTableChange\"\n >\n <template\n v-for=\"(_, name) of tableSlots\"\n :key=\"name\"\n #[name]=\"scoped\"\n >\n <slot :name=\"name\" v-bind=\"scoped\" />\n </template>\n </ATable>\n </slot>\n </ContainerFragment>\n </div>\n</template>\n\n<style scoped lang=\"less\">\n.pro-table {\n &_header {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n\n &:empty {\n display: none;\n }\n\n & + &_content {\n margin-top: 16px;\n }\n\n &_button-bar {\n flex: 1;\n }\n\n &_toolbar {\n margin-left: 12px;\n }\n }\n\n :deep([class*='-pagination']) {\n [class*='-pagination-total-text'] {\n flex: 1;\n }\n }\n}\n</style>\n","import {\n useTable as coreUseTable,\n type Table as _Table,\n} from '../../shared/core';\nimport type {\n Data,\n ExtendWithAny,\n DeepPartial,\n PageParam,\n} from '../../shared/core';\nimport { Fields } from '../form/types';\nimport type { Column, Columns } from './types';\n\n/**\n * 表格实例类型\n *\n * @description 在 core Table 类型的基础上,将列类型 C 绑定为本地 Column\\<T\\>,\n * 使 columns 操作获得 antdv-next 表格列的完整属性类型提示。\n *\n * @template D - 搜索表单数据类型\n * @template T - 表格行数据类型(一行数据的类型)\n *\n * @property columns - 列配置数组(响应式 Ref),用于渲染表格列\n * @property dataSource - 表格数据源(响应式 Ref),绑定到 Table 的 data-source\n * @property pageParam - 分页参数(响应式 reactive),包含 current、pageSize、total\n * @property searchForm - 搜索表单实例(Form 类型),用于管理搜索区域的字段和数据\n * @property setColumn - 更新列配置,支持合并/覆盖两种模式,用法同 setField\n * @property deleteColumn - 删除列,支持路径或查找函数\n * @property appendColumn - 在指定列后追加新列,传 undefined 在末尾追加\n * @property prependColumn - 在指定列前插入新列,传 undefined 在开头插入\n * @property setPageParam - 设置分页参数,支持部分更新和函数式更新\n * @property resetQueryParams - 重置分页到第一页并恢复搜索条件到初始值\n *\n * @example\n * ```ts\n * interface User { name: string; age: number; email: string }\n *\n * const table: Table<{}, User> = useTable({\n * columns: [{ dataIndex: 'name', title: '姓名' }],\n * })\n *\n * table.columns.value // 访问列配置\n * table.setColumn('name', { width: 150 }) // 更新列\n * table.setPageParam({ current: 2 }) // 切换页码\n * table.searchForm.setFormData('keyword', '搜索词') // 操作搜索表单\n * ```\n *\n * @public\n */\nexport type Table<\n D extends Data = Data,\n T extends Data = ExtendWithAny<D>,\n> = _Table<D, T, Column<T>>;\n\n/**\n * 创建表格实例的 Hook\n *\n * @description 基于 `@qin-ui/pro-components-core` 的 `useTable`,将列类型绑定为本地 `Column<T>`。\n * 是 ProTable 组件的核心 Hook,提供了:\n * - 列配置管理(增删改查)\n * - 数据源管理\n * - 分页管理\n * - 搜索表单集成(内部使用 useForm)\n * - 查询参数重置\n *\n * @template D - 搜索表单数据类型\n * @template T - 表格行数据类型\n *\n * @param {object} params - 表格配置参数\n * @param {Columns<T>} [params.columns] - 初始列配置数组\n * @param {T[]} [params.dataSource] - 初始数据源\n * @param {PageParam} [params.pageParam] - 初始分页参数,默认 `{ current: 1, pageSize: 10, total: 0 }`\n * @param {ExtendWithAny<DeepPartial<D>>} [params.searchParam] - 初始搜索参数\n * @param {Fields<D>} [params.searchFields] - 搜索表单字段配置\n *\n * @returns {Table<D, T>} 表格实例\n *\n * @example\n * ```ts\n * interface SearchParams { keyword: string; status: string }\n * interface User { name: string; age: number; email: string }\n *\n * const table = useTable<SearchParams, User>({\n * columns: [\n * { dataIndex: 'name', title: '姓名', width: 120 },\n * { dataIndex: 'age', title: '年龄', width: 80 },\n * ],\n * dataSource: [],\n * pageParam: { current: 1, pageSize: 20, total: 0 },\n * searchParam: { keyword: '', status: '' },\n * searchFields: [\n * { path: 'keyword', label: '关键词', component: 'input' },\n * { path: 'status', label: '状态', component: 'select' },\n * ],\n * })\n *\n * // 查询\n * const handleSearch = async () => {\n * const res = await fetchUserList({\n * ...table.searchForm.formData,\n * ...table.pageParam,\n * })\n * table.dataSource.value = res.data\n * table.setPageParam({ total: res.total })\n * }\n *\n * // 重置\n * const handleReset = () => {\n * table.resetQueryParams()\n * handleSearch()\n * }\n * ```\n *\n * @see {@link coreUseTable} 底层核心实现(来自 @qin-ui/pro-components-core)\n *\n * @public\n */\nexport function useTable<\n D extends Data = Data,\n T extends Data = ExtendWithAny<D>,\n>(params: {\n columns?: Columns<T>;\n dataSource?: T[];\n pageParam?: PageParam;\n searchParam?: ExtendWithAny<DeepPartial<D>>;\n searchFields?: Fields<D>;\n}): Table<D, T> {\n return coreUseTable(params) as any;\n}\n"],"names":["_openBlock","_createElementBlock","_hoisted_1","_createElementVNode","_createBlock","_unref","ProForm","_mergeProps","_createVNode","_renderSlot","_Fragment","_resolveDynamicComponent","_createTextVNode","_toDisplayString","_normalizeStyle","_useModel","_a","_useSlots","_normalizeClass","$attrs","ContainerFragment","_withCtx","_normalizeProps","_guardReactiveProps","coreUseTable"],"mappings":";;;;;;;;;;;;;;;EAEO,WAAU;AAAA,EAAQ,aAAU;AAAA,EAAO,OAAM;AAAA,EAAM,QAAO;AAAA,EAAM,MAAK;AAAA,EAAe,eAAY;AAAA,EAAO,SAAQ;;;AAAhH,SAAAA,UAAA,GAAAC,mBAAiV,OAAjVC,cAAiV,CAAA,GAAA,OAAA,CAAA,MAAA,OAAA,CAAA,IAAA;AAAA,IAAjNC,mBAA2M,QAAA,EAArM,GAAE,4LAA2L,GAAA,MAAA,EAAA;A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IAAAc,QAAA,CAFS,WAAM;AAAA,sBAEfZ,WAAqC,KAAA,QAAxB,MAAIa,eAAAC,mBAAU,MAAM,CAAA,GAAA,QAAA,IAAA;AAAA,oBAAA;;;;;;;;;;;;;ACxNtC,SAAS,SAGd,QAMc;AACd,SAAOC,WAAa,MAAM;AAC5B;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qin-ui/antdv-next-pro",
3
- "version": "1.1.14",
3
+ "version": "1.2.0",
4
4
  "description": "基于 antdv-next 的二次封装组件",
5
5
  "bin": {
6
6
  "antdv-next-pro": "./bin/init-ai.mjs"
@@ -17,6 +17,7 @@
17
17
  },
18
18
  "files": [
19
19
  "es",
20
+ "src",
20
21
  "bin",
21
22
  "README.md",
22
23
  "LICENSE",
@@ -28,10 +29,6 @@
28
29
  "type": "git",
29
30
  "url": "git+https://github.com/dufan3715/pro-components.git"
30
31
  },
31
- "scripts": {
32
- "prebuild": "tsx ../../scripts/generate-api-json.ts antdv-next-pro",
33
- "build": "vue-tsc && vite build"
34
- },
35
32
  "author": "dufan3715",
36
33
  "license": "MIT",
37
34
  "private": false,
@@ -40,16 +37,18 @@
40
37
  "vue": "^3.5.0"
41
38
  },
42
39
  "dependencies": {
43
- "vue-component-type-helpers": "^3.2.5"
40
+ "vue-component-type-helpers": "^3.2.5",
41
+ "@qin-ui/pro-components-core": "^1.0.0"
44
42
  },
45
43
  "devDependencies": {
46
- "@qin-ui/core": "workspace:^",
47
- "@types/lodash-es": "^4.17.12",
48
- "antdv-next": "^1.1.0",
49
- "lodash-es": "^4.17.21"
44
+ "antdv-next": "^1.1.0"
50
45
  },
51
46
  "publishConfig": {
52
47
  "access": "public",
53
48
  "registry": "https://registry.npmjs.org/"
49
+ },
50
+ "scripts": {
51
+ "prebuild": "tsx ../../scripts/generate-api-json.ts antdv-next-pro",
52
+ "build": "vue-tsc && vite build"
54
53
  }
55
- }
54
+ }
@@ -0,0 +1,67 @@
1
+ <script lang="ts" setup>
2
+ /**
3
+ * @component ProComponentProvider
4
+ * @description @qin-ui/antdv-next-pro 全局配置提供者组件
5
+ *
6
+ * 用于在组件树的顶层配置所有子组件的全局默认属性。
7
+ *
8
+ * @param {ComponentVars} [componentVars] - 组件全局配置变量
9
+ * @param {Record<ComponentName, any>} [componentMap] - 自定义组件映射
10
+ *
11
+ * @slot default - 子组件内容
12
+ *
13
+ * @example
14
+ * ```vue
15
+ * <ProComponentProvider
16
+ * :componentVars="{ 'input': { placeholder: '请输入' } }"
17
+ * >
18
+ * <ProForm :form="form" :fields="fields" />
19
+ * </ProComponentProvider>
20
+ * ```
21
+
22
+ * @public
23
+ */
24
+ import { ComponentVars } from '../types';
25
+ import { INJECT_COMPONENTS, ensureInjectConfig } from '../constants';
26
+ import { provide } from 'vue';
27
+ import { getObject } from '../../../shared/core';
28
+ import { ComponentName } from '../../form/constants';
29
+
30
+ type ComponentMap = Partial<Record<ComponentName, any>>;
31
+
32
+ defineOptions({
33
+ name: 'ProComponentProvider',
34
+ inheritAttrs: false,
35
+ });
36
+
37
+ type Props = {
38
+ /** 组件全局配置,可配置所有内置组件的默认属性 */
39
+ componentVars?: ComponentVars;
40
+ /** 自定义组件映射,用于替换或扩展内置组件 */
41
+ componentMap?: ComponentMap;
42
+ };
43
+
44
+ const props = defineProps<Props>();
45
+
46
+ /*
47
+ * 遍历 componentVars 的每个 key,获取或创建对应的 inject 配置
48
+ * 将用户提供的值合并到默认值上,通过 provide 注入到子组件树
49
+ * 子组件通过 inject(config.injectionKey) 获取合并后的配置
50
+ */
51
+ if (props.componentVars) {
52
+ Object.entries(props.componentVars).forEach(([key, val]) => {
53
+ const config = ensureInjectConfig(key);
54
+ // 用户配置覆盖默认值
55
+ provide(config.injectionKey, { ...config.default, ...getObject(val) });
56
+ });
57
+ }
58
+
59
+ // 注入自定义组件映射,BaseField 在解析组件时会优先使用此映射
60
+ if (props.componentMap) {
61
+ provide(INJECT_COMPONENTS, props.componentMap);
62
+ }
63
+ </script>
64
+
65
+ <template>
66
+ <slot />
67
+ </template>
@@ -0,0 +1,177 @@
1
+ import { RequiredComponentVars } from '../types';
2
+ import { InjectionKey, Component } from 'vue';
3
+
4
+ const getPopupContainer = (triggerNode: any) =>
5
+ triggerNode.closest("form[class*='-form']");
6
+
7
+ export type InjectConfigEntry<T = any> = {
8
+ injectionKey: InjectionKey<T>;
9
+ default: T;
10
+ };
11
+
12
+ export const INJECT_CONFIG: {
13
+ [key in keyof RequiredComponentVars]: {
14
+ injectionKey: InjectionKey<RequiredComponentVars[key]>;
15
+ default: RequiredComponentVars[key];
16
+ };
17
+ } = {
18
+ 'pro-table': {
19
+ injectionKey: Symbol(''),
20
+ default: {
21
+ pagination: {
22
+ showTotal: total => `共 ${total} 条`,
23
+ showSizeChanger: true,
24
+ pageSizeOptions: ['10', '20', '30', '40', '50', '100'],
25
+ showQuickJumper: true,
26
+ },
27
+ searchFormConfig: {
28
+ layout: 'grid',
29
+ expand: { minExpandRows: 2, expandStatus: false },
30
+ },
31
+ control: true,
32
+ addIndexColumn: true,
33
+ },
34
+ },
35
+ 'pro-form': {
36
+ injectionKey: Symbol(''),
37
+ default: { grid: { gutter: { xs: 8, sm: 16, md: 16, lg: 24 } } },
38
+ },
39
+ 'pro-form-item': {
40
+ injectionKey: Symbol(''),
41
+ default: { validateFirst: true, span: 8 },
42
+ },
43
+ // field
44
+ input: {
45
+ injectionKey: Symbol(''),
46
+ default: { maxlength: 100, allowClear: true, placeholder: '请输入' },
47
+ },
48
+ textarea: {
49
+ injectionKey: Symbol(''),
50
+ default: {
51
+ maxlength: 200,
52
+ autoSize: { minRows: 3, maxRows: 6 },
53
+ showCount: true,
54
+ allowClear: true,
55
+ placeholder: '请输入',
56
+ },
57
+ },
58
+ 'input-password': {
59
+ injectionKey: Symbol(''),
60
+ default: { maxlength: 100, allowClear: true, placeholder: '请输入' },
61
+ },
62
+ 'input-search': {
63
+ injectionKey: Symbol(''),
64
+ default: {},
65
+ },
66
+ 'input-number': {
67
+ injectionKey: Symbol(''),
68
+ default: {
69
+ max: 10 ** 15 - 1,
70
+ min: -(10 ** 15 + 1),
71
+ controls: false,
72
+ placeholder: '请输入',
73
+ style: { width: '100%' },
74
+ } as any,
75
+ },
76
+ 'input-otp': {
77
+ injectionKey: Symbol(''),
78
+ default: {},
79
+ },
80
+ 'auto-complete': {
81
+ injectionKey: Symbol(''),
82
+ default: { allowClear: true, placeholder: '请选择', getPopupContainer },
83
+ },
84
+ select: {
85
+ injectionKey: Symbol(''),
86
+ default: { allowClear: true, placeholder: '请选择', getPopupContainer },
87
+ },
88
+ cascader: {
89
+ injectionKey: Symbol(''),
90
+ default: { allowClear: true, placeholder: '请选择', getPopupContainer },
91
+ },
92
+ 'date-picker': {
93
+ injectionKey: Symbol(''),
94
+ default: { allowClear: true, getPopupContainer, style: { width: '100%' } },
95
+ },
96
+ 'date-picker.date': {
97
+ injectionKey: Symbol(''),
98
+ default: { allowClear: true, getPopupContainer, style: { width: '100%' } },
99
+ },
100
+ 'date-picker.week': {
101
+ injectionKey: Symbol(''),
102
+ default: { allowClear: true, getPopupContainer, style: { width: '100%' } },
103
+ },
104
+ 'date-picker.month': {
105
+ injectionKey: Symbol(''),
106
+ default: { allowClear: true, getPopupContainer, style: { width: '100%' } },
107
+ },
108
+ 'date-picker.year': {
109
+ injectionKey: Symbol(''),
110
+ default: { allowClear: true, getPopupContainer, style: { width: '100%' } },
111
+ },
112
+ 'date-picker.quarter': {
113
+ injectionKey: Symbol(''),
114
+ default: { allowClear: true, getPopupContainer, style: { width: '100%' } },
115
+ },
116
+ 'range-picker': {
117
+ injectionKey: Symbol(''),
118
+ default: { allowClear: true, getPopupContainer, style: { width: '100%' } },
119
+ },
120
+ 'time-picker': {
121
+ injectionKey: Symbol(''),
122
+ default: { allowClear: true, getPopupContainer, style: { width: '100%' } },
123
+ },
124
+ 'time-range-picker': {
125
+ injectionKey: Symbol(''),
126
+ default: { allowClear: true, getPopupContainer, style: { width: '100%' } },
127
+ },
128
+ 'checkbox-group': {
129
+ injectionKey: Symbol(''),
130
+ default: {},
131
+ },
132
+ 'radio-group': {
133
+ injectionKey: Symbol(''),
134
+ default: {},
135
+ },
136
+ switch: {
137
+ injectionKey: Symbol(''),
138
+ default: { modelProp: 'checked' },
139
+ },
140
+ slider: {
141
+ injectionKey: Symbol(''),
142
+ default: {},
143
+ },
144
+ 'tree-select': {
145
+ injectionKey: Symbol(''),
146
+ default: {},
147
+ },
148
+ transfer: {
149
+ injectionKey: Symbol(''),
150
+ default: {},
151
+ },
152
+ };
153
+
154
+ export const INJECT_COMPONENTS: InjectionKey<
155
+ Partial<Record<string, Component>>
156
+ > = Symbol('INJECT_COMPONENTS');
157
+
158
+ const DYNAMIC_INJECT_CONFIG: Record<string, InjectConfigEntry> =
159
+ Object.create(null);
160
+
161
+ export const getInjectConfig = (key: string): InjectConfigEntry | undefined => {
162
+ return (
163
+ (INJECT_CONFIG as Record<string, InjectConfigEntry>)[key] ||
164
+ DYNAMIC_INJECT_CONFIG[key]
165
+ );
166
+ };
167
+
168
+ export const ensureInjectConfig = (key: string): InjectConfigEntry => {
169
+ const existing = getInjectConfig(key);
170
+ if (existing) return existing;
171
+ const created: InjectConfigEntry = {
172
+ injectionKey: Symbol(`dynamic:${key}`),
173
+ default: {},
174
+ };
175
+ DYNAMIC_INJECT_CONFIG[key] = created;
176
+ return created;
177
+ };
@@ -0,0 +1,6 @@
1
+ import ComponentProvider from './components/index.vue';
2
+
3
+ // 仅导出全局属性配置类型,隐藏所有底层的 INJECT_CONFIG 与工具函数
4
+ export { type ComponentVars } from './types';
5
+
6
+ export default ComponentProvider;
@@ -0,0 +1,59 @@
1
+ import { GridItemProps, FormItemProps, TableProps } from '../../../shared/ui';
2
+ import { ComponentName, GetComponentType } from '../../form/constants';
3
+ import { Base, Grid } from '../../form/types';
4
+ import { ProFormProps } from '../../form';
5
+ import { ProTableProps } from '../../table';
6
+ import { AllowedComponentProps } from 'vue';
7
+ import type { ComponentProps } from 'vue-component-type-helpers';
8
+
9
+ type PP<T extends Record<string, any>> = Partial<T & AllowedComponentProps>;
10
+
11
+ type FP<T extends Record<string, any>> = Partial<
12
+ T &
13
+ Pick<
14
+ Base,
15
+ | 'valueFormatter'
16
+ | 'componentContainer'
17
+ | 'modelProp'
18
+ | 'componentClass'
19
+ | 'componentStyle'
20
+ > &
21
+ AllowedComponentProps
22
+ >;
23
+
24
+ export type RequiredComponentVars = {
25
+ 'pro-table': PP<
26
+ TableProps &
27
+ Pick<
28
+ ProTableProps,
29
+ | 'control'
30
+ | 'searchFormConfig'
31
+ | 'immediateSearch'
32
+ | 'addIndexColumn'
33
+ | 'tableContainer'
34
+ >
35
+ >;
36
+ 'pro-form': PP<
37
+ Omit<ProFormProps, 'form' | 'grid'> & {
38
+ grid: Exclude<Grid, undefined | boolean>;
39
+ }
40
+ >;
41
+ 'pro-form-item': PP<
42
+ FormItemProps &
43
+ Pick<GridItemProps, 'span' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl'> &
44
+ Pick<Base, 'formItemContainer'>
45
+ >;
46
+ // field
47
+ 'date-picker.date': FP<ComponentProps<GetComponentType<'date-picker'>>>;
48
+ 'date-picker.week': FP<ComponentProps<GetComponentType<'date-picker'>>>;
49
+ 'date-picker.month': FP<ComponentProps<GetComponentType<'date-picker'>>>;
50
+ 'date-picker.year': FP<ComponentProps<GetComponentType<'date-picker'>>>;
51
+ 'date-picker.quarter': FP<ComponentProps<GetComponentType<'date-picker'>>>;
52
+ } & {
53
+ // field
54
+ [K in Exclude<ComponentName, 'custom'>]: FP<
55
+ ComponentProps<GetComponentType<K>>
56
+ >;
57
+ };
58
+
59
+ export type ComponentVars = Partial<RequiredComponentVars>;