ff-ui-plus 2.0.7

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 (319) hide show
  1. package/.nvmrc +1 -0
  2. package/.prettierrc.cjs +41 -0
  3. package/.stylelintignore +5 -0
  4. package/LICENSE +21 -0
  5. package/README.md +265 -0
  6. package/commitlint.config.cjs +162 -0
  7. package/global.d.ts +27 -0
  8. package/index.html +16 -0
  9. package/lib.sh +9 -0
  10. package/lint-staged.config.cjs +8 -0
  11. package/package.json +149 -0
  12. package/packages/components/adaptive-page/index.ts +5 -0
  13. package/packages/components/adaptive-page/src/index.vue +85 -0
  14. package/packages/components/adaptive-page/src/type.ts +9 -0
  15. package/packages/components/adaptive-page/style/css.ts +1 -0
  16. package/packages/components/adaptive-page/style/index.ts +1 -0
  17. package/packages/components/button/index.ts +5 -0
  18. package/packages/components/button/src/index.vue +41 -0
  19. package/packages/components/button/src/type.ts +11 -0
  20. package/packages/components/button/style/css.ts +1 -0
  21. package/packages/components/button/style/index.ts +1 -0
  22. package/packages/components/chart/index.ts +5 -0
  23. package/packages/components/chart/src/index.vue +121 -0
  24. package/packages/components/chart/src/type.ts +7 -0
  25. package/packages/components/chart/style/css.ts +1 -0
  26. package/packages/components/chart/style/index.ts +1 -0
  27. package/packages/components/checkbox/index.ts +3 -0
  28. package/packages/components/checkbox/src/checkbox.d.ts +5 -0
  29. package/packages/components/checkbox/src/index.vue +67 -0
  30. package/packages/components/checkbox/style/css.ts +1 -0
  31. package/packages/components/checkbox/style/index.ts +1 -0
  32. package/packages/components/date-picker/index.ts +5 -0
  33. package/packages/components/date-picker/src/index.vue +228 -0
  34. package/packages/components/date-picker/src/type.ts +22 -0
  35. package/packages/components/date-picker/style/css.ts +1 -0
  36. package/packages/components/date-picker/style/index.ts +1 -0
  37. package/packages/components/detail/index.ts +5 -0
  38. package/packages/components/detail/src/index.vue +102 -0
  39. package/packages/components/detail/src/renderLabel.vue +15 -0
  40. package/packages/components/detail/src/renderTooltip.vue +15 -0
  41. package/packages/components/detail/src/type.ts +28 -0
  42. package/packages/components/detail/style/css.ts +1 -0
  43. package/packages/components/detail/style/index.ts +1 -0
  44. package/packages/components/form/index.ts +5 -0
  45. package/packages/components/form/src/index.vue +407 -0
  46. package/packages/components/form/src/renderBtn.vue +15 -0
  47. package/packages/components/form/src/renderComp.vue +15 -0
  48. package/packages/components/form/src/type.ts +26 -0
  49. package/packages/components/form/style/css.ts +1 -0
  50. package/packages/components/form/style/index.ts +1 -0
  51. package/packages/components/index.ts +20 -0
  52. package/packages/components/input/index.ts +5 -0
  53. package/packages/components/input/src/index.vue +225 -0
  54. package/packages/components/input/src/type.ts +14 -0
  55. package/packages/components/input/style/css.ts +1 -0
  56. package/packages/components/input/style/index.ts +1 -0
  57. package/packages/components/layout-page/index.ts +4 -0
  58. package/packages/components/layout-page/src/index.vue +74 -0
  59. package/packages/components/layout-page/style/css.ts +1 -0
  60. package/packages/components/layout-page/style/index.ts +1 -0
  61. package/packages/components/layout-page-item/index.ts +3 -0
  62. package/packages/components/layout-page-item/src/index.vue +16 -0
  63. package/packages/components/layout-page-item/style/css.ts +1 -0
  64. package/packages/components/layout-page-item/style/index.ts +1 -0
  65. package/packages/components/module-form/index.ts +4 -0
  66. package/packages/components/module-form/src/index.vue +243 -0
  67. package/packages/components/module-form/src/moduleDetail.vue +61 -0
  68. package/packages/components/module-form/src/moduleForm.vue +88 -0
  69. package/packages/components/module-form/src/type.ts +16 -0
  70. package/packages/components/module-form/style/css.ts +1 -0
  71. package/packages/components/module-form/style/index.ts +1 -0
  72. package/packages/components/package.json +9 -0
  73. package/packages/components/query-condition/index.ts +4 -0
  74. package/packages/components/query-condition/src/index.vue +478 -0
  75. package/packages/components/query-condition/src/moreChoose.vue +159 -0
  76. package/packages/components/query-condition/src/renderComp.vue +15 -0
  77. package/packages/components/query-condition/src/type.ts +22 -0
  78. package/packages/components/query-condition/src/useComputed.ts +94 -0
  79. package/packages/components/query-condition/style/css.ts +1 -0
  80. package/packages/components/query-condition/style/index.ts +1 -0
  81. package/packages/components/radio/index.ts +3 -0
  82. package/packages/components/radio/src/index.vue +73 -0
  83. package/packages/components/radio/src/radio.d.ts +12 -0
  84. package/packages/components/radio/style/css.ts +1 -0
  85. package/packages/components/radio/style/index.ts +1 -0
  86. package/packages/components/select/index.ts +4 -0
  87. package/packages/components/select/src/index.vue +240 -0
  88. package/packages/components/select/src/type.ts +43 -0
  89. package/packages/components/select/style/css.ts +1 -0
  90. package/packages/components/select/style/index.ts +1 -0
  91. package/packages/components/select-icon/index.ts +4 -0
  92. package/packages/components/select-icon/src/index.vue +128 -0
  93. package/packages/components/select-icon/style/css.ts +1 -0
  94. package/packages/components/select-icon/style/index.ts +1 -0
  95. package/packages/components/select-table/index.ts +4 -0
  96. package/packages/components/select-table/src/ClickOutside.ts +106 -0
  97. package/packages/components/select-table/src/index.vue +851 -0
  98. package/packages/components/select-table/src/renderCol.vue +20 -0
  99. package/packages/components/select-table/src/type.ts +56 -0
  100. package/packages/components/select-table/src/useVirtualized.ts +86 -0
  101. package/packages/components/select-table/style/css.ts +1 -0
  102. package/packages/components/select-table/style/index.ts +1 -0
  103. package/packages/components/step-wizard/index.ts +4 -0
  104. package/packages/components/step-wizard/src/index.vue +99 -0
  105. package/packages/components/step-wizard/src/type.ts +17 -0
  106. package/packages/components/step-wizard/style/css.ts +1 -0
  107. package/packages/components/step-wizard/style/index.ts +1 -0
  108. package/packages/components/table/index.ts +5 -0
  109. package/packages/components/table/src/ColumnSet.vue +176 -0
  110. package/packages/components/table/src/TTableColumn.vue +100 -0
  111. package/packages/components/table/src/densitySet.vue +91 -0
  112. package/packages/components/table/src/firstColumn.vue +132 -0
  113. package/packages/components/table/src/index.vue +926 -0
  114. package/packages/components/table/src/operator.vue +246 -0
  115. package/packages/components/table/src/renderCol.vue +20 -0
  116. package/packages/components/table/src/renderHeader.vue +18 -0
  117. package/packages/components/table/src/singleEdit.vue +354 -0
  118. package/packages/components/table/src/singleEditCell.vue +303 -0
  119. package/packages/components/table/src/tableProps.ts +162 -0
  120. package/packages/components/table/src/useExpose.ts +74 -0
  121. package/packages/components/table/src/useVirtualized.ts +70 -0
  122. package/packages/components/table/style/css.ts +1 -0
  123. package/packages/components/table/style/index.ts +1 -0
  124. package/packages/components/tabs/index.ts +4 -0
  125. package/packages/components/tabs/src/index.vue +50 -0
  126. package/packages/components/tabs/style/css.ts +1 -0
  127. package/packages/components/tabs/style/index.ts +1 -0
  128. package/packages/components/timer-btn/index.ts +4 -0
  129. package/packages/components/timer-btn/src/index.vue +57 -0
  130. package/packages/components/timer-btn/style/css.ts +1 -0
  131. package/packages/components/timer-btn/style/index.ts +1 -0
  132. package/packages/components/utils/index.ts +142 -0
  133. package/packages/components/utils/install.ts +16 -0
  134. package/packages/eslint-config/build.config.ts +16 -0
  135. package/packages/eslint-config/dist/index.cjs +122 -0
  136. package/packages/eslint-config/dist/index.d.cts +92 -0
  137. package/packages/eslint-config/dist/index.d.mts +92 -0
  138. package/packages/eslint-config/dist/index.d.ts +92 -0
  139. package/packages/eslint-config/dist/index.mjs +120 -0
  140. package/packages/eslint-config/package.json +34 -0
  141. package/packages/eslint-config/src/index.ts +121 -0
  142. package/packages/ff-ui-plus/component.ts +55 -0
  143. package/packages/ff-ui-plus/defaults.ts +4 -0
  144. package/packages/ff-ui-plus/index.ts +9 -0
  145. package/packages/ff-ui-plus/make-installer.ts +10 -0
  146. package/packages/ff-ui-plus/package.json +117 -0
  147. package/packages/ff-ui-plus/version.ts +1 -0
  148. package/packages/hooks/index.ts +1 -0
  149. package/packages/hooks/package.json +9 -0
  150. package/packages/hooks/useLocale.ts +53 -0
  151. package/packages/locale/index.ts +11 -0
  152. package/packages/locale/lang/en.ts +157 -0
  153. package/packages/locale/lang/zh-cn.ts +155 -0
  154. package/packages/locale/package.json +12 -0
  155. package/packages/resolver/package.json +23 -0
  156. package/packages/resolver/src/index.ts +99 -0
  157. package/packages/theme-chalk/build.ts +76 -0
  158. package/packages/theme-chalk/dist/index.css +1 -0
  159. package/packages/theme-chalk/dist/src/adaptive-page.scss +48 -0
  160. package/packages/theme-chalk/dist/src/button.scss +23 -0
  161. package/packages/theme-chalk/dist/src/chart.scss +10 -0
  162. package/packages/theme-chalk/dist/src/checkbox.scss +0 -0
  163. package/packages/theme-chalk/dist/src/date-picker.scss +3 -0
  164. package/packages/theme-chalk/dist/src/detail.scss +7 -0
  165. package/packages/theme-chalk/dist/src/form.scss +104 -0
  166. package/packages/theme-chalk/dist/src/index.scss +19 -0
  167. package/packages/theme-chalk/dist/src/input.scss +0 -0
  168. package/packages/theme-chalk/dist/src/layout-page-item.scss +10 -0
  169. package/packages/theme-chalk/dist/src/layout-page.scss +37 -0
  170. package/packages/theme-chalk/dist/src/module-form.scss +335 -0
  171. package/packages/theme-chalk/dist/src/query-condition.scss +132 -0
  172. package/packages/theme-chalk/dist/src/radio.scss +0 -0
  173. package/packages/theme-chalk/dist/src/select-icon.scss +61 -0
  174. package/packages/theme-chalk/dist/src/select-table.scss +71 -0
  175. package/packages/theme-chalk/dist/src/select.scss +7 -0
  176. package/packages/theme-chalk/dist/src/step-wizard.scss +51 -0
  177. package/packages/theme-chalk/dist/src/table.scss +381 -0
  178. package/packages/theme-chalk/dist/src/tabs.scss +20 -0
  179. package/packages/theme-chalk/dist/src/timer-btn.scss +21 -0
  180. package/packages/theme-chalk/dist/t-adaptive-page.css +1 -0
  181. package/packages/theme-chalk/dist/t-button.css +1 -0
  182. package/packages/theme-chalk/dist/t-chart.css +1 -0
  183. package/packages/theme-chalk/dist/t-checkbox.css +0 -0
  184. package/packages/theme-chalk/dist/t-date-picker.css +1 -0
  185. package/packages/theme-chalk/dist/t-detail.css +1 -0
  186. package/packages/theme-chalk/dist/t-form.css +1 -0
  187. package/packages/theme-chalk/dist/t-input.css +0 -0
  188. package/packages/theme-chalk/dist/t-layout-page-item.css +1 -0
  189. package/packages/theme-chalk/dist/t-layout-page.css +1 -0
  190. package/packages/theme-chalk/dist/t-module-form.css +1 -0
  191. package/packages/theme-chalk/dist/t-query-condition.css +1 -0
  192. package/packages/theme-chalk/dist/t-radio.css +0 -0
  193. package/packages/theme-chalk/dist/t-select-icon.css +1 -0
  194. package/packages/theme-chalk/dist/t-select-table.css +1 -0
  195. package/packages/theme-chalk/dist/t-select.css +1 -0
  196. package/packages/theme-chalk/dist/t-step-wizard.css +1 -0
  197. package/packages/theme-chalk/dist/t-table.css +1 -0
  198. package/packages/theme-chalk/dist/t-tabs.css +1 -0
  199. package/packages/theme-chalk/dist/t-timer-btn.css +1 -0
  200. package/packages/theme-chalk/mixins/config.scss +8 -0
  201. package/packages/theme-chalk/mixins/function.scss +71 -0
  202. package/packages/theme-chalk/mixins/mixins.scss +79 -0
  203. package/packages/theme-chalk/package.json +21 -0
  204. package/packages/theme-chalk/src/adaptive-page.scss +48 -0
  205. package/packages/theme-chalk/src/button.scss +23 -0
  206. package/packages/theme-chalk/src/chart.scss +10 -0
  207. package/packages/theme-chalk/src/checkbox.scss +0 -0
  208. package/packages/theme-chalk/src/date-picker.scss +3 -0
  209. package/packages/theme-chalk/src/detail.scss +7 -0
  210. package/packages/theme-chalk/src/form.scss +104 -0
  211. package/packages/theme-chalk/src/index.scss +19 -0
  212. package/packages/theme-chalk/src/input.scss +0 -0
  213. package/packages/theme-chalk/src/layout-page-item.scss +10 -0
  214. package/packages/theme-chalk/src/layout-page.scss +37 -0
  215. package/packages/theme-chalk/src/module-form.scss +335 -0
  216. package/packages/theme-chalk/src/query-condition.scss +132 -0
  217. package/packages/theme-chalk/src/radio.scss +0 -0
  218. package/packages/theme-chalk/src/select-icon.scss +61 -0
  219. package/packages/theme-chalk/src/select-table.scss +71 -0
  220. package/packages/theme-chalk/src/select.scss +7 -0
  221. package/packages/theme-chalk/src/step-wizard.scss +51 -0
  222. package/packages/theme-chalk/src/table.scss +381 -0
  223. package/packages/theme-chalk/src/tabs.scss +20 -0
  224. package/packages/theme-chalk/src/timer-btn.scss +21 -0
  225. package/packages/types/global.ts +34 -0
  226. package/packages/types/index.ts +1 -0
  227. package/packages/types/package.json +10 -0
  228. package/packages/utils/build.config.ts +23 -0
  229. package/packages/utils/dist/cookie.cjs +1 -0
  230. package/packages/utils/dist/cookie.d.cts +16 -0
  231. package/packages/utils/dist/cookie.d.mts +16 -0
  232. package/packages/utils/dist/cookie.d.ts +16 -0
  233. package/packages/utils/dist/cookie.mjs +1 -0
  234. package/packages/utils/dist/day.cjs +1 -0
  235. package/packages/utils/dist/day.d.cts +37 -0
  236. package/packages/utils/dist/day.d.mts +37 -0
  237. package/packages/utils/dist/day.d.ts +37 -0
  238. package/packages/utils/dist/day.mjs +1 -0
  239. package/packages/utils/dist/file.cjs +1 -0
  240. package/packages/utils/dist/file.d.cts +61 -0
  241. package/packages/utils/dist/file.d.mts +61 -0
  242. package/packages/utils/dist/file.d.ts +61 -0
  243. package/packages/utils/dist/file.mjs +1 -0
  244. package/packages/utils/dist/index.cjs +1 -0
  245. package/packages/utils/dist/index.d.cts +13 -0
  246. package/packages/utils/dist/index.d.mts +13 -0
  247. package/packages/utils/dist/index.d.ts +13 -0
  248. package/packages/utils/dist/index.mjs +1 -0
  249. package/packages/utils/dist/is.cjs +1 -0
  250. package/packages/utils/dist/is.d.cts +117 -0
  251. package/packages/utils/dist/is.d.mts +117 -0
  252. package/packages/utils/dist/is.d.ts +117 -0
  253. package/packages/utils/dist/is.mjs +1 -0
  254. package/packages/utils/dist/letter.cjs +1 -0
  255. package/packages/utils/dist/letter.d.cts +12 -0
  256. package/packages/utils/dist/letter.d.mts +12 -0
  257. package/packages/utils/dist/letter.d.ts +12 -0
  258. package/packages/utils/dist/letter.mjs +1 -0
  259. package/packages/utils/dist/number.cjs +1 -0
  260. package/packages/utils/dist/number.d.cts +23 -0
  261. package/packages/utils/dist/number.d.mts +23 -0
  262. package/packages/utils/dist/number.d.ts +23 -0
  263. package/packages/utils/dist/number.mjs +1 -0
  264. package/packages/utils/dist/openExe.cjs +1 -0
  265. package/packages/utils/dist/openExe.d.cts +9 -0
  266. package/packages/utils/dist/openExe.d.mts +9 -0
  267. package/packages/utils/dist/openExe.d.ts +9 -0
  268. package/packages/utils/dist/openExe.mjs +1 -0
  269. package/packages/utils/dist/storage.cjs +1 -0
  270. package/packages/utils/dist/storage.d.cts +46 -0
  271. package/packages/utils/dist/storage.d.mts +46 -0
  272. package/packages/utils/dist/storage.d.ts +46 -0
  273. package/packages/utils/dist/storage.mjs +1 -0
  274. package/packages/utils/dist/validate.cjs +1 -0
  275. package/packages/utils/dist/validate.d.cts +32 -0
  276. package/packages/utils/dist/validate.d.mts +32 -0
  277. package/packages/utils/dist/validate.d.ts +32 -0
  278. package/packages/utils/dist/validate.mjs +1 -0
  279. package/packages/utils/dist/ws.cjs +1 -0
  280. package/packages/utils/dist/ws.d.cts +86 -0
  281. package/packages/utils/dist/ws.d.mts +86 -0
  282. package/packages/utils/dist/ws.d.ts +86 -0
  283. package/packages/utils/dist/ws.mjs +1 -0
  284. package/packages/utils/package.json +42 -0
  285. package/packages/utils/src/cookie.ts +24 -0
  286. package/packages/utils/src/day.ts +66 -0
  287. package/packages/utils/src/file.ts +173 -0
  288. package/packages/utils/src/index.ts +10 -0
  289. package/packages/utils/src/is.ts +159 -0
  290. package/packages/utils/src/letter.ts +15 -0
  291. package/packages/utils/src/number.ts +37 -0
  292. package/packages/utils/src/openExe.ts +45 -0
  293. package/packages/utils/src/storage.ts +77 -0
  294. package/packages/utils/src/validate.ts +55 -0
  295. package/packages/utils/src/ws.ts +191 -0
  296. package/pnpm-workspace.yaml +3 -0
  297. package/publish.sh +37 -0
  298. package/resolver.sh +9 -0
  299. package/scripts/build/all.ts +152 -0
  300. package/scripts/build/build.config.ts +10 -0
  301. package/scripts/build/dist/index.cjs +7 -0
  302. package/scripts/build/dist/index.d.ts +2 -0
  303. package/scripts/build/dist/index.mjs +12 -0
  304. package/scripts/build/index.ts +63 -0
  305. package/scripts/build/modules.ts +141 -0
  306. package/scripts/build/package.json +14 -0
  307. package/scripts/release/gen-version.ts +12 -0
  308. package/scripts/release/index.ts +209 -0
  309. package/scripts/utils/excludeFiles.ts +14 -0
  310. package/scripts/utils/index.ts +88 -0
  311. package/scripts/utils/main.ts +14 -0
  312. package/scripts/utils/paths.ts +40 -0
  313. package/scripts/utils/plugin.ts +61 -0
  314. package/tsconfig.base.json +23 -0
  315. package/tsconfig.vitest.json +11 -0
  316. package/tsconfig.web.json +18 -0
  317. package/typings/env.d.ts +22 -0
  318. package/typings/index.d.ts +161 -0
  319. package/vitest.config.ts +22 -0
