gy-ui-plus 1.0.16 → 1.0.20

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 (238) hide show
  1. package/.editorconfig +8 -0
  2. package/.gitattributes +1 -0
  3. package/.prettierignore +21 -0
  4. package/.prettierrc.json +11 -0
  5. package/.vscode/extensions.json +9 -0
  6. package/MONOREPO.md +103 -0
  7. package/README.md +241 -0
  8. package/deploy.yml +30 -0
  9. package/docs/.vitepress/cache/deps/@element-plus_icons-vue.js +5472 -0
  10. package/docs/.vitepress/cache/deps/@element-plus_icons-vue.js.map +7 -0
  11. package/docs/.vitepress/cache/deps/@highlightjs_vue-plugin_dist_highlightjs-vue__esm__min__js.js +53 -0
  12. package/docs/.vitepress/cache/deps/@highlightjs_vue-plugin_dist_highlightjs-vue__esm__min__js.js.map +7 -0
  13. package/docs/.vitepress/cache/deps/_metadata.json +82 -0
  14. package/docs/.vitepress/cache/deps/chunk-G3PMV62Z.js +36 -0
  15. package/docs/.vitepress/cache/deps/chunk-G3PMV62Z.js.map +7 -0
  16. package/docs/.vitepress/cache/deps/chunk-LFZJEN3U.js +1546 -0
  17. package/docs/.vitepress/cache/deps/chunk-LFZJEN3U.js.map +7 -0
  18. package/docs/.vitepress/cache/deps/chunk-SW5CTN4G.js +9172 -0
  19. package/docs/.vitepress/cache/deps/chunk-SW5CTN4G.js.map +7 -0
  20. package/docs/.vitepress/cache/deps/chunk-W5AQ4OLI.js +12824 -0
  21. package/docs/.vitepress/cache/deps/chunk-W5AQ4OLI.js.map +7 -0
  22. package/docs/.vitepress/cache/deps/echarts.js +75413 -0
  23. package/docs/.vitepress/cache/deps/echarts.js.map +7 -0
  24. package/docs/.vitepress/cache/deps/element-plus.js +77975 -0
  25. package/docs/.vitepress/cache/deps/element-plus.js.map +7 -0
  26. package/docs/.vitepress/cache/deps/element-plus_es_locale_lang_zh-cn.js +201 -0
  27. package/docs/.vitepress/cache/deps/element-plus_es_locale_lang_zh-cn.js.map +7 -0
  28. package/docs/.vitepress/cache/deps/highlight__js_lib_common.js +12558 -0
  29. package/docs/.vitepress/cache/deps/highlight__js_lib_common.js.map +7 -0
  30. package/docs/.vitepress/cache/deps/package.json +3 -0
  31. package/docs/.vitepress/cache/deps/sortablejs.js +2781 -0
  32. package/docs/.vitepress/cache/deps/sortablejs.js.map +7 -0
  33. package/docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js +4507 -0
  34. package/docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js.map +7 -0
  35. package/docs/.vitepress/cache/deps/vitepress___@vueuse_core.js +568 -0
  36. package/docs/.vitepress/cache/deps/vitepress___@vueuse_core.js.map +7 -0
  37. package/docs/.vitepress/cache/deps/vue.js +348 -0
  38. package/docs/.vitepress/cache/deps/vue.js.map +7 -0
  39. package/docs/.vitepress/cache/deps_temp_17f22fad/chunk-W5AQ4OLI.js +12824 -0
  40. package/docs/.vitepress/cache/deps_temp_17f22fad/chunk-W5AQ4OLI.js.map +7 -0
  41. package/docs/.vitepress/cache/deps_temp_17f22fad/package.json +3 -0
  42. package/docs/.vitepress/cache/deps_temp_17f22fad/vitepress___@vue_devtools-api.js +4505 -0
  43. package/docs/.vitepress/cache/deps_temp_17f22fad/vitepress___@vue_devtools-api.js.map +7 -0
  44. package/docs/.vitepress/cache/deps_temp_17f22fad/vitepress___@vueuse_core.js +9184 -0
  45. package/docs/.vitepress/cache/deps_temp_17f22fad/vitepress___@vueuse_core.js.map +7 -0
  46. package/docs/.vitepress/cache/deps_temp_17f22fad/vue.js +347 -0
  47. package/docs/.vitepress/cache/deps_temp_17f22fad/vue.js.map +7 -0
  48. package/docs/.vitepress/cache/deps_temp_35eb88f5/chunk-W5AQ4OLI.js +12824 -0
  49. package/docs/.vitepress/cache/deps_temp_35eb88f5/chunk-W5AQ4OLI.js.map +7 -0
  50. package/docs/.vitepress/cache/deps_temp_35eb88f5/package.json +3 -0
  51. package/docs/.vitepress/cache/deps_temp_35eb88f5/vitepress___@vue_devtools-api.js +4505 -0
  52. package/docs/.vitepress/cache/deps_temp_35eb88f5/vitepress___@vue_devtools-api.js.map +7 -0
  53. package/docs/.vitepress/cache/deps_temp_35eb88f5/vitepress___@vueuse_core.js +9184 -0
  54. package/docs/.vitepress/cache/deps_temp_35eb88f5/vitepress___@vueuse_core.js.map +7 -0
  55. package/docs/.vitepress/cache/deps_temp_35eb88f5/vue.js +347 -0
  56. package/docs/.vitepress/cache/deps_temp_35eb88f5/vue.js.map +7 -0
  57. package/docs/.vitepress/components/TIcon.vue +13 -0
  58. package/docs/.vitepress/components/TTip.vue +35 -0
  59. package/docs/.vitepress/components/TVHtml.vue +12 -0
  60. package/docs/.vitepress/config.ts +45 -0
  61. package/docs/.vitepress/plugins/mdPlugin.ts +46 -0
  62. package/docs/.vitepress/theme/components/docs-code-demo.vue +212 -0
  63. package/docs/.vitepress/theme/components/layout.vue +73 -0
  64. package/docs/.vitepress/theme/directives/index.ts +43 -0
  65. package/docs/.vitepress/theme/index.ts +49 -0
  66. package/docs/.vitepress/theme/styles/code.scss +59 -0
  67. package/docs/.vitepress/theme/styles/index.scss +150 -0
  68. package/docs/.vitepress/utils/getComponent.ts +4 -0
  69. package/docs/.vitepress/utils/highlight.ts +16 -0
  70. package/docs/.vitepress/utils/index.ts +13 -0
  71. package/docs/.vitepress/utils/utils.ts +940 -0
  72. package/docs/components/gy-button.md +38 -0
  73. package/docs/components/gy-table.md +539 -0
  74. package/docs/examples/GyButton/base.vue +39 -0
  75. package/docs/examples/GyButton/isDebounce.vue +46 -0
  76. package/docs/examples/GyButton/tip.vue +27 -0
  77. package/docs/examples/GyTable/align.vue +142 -0
  78. package/docs/examples/GyTable/base.vue +60 -0
  79. package/docs/examples/GyTable/border.vue +60 -0
  80. package/docs/examples/GyTable/borderCom.vue +61 -0
  81. package/docs/examples/GyTable/columnSetting.vue +82 -0
  82. package/docs/examples/GyTable/configEdit.vue +225 -0
  83. package/docs/examples/GyTable/configEditUse.vue +341 -0
  84. package/docs/examples/GyTable/data.json +284 -0
  85. package/docs/examples/GyTable/data2.json +284 -0
  86. package/docs/examples/GyTable/dept.json +1015 -0
  87. package/docs/examples/GyTable/echoSelectTable.vue +224 -0
  88. package/docs/examples/GyTable/editSingle.vue +161 -0
  89. package/docs/examples/GyTable/emptySlot.vue +31 -0
  90. package/docs/examples/GyTable/emptyText.vue +25 -0
  91. package/docs/examples/GyTable/eventHandle.vue +227 -0
  92. package/docs/examples/GyTable/expand.vue +99 -0
  93. package/docs/examples/GyTable/filterMethod.vue +71 -0
  94. package/docs/examples/GyTable/filters.vue +84 -0
  95. package/docs/examples/GyTable/footerSlot.vue +251 -0
  96. package/docs/examples/GyTable/formatter.vue +66 -0
  97. package/docs/examples/GyTable/headerCellStyle.vue +65 -0
  98. package/docs/examples/GyTable/isCopy.vue +60 -0
  99. package/docs/examples/GyTable/isRadioDisabled.vue +69 -0
  100. package/docs/examples/GyTable/isRowSortIcon.vue +83 -0
  101. package/docs/examples/GyTable/isShowCol.vue +66 -0
  102. package/docs/examples/GyTable/isShowColMultileHead.vue +84 -0
  103. package/docs/examples/GyTable/isShowPagination.vue +100 -0
  104. package/docs/examples/GyTable/menu.json +31466 -0
  105. package/docs/examples/GyTable/menu1.json +2889 -0
  106. package/docs/examples/GyTable/menuMange.vue +490 -0
  107. package/docs/examples/GyTable/multileHead.vue +155 -0
  108. package/docs/examples/GyTable/multileHeadEdit.vue +313 -0
  109. package/docs/examples/GyTable/multileHeadRenderHeader.vue +208 -0
  110. package/docs/examples/GyTable/multileHeadSort.vue +99 -0
  111. package/docs/examples/GyTable/operator.vue +147 -0
  112. package/docs/examples/GyTable/operatorBtn.vue +154 -0
  113. package/docs/examples/GyTable/operatorMore.vue +135 -0
  114. package/docs/examples/GyTable/operatorRender.vue +153 -0
  115. package/docs/examples/GyTable/operatorSlotName.vue +117 -0
  116. package/docs/examples/GyTable/pageCheck.vue +114 -0
  117. package/docs/examples/GyTable/paginationSlot.vue +104 -0
  118. package/docs/examples/GyTable/radio.vue +77 -0
  119. package/docs/examples/GyTable/radioDefault.vue +77 -0
  120. package/docs/examples/GyTable/radioIndex.vue +73 -0
  121. package/docs/examples/GyTable/render.vue +120 -0
  122. package/docs/examples/GyTable/renderHeader.vue +106 -0
  123. package/docs/examples/GyTable/rowSort.vue +67 -0
  124. package/docs/examples/GyTable/rules.vue +241 -0
  125. package/docs/examples/GyTable/rulesCol.vue +237 -0
  126. package/docs/examples/GyTable/rulesSelectTable.vue +256 -0
  127. package/docs/examples/GyTable/rulesSelectTableRefs.vue +261 -0
  128. package/docs/examples/GyTable/selection.vue +99 -0
  129. package/docs/examples/GyTable/selectionDisabled.vue +90 -0
  130. package/docs/examples/GyTable/selectionIndex.vue +137 -0
  131. package/docs/examples/GyTable/serialNum.vue +60 -0
  132. package/docs/examples/GyTable/showSummary.vue +65 -0
  133. package/docs/examples/GyTable/singleEditKeyup.vue +213 -0
  134. package/docs/examples/GyTable/size.vue +67 -0
  135. package/docs/examples/GyTable/slotName.vue +100 -0
  136. package/docs/examples/GyTable/slotNameMerge.vue +171 -0
  137. package/docs/examples/GyTable/sort.vue +58 -0
  138. package/docs/examples/GyTable/sortCellChange.vue +63 -0
  139. package/docs/examples/GyTable/sortMethod.vue +69 -0
  140. package/docs/examples/GyTable/sortable.vue +111 -0
  141. package/docs/examples/GyTable/stripe.vue +61 -0
  142. package/docs/examples/GyTable/summaryMethod.vue +92 -0
  143. package/docs/examples/GyTable/tableLoading.vue +131 -0
  144. package/docs/examples/GyTable/treeMenuTable.vue +161 -0
  145. package/docs/examples/GyTable/treeTable.vue +118 -0
  146. package/docs/examples/GyTable/tselecttabledata.json +102 -0
  147. package/docs/examples/GyTable/useVirtual.vue +54 -0
  148. package/docs/index.md +40 -0
  149. package/docs/package-lock.json +5898 -0
  150. package/docs/package.json +52 -0
  151. package/eslint.config.ts +39 -0
  152. package/index.html +28 -0
  153. package/package.json +16 -40
  154. package/packages/button/index.ts +5 -0
  155. package/packages/button/package.json +19 -0
  156. package/packages/button/src/index.vue +41 -0
  157. package/packages/button/src/type.ts +11 -0
  158. package/packages/core/package.json +18 -0
  159. package/packages/core/withInstall.ts +21 -0
  160. package/packages/gy-ui-plus/package.json +78 -0
  161. package/packages/gy-ui-plus/tsconfig.json +16 -0
  162. package/packages/gy-ui-plus/vite.config.ts +71 -0
  163. package/packages/index.ts +37 -0
  164. package/packages/layout-page/index.ts +6 -0
  165. package/packages/layout-page/package.json +19 -0
  166. package/packages/layout-page/src/index.vue +75 -0
  167. package/packages/layout-page/style/index.ts +1 -0
  168. package/packages/layout-page/style/layout-page.scss +38 -0
  169. package/packages/table/index.ts +7 -0
  170. package/packages/table/package.json +19 -0
  171. package/packages/table/src/ColumnSet.vue +170 -0
  172. package/packages/table/src/GyTableColumn.vue +100 -0
  173. package/packages/table/src/index.vue +1088 -0
  174. package/packages/table/src/operator.vue +203 -0
  175. package/packages/table/src/renderCol.vue +20 -0
  176. package/packages/table/src/renderHeader.vue +18 -0
  177. package/packages/table/src/singleEdit.vue +352 -0
  178. package/packages/table/src/singleEditCell.vue +301 -0
  179. package/packages/table/src/tableProps.ts +167 -0
  180. package/packages/table/src/useExpose.ts +74 -0
  181. package/packages/table/src/useVirtualized.ts +70 -0
  182. package/packages/table/style/index.ts +1 -0
  183. package/packages/table/style/table.scss +346 -0
  184. package/pnpm-workspace.yaml +3 -0
  185. package/public/favicon.ico +0 -0
  186. package/tsconfig.app.json +23 -0
  187. package/tsconfig.json +11 -0
  188. package/tsconfig.node.json +19 -0
  189. package/typings/env.d.ts +24 -0
  190. package/typings/index.d.ts +159 -0
  191. package/dist/gy-ui-plus.es.js +0 -4660
  192. package/dist/gy-ui-plus.umd.js +0 -2
  193. package/dist/packages/button/index.d.ts +0 -109
  194. package/dist/packages/button/src/index.vue.d.ts +0 -52
  195. package/dist/packages/button/src/type.d.ts +0 -11
  196. package/dist/packages/core/withInstall.d.ts +0 -5
  197. package/dist/packages/gy-ui-plus/__VLS_types.d.ts +0 -124
  198. package/dist/packages/gy-ui-plus/dist/packages/button/index.d.ts +0 -109
  199. package/dist/packages/gy-ui-plus/dist/packages/button/src/index.vue.d.ts +0 -53
  200. package/dist/packages/gy-ui-plus/dist/packages/button/src/type.d.ts +0 -12
  201. package/dist/packages/gy-ui-plus/dist/packages/core/withInstall.d.ts +0 -6
  202. package/dist/packages/gy-ui-plus/dist/packages/gy-ui-plus/__VLS_types.d.ts +0 -124
  203. package/dist/packages/gy-ui-plus/dist/packages/gy-ui-plus/vite.config.d.ts +0 -2
  204. package/dist/packages/gy-ui-plus/dist/packages/index.d.ts +0 -10
  205. package/dist/packages/gy-ui-plus/dist/packages/layout-page/index.d.ts +0 -84
  206. package/dist/packages/gy-ui-plus/dist/packages/layout-page/src/index.vue.d.ts +0 -49
  207. package/dist/packages/gy-ui-plus/dist/packages/layout-page/style/index.d.ts +0 -1
  208. package/dist/packages/gy-ui-plus/dist/packages/table/index.d.ts +0 -616
  209. package/dist/packages/gy-ui-plus/dist/packages/table/src/ColumnSet.vue.d.ts +0 -52
  210. package/dist/packages/gy-ui-plus/dist/packages/table/src/GyTableColumn.vue.d.ts +0 -46
  211. package/dist/packages/gy-ui-plus/dist/packages/table/src/index.vue.d.ts +0 -344
  212. package/dist/packages/gy-ui-plus/dist/packages/table/src/operator.vue.d.ts +0 -41
  213. package/dist/packages/gy-ui-plus/dist/packages/table/src/renderCol.vue.d.ts +0 -20
  214. package/dist/packages/gy-ui-plus/dist/packages/table/src/renderHeader.vue.d.ts +0 -16
  215. package/dist/packages/gy-ui-plus/dist/packages/table/src/singleEdit.vue.d.ts +0 -96
  216. package/dist/packages/gy-ui-plus/dist/packages/table/src/singleEditCell.vue.d.ts +0 -97
  217. package/dist/packages/gy-ui-plus/dist/packages/table/src/tableProps.d.ts +0 -129
  218. package/dist/packages/gy-ui-plus/dist/packages/table/src/useExpose.d.ts +0 -16
  219. package/dist/packages/gy-ui-plus/dist/packages/table/src/useVirtualized.d.ts +0 -11
  220. package/dist/packages/gy-ui-plus/dist/packages/table/style/index.d.ts +0 -1
  221. package/dist/packages/gy-ui-plus/vite.config.d.ts +0 -2
  222. package/dist/packages/index.d.ts +0 -9
  223. package/dist/packages/layout-page/index.d.ts +0 -84
  224. package/dist/packages/layout-page/src/index.vue.d.ts +0 -49
  225. package/dist/packages/layout-page/style/index.d.ts +0 -1
  226. package/dist/packages/table/index.d.ts +0 -616
  227. package/dist/packages/table/src/ColumnSet.vue.d.ts +0 -52
  228. package/dist/packages/table/src/GyTableColumn.vue.d.ts +0 -46
  229. package/dist/packages/table/src/index.vue.d.ts +0 -344
  230. package/dist/packages/table/src/operator.vue.d.ts +0 -41
  231. package/dist/packages/table/src/renderCol.vue.d.ts +0 -20
  232. package/dist/packages/table/src/renderHeader.vue.d.ts +0 -16
  233. package/dist/packages/table/src/singleEdit.vue.d.ts +0 -96
  234. package/dist/packages/table/src/singleEditCell.vue.d.ts +0 -97
  235. package/dist/packages/table/src/tableProps.d.ts +0 -128
  236. package/dist/packages/table/src/useExpose.d.ts +0 -16
  237. package/dist/packages/table/src/useVirtualized.d.ts +0 -10
  238. package/dist/packages/table/style/index.d.ts +0 -1
