@qin-ui/element-plus-pro 1.3.0 → 1.3.2

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 (170) hide show
  1. package/AI-CONTEXT.md +1 -1
  2. package/api.json +1 -1
  3. package/es/components/component-provider/components/index.vue.d.ts.map +1 -0
  4. package/es/{src/components → components}/component-provider/constants/index.d.ts +2 -2
  5. package/es/components/component-provider/constants/index.d.ts.map +1 -0
  6. package/es/components/component-provider/index.d.ts.map +1 -0
  7. package/es/components/component-provider/types/index.d.ts.map +1 -0
  8. package/es/components/form/components/BaseField/index.vue.d.ts.map +1 -0
  9. package/es/{src/components → components}/form/components/BaseField/utils/index.d.ts +1 -0
  10. package/es/components/form/components/BaseField/utils/index.d.ts.map +1 -0
  11. package/es/components/form/components/BaseFormItem/index.vue.d.ts.map +1 -0
  12. package/es/components/form/components/ContainerFragment/index.vue.d.ts.map +1 -0
  13. package/es/components/form/components/ProForm/index.vue.d.ts.map +1 -0
  14. package/es/components/form/components/SlotComponent/index.vue.d.ts.map +1 -0
  15. package/es/components/form/components/index.d.ts.map +1 -0
  16. package/es/components/form/constants/index.d.ts.map +1 -0
  17. package/es/components/form/hooks/index.d.ts.map +1 -0
  18. package/es/components/form/hooks/useFields.d.ts.map +1 -0
  19. package/es/components/form/hooks/useForm.d.ts.map +1 -0
  20. package/es/components/form/hooks/useFormRef.d.ts.map +1 -0
  21. package/es/components/form/hooks/useGroupFieldAttrs.d.ts.map +1 -0
  22. package/es/components/form/index.d.ts.map +1 -0
  23. package/es/components/form/types/index.d.ts.map +1 -0
  24. package/es/components/table/components/ColumnControl.vue.d.ts.map +1 -0
  25. package/es/components/table/components/DefaultSearchFormContainer.vue.d.ts.map +1 -0
  26. package/es/components/table/components/DefaultTableContainer.vue.d.ts.map +1 -0
  27. package/es/{src/components → components}/table/components/ProTable.vue.d.ts +4 -1
  28. package/es/components/table/components/ProTable.vue.d.ts.map +1 -0
  29. package/es/components/table/components/SearchForm.vue.d.ts.map +1 -0
  30. package/es/components/table/components/SizeControl.vue.d.ts.map +1 -0
  31. package/es/components/table/components/TableColumnRenderer.vue.d.ts.map +1 -0
  32. package/es/components/table/components/icons/ColumnHeightOutlined.vue.d.ts.map +1 -0
  33. package/es/components/table/components/icons/DownOutlined.vue.d.ts.map +1 -0
  34. package/es/components/table/components/icons/FilterOutlined.vue.d.ts.map +1 -0
  35. package/es/components/table/components/index.d.ts.map +1 -0
  36. package/es/components/table/index.d.ts.map +1 -0
  37. package/es/{src/components → components}/table/types/index.d.ts +3 -0
  38. package/es/components/table/types/index.d.ts.map +1 -0
  39. package/es/components/table/useTable.d.ts.map +1 -0
  40. package/es/element-plus-pro.css +12 -12
  41. package/es/index.d.ts.map +1 -0
  42. package/es/index.js +98 -250
  43. package/es/index.js.map +1 -1
  44. package/es/locale/en-US.d.ts.map +1 -0
  45. package/es/{src/locale → locale}/index.d.ts +1 -1
  46. package/es/locale/index.d.ts.map +1 -0
  47. package/es/locale/zh-CN.d.ts.map +1 -0
  48. package/es/locale/zh-TW.d.ts.map +1 -0
  49. package/es/shared/core/index.d.ts +6 -0
  50. package/es/shared/core/index.d.ts.map +1 -0
  51. package/es/shared/ui/index.d.ts.map +1 -0
  52. package/package.json +2 -2
  53. package/src/components/component-provider/components/index.vue +4 -3
  54. package/src/components/component-provider/constants/index.ts +4 -3
  55. package/src/components/form/components/BaseField/index.vue +3 -6
  56. package/src/components/form/components/BaseField/utils/index.ts +11 -0
  57. package/src/components/form/components/BaseFormItem/index.vue +2 -1
  58. package/src/components/form/components/ProForm/index.vue +12 -22
  59. package/src/components/form/components/SlotComponent/index.vue +9 -6
  60. package/src/components/form/hooks/useGroupFieldAttrs.ts +5 -2
  61. package/src/components/table/components/ColumnControl.vue +20 -19
  62. package/src/components/table/components/ProTable.vue +41 -38
  63. package/src/components/table/components/SearchForm.vue +4 -182
  64. package/src/components/table/components/TableColumnRenderer.vue +4 -2
  65. package/src/components/table/types/index.ts +3 -0
  66. package/src/locale/en-US.ts +1 -1
  67. package/src/locale/index.ts +1 -5
  68. package/src/locale/zh-CN.ts +1 -1
  69. package/src/locale/zh-TW.ts +1 -1
  70. package/src/shared/core/index.ts +11 -0
  71. package/src/shared/ui/index.ts +9 -4
  72. package/es/__tests__/BaseField.spec.d.ts +0 -2
  73. package/es/__tests__/BaseField.spec.d.ts.map +0 -1
  74. package/es/__tests__/BaseFormItem.spec.d.ts +0 -2
  75. package/es/__tests__/BaseFormItem.spec.d.ts.map +0 -1
  76. package/es/__tests__/ProForm.spec.d.ts +0 -2
  77. package/es/__tests__/ProForm.spec.d.ts.map +0 -1
  78. package/es/__tests__/ProTable.spec.d.ts +0 -2
  79. package/es/__tests__/ProTable.spec.d.ts.map +0 -1
  80. package/es/__tests__/SearchForm.spec.d.ts +0 -2
  81. package/es/__tests__/SearchForm.spec.d.ts.map +0 -1
  82. package/es/__tests__/controls.spec.d.ts +0 -2
  83. package/es/__tests__/controls.spec.d.ts.map +0 -1
  84. package/es/__tests__/helpers/fixtures.d.ts +0 -15
  85. package/es/__tests__/helpers/fixtures.d.ts.map +0 -1
  86. package/es/__tests__/helpers/mount.d.ts +0 -38
  87. package/es/__tests__/helpers/mount.d.ts.map +0 -1
  88. package/es/__tests__/hooks-locale.spec.d.ts +0 -2
  89. package/es/__tests__/hooks-locale.spec.d.ts.map +0 -1
  90. package/es/__tests__/index.spec.d.ts +0 -2
  91. package/es/__tests__/index.spec.d.ts.map +0 -1
  92. package/es/__tests__/integration.spec.d.ts +0 -2
  93. package/es/__tests__/integration.spec.d.ts.map +0 -1
  94. package/es/__tests__/setup.d.ts +0 -14
  95. package/es/__tests__/setup.d.ts.map +0 -1
  96. package/es/src/components/component-provider/components/index.vue.d.ts.map +0 -1
  97. package/es/src/components/component-provider/constants/index.d.ts.map +0 -1
  98. package/es/src/components/component-provider/index.d.ts.map +0 -1
  99. package/es/src/components/component-provider/types/index.d.ts.map +0 -1
  100. package/es/src/components/form/components/BaseField/index.vue.d.ts.map +0 -1
  101. package/es/src/components/form/components/BaseField/utils/index.d.ts.map +0 -1
  102. package/es/src/components/form/components/BaseFormItem/index.vue.d.ts.map +0 -1
  103. package/es/src/components/form/components/ContainerFragment/index.vue.d.ts.map +0 -1
  104. package/es/src/components/form/components/ProForm/index.vue.d.ts.map +0 -1
  105. package/es/src/components/form/components/SlotComponent/index.vue.d.ts.map +0 -1
  106. package/es/src/components/form/components/index.d.ts.map +0 -1
  107. package/es/src/components/form/constants/index.d.ts.map +0 -1
  108. package/es/src/components/form/hooks/index.d.ts.map +0 -1
  109. package/es/src/components/form/hooks/useFields.d.ts.map +0 -1
  110. package/es/src/components/form/hooks/useForm.d.ts.map +0 -1
  111. package/es/src/components/form/hooks/useFormRef.d.ts.map +0 -1
  112. package/es/src/components/form/hooks/useGroupFieldAttrs.d.ts.map +0 -1
  113. package/es/src/components/form/index.d.ts.map +0 -1
  114. package/es/src/components/form/types/index.d.ts.map +0 -1
  115. package/es/src/components/table/components/ColumnControl.vue.d.ts.map +0 -1
  116. package/es/src/components/table/components/DefaultSearchFormContainer.vue.d.ts.map +0 -1
  117. package/es/src/components/table/components/DefaultTableContainer.vue.d.ts.map +0 -1
  118. package/es/src/components/table/components/ProTable.vue.d.ts.map +0 -1
  119. package/es/src/components/table/components/SearchForm.vue.d.ts.map +0 -1
  120. package/es/src/components/table/components/SizeControl.vue.d.ts.map +0 -1
  121. package/es/src/components/table/components/TableColumnRenderer.vue.d.ts.map +0 -1
  122. package/es/src/components/table/components/icons/ColumnHeightOutlined.vue.d.ts.map +0 -1
  123. package/es/src/components/table/components/icons/DownOutlined.vue.d.ts.map +0 -1
  124. package/es/src/components/table/components/icons/FilterOutlined.vue.d.ts.map +0 -1
  125. package/es/src/components/table/components/index.d.ts.map +0 -1
  126. package/es/src/components/table/index.d.ts.map +0 -1
  127. package/es/src/components/table/types/index.d.ts.map +0 -1
  128. package/es/src/components/table/useTable.d.ts.map +0 -1
  129. package/es/src/index.d.ts.map +0 -1
  130. package/es/src/locale/en-US.d.ts.map +0 -1
  131. package/es/src/locale/index.d.ts.map +0 -1
  132. package/es/src/locale/zh-CN.d.ts.map +0 -1
  133. package/es/src/locale/zh-TW.d.ts.map +0 -1
  134. package/es/src/shared/core/index.d.ts +0 -6
  135. package/es/src/shared/core/index.d.ts.map +0 -1
  136. package/es/src/shared/ui/index.d.ts.map +0 -1
  137. /package/es/{src/components → components}/component-provider/components/index.vue.d.ts +0 -0
  138. /package/es/{src/components → components}/component-provider/index.d.ts +0 -0
  139. /package/es/{src/components → components}/component-provider/types/index.d.ts +0 -0
  140. /package/es/{src/components → components}/form/components/BaseField/index.vue.d.ts +0 -0
  141. /package/es/{src/components → components}/form/components/BaseFormItem/index.vue.d.ts +0 -0
  142. /package/es/{src/components → components}/form/components/ContainerFragment/index.vue.d.ts +0 -0
  143. /package/es/{src/components → components}/form/components/ProForm/index.vue.d.ts +0 -0
  144. /package/es/{src/components → components}/form/components/SlotComponent/index.vue.d.ts +0 -0
  145. /package/es/{src/components → components}/form/components/index.d.ts +0 -0
  146. /package/es/{src/components → components}/form/constants/index.d.ts +0 -0
  147. /package/es/{src/components → components}/form/hooks/index.d.ts +0 -0
  148. /package/es/{src/components → components}/form/hooks/useFields.d.ts +0 -0
  149. /package/es/{src/components → components}/form/hooks/useForm.d.ts +0 -0
  150. /package/es/{src/components → components}/form/hooks/useFormRef.d.ts +0 -0
  151. /package/es/{src/components → components}/form/hooks/useGroupFieldAttrs.d.ts +0 -0
  152. /package/es/{src/components → components}/form/index.d.ts +0 -0
  153. /package/es/{src/components → components}/form/types/index.d.ts +0 -0
  154. /package/es/{src/components → components}/table/components/ColumnControl.vue.d.ts +0 -0
  155. /package/es/{src/components → components}/table/components/DefaultSearchFormContainer.vue.d.ts +0 -0
  156. /package/es/{src/components → components}/table/components/DefaultTableContainer.vue.d.ts +0 -0
  157. /package/es/{src/components → components}/table/components/SearchForm.vue.d.ts +0 -0
  158. /package/es/{src/components → components}/table/components/SizeControl.vue.d.ts +0 -0
  159. /package/es/{src/components → components}/table/components/TableColumnRenderer.vue.d.ts +0 -0
  160. /package/es/{src/components → components}/table/components/icons/ColumnHeightOutlined.vue.d.ts +0 -0
  161. /package/es/{src/components → components}/table/components/icons/DownOutlined.vue.d.ts +0 -0
  162. /package/es/{src/components → components}/table/components/icons/FilterOutlined.vue.d.ts +0 -0
  163. /package/es/{src/components → components}/table/components/index.d.ts +0 -0
  164. /package/es/{src/components → components}/table/index.d.ts +0 -0
  165. /package/es/{src/components → components}/table/useTable.d.ts +0 -0
  166. /package/es/{src/index.d.ts → index.d.ts} +0 -0
  167. /package/es/{src/locale → locale}/en-US.d.ts +0 -0
  168. /package/es/{src/locale → locale}/zh-CN.d.ts +0 -0
  169. /package/es/{src/locale → locale}/zh-TW.d.ts +0 -0
  170. /package/es/{src/shared → shared}/ui/index.d.ts +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"en-US.d.ts","sourceRoot":"","sources":["../../src/locale/en-US.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAQA,wBAYW"}