package/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ v18.19.0
@@ -0,0 +1,41 @@
1
+ // @see: https://www.prettier.cn
2
+
3
+ module.exports = {
4
+ // 指定最大换行长度
5
+ printWidth: 100,
6
+ // 缩进制表符宽度 | 空格数
7
+ tabWidth: 2,
8
+ // 使用制表符而不是空格缩进行 (true:制表符,false:空格)
9
+ useTabs: false,
10
+ // 结尾不用分号 (true:有,false:没有)
11
+ semi: false,
12
+ // 使用单引号 (true:单引号,false:双引号)
13
+ singleQuote: false,
14
+ // 在对象字面量中决定是否将属性名用引号括起来 可选值 "<as-needed|consistent|preserve>"
15
+ quoteProps: "as-needed",
16
+ // 在JSX中使用单引号而不是双引号 (true:单引号,false:双引号)
17
+ jsxSingleQuote: false,
18
+ // 多行时尽可能打印尾随逗号 可选值"<none|es5|all>"
19
+ trailingComma: "none",
20
+ // 在对象,数组括号与文字之间加空格 "{ foo: bar }" (true:有,false:没有)
21
+ bracketSpacing: true,
22
+ // 将 > 多行元素放在最后一行的末尾,而不是单独放在下一行 (true:放末尾,false:单独一行)
23
+ bracketSameLine: false,
24
+ // (x) => {} 箭头函数参数只有一个时是否要有小括号 (avoid:省略括号,always:不省略括号)
25
+ arrowParens: "avoid",
26
+ // 指定要使用的解析器,不需要写文件开头的 @prettier
27
+ requirePragma: false,
28
+ // 可以在文件顶部插入一个特殊标记,指定该文件已使用 Prettier 格式化
29
+ insertPragma: false,
30
+ // 用于控制文本是否应该被换行以及如何进行换行
31
+ proseWrap: "preserve",
32
+ // 在html中空格是否是敏感的 "css" - 遵守 CSS 显示属性的默认值, "strict" - 空格被认为是敏感的 ,"ignore" - 空格被认为是不敏感的
33
+ htmlWhitespaceSensitivity: "css",
34
+ // 控制在 Vue 单文件组件中 <script> 和 <style> 标签内的代码缩进方式
35
+ vueIndentScriptAndStyle: false,
36
+ // 换行符使用 lf 结尾是 可选值 "<auto|lf|crlf|cr>"
37
+ endOfLine: "auto",
38
+ // 这两个选项可用于格式化以给定字符偏移量(分别包括和不包括)开始和结束的代码 (rangeStart:开始,rangeEnd:结束)
39
+ rangeStart: 0,
40
+ rangeEnd: Infinity
41
+ };
@@ -0,0 +1,5 @@
1
+ node_modules/
2
+ dist/
3
+ *.min.css
4
+ packages/
5
+ docs/
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 wocwin
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,265 @@
1
+ # FF-ui-Plus
2
+
3
+ ## [FF-ui-Plus 使用 Demo 项目](https://github.com/wocwin/wocwin-admin)
4
+
5
+ > `wocwin-admin`是基于 Vue3.3、TypeScript、Vite4、Pinia、Element-Plus 开源的一套后台管理模板;此项目全面使用了`FF-ui-Plus`二次封装基础组件库
6
+
7
+ ## 介绍
8
+
9
+ > 基于 vue3+ ts+ Element-plus 二次封装组件
10
+
11
+ 这是我在学习 Vue3 中基于[Element-plus](https://element-plus.org/zh-CN/) 二次封装基础组件文档,希望对你有用。可查看 [详细组件案例文档](https://zhangpengfeia.github.io/ff-ui-plus/) 预览
12
+
13
+ ### 安装
14
+
15
+ **建议您使用包管理器 ([pnpm](https://pnpm.io/)<el-tag effect="dark">推荐</el-tag> , [yarn](https://classic.yarnpkg.com/lang/en/),[npm](https://www.npmjs.com/)) 安装 ff-ui-plus**。
16
+
17
+ ```shell
18
+ // 使用pnpm
19
+ pnpm install ff-ui-plus -S
20
+
21
+ // 使用npm
22
+ npm install ff-ui-plus -S
23
+
24
+ // 使用yarn
25
+ yarn add ff-ui-plus
26
+ ```
27
+
28
+ ## 全局注册使用
29
+
30
+ > ### 前提条件:使用项目必须全局注册 Element-plus 组件库
31
+
32
+ ```js
33
+ // 在main.js中按下引入
34
+ import { createApp } from "vue"
35
+ import App from "./App.vue"
36
+ import ElementPlus from "element-plus"
37
+ import "element-plus/dist/index.css"
38
+ import "element-plus/theme-chalk/dark/css-vars.css"
39
+ // import en from 'element-plus/es/locale/lang/en' // 引入element-plus语言包 en--不建议固定设置
40
+ import zhCn from "element-plus/es/locale/lang/zh-cn" // 引入element-plus语言包 zh-cn--不建议固定设置
41
+ import plusZhCn from "ff-ui-plus/locale/zh-cn" // 引入ff-ui-plus语言包 zh-cn--不建议固定设置
42
+ // import plusEn from 'ff-ui-plus/locale/en' // 引入ff-ui-plus语言包 en--不建议固定设置
43
+ // element-plus图标
44
+ import * as ElementPlusIconsVue from "@element-plus/icons-vue"
45
+ import TuiPlus from "ff-ui-plus"
46
+ import "ff-ui-plus/index.css"
47
+ const app = createApp(App)
48
+ // 注册所有图标
49
+ for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
50
+ app.component(key, component)
51
+ }
52
+ // 注册ElementPlus
53
+ app.use(ElementPlus, {
54
+ locale: { ...zhCn, ...plusZhCn } // 语言设置--不建议固定设置
55
+ // size: Cookies.get('size') || 'medium' // 尺寸设置
56
+ })
57
+ app.use(TuiPlus)
58
+ app.mount("#app")
59
+ ```
60
+
61
+ ## 按需引入
62
+
63
+ ```js
64
+ // 在main.js中按下引入
65
+ import "ff-ui-plus/index.css"
66
+ // 单个.vue文件引入
67
+ ;<script setup lang="ts">
68
+ import {(TDetail, TForm)} from "ff-ui-plus"
69
+ </script>
70
+ ```
71
+
72
+ ## 国际化配置-- ConfigProvider <el-tag effect="dark">推荐</el-tag>
73
+
74
+ ```html
75
+ <template>
76
+ <el-config-provider :locale="locale"> *** </el-config-provider>
77
+ </template>
78
+
79
+ <script setup>
80
+ import { ElConfigProvider } from "element-plus"
81
+ import { useGlobalStore } from "@/store/modules/global" // 引入pinia全局状态管理
82
+ import en from "element-plus/es/locale/lang/en"
83
+ import zhCn from "element-plus/es/locale/lang/zh-cn"
84
+ import plusZhCn from "ff-ui-plus/locale/zh-cn"
85
+ import plusEn from "ff-ui-plus/locale/en"
86
+
87
+ const zhCnLocales = {
88
+ ...zhCn,
89
+ ...plusZhCn
90
+ }
91
+ const enLocales = {
92
+ ...en,
93
+ ...plusEn
94
+ }
95
+
96
+ const globalStore = useGlobalStore()
97
+ const locale = computed(() => (globalStore.language === "zh" ? zhCnLocales : enLocales))
98
+ </script>
99
+ ```
100
+
101
+ ## 浏览器直接引入
102
+
103
+ 直接通过浏览器的 HTML 标签导入 ff-ui-plus,然后就可以使用全局变量 `TuiPlus` 了。
104
+
105
+ 根据不同的 CDN 提供商有不同的引入方式, 我们在这里以[unpkg](https://unpkg.com) 和 [jsDelivr](https://jsdelivr.com) 举例。 你也可以使用其它的 CDN 供应商。
106
+
107
+ ### unpkg
108
+
109
+ ```html
110
+ <head>
111
+ <!-- 导入element-plus样式 -->
112
+ <link rel="stylesheet" href="//unpkg.com/element-plus/dist/index.css" />
113
+ <!-- 导入vue3 -->
114
+ <script src="//unpkg.com/vue@3"></script>
115
+ <!-- 导入element-plus -->
116
+ <script src="//unpkg.com/element-plus"></script>
117
+
118
+ <!-- 导入ff-ui-plus样式 -->
119
+ <link rel="stylesheet" href="//unpkg.com/ff-ui-plus/index.css" />
120
+ <!--导入ff-ui-plus" -->
121
+ <script src="//unpkg.com/ff-ui-plus"></script>
122
+ </head>
123
+ ```
124
+
125
+ ### jsDelivr
126
+
127
+ ```html
128
+ <head>
129
+ <!-- 导入element-plus样式 -->
130
+ <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/element-plus/dist/index.css" />
131
+ <!-- 导入vue3 -->
132
+ <script src="//cdn.jsdelivr.net/npm/vue@3"></script>
133
+ <!-- 导入element-plus -->
134
+ <script src="//cdn.jsdelivr.net/npm/element-plus"></script>
135
+
136
+ <!-- 导入ff-ui-plus样式 -->
137
+ <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/ff-ui-plus/index.css" />
138
+ <!--导入ff-ui-plus" -->
139
+ <script src="//cdn.jsdelivr.net/npm/ff-ui-plus"></script>
140
+ </head>
141
+ ```
142
+
143
+ ## 全部组件如下
144
+
145
+ | 组件名称 | 说明 |
146
+ | :----------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
147
+ | TLayoutPage | 布局页面 |
148
+ | TLayoutPageItem | 布局页面子项 |
149
+ | TAdaptivePage | [一屏组件](https://github.com/zhangpengfeia/vitepress-ui/components/TAdaptivePage/base.html?_blank)(继承 TTable 及 TQueryCondition 组件的所有属性、事件、插槽、方法) |
150
+ | TQueryCondition | [条件查询组件](https://github.com/zhangpengfeia/vitepress-ui/components/TQueryCondition/base.html?_blank) |
151
+ | TTable | [表格组件](https://github.com/zhangpengfeia/vitepress-ui/components/TTable/base.html?_blank) |
152
+ | Virtualized TTable | [虚拟列表](https://github.com/zhangpengfeia/vitepress-ui/components/TTableVirtual/base.html?_blank) |
153
+ | TForm | [表单组件](https://github.com/zhangpengfeia/vitepress-ui/components/TForm/base.html?_blank) |
154
+ | TSelectTable | [下拉选择表格组件](https://github.com/zhangpengfeia/vitepress-ui/components/TSelectTable/base.html?_blank) |
155
+ | Virtualized TSelectTable | [下拉选择虚拟表格组件](https://github.com/zhangpengfeia/vitepress-ui/components/multipleVirtual/base.html?_blank) |
156
+ | TSelectIcon | [图标选择组件](https://github.com/zhangpengfeia/vitepress-ui/components/TSelectIcon/base.html?_blank) |
157
+ | TSelect | [下拉选择组件](https://github.com/zhangpengfeia/vitepress-ui/components/TSelect/base.html?_blank) |
158
+ | TDetail | [详情组件](https://github.com/zhangpengfeia/vitepress-ui/components/TDetail/base.html?_blank) |
159
+ | TButton | [防抖按钮组件](https://github.com/zhangpengfeia/vitepress-ui/components/TButton/base.html?_blank) |
160
+ | TStepWizard | [步骤条组件](https://github.com/zhangpengfeia/vitepress-ui/components/TStepWizard/base.html?_blank) |
161
+ | TTimerBtn | 定时按钮组件 |
162
+ | TModuleForm | [模块表单/详情组件](https://github.com/zhangpengfeia/vitepress-ui/components/TModuleForm/base.html?_blank) |
163
+ | TDatePicker | [日期选择器组件](https://github.com/zhangpengfeia/vitepress-ui/components/TDatePicker/base.html?_blank) |
164
+ | TRadio | [单选组件](https://github.com/zhangpengfeia/vitepress-ui/components/TRadio/base.html?_blank) |
165
+ | TCheckbox | [多选组件](https://github.com/zhangpengfeia/vitepress-ui/components/TCheckbox/base.html?_blank) |
166
+ | TChart | [图表组件](https://github.com/zhangpengfeia/vitepress-ui/components/TChart/base.html?_blank) |
167
+ | TTabs | [标签页组件](https://github.com/zhangpengfeia/vitepress-ui/components/TTabs/base.html?_blank) |
168
+ | TSelectIcon | [图标选择组件](https://github.com/zhangpengfeia/vitepress-ui/components/TSelectIcon/base.html?_blank) |
169
+
170
+ ## Vue - Official (Volar)待验证
171
+
172
+ ```js
173
+ // 需要在使用的项目的tsconfig.json文件中添加以下
174
+ compilerOptions:{
175
+ "types": [
176
+ "ff-ui-plus/index.d.ts"
177
+ ],
178
+ }
179
+
180
+ ```
181
+
182
+ ## 自动按需导入 (暂不支持--待完善)
183
+
184
+ - 1. 安装插件
185
+
186
+ ```sh
187
+ pnpm install -D unplugin-vue-components unplugin-auto-import @ff-ui-plus/resolver
188
+
189
+ ```
190
+
191
+ - 2. 配置 `vite.config.ts` 或者配置 `webpack(vue).config.js`
192
+
193
+ ### vite.config.ts 配置
194
+
195
+ ```js
196
+ // vite.config.ts
197
+ import { defineConfig } from "vite"
198
+ import AutoImport from "unplugin-auto-import/vite"
199
+ import Components from "unplugin-vue-components/vite"
200
+ import { ElementPlusResolver } from "unplugin-vue-components/resolvers"
201
+ import { TuiPlusResolver } from "@ff-ui-plus/resolver"
202
+
203
+ export default defineConfig({
204
+ // ...
205
+ plugins: [
206
+ // ...
207
+ AutoImport({
208
+ resolvers: [ElementPlusResolver()]
209
+ }),
210
+ Components({
211
+ resolvers: [ElementPlusResolver(), TuiPlusResolver()]
212
+ })
213
+ ]
214
+ })
215
+ ```
216
+
217
+ ### vue.config.js 配置
218
+
219
+ ```js
220
+ const { defineConfig } = require("@vue/cli-service")
221
+ const AutoImport = require("unplugin-auto-import/webpack")
222
+ const Components = require("unplugin-vue-components/webpack")
223
+ const { ElementPlusResolver } = require("unplugin-vue-components/resolvers")
224
+ const { TuiPlusResolver } = require("@ff-ui-plus/resolver")
225
+
226
+ module.exports = defineConfig({
227
+ // ...
228
+ configureWebpack: {
229
+ plugins: [
230
+ // ...
231
+ AutoImport({
232
+ resolvers: [ElementPlusResolver()]
233
+ }),
234
+ Components({
235
+ resolvers: [TuiPlusResolver(), ElementPlusResolver()]
236
+ })
237
+ ]
238
+ }
239
+ })
240
+ ```
241
+
242
+ ## 安装依赖
243
+
244
+ > ### 注意: 本地环境版本最好安装 [Node.js 18.x+](https://nodejs.org/en)、[pnpm 7.x+](https://github.com/pnpm/pnpm/)
245
+
246
+ ```shell
247
+ npm install -g pnpm
248
+
249
+ # 安装依赖
250
+ pnpm install --registry=https://registry.npmjs.org/
251
+ >pnpm config get registry 查看当前指向源
252
+
253
+ # 如果安装依赖失败,可以尝试使用淘宝镜像 --registry=https://registry.npmmirror.com/
254
+ >pnpm config set registry https://registry.npmmirror.com/ 切换淘宝镜像源
255
+ >pnpm install
256
+
257
+ ```
258
+
259
+ ## 本地运行 vitepress 中组件文档
260
+
261
+ ```shell
262
+ // docs项目(文档demo示例)基于vue3+vite项目
263
+ npm run docs:dev
264
+
265
+ ```
@@ -0,0 +1,162 @@
1
+ // @see: https://cz-git.qbenben.com/zh/guide
2
+ const fs = require("fs");
3
+ const path = require("path");
4
+
5
+ const scopes = fs
6
+ .readdirSync(path.resolve(__dirname, "src"), { withFileTypes: true })
7
+ .filter(dirent => dirent.isDirectory())
8
+ .map(dirent => dirent.name.replace(/s$/, ""));
9
+
10
+ /** @type {import('cz-git').UserConfig} */
11
+ module.exports = {
12
+ ignores: [commit => commit.includes("init")],
13
+ extends: ["@commitlint/config-conventional"],
14
+ rules: {
15
+ // @see: https://commitlint.js.org/#/reference-rules
16
+ "body-leading-blank": [2, "always"],
17
+ "footer-leading-blank": [1, "always"],
18
+ "header-max-length": [2, "always", 108],
19
+ "subject-empty": [2, "never"],
20
+ "type-empty": [2, "never"],
21
+ "subject-case": [0],
22
+ "type-enum": [
23
+ 2,
24
+ "always",
25
+ [
26
+ "feat",
27
+ "fix",
28
+ "docs",
29
+ "style",
30
+ "refactor",
31
+ "perf",
32
+ "test",
33
+ "build",
34
+ "ci",
35
+ "chore",
36
+ "revert",
37
+ "wip",
38
+ "workflow",
39
+ "types",
40
+ "release"
41
+ ]
42
+ ]
43
+ },
44
+ prompt: {
45
+ messages: {
46
+ type: "Select the type of change that you're committing:",
47
+ scope: "Denote the SCOPE of this change (optional):",
48
+ customScope: "Denote the SCOPE of this change:",
49
+ subject: "Write a SHORT, IMPERATIVE tense description of the change:\n",
50
+ body: 'Provide a LONGER description of the change (optional). Use "|" to break new line:\n',
51
+ breaking: 'List any BREAKING CHANGES (optional). Use "|" to break new line:\n',
52
+ footerPrefixsSelect: "Select the ISSUES type of changeList by this change (optional):",
53
+ customFooterPrefixs: "Input ISSUES prefix:",
54
+ footer: "List any ISSUES by this change. E.g.: #31, #34:\n",
55
+ confirmCommit: "Are you sure you want to proceed with the commit above?"
56
+ // 中文版
57
+ // type: "选择你要提交的类型 :",
58
+ // scope: "选择一个提交范围(可选):",
59
+ // customScope: "请输入自定义的提交范围 :",
60
+ // subject: "填写简短精炼的变更描述 :\n",
61
+ // body: '填写更加详细的变更描述(可选)。使用 "|" 换行 :\n',
62
+ // breaking: '列举非兼容性重大的变更(可选)。使用 "|" 换行 :\n',
63
+ // footerPrefixsSelect: "选择关联issue前缀(可选):",
64
+ // customFooterPrefixs: "输入自定义issue前缀 :",
65
+ // footer: "列举关联issue (可选) 例如: #31, #I3244 :\n",
66
+ // confirmCommit: "是否提交或修改commit ?"
67
+ },
68
+ types: [
69
+ {
70
+ value: "feat",
71
+ name: "feat: 🚀 A new feature",
72
+ emoji: "🚀"
73
+ },
74
+ {
75
+ value: "fix",
76
+ name: "fix: 🧩 A bug fix",
77
+ emoji: "🧩"
78
+ },
79
+ {
80
+ value: "docs",
81
+ name: "docs: 📚 Documentation only changes",
82
+ emoji: "📚"
83
+ },
84
+ {
85
+ value: "style",
86
+ name: "style: 🎨 Changes that do not affect the meaning of the code",
87
+ emoji: "🎨"
88
+ },
89
+ {
90
+ value: "refactor",
91
+ name: "refactor: ♻️ A code change that neither fixes a bug nor adds a feature",
92
+ emoji: "♻️"
93
+ },
94
+ {
95
+ value: "perf",
96
+ name: "perf: ⚡️ A code change that improves performance",
97
+ emoji: "⚡️"
98
+ },
99
+ {
100
+ value: "test",
101
+ name: "test: ✅ Adding missing tests or correcting existing tests",
102
+ emoji: "✅"
103
+ },
104
+ {
105
+ value: "build",
106
+ name: "build: 📦️ Changes that affect the build system or external dependencies",
107
+ emoji: "📦️"
108
+ },
109
+ {
110
+ value: "ci",
111
+ name: "ci: 🎡 Changes to our CI configuration files and scripts",
112
+ emoji: "🎡"
113
+ },
114
+ {
115
+ value: "chore",
116
+ name: "chore: 🔨 Other changes that don't modify src or test files",
117
+ emoji: "🔨"
118
+ },
119
+ {
120
+ value: "revert",
121
+ name: "revert: ⏪️ Reverts a previous commit",
122
+ emoji: "⏪️"
123
+ },
124
+ {
125
+ value: "wip",
126
+ name: "wip: 🕔 work in process",
127
+ emoji: "🕔"
128
+ },
129
+ {
130
+ value: "workflow",
131
+ name: "workflow: 📋 workflow improvements",
132
+ emoji: "📋"
133
+ },
134
+ {
135
+ value: "type",
136
+ name: "type: 🔰 type definition file changes",
137
+ emoji: "🔰"
138
+ }
139
+ // 中文版
140
+ // { value: "feat", name: "特性: 🚀 新增功能", emoji: "🚀" },
141
+ // { value: "fix", name: "修复: 🧩 修复缺陷", emoji: "🧩" },
142
+ // { value: "docs", name: "文档: 📚 文档变更", emoji: "📚" },
143
+ // { value: "style", name: "格式: 🎨 代码格式(不影响功能,例如空格、分号等格式修正)", emoji: "🎨" },
144
+ // { value: "refactor", name: "重构: ♻️ 代码重构(不包括 bug 修复、功能新增)", emoji: "♻️" },
145
+ // { value: "perf", name: "性能: ⚡️ 性能优化", emoji: "⚡️" },
146
+ // { value: "test", name: "测试: ✅ 添加疏漏测试或已有测试改动", emoji: "✅" },
147
+ // { value: "build", name: "构建: 📦️ 构建流程、外部依赖变更(如升级 npm 包、修改 webpack 配置等)", emoji: "📦️" },
148
+ // { value: "ci", name: "集成: 🎡 修改 CI 配置、脚本", emoji: "🎡" },
149
+ // { value: "chore", name: "回退: ⏪️ 回滚 commit", emoji: "⏪️" },
150
+ // { value: "revert", name: "其他: 🔨 对构建过程或辅助工具和库的更改(不影响源文件、测试用例)", emoji: "🔨" },
151
+ // { value: "wip", name: "开发: 🕔 正在开发中", emoji: "🕔" },
152
+ // { value: "workflow", name: "工作流: 📋 工作流程改进", emoji: "📋" },
153
+ // { value: "types", name: "类型: 🔰 类型定义文件修改", emoji: "🔰" }
154
+ ],
155
+ useEmoji: true,
156
+ scopes: [...scopes],
157
+ customScopesAlign: "bottom",
158
+ emptyScopesAlias: "empty",
159
+ customScopesAlias: "custom",
160
+ allowBreakingChanges: ["feat", "fix"]
161
+ }
162
+ };
package/global.d.ts ADDED
@@ -0,0 +1,27 @@
1
+ // GlobalComponents for Volar
2
+ declare module "@vue/runtime-core" {
3
+ export interface GlobalComponents {
4
+ TLayoutPage: typeof import("ff-ui-plus")["TLayoutPage"]
5
+ TLayoutPageItem: typeof import("ff-ui-plus")["TLayoutPageItem"]
6
+ TQueryCondition: typeof import("ff-ui-plus")["TQueryCondition"]
7
+ TTable: typeof import("ff-ui-plus")["TTable"]
8
+ TForm: typeof import("ff-ui-plus")["TForm"]
9
+ TSelect: typeof import("ff-ui-plus")["TSelect"]
10
+ TSelectTable: typeof import("ff-ui-plus")["TSelectTable"]
11
+ TDetail: typeof import("ff-ui-plus")["TDetail"]
12
+ TButton: typeof import("ff-ui-plus")["TButton"]
13
+ TStepWizard: typeof import("ff-ui-plus")["TStepWizard"]
14
+ TTimerBtn: typeof import("ff-ui-plus")["TTimerBtn"]
15
+ TModuleForm: typeof import("ff-ui-plus")["TModuleForm"]
16
+ TAdaptivePage: typeof import("ff-ui-plus")["TAdaptivePage"]
17
+ TDatePicker: typeof import("ff-ui-plus")["TDatePicker"]
18
+ TChart: typeof import("ff-ui-plus")["TChart"]
19
+ TCheckbox: typeof import("ff-ui-plus")["TCheckbox"]
20
+ FFInput: typeof import("ff-ui-plus")["FFInput"]
21
+ TRadio: typeof import("ff-ui-plus")["TRadio"]
22
+ TSelectIcon: typeof import("ff-ui-plus")["TSelectIcon"]
23
+ TTabs: typeof import("ff-ui-plus")["TTabs"]
24
+ }
25
+ }
26
+
27
+ export {}
package/index.html ADDED
@@ -0,0 +1,16 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="UTF-8" />
6
+ <link rel="icon" type="image/svg+xml" href="/favicon.ico" />
7
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
8
+ <title>Vue3 中基于Element-plus二次封装基础组件文档</title>
9
+ </head>
10
+
11
+ <body>
12
+ <div id="app"></div>
13
+ <!-- <script type="module" src="/examples/main.ts"></script> -->
14
+ </body>
15
+
16
+ </html>
package/lib.sh ADDED
@@ -0,0 +1,9 @@
1
+ set -e
2
+
3
+ cd dist/ff-ui-plus
4
+
5
+ npm publish --registry=https://registry.npmjs.org/
6
+
7
+ echo "Successfully published ff-ui-plus"
8
+
9
+ cd -
@@ -0,0 +1,8 @@
1
+ module.exports = {
2
+ "*.{js,jsx,ts,tsx}": ["eslint --fix", "prettier --write"],
3
+ "{!(package)*.json,*.code-snippets,.!(browserslist)*rc}": ["prettier --write--parser json"],
4
+ "package.json": ["prettier --write"],
5
+ "*.vue": ["eslint --fix", "prettier --write", "stylelint --fix"],
6
+ "*.{scss,less,styl,html}": ["stylelint --fix", "prettier --write"],
7
+ "*.md": ["prettier --write"]
8
+ };