package/.editorconfig ADDED
@@ -0,0 +1,8 @@
1
+ [*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,vue,css,scss,sass,less,styl}]
2
+ charset = utf-8
3
+ indent_size = 2
4
+ indent_style = space
5
+ insert_final_newline = true
6
+ trim_trailing_whitespace = true
7
+ end_of_line = lf
8
+ max_line_length = 100
package/.gitattributes ADDED
@@ -0,0 +1 @@
1
+ * text=auto eol=lf
@@ -0,0 +1,21 @@
1
+ # 依赖目录
2
+ node_modules
3
+ dist
4
+ dist-ssr
5
+ coverage
6
+
7
+ # 构建产物
8
+ *.min.js
9
+ *.min.css
10
+
11
+ # 日志文件
12
+ *.log
13
+
14
+ # 锁文件
15
+ package-lock.json
16
+ yarn.lock
17
+ pnpm-lock.yaml
18
+
19
+ # 配置文件(保持原样)
20
+ tsconfig*.json
21
+
@@ -0,0 +1,11 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/prettierrc",
3
+ "semi": false,
4
+ "singleQuote": true,
5
+ "printWidth": 100,
6
+ "tabWidth": 2,
7
+ "useTabs": false,
8
+ "trailingComma": "es5",
9
+ "arrowParens": "always",
10
+ "endOfLine": "lf"
11
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "recommendations": [
3
+ "Vue.volar",
4
+ "dbaeumer.vscode-eslint",
5
+ "EditorConfig.EditorConfig",
6
+ "oxc.oxc-vscode",
7
+ "esbenp.prettier-vscode"
8
+ ]
9
+ }
package/MONOREPO.md ADDED
@@ -0,0 +1,103 @@
1
+ # Monorepo 架构说明
2
+
3
+ 本项目已转换为 monorepo 架构,使用 pnpm workspace 进行管理。
4
+
5
+ ## 项目结构
6
+
7
+ ```
8
+ gy-ui-plus/
9
+ ├── packages/
10
+ │ ├── core/ # 核心工具包(withInstall 等)
11
+ │ ├── button/ # Button 组件包
12
+ │ ├── table/ # Table 组件包
13
+ │ ├── layout-page/ # LayoutPage 组件包
14
+ │ ├── gy-ui-plus/ # 主构建包(用于构建发布版本)
15
+ │ └── index.ts # 主入口文件
16
+ ├── docs/ # 文档站点
17
+ └── dist/ # 构建输出目录
18
+ ```
19
+
20
+ ## 包说明
21
+
22
+ ### @gy-ui-plus/core
23
+ 核心工具包,包含 `withInstall` 等通用工具函数。
24
+
25
+ ### @gy-ui-plus/button
26
+ Button 组件包。
27
+
28
+ ### @gy-ui-plus/table
29
+ Table 组件包。
30
+
31
+ ### @gy-ui-plus/layout-page
32
+ LayoutPage 组件包。
33
+
34
+ ### gy-ui-plus
35
+ 主构建包,用于构建和发布整个组件库。
36
+
37
+ ### @gy-ui-plus/docs
38
+ 文档站点,使用 VitePress 构建。
39
+
40
+ ## 常用命令
41
+
42
+ ### 安装依赖
43
+ ```bash
44
+ pnpm install
45
+ ```
46
+
47
+ ### 构建组件库
48
+ ```bash
49
+ pnpm build
50
+ # 或
51
+ pnpm lib
52
+ ```
53
+
54
+ ### 开发文档
55
+ ```bash
56
+ pnpm docs:dev
57
+ # 或
58
+ pnpm dev
59
+ ```
60
+
61
+ ### 构建文档
62
+ ```bash
63
+ pnpm docs:build
64
+ ```
65
+
66
+ ### 预览文档
67
+ ```bash
68
+ pnpm docs:preview
69
+ ```
70
+
71
+ ### 类型检查
72
+ ```bash
73
+ pnpm type-check
74
+ ```
75
+
76
+ ### 代码检查
77
+ ```bash
78
+ pnpm lint
79
+ ```
80
+
81
+ ### 代码格式化
82
+ ```bash
83
+ pnpm format
84
+ ```
85
+
86
+ ## 工作空间依赖
87
+
88
+ 在 monorepo 中,包之间使用 `workspace:*` 协议来引用本地包:
89
+
90
+ ```json
91
+ {
92
+ "dependencies": {
93
+ "@gy-ui-plus/core": "workspace:*"
94
+ }
95
+ }
96
+ ```
97
+
98
+ ## 注意事项
99
+
100
+ 1. 必须使用 pnpm 作为包管理器(已通过 `preinstall` 脚本强制)
101
+ 2. 所有包都通过 workspace 协议相互引用
102
+ 3. 构建输出在根目录的 `dist` 文件夹
103
+ 4. 每个包都有独立的 `package.json`,但共享根目录的依赖
package/README.md ADDED
@@ -0,0 +1,241 @@
1
+ # gy-ui-plus
2
+
3
+ 一个基于 Vue 3 + Element Plus 二次封装的企业级 UI 组件库,提供高质量的封装组件,帮助开发者快速构建复杂的前端应用。
4
+
5
+ ## 特性
6
+
7
+ - 基于 Vue 3 + TypeScript 开发,提供完整的类型定义
8
+ - 基于 Element Plus 深度封装,保持良好兼容性
9
+ - 支持按需引入,减小打包体积
10
+ - 提供 LayoutPage、Table、Button 等常用业务组件
11
+ - 内置虚拟滚动、列设置、单行编辑等高级功能
12
+ - 完善的代码规范和自动化工具链
13
+
14
+ ## 安装
15
+
16
+ 使用 npm、yarn 或 pnpm 安装:
17
+
18
+ ```bash
19
+ npm install gy-ui-plus
20
+ # 或
21
+ yarn add gy-ui-plus
22
+ # 或
23
+ pnpm add gy-ui-plus
24
+ ```
25
+
26
+ ## 开发
27
+
28
+ 本项目使用 monorepo 架构,基于 pnpm workspace 管理。详细说明请参考 [MONOREPO.md](./MONOREPO.md)。
29
+
30
+ ### 开发环境要求
31
+
32
+ - Node.js: ^20.19.0 || >=22.12.0
33
+ - pnpm: >=8.0.0
34
+
35
+ ### 本地开发
36
+
37
+ ```bash
38
+ # 安装依赖
39
+ pnpm install
40
+
41
+ # 开发文档站点
42
+ pnpm docs:dev
43
+
44
+ # 构建组件库
45
+ pnpm build
46
+
47
+ # 类型检查
48
+ pnpm type-check
49
+
50
+ # 代码检查
51
+ pnpm lint
52
+ ```
53
+
54
+ ## 快速开始
55
+
56
+ ### 完整引入
57
+
58
+ 在 main.ts 中引入组件库:
59
+
60
+ ```typescript
61
+ import { createApp } from 'vue'
62
+ import App from './App.vue'
63
+ import GyUiPlus from 'gy-ui-plus'
64
+ import 'gy-ui-plus/dist/style.css'
65
+
66
+ const app = createApp(App)
67
+ app.use(GyUiPlus)
68
+ app.mount('#app')
69
+ ```
70
+
71
+ ### 按需引入
72
+
73
+ 可以单独引入需要的组件:
74
+
75
+ ```typescript
76
+ import { createApp } from 'vue'
77
+ import App from './App.vue'
78
+ import { GyButton, GyTable, GyLayoutPage } from 'gy-ui-plus'
79
+ import 'gy-ui-plus/dist/style.css'
80
+
81
+ const app = createApp(App)
82
+ app.component('GyButton', GyButton)
83
+ app.component('GyTable', GyTable)
84
+ app.component('GyLayoutPage', GyLayoutPage)
85
+ app.mount('#app')
86
+ ```
87
+
88
+ ## 组件列表
89
+
90
+ ### GyLayoutPage
91
+
92
+ 布局页面组件,提供标准的页面布局结构。
93
+
94
+ ### GyTable
95
+
96
+ 增强表格组件,支持:
97
+
98
+ - 虚拟滚动(大数据量优化)
99
+ - 列设置(显示/隐藏列)
100
+ - 单行编辑
101
+ - 自定义列渲染
102
+ - 操作列配置
103
+
104
+ ### GyButton
105
+
106
+ 增强按钮组件,提供更多业务场景的按钮样式和功能。
107
+
108
+ ## 开发
109
+
110
+ ### 环境要求
111
+
112
+ - Node.js >= 20.19.0
113
+ - npm >= 10.0.0
114
+
115
+ ### 安装依赖
116
+
117
+ ```bash
118
+ npm install
119
+ ```
120
+
121
+ ### 构建组件库
122
+
123
+ ```bash
124
+ npm run lib
125
+ ```
126
+
127
+ ### 代码检查和格式化
128
+
129
+ ```bash
130
+ # 运行所有检查
131
+ npm run lint
132
+
133
+ # 仅运行 ESLint
134
+ npm run lint:eslint
135
+
136
+ # 仅运行 Oxlint
137
+ npm run lint:oxlint
138
+
139
+ # 格式化代码
140
+ npm run format
141
+ ```
142
+
143
+ ### 类型检查
144
+
145
+ ```bash
146
+ npm run type-check
147
+ ```
148
+
149
+ ### 文档开发
150
+
151
+ ```bash
152
+ # 启动文档开发服务器
153
+ npm run docs:dev
154
+
155
+ # 构建文档
156
+ npm run docs:build
157
+
158
+ # 预览构建后的文档
159
+ npm run docs:preview
160
+ ```
161
+
162
+ ## 项目结构
163
+
164
+ ```
165
+ gy-ui-plus/
166
+ ├── packages/ # 组件源码目录
167
+ │ ├── index.ts # 组件库入口文件
168
+ │ ├── withInstall.ts # 组件安装工具函数
169
+ │ ├── button/ # 按钮组件
170
+ │ │ ├── src/
171
+ │ │ │ ├── index.vue # 组件实现
172
+ │ │ │ └── type.ts # 类型定义
173
+ │ │ └── index.ts # 组件导出
174
+ │ ├── table/ # 增强表格组件
175
+ │ │ ├── src/
176
+ │ │ │ ├── index.vue # 主组件
177
+ │ │ │ ├── ColumnSet.vue # 列设置组件
178
+ │ │ │ ├── GyTableColumn.vue # 表格列组件
179
+ │ │ │ ├── operator.vue # 操作列组件
180
+ │ │ │ ├── renderCol.vue # 列渲染组件
181
+ │ │ │ ├── renderHeader.vue # 表头渲染组件
182
+ │ │ │ ├── singleEdit.vue # 单行编辑组件
183
+ │ │ │ ├── singleEditCell.vue # 单元格编辑组件
184
+ │ │ │ ├── tableProps.ts # 表格属性类型定义
185
+ │ │ │ ├── useExpose.ts # 组件暴露方法
186
+ │ │ │ └── useVirtualized.ts # 虚拟滚动逻辑
187
+ │ │ ├── style/
188
+ │ │ │ ├── index.ts # 样式导出
189
+ │ │ │ └── table.scss # 表格样式
190
+ │ │ └── index.ts # 组件导出
191
+ │ └── layout-page/ # 布局页面组件
192
+ │ ├── src/
193
+ │ │ └── index.vue # 组件实现
194
+ │ ├── style/
195
+ │ │ ├── index.ts # 样式导出
196
+ │ │ └── layout-page.scss # 布局样式
197
+ │ └── index.ts # 组件导出
198
+ ├── typings/ # 全局类型定义
199
+ │ ├── env.d.ts # 环境变量类型
200
+ │ └── index.d.ts # 主类型定义
201
+ ├── public/ # 静态资源目录
202
+ ├── .editorconfig # 编辑器配置
203
+ ├── .gitattributes # Git 属性配置
204
+ ├── .gitignore # Git 忽略文件
205
+ ├── .prettierignore # Prettier 忽略文件
206
+ ├── .prettierrc.json # Prettier 配置
207
+ ├── deploy.yml # 部署配置文件
208
+ ├── eslint.config.ts # ESLint 配置
209
+ ├── index.html # HTML 入口文件
210
+ ├── package.json # 项目配置和依赖
211
+ ├── README.md # 项目说明文档
212
+ ├── tsconfig.app.json # 应用 TypeScript 配置
213
+ ├── tsconfig.json # 主 TypeScript 配置
214
+ ├── tsconfig.node.json # Node.js TypeScript 配置
215
+ └── vite.config.ts # Vite 构建配置
216
+ ```
217
+
218
+ ## 技术栈
219
+
220
+ - **框架**: Vue 3
221
+ - **UI 基础**: Element Plus
222
+ - **构建工具**: Vite
223
+ - **语言**: TypeScript
224
+ - **样式**: SCSS
225
+ - **代码规范**: ESLint + Prettier + Oxlint
226
+
227
+ ## 许可证
228
+
229
+ MIT License
230
+
231
+ ## 贡献
232
+
233
+ 欢迎提交 Issue 和 Pull Request 来帮助改进这个项目!
234
+
235
+ ## 联系方式
236
+
237
+ - GitHub Issues: https://github.com/SKYE-iiii/gy-ui-plus/issues
238
+
239
+ ---
240
+
241
+ 感谢使用 gy-ui-plus!
package/deploy.yml ADDED
@@ -0,0 +1,30 @@
1
+ name: Deploy VitePress to GitHub Pages
2
+
3
+ on:
4
+ push:
5
+ branches: [main] # 主分支名称
6
+
7
+ jobs:
8
+ deploy:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@v3
12
+ with:
13
+ fetch-depth: 0
14
+
15
+ - name: Setup Node.js
16
+ uses: actions/setup-node@v3
17
+ with:
18
+ node-version: 20
19
+
20
+ - name: Install dependencies
21
+ run: npm install
22
+
23
+ - name: Build docs
24
+ run: npm run docs:build
25
+
26
+ - name: Deploy to GitHub Pages
27
+ uses: peaceiris/actions-gh-pages@v3
28
+ with:
29
+ github_token: ${{ secrets.GITHUB_TOKEN }}
30
+ publish_dir: ./docs/.vitepress/dist