@@ -1,5 +1,5 @@
1
1
  import { InjectionKey, MaybeRef } from 'vue';
2
- import { ProLocaleName } from '@qin-ui/pro-components-core';
2
+ import { ProLocaleName } from '../shared/core';
3
3
  import { default as zhCN } from './zh-CN';
4
4
  import { default as zhTW } from './zh-TW';
5
5
  import { default as enUS } from './en-US';
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/locale/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,QAAQ,EACd,MAAM,KAAK,CAAC;AAEb,OAAO,EAA6B,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/E,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,MAAM,SAAS,CAAC;AAE3B,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAE5B,MAAM,MAAM,SAAS,GAAG,OAAO,IAAI,CAAC;AAEpC,4CAA4C;AAC5C,eAAO,MAAM,iBAAiB,EAAE,YAAY,CAC1C,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC,CAClB,CAAC;AAEzB;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,SAAS;aAaJ,MAAM,WAAW,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KAAG,MAAM;;CAQ1E,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zh-CN.d.ts","sourceRoot":"","sources":["../../src/locale/zh-CN.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAQA,wBAYW"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zh-TW.d.ts","sourceRoot":"","sources":["../../src/locale/zh-TW.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAQA,wBAYW"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 统一 re-export @qin-ui/pro-components-core,包内所有文件通过此文件引入 core 内容,
3
+ * 避免直接散列依赖 @qin-ui/pro-components-core,便于将来统一维护。
4
+ */
5
+ export { useForm, createFormProxy, useTable, useSearchFormExpand, useFields, useFormData, useFormRef, InjectionFormKey, InjectionFormSlotsKey, getObject, get, set, normalizePathKey, toPath, camelizeProperties, cloneDeep, pick, isPlainObject, isPromise, zhCN, zhTW, enUS, format, resolveLocaleName, type ProLocale, type ProLocaleName, type ProLocaleKey, 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,eAAe,EACf,QAAQ,EACR,mBAAmB,EACnB,SAAS,EACT,WAAW,EACX,UAAU,EAEV,gBAAgB,EAChB,qBAAqB,EAErB,SAAS,EACT,GAAG,EACH,GAAG,EACH,gBAAgB,EAChB,MAAM,EACN,kBAAkB,EAClB,SAAS,EACT,IAAI,EACJ,aAAa,EACb,SAAS,EAET,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,iBAAiB,EACjB,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,YAAY,EAEjB,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 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shared/ui/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,IAAI,IAAI,EACd,UAAU,IAAI,QAAQ,EACtB,KAAK,IAAI,IAAI,EACb,KAAK,IAAI,QAAQ,EACjB,OAAO,IAAI,KAAK,EAChB,aAAa,IAAI,WAAW,EAC5B,OAAO,IAAI,KAAK,EAChB,UAAU,IAAI,QAAQ,EACtB,cAAc,IAAI,YAAY,EAC9B,cAAc,IAAI,YAAY,EAC9B,UAAU,IAAI,QAAQ,EACtB,eAAe,IAAI,aAAa,EAChC,QAAQ,IAAI,MAAM,EAClB,cAAc,IAAI,YAAY,EAC9B,UAAU,IAAI,QAAQ,EACtB,YAAY,IAAI,UAAU,EAC1B,OAAO,IAAI,KAAK,EAChB,aAAa,IAAI,WAAW,EAC5B,QAAQ,IAAI,MAAM,EAClB,QAAQ,IAAI,MAAM,EAClB,QAAQ,IAAI,MAAM,EAClB,UAAU,IAAI,QAAQ,EACtB,YAAY,IAAI,UAAU,EAC1B,YAAY,IAAI,UAAU,EAC1B,YAAY,IAAI,UAAU,EAC1B,YAAY,IAAI,UAAU,EAC1B,YAAY,IAAI,UAAU,EAE1B,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,UAAU,IAAI,WAAW,EAC9B,KAAK,cAAc,IAAI,UAAU,EACjC,KAAK,eAAe,EACpB,KAAK,QAAQ,IAAI,SAAS,EAC1B,KAAK,QAAQ,IAAI,aAAa,EAC/B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,KAAK,gBAAgB,EAAsC,MAAM,KAAK,CAAC;AAEhF,OAAO,EACL,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,WAAW,EACX,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,MAAM,EACN,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,KAAK,EACL,WAAW,EACX,MAAM,EACN,MAAM,EACN,MAAM,EACN,QAAQ,EACR,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,UAAU,GAChB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;AAO1C,eAAO,MAAM,UAAU,WAAoB,CAAC;AAC5C,eAAO,MAAM,eAAe,WAAyB,CAAC;AACtD,eAAO,MAAM,aAAa,WAAuB,CAAC;AAClD,eAAO,MAAM,aAAa,WAAuB,CAAC;AAIlD,eAAO,MAAM,kBAAkB,0CAS9B,CAAC;AAEF,eAAO,MAAM,0BAA0B,GACrC,UAAU,gBAAgB,CAAC,OAAO,GAAG,SAAS,CAAC,SAMhD,CAAC;AAEF,eAAO,MAAM,iBAAiB,0CAAqB,CAAC;AACpD,eAAO,MAAM,mBAAmB,aATpB,gBAAgB,CAAC,OAAO,GAAG,SAAS,CAAC,SASY,CAAC;AAE9D,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qin-ui/element-plus-pro",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "description": "基于 element-plus 的二次封装组件",
5
5
  "bin": {
6
6
  "element-plus-pro": "./bin/init-ai.mjs"
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "vue-component-type-helpers": "^3.2.5",
42
- "@qin-ui/pro-components-core": "^2.0.0"
42
+ "@qin-ui/pro-components-core": "^2.0.1"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@vue/test-utils": "^2.4.11",
@@ -93,9 +93,10 @@ if (props.componentVars) {
93
93
  }
94
94
 
95
95
  // 注入自定义组件映射,BaseField 在解析组件时会优先使用此映射
96
- if (props.componentMap) {
97
- provide(INJECT_COMPONENTS, props.componentMap);
98
- }
96
+ provide(
97
+ INJECT_COMPONENTS,
98
+ computed(() => props.componentMap)
99
+ );
99
100
 
100
101
  // 注入内置文案覆盖,useLocale 在解析文案时会优先使用
101
102
  provide(
@@ -1,5 +1,5 @@
1
1
  import { RequiredComponentVars } from '../types';
2
- import { InjectionKey, Component } from 'vue';
2
+ import { InjectionKey, Component, type ComputedRef } from 'vue';
3
3
 
4
4
  export type InjectConfigEntry<T = any> = {
5
5
  injectionKey: InjectionKey<T>;
@@ -61,7 +61,7 @@ export const INJECT_CONFIG: {
61
61
  injectionKey: Symbol(''),
62
62
  default: {
63
63
  max: 10 ** 15 - 1,
64
- min: -(10 ** 15 + 1),
64
+ min: -(10 ** 15 - 1),
65
65
  controls: false,
66
66
  style: { width: '100%' },
67
67
  },
@@ -165,7 +165,8 @@ export const INJECT_CONFIG: {
165
165
  };
166
166
 
167
167
  export const INJECT_COMPONENTS: InjectionKey<
168
- Partial<Record<string, Component>>
168
+ | ComputedRef<Partial<Record<string, Component>> | undefined>
169
+ | Partial<Record<string, Component>>
169
170
  > = Symbol('INJECT_COMPONENTS');
170
171
 
171
172
  const DYNAMIC_INJECT_CONFIG: Record<string, InjectConfigEntry> =
@@ -46,7 +46,7 @@ import {
46
46
  getInjectConfig,
47
47
  } from '../../../component-provider/constants';
48
48
  import { useForm } from '../../hooks/useForm';
49
- import { getInitProps } from './utils';
49
+ import { getInitProps, warnUnknownComponent } from './utils';
50
50
  import { useLocale } from '../../../../locale';
51
51
 
52
52
  defineOptions({ name: 'BaseField', inheritAttrs: false });
@@ -142,7 +142,6 @@ const groupedAttrs = computed(() => {
142
142
  initProps,
143
143
  attrs,
144
144
  { class: attrs.componentClass, style: attrs.componentStyle },
145
- { class: initProps.componentClass, style: initProps.componentStyle },
146
145
  { disabled: effectiveDisabled },
147
146
  { modelProp: modelPropName }
148
147
  ) as Required<Field>;
@@ -177,12 +176,10 @@ const is = computed(() => {
177
176
  if (teleportSlot) return teleportSlot;
178
177
  if (typeof props.component === 'string') {
179
178
  const resolved =
180
- (customComponents as any)[props.component] ||
179
+ toValue(customComponents as any)?.[props.component] ||
181
180
  (componentMap as any)[props.component];
182
181
  if (resolved) return resolved;
183
- console.warn(
184
- `[pro-components] 未识别的组件类型 "${props.component}",已降级为原生元素渲染。如为自定义组件请在 componentMap 或 ProComponentProvider 中注册。`
185
- );
182
+ warnUnknownComponent(props.component);
186
183
  return props.component;
187
184
  }
188
185
  return props.component;
@@ -71,3 +71,14 @@ export const getInitProps = (
71
71
  }
72
72
  return {};
73
73
  };
74
+
75
+ /** 已告警过的未知组件名(模块级去重,避免 computed 重算导致刷屏) */
76
+ const warnedUnknownComponents = new Set<string>();
77
+
78
+ export function warnUnknownComponent(name: string) {
79
+ if (warnedUnknownComponents.has(name)) return;
80
+ warnedUnknownComponents.add(name);
81
+ console.warn(
82
+ `[pro-components] 未识别的组件类型 "${name}",已降级为原生元素渲染。如为自定义组件请在 componentMap 或 ProComponentProvider 中注册。`
83
+ );
84
+ }
@@ -47,7 +47,8 @@ const props = withDefaults(defineProps<Props>(), {
47
47
  });
48
48
 
49
49
  const validFields = computed(() =>
50
- (props.fields ?? []).filter(field => !field.hidden)
50
+ // hidden 支持 Ref/ComputedRef/getter 等响应式形态(统一使用 toValue 取值)
51
+ (props.fields ?? []).filter(field => !toValue(field.hidden))
51
52
  );
52
53
 
53
54
  const config = INJECT_CONFIG['pro-form'];
@@ -41,7 +41,11 @@ import { INJECT_CONFIG } from '../../../component-provider/constants';
41
41
  import { BaseFormItem } from '..';
42
42
  import { InjectionFormKey, InjectionFormSlotsKey } from '../../constants';
43
43
  import type { Grid, VModelProps, PathProps } from '../../types';
44
- import { Path, camelizeProperties } from '../../../../shared/core';
44
+ import {
45
+ Path,
46
+ camelizeProperties,
47
+ createFormProxy,
48
+ } from '../../../../shared/core';
45
49
  import { useForm, type Form } from '../../hooks/useForm';
46
50
 
47
51
  defineOptions({ name: 'ProForm', inheritAttrs: false });
@@ -69,27 +73,9 @@ const currentForm = computed(
69
73
 
70
74
  /**
71
75
  * 表单实例代理:操作全部转发至 currentForm 当前实例;
72
- * 下游持有本代理即可,:form 运行期替换无需重绑。
76
+ * 下游持有本代理即可,:form 运行期替换无需重绑;方法具有引用记忆化。
73
77
  */
74
- const formProxy = new Proxy({} as F, {
75
- get(_, prop) {
76
- const target = currentForm.value as any;
77
- const val = target?.[prop];
78
- if (typeof val === 'function') {
79
- return (...args: any[]) => (currentForm.value as any)?.[prop]?.(...args);
80
- }
81
- return val;
82
- },
83
- set(_, prop, value) {
84
- if (currentForm.value) {
85
- (currentForm.value as any)[prop] = value;
86
- }
87
- return true;
88
- },
89
- has(_, prop) {
90
- return Boolean(currentForm.value && prop in currentForm.value);
91
- },
92
- });
78
+ const formProxy = createFormProxy(() => currentForm.value);
93
79
 
94
80
  provide(InjectionFormKey, formProxy);
95
81
 
@@ -124,6 +110,10 @@ const injectAttrs = computed(() => {
124
110
  return rest;
125
111
  });
126
112
 
113
+ const formAttrs = computed(() => {
114
+ return mergeProps(injectAttrs.value, camelizeProperties(attrs));
115
+ });
116
+
127
117
  type ExtractPath<T> = T extends Form<infer D> ? Path<D> : string;
128
118
  type FieldSlotProps = VModelProps &
129
119
  PathProps & { disabled?: boolean; [x: string]: any };
@@ -143,7 +133,7 @@ provide(InjectionFormSlotsKey, slots);
143
133
  :key="formKey"
144
134
  :ref="setFormRef"
145
135
  :model="formData"
146
- v-bind="mergeProps(injectAttrs, camelizeProperties(attrs))"
136
+ v-bind="formAttrs"
147
137
  class="pro-form"
148
138
  @submit.prevent
149
139
  >
@@ -5,7 +5,6 @@
5
5
  *
6
6
  * @public
7
7
  */
8
- import { isVNode } from 'vue';
9
8
  import { SlotComponentType } from '../../types';
10
9
 
11
10
  defineOptions({ name: 'SlotComponent', inheritAttrs: false });
@@ -14,13 +13,17 @@ type Props = {
14
13
  component?: SlotComponentType;
15
14
  };
16
15
  defineProps<Props>();
16
+
17
+ // 可组件化渲染判定:VNode / 函数(含函数式组件)/ 组件定义对象;
18
+ // 其余(string/number/boolean/null/undefined)一律按文本渲染,
19
+ // 避免字符串返回值被 <component :is> 当作标签名解析
20
+ const isRenderable = (c: Props['component']) =>
21
+ c !== null &&
22
+ c !== undefined &&
23
+ (typeof c === 'function' || typeof c === 'object');
17
24
  </script>
18
25
 
19
26
  <template>
20
- <component
21
- :is="component"
22
- v-if="isVNode(component) || typeof component === 'function'"
23
- v-bind="$attrs"
24
- />
27
+ <component :is="component" v-if="isRenderable(component)" v-bind="$attrs" />
25
28
  <template v-else>{{ component }}</template>
26
29
  </template>
@@ -14,6 +14,9 @@ const formItemPropKeys = Object.keys(formItemProps()).filter(
14
14
  k => k !== 'disabled'
15
15
  );
16
16
  const gridItemPropKeys = Object.keys(gridItemProps());
17
+ // 模块级 Set:字段循环内 O(1) 命中,替代数组 includes 线性扫描
18
+ const gridItemPropKeySet = new Set<string>(gridItemPropKeys);
19
+ const formItemPropKeySet = new Set<string>(formItemPropKeys);
17
20
 
18
21
  export interface GroupedField {
19
22
  path: string;
@@ -75,9 +78,9 @@ export function useGroupFieldAttrs(validFields: ComputedRef<Field[]>) {
75
78
  const container = formItemContainer ?? injectFormItemContainer;
76
79
 
77
80
  Object.keys(rest).forEach(k => {
78
- if (gridItemPropKeys.includes(k)) {
81
+ if (gridItemPropKeySet.has(k)) {
79
82
  gridItemProps[k] = rest[k];
80
- } else if (formItemPropKeys.includes(k)) {
83
+ } else if (formItemPropKeySet.has(k)) {
81
84
  (formItemProps as any)[k] = rest[k];
82
85
  } else {
83
86
  componentProps[k] = rest[k];
@@ -6,7 +6,7 @@ import {
6
6
  DropdownItem,
7
7
  Checkbox,
8
8
  } from '../../../shared/ui';
9
- import { computed, onMounted, ref, watch } from 'vue';
9
+ import { computed, ref, watch } from 'vue';
10
10
  import type { Column, Columns, ColumnControlConfig } from '../types';
11
11
  import { type Table } from '../useTable';
12
12
  import FilterOutlined from './icons/FilterOutlined.vue';
@@ -46,18 +46,26 @@ const checkedColumnsOptions = computed<
46
46
  props.columns
47
47
  .map((item, index) => {
48
48
  const key = getColumnKey(item, index);
49
- const excluded = props.columnControl?.excludedKeys?.some(
50
- ek => String(ek) === key
51
- );
49
+ // 默认排除内部序号列 __INDEX__ 及显式指定的 excludedKeys
50
+ const excluded =
51
+ key === '__INDEX__' ||
52
+ (item as any).type === 'index' ||
53
+ props.columnControl?.excludedKeys?.some(ek => String(ek) === key);
52
54
  const disabled = props.columnControl?.disabledKeys?.some(
53
55
  dk => String(dk) === key
54
56
  );
55
- const label = String(
56
- item.label ??
57
- (item as any).title ??
58
- item.prop ??
59
- t('table.columnFallback', { index: index + 1 })
60
- );
57
+ const rawTitle = item.label ?? (item as any).title;
58
+ const titleLabel = typeof rawTitle === 'string' ? rawTitle : undefined;
59
+ const propLabel =
60
+ item.prop !== undefined && item.prop !== null
61
+ ? String(item.prop)
62
+ : undefined;
63
+ const label =
64
+ (props.columnControl?.labels?.[key] as string) ??
65
+ titleLabel ??
66
+ propLabel ??
67
+ key ??
68
+ t('table.columnFallback', { index: index + 1 });
61
69
  return {
62
70
  label,
63
71
  value: key,
@@ -96,7 +104,6 @@ const onCheckAllChange = (value: any) => {
96
104
  checkedColumnKeys.value = checked
97
105
  ? controllableOptions.value.map(item => item.value)
98
106
  : [];
99
- indeterminate.value = false;
100
107
  };
101
108
 
102
109
  const toggleColumnsItem = (val: string) => {
@@ -127,13 +134,7 @@ watch(
127
134
  { immediate: true }
128
135
  );
129
136
 
130
- // 强制 disabledKeys 列始终展示
131
- onMounted(() => {
132
- props.columnControl?.disabledKeys?.forEach(key => {
133
- props.table?.setColumn(String(key), { hidden: false });
134
- });
135
- });
136
-
137
+ // disabledKeys 指定的列始终强制展示
137
138
  watch(
138
139
  () => props.columnControl?.disabledKeys,
139
140
  keys => {
@@ -141,7 +142,7 @@ watch(
141
142
  props.table?.setColumn(String(key), { hidden: false });
142
143
  });
143
144
  },
144
- { deep: true }
145
+ { immediate: true, deep: true }
145
146
  );
146
147
  </script>
147
148
 
@@ -83,6 +83,9 @@ defineOptions({
83
83
  inheritAttrs: false,
84
84
  });
85
85
 
86
+ const tableProperties = Object.keys(tableProps());
87
+ const paginationProperties = Object.keys(paginationProps());
88
+
86
89
  type Control = {
87
90
  sizeControl: boolean;
88
91
  columnControl: boolean | ColumnControlConfig<Path<RecordType>>;
@@ -137,9 +140,6 @@ const config = INJECT_CONFIG['pro-table'];
137
140
  const injectPropsRaw = inject(config.injectionKey, config.default);
138
141
  const injectProps = computed(() => toValue(injectPropsRaw) || {});
139
142
 
140
- const tableProperties = Object.keys(tableProps());
141
- const paginationProperties = Object.keys(paginationProps());
142
-
143
143
  const attrs = useAttrs() as Record<string, any>;
144
144
 
145
145
  const injectTableAttrs = computed(() => {
@@ -156,14 +156,17 @@ const attrsTableProps = computed(() => {
156
156
  const size = defineModel<TableProps['size']>('size');
157
157
  const loading = defineModel<boolean>('loading', { default: false });
158
158
 
159
- // 核心搜索方法:设置 loading 状态,调用外部 search 函数
159
+ // 递增序号做请求竞态守卫,仅最新一次请求可变更 loading
160
+ let searchSequence = 0;
160
161
  const _search = async () => {
162
+ const seq = ++searchSequence;
161
163
  const searchPromise = (props.search || attrs.onSearch)?.();
162
- if (isPromise(searchPromise)) {
163
- loading.value = true;
164
- try {
165
- await searchPromise;
166
- } finally {
164
+ if (!isPromise(searchPromise)) return;
165
+ loading.value = true;
166
+ try {
167
+ await searchPromise;
168
+ } finally {
169
+ if (seq === searchSequence) {
167
170
  loading.value = false;
168
171
  }
169
172
  }
@@ -177,29 +180,21 @@ const reset = () => {
177
180
  });
178
181
  };
179
182
 
183
+ const customSlotNames = [
184
+ 'search-form',
185
+ 'button-bar',
186
+ 'toolbar',
187
+ 'table',
188
+ ] as const;
189
+
180
190
  type CustomSlots = Readonly<
181
- Partial<Record<'search-form' | 'button-bar' | 'toolbar' | 'table', Slot>>
191
+ Partial<Record<(typeof customSlotNames)[number], Slot>>
182
192
  >;
183
-
184
193
  type Slots = CustomSlots & Readonly<Record<string, Slot>>;
185
194
 
186
195
  const slots = useSlots() as Slots;
187
- const searchFormSlot = slots['search-form'];
188
- const buttonBarSlot = slots['button-bar'];
189
- const toolbarSlot = slots['toolbar'];
190
-
191
- const tableSlots = computed(() => {
192
- const customNames = new Set([
193
- 'search-form',
194
- 'button-bar',
195
- 'toolbar',
196
- 'table',
197
- ]);
198
- return Object.fromEntries(
199
- Object.entries(slots).filter(([name]) => !customNames.has(name))
200
- ) as Record<string, Slot>;
201
- });
202
- const tableSlotNames = computed(() => Object.keys(tableSlots.value));
196
+ const forwardedSlotNames = () =>
197
+ Object.keys(slots).filter(name => !customSlotNames.includes(name as any));
203
198
 
204
199
  const searchPage1st = () => {
205
200
  props.table?.setPageParam?.({ current: 1 });
@@ -242,7 +237,7 @@ const normalizedRawColumns = computed(() => {
242
237
  if (props.addIndexColumn ?? injectProps.value.addIndexColumn) {
243
238
  return [
244
239
  {
245
- key: '_index',
240
+ key: '__INDEX__',
246
241
  type: 'index',
247
242
  label: t('table.index'),
248
243
  width: 80,
@@ -328,15 +323,14 @@ const onPaginationChange = (currentPage: number, pageSize: number) => {
328
323
  attrs.onChange?.(currentPage, pageSize);
329
324
  };
330
325
 
331
- const showSearch = computed(() => {
326
+ const searchFormVisible = computed(() => {
332
327
  const searchFields = props.table?.searchForm?.fields;
333
328
  const fieldList =
334
329
  (Array.isArray(searchFields) ? searchFields : searchFields?.value) ?? [];
335
330
  return !!(
336
- searchFormSlot ||
337
- ((computedSearchFormConfig.value as any)?.hidden !== true &&
338
- props.table?.searchForm &&
339
- fieldList.filter((item: any) => !item.hidden)?.length > 0)
331
+ (computedSearchFormConfig.value as any)?.hidden !== true &&
332
+ props.table?.searchForm &&
333
+ fieldList.filter((item: any) => !toValue(item.hidden))?.length > 0
340
334
  );
341
335
  });
342
336
 
@@ -372,12 +366,17 @@ onMounted(() => {
372
366
  _search();
373
367
  }
374
368
  });
369
+
370
+ defineExpose({
371
+ /** 手动触发一次查询(与内部搜索共用 loading 竞态守卫),便于外部刷新列表 */
372
+ search: _search,
373
+ });
375
374
  </script>
376
375
 
377
376
  <template>
378
377
  <div class="pro-table" :class="attrs.class" :style="attrs.style">
379
378
  <ContainerFragment
380
- v-if="showSearch"
379
+ v-if="searchFormVisible || $slots['search-form']"
381
380
  :component="computedSearchFormConfig.container"
382
381
  >
383
382
  <slot name="search-form">
@@ -393,10 +392,10 @@ onMounted(() => {
393
392
 
394
393
  <ContainerFragment :component="computedTableContainer">
395
394
  <div class="pro-table_header">
396
- <div v-if="buttonBarSlot" class="pro-table_header_button-bar">
395
+ <div v-if="$slots['button-bar']" class="pro-table_header_button-bar">
397
396
  <slot name="button-bar" />
398
397
  </div>
399
- <div v-if="toolbarSlot" class="pro-table_header_toolbar">
398
+ <div v-if="$slots['toolbar']" class="pro-table_header_toolbar">
400
399
  <slot name="toolbar" />
401
400
  </div>
402
401
  <div
@@ -411,7 +410,7 @@ onMounted(() => {
411
410
  >
412
411
  <ColumnControl
413
412
  :columns="
414
- normalizedRawColumns.filter(item => item.key !== '_index')
413
+ normalizedRawColumns.filter(item => item.key !== '__INDEX__')
415
414
  "
416
415
  :table="props.table"
417
416
  :column-control="columnControlConfig"
@@ -428,7 +427,11 @@ onMounted(() => {
428
427
  :data="computedDataSource"
429
428
  >
430
429
  <TableColumnRenderer :columns="normalizedRawColumns" />
431
- <template v-for="name in tableSlotNames" :key="name" #[name]="scoped">
430
+ <template
431
+ v-for="name in forwardedSlotNames()"
432
+ :key="name"
433
+ #[name]="scoped"
434
+ >
432
435
  <slot :name="name" v-bind="scoped" />
433
436
  </template>
434
437
  </ElTable>