vue-amazing-ui 2.3.1 → 2.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 (295) hide show
  1. package/README.md +289 -289
  2. package/README.zh-CN.md +288 -288
  3. package/dist/index.iife.js +59 -59
  4. package/dist/index.js +1685 -1685
  5. package/dist/index.umd.cjs +51 -51
  6. package/dist/style.css +1 -1
  7. package/es/alert/Alert.css +1 -1
  8. package/es/alert/Alert.vue.js +2 -2
  9. package/es/avatar/Avatar.css +1 -1
  10. package/es/avatar/Avatar.vue.js +2 -2
  11. package/es/backtop/BackTop.css +1 -1
  12. package/es/backtop/BackTop.vue.js +2 -2
  13. package/es/badge/Badge.css +1 -1
  14. package/es/badge/Badge.vue.js +2 -2
  15. package/es/breadcrumb/Breadcrumb.css +1 -1
  16. package/es/breadcrumb/Breadcrumb.vue.js +2 -2
  17. package/es/button/Button.css +1 -1
  18. package/es/button/Button.d.ts +2 -2
  19. package/es/button/Button.vue.js +2 -2
  20. package/es/button/Button.vue2.js +38 -37
  21. package/es/button/index.d.ts +3 -3
  22. package/es/calendar/Calendar.css +1 -1
  23. package/es/calendar/Calendar.vue.js +3 -3
  24. package/es/card/Card.css +1 -1
  25. package/es/card/Card.vue.js +3 -3
  26. package/es/carousel/Carousel.css +1 -1
  27. package/es/carousel/Carousel.vue.js +2 -2
  28. package/es/cascader/Cascader.css +1 -1
  29. package/es/cascader/Cascader.vue.js +2 -2
  30. package/es/checkbox/Checkbox.css +1 -1
  31. package/es/checkbox/Checkbox.vue.js +2 -2
  32. package/es/collapse/Collapse.css +1 -1
  33. package/es/collapse/Collapse.vue.js +2 -2
  34. package/es/colorpicker/ColorPicker.css +1 -1
  35. package/es/colorpicker/ColorPicker.vue.js +2 -2
  36. package/es/countdown/Countdown.css +1 -1
  37. package/es/countdown/Countdown.vue.js +2 -2
  38. package/es/datepicker/DatePicker.css +1 -1
  39. package/es/datepicker/DatePicker.vue.js +1 -1
  40. package/es/descriptions/descriptions/Descriptions.css +1 -1
  41. package/es/descriptions/descriptions/Descriptions.vue.js +2 -2
  42. package/es/descriptions/descriptionsitem/DescriptionsItem.css +1 -1
  43. package/es/descriptions/descriptionsitem/DescriptionsItem.vue.js +2 -2
  44. package/es/dialog/Dialog.css +1 -1
  45. package/es/dialog/Dialog.vue.js +2 -2
  46. package/es/divider/Divider.css +1 -1
  47. package/es/divider/Divider.vue.js +2 -2
  48. package/es/drawer/Drawer.css +1 -1
  49. package/es/drawer/Drawer.vue.js +2 -2
  50. package/es/ellipsis/Ellipsis.css +1 -1
  51. package/es/ellipsis/Ellipsis.vue.js +1 -1
  52. package/es/empty/Empty.css +1 -1
  53. package/es/empty/Empty.vue.js +2 -2
  54. package/es/empty/Empty.vue2.js +13 -13
  55. package/es/flex/Flex.css +1 -1
  56. package/es/flex/Flex.vue.js +2 -2
  57. package/es/floatbutton/FloatButton.css +1 -1
  58. package/es/floatbutton/FloatButton.vue.js +2 -2
  59. package/es/gradienttext/GradientText.css +1 -1
  60. package/es/gradienttext/GradientText.vue.js +2 -2
  61. package/es/grid/col/Col.css +1 -1
  62. package/es/grid/col/Col.vue.js +2 -2
  63. package/es/grid/row/Row.css +1 -1
  64. package/es/grid/row/Row.vue.js +1 -1
  65. package/es/image/Image.css +1 -1
  66. package/es/image/Image.vue.js +2 -2
  67. package/es/input/Input.css +1 -1
  68. package/es/input/Input.vue.js +2 -2
  69. package/es/inputnumber/InputNumber.css +1 -1
  70. package/es/inputnumber/InputNumber.vue.js +2 -2
  71. package/es/inputsearch/InputSearch.css +1 -1
  72. package/es/inputsearch/InputSearch.vue.js +2 -2
  73. package/es/list/list/List.css +1 -1
  74. package/es/list/list/List.vue.js +2 -2
  75. package/es/list/listitem/ListItem.css +1 -1
  76. package/es/list/listitem/ListItem.vue.js +2 -2
  77. package/es/loadingbar/LoadingBar.css +1 -1
  78. package/es/loadingbar/LoadingBar.vue.js +2 -2
  79. package/es/message/Message.css +1 -1
  80. package/es/message/Message.vue.js +2 -2
  81. package/es/modal/Modal.css +1 -1
  82. package/es/modal/Modal.vue.js +2 -2
  83. package/es/notification/Notification.css +1 -1
  84. package/es/notification/Notification.vue.js +2 -2
  85. package/es/pagination/Pagination.css +1 -1
  86. package/es/pagination/Pagination.vue.js +2 -2
  87. package/es/popconfirm/Popconfirm.css +1 -1
  88. package/es/popconfirm/Popconfirm.vue.js +2 -2
  89. package/es/popover/Popover.css +1 -1
  90. package/es/popover/Popover.vue.js +1 -1
  91. package/es/progress/Progress.css +1 -1
  92. package/es/progress/Progress.vue.js +2 -2
  93. package/es/progress/Progress.vue2.js +52 -52
  94. package/es/qrcode/QRCode.css +1 -1
  95. package/es/qrcode/QRCode.vue.js +1 -1
  96. package/es/radio/Radio.css +1 -1
  97. package/es/radio/Radio.vue.js +1 -1
  98. package/es/rate/Rate.css +1 -1
  99. package/es/rate/Rate.vue.js +1 -1
  100. package/es/result/Result.css +1 -1
  101. package/es/result/Result.vue.js +2 -2
  102. package/es/result/Result.vue2.js +49 -49
  103. package/es/scrollbar/Scrollbar.css +1 -1
  104. package/es/scrollbar/Scrollbar.vue.js +1 -1
  105. package/es/segmented/Segmented.css +1 -1
  106. package/es/segmented/Segmented.vue.js +2 -2
  107. package/es/select/Select.css +1 -1
  108. package/es/select/Select.vue.js +2 -2
  109. package/es/skeleton/Skeleton.css +1 -1
  110. package/es/skeleton/Skeleton.vue.js +2 -2
  111. package/es/slider/Slider.css +1 -1
  112. package/es/slider/Slider.vue.js +2 -2
  113. package/es/space/Space.css +1 -1
  114. package/es/space/Space.vue.js +3 -3
  115. package/es/spin/Spin.css +1 -1
  116. package/es/spin/Spin.vue.js +2 -2
  117. package/es/spin/Spin.vue2.js +16 -16
  118. package/es/statistic/Statistic.css +1 -1
  119. package/es/statistic/Statistic.vue.js +2 -2
  120. package/es/steps/Steps.css +1 -1
  121. package/es/steps/Steps.vue.js +2 -2
  122. package/es/swiper/Swiper.css +1 -1
  123. package/es/swiper/Swiper.vue.js +1 -1
  124. package/es/switch/Switch.css +1 -1
  125. package/es/switch/Switch.d.ts +1 -1
  126. package/es/switch/Switch.vue.js +2 -2
  127. package/es/switch/index.d.ts +3 -3
  128. package/es/table/Table.css +1 -1
  129. package/es/table/Table.vue.js +2 -2
  130. package/es/tabs/Tabs.css +1 -1
  131. package/es/tabs/Tabs.vue.js +2 -2
  132. package/es/tag/Tag.css +1 -1
  133. package/es/tag/Tag.vue.js +1 -1
  134. package/es/textarea/Textarea.css +1 -1
  135. package/es/textarea/Textarea.vue.js +2 -2
  136. package/es/textscroll/TextScroll.css +1 -1
  137. package/es/textscroll/TextScroll.vue.js +2 -2
  138. package/es/timeline/Timeline.css +1 -1
  139. package/es/timeline/Timeline.vue.js +2 -2
  140. package/es/tooltip/Tooltip.css +1 -1
  141. package/es/tooltip/Tooltip.vue.js +2 -2
  142. package/es/upload/Upload.css +1 -1
  143. package/es/upload/Upload.vue.js +2 -2
  144. package/es/utils/index.d.ts +2 -0
  145. package/es/utils/index.js +2 -0
  146. package/es/video/Video.css +1 -1
  147. package/es/video/Video.vue.js +1 -1
  148. package/es/video/Video.vue2.js +1 -1
  149. package/es/waterfall/Waterfall.css +1 -1
  150. package/es/waterfall/Waterfall.vue.js +4 -4
  151. package/lib/alert/Alert.css +1 -1
  152. package/lib/alert/Alert.vue.cjs +1 -1
  153. package/lib/avatar/Avatar.css +1 -1
  154. package/lib/avatar/Avatar.vue.cjs +1 -1
  155. package/lib/backtop/BackTop.css +1 -1
  156. package/lib/backtop/BackTop.vue.cjs +1 -1
  157. package/lib/badge/Badge.css +1 -1
  158. package/lib/badge/Badge.vue.cjs +1 -1
  159. package/lib/breadcrumb/Breadcrumb.css +1 -1
  160. package/lib/breadcrumb/Breadcrumb.vue.cjs +1 -1
  161. package/lib/button/Button.css +1 -1
  162. package/lib/button/Button.d.ts +2 -2
  163. package/lib/button/Button.vue.cjs +1 -1
  164. package/lib/button/Button.vue2.cjs +6 -6
  165. package/lib/button/index.d.ts +3 -3
  166. package/lib/calendar/Calendar.css +1 -1
  167. package/lib/calendar/Calendar.vue.cjs +1 -1
  168. package/lib/card/Card.css +1 -1
  169. package/lib/card/Card.vue.cjs +1 -1
  170. package/lib/carousel/Carousel.css +1 -1
  171. package/lib/carousel/Carousel.vue.cjs +1 -1
  172. package/lib/cascader/Cascader.css +1 -1
  173. package/lib/cascader/Cascader.vue.cjs +1 -1
  174. package/lib/checkbox/Checkbox.css +1 -1
  175. package/lib/checkbox/Checkbox.vue.cjs +1 -1
  176. package/lib/collapse/Collapse.css +1 -1
  177. package/lib/collapse/Collapse.vue.cjs +1 -1
  178. package/lib/colorpicker/ColorPicker.css +1 -1
  179. package/lib/colorpicker/ColorPicker.vue.cjs +1 -1
  180. package/lib/countdown/Countdown.css +1 -1
  181. package/lib/countdown/Countdown.vue.cjs +1 -1
  182. package/lib/datepicker/DatePicker.css +1 -1
  183. package/lib/datepicker/DatePicker.vue.cjs +1 -1
  184. package/lib/descriptions/descriptions/Descriptions.css +1 -1
  185. package/lib/descriptions/descriptions/Descriptions.vue.cjs +1 -1
  186. package/lib/descriptions/descriptionsitem/DescriptionsItem.css +1 -1
  187. package/lib/descriptions/descriptionsitem/DescriptionsItem.vue.cjs +1 -1
  188. package/lib/dialog/Dialog.css +1 -1
  189. package/lib/dialog/Dialog.vue.cjs +1 -1
  190. package/lib/divider/Divider.css +1 -1
  191. package/lib/divider/Divider.vue.cjs +1 -1
  192. package/lib/drawer/Drawer.css +1 -1
  193. package/lib/drawer/Drawer.vue.cjs +1 -1
  194. package/lib/ellipsis/Ellipsis.css +1 -1
  195. package/lib/ellipsis/Ellipsis.vue.cjs +1 -1
  196. package/lib/empty/Empty.css +1 -1
  197. package/lib/empty/Empty.vue.cjs +1 -1
  198. package/lib/empty/Empty.vue2.cjs +1 -1
  199. package/lib/flex/Flex.css +1 -1
  200. package/lib/flex/Flex.vue.cjs +1 -1
  201. package/lib/floatbutton/FloatButton.css +1 -1
  202. package/lib/floatbutton/FloatButton.vue.cjs +1 -1
  203. package/lib/gradienttext/GradientText.css +1 -1
  204. package/lib/gradienttext/GradientText.vue.cjs +1 -1
  205. package/lib/grid/col/Col.css +1 -1
  206. package/lib/grid/col/Col.vue.cjs +1 -1
  207. package/lib/grid/row/Row.css +1 -1
  208. package/lib/grid/row/Row.vue.cjs +1 -1
  209. package/lib/image/Image.css +1 -1
  210. package/lib/image/Image.vue.cjs +1 -1
  211. package/lib/input/Input.css +1 -1
  212. package/lib/input/Input.vue.cjs +1 -1
  213. package/lib/inputnumber/InputNumber.css +1 -1
  214. package/lib/inputnumber/InputNumber.vue.cjs +1 -1
  215. package/lib/inputsearch/InputSearch.css +1 -1
  216. package/lib/inputsearch/InputSearch.vue.cjs +1 -1
  217. package/lib/list/list/List.css +1 -1
  218. package/lib/list/list/List.vue.cjs +1 -1
  219. package/lib/list/listitem/ListItem.css +1 -1
  220. package/lib/list/listitem/ListItem.vue.cjs +1 -1
  221. package/lib/loadingbar/LoadingBar.css +1 -1
  222. package/lib/loadingbar/LoadingBar.vue.cjs +1 -1
  223. package/lib/message/Message.css +1 -1
  224. package/lib/message/Message.vue.cjs +1 -1
  225. package/lib/modal/Modal.css +1 -1
  226. package/lib/modal/Modal.vue.cjs +1 -1
  227. package/lib/notification/Notification.css +1 -1
  228. package/lib/notification/Notification.vue.cjs +1 -1
  229. package/lib/pagination/Pagination.css +1 -1
  230. package/lib/pagination/Pagination.vue.cjs +1 -1
  231. package/lib/popconfirm/Popconfirm.css +1 -1
  232. package/lib/popconfirm/Popconfirm.vue.cjs +1 -1
  233. package/lib/popover/Popover.css +1 -1
  234. package/lib/popover/Popover.vue.cjs +1 -1
  235. package/lib/progress/Progress.css +1 -1
  236. package/lib/progress/Progress.vue.cjs +1 -1
  237. package/lib/progress/Progress.vue2.cjs +10 -10
  238. package/lib/qrcode/QRCode.css +1 -1
  239. package/lib/qrcode/QRCode.vue.cjs +1 -1
  240. package/lib/radio/Radio.css +1 -1
  241. package/lib/radio/Radio.vue.cjs +1 -1
  242. package/lib/rate/Rate.css +1 -1
  243. package/lib/rate/Rate.vue.cjs +1 -1
  244. package/lib/result/Result.css +1 -1
  245. package/lib/result/Result.vue.cjs +1 -1
  246. package/lib/result/Result.vue2.cjs +1 -1
  247. package/lib/scrollbar/Scrollbar.css +1 -1
  248. package/lib/scrollbar/Scrollbar.vue.cjs +1 -1
  249. package/lib/segmented/Segmented.css +1 -1
  250. package/lib/segmented/Segmented.vue.cjs +1 -1
  251. package/lib/select/Select.css +1 -1
  252. package/lib/select/Select.vue.cjs +1 -1
  253. package/lib/skeleton/Skeleton.css +1 -1
  254. package/lib/skeleton/Skeleton.vue.cjs +1 -1
  255. package/lib/slider/Slider.css +1 -1
  256. package/lib/slider/Slider.vue.cjs +1 -1
  257. package/lib/space/Space.css +1 -1
  258. package/lib/space/Space.vue.cjs +1 -1
  259. package/lib/spin/Spin.css +1 -1
  260. package/lib/spin/Spin.vue.cjs +1 -1
  261. package/lib/spin/Spin.vue2.cjs +3 -3
  262. package/lib/statistic/Statistic.css +1 -1
  263. package/lib/statistic/Statistic.vue.cjs +1 -1
  264. package/lib/steps/Steps.css +1 -1
  265. package/lib/steps/Steps.vue.cjs +1 -1
  266. package/lib/swiper/Swiper.css +1 -1
  267. package/lib/swiper/Swiper.vue.cjs +1 -1
  268. package/lib/switch/Switch.css +1 -1
  269. package/lib/switch/Switch.d.ts +1 -1
  270. package/lib/switch/Switch.vue.cjs +1 -1
  271. package/lib/switch/index.d.ts +3 -3
  272. package/lib/table/Table.css +1 -1
  273. package/lib/table/Table.vue.cjs +1 -1
  274. package/lib/tabs/Tabs.css +1 -1
  275. package/lib/tabs/Tabs.vue.cjs +1 -1
  276. package/lib/tag/Tag.css +1 -1
  277. package/lib/tag/Tag.vue.cjs +1 -1
  278. package/lib/textarea/Textarea.css +1 -1
  279. package/lib/textarea/Textarea.vue.cjs +1 -1
  280. package/lib/textscroll/TextScroll.css +1 -1
  281. package/lib/textscroll/TextScroll.vue.cjs +1 -1
  282. package/lib/timeline/Timeline.css +1 -1
  283. package/lib/timeline/Timeline.vue.cjs +1 -1
  284. package/lib/tooltip/Tooltip.css +1 -1
  285. package/lib/tooltip/Tooltip.vue.cjs +1 -1
  286. package/lib/upload/Upload.css +1 -1
  287. package/lib/upload/Upload.vue.cjs +1 -1
  288. package/lib/utils/index.cjs +1 -1
  289. package/lib/utils/index.d.ts +2 -0
  290. package/lib/video/Video.css +1 -1
  291. package/lib/video/Video.vue.cjs +1 -1
  292. package/lib/video/Video.vue2.cjs +1 -1
  293. package/lib/waterfall/Waterfall.css +1 -1
  294. package/lib/waterfall/Waterfall.vue.cjs +1 -1
  295. package/package.json +4 -4
package/README.md CHANGED
@@ -1,289 +1,289 @@
1
- <p align="center">
2
- <a href="https://themusecatcher.github.io/vue-amazing-ui/">
3
- <img width="200" src="https://themusecatcher.github.io/vue-amazing-ui/amazing-logo.svg">
4
- </a>
5
- </p>
6
-
7
- <h1 align="center">Vue Amazing UI</h1>
8
- <p align="center">A Vue 3 Component Library</p>
9
- <p align="center">Theme Customizable, Fully using TypeScript and SFC, Supports tree shaking.</p>
10
- <p align="center">Kinda Interesting</p>
11
- <p align="center">English | <a href="README.zh-CN.md">中文</a></p>
12
-
13
- ## Documentation
14
-
15
- [Vue Amazing UI](https://themusecatcher.github.io/vue-amazing-ui/)
16
-
17
- ## Features
18
-
19
- - The component library is implemented with `Vue@3.5.13`+ `TypeScript@5.8.2` + `Vite@6.2.1` + `Less@4.2.2`.
20
- - Currently, it includes `66` basic UI components and `17` utility functions, with continuous exploration and updates ongoing...
21
- - What's more, they are all treeshakable.
22
- - Theme Customizable, all you need is to provide a theme color, then all the stuffs will be done by me.
23
- - All the stuff in Vue Amazing UI is written in TypeScript. It can work with your typescript project seamlessly.
24
- - All components are built in single file component `SFC` and can be used independently.
25
- - Ready to use out of the box, no fuss.
26
-
27
- ## Installation
28
-
29
- ```sh
30
- pnpm add vue-amazing-ui
31
- # or
32
- npm install vue-amazing-ui
33
- # or
34
- yarn add vue-amazing-ui
35
- # or
36
- bun add vue-amazing-ui
37
- ```
38
-
39
- ## Use Components
40
-
41
- **Global Registration All Components (Not Recommended)**
42
-
43
- *No tree-shaking. Bundle will have redundant codes.*
44
-
45
- ```ts
46
- import { createApp } from 'vue'
47
- import App from './App.vue'
48
- import VueAmazingUI from 'vue-amazing-ui'
49
- import 'vue-amazing-ui/css'
50
-
51
- const app = createApp(App)
52
- app.use(VueAmazingUI)
53
- app.mount('#app')
54
- ```
55
-
56
- **Global Partial Registration**
57
-
58
- *In this form, only the imported components will be bundled.*
59
-
60
- ```ts
61
- import { createApp } from 'vue'
62
- import App from './App.vue'
63
- import { Button, Tag } from 'vue-amazing-ui'
64
- import 'vue-amazing-ui/es/button/Button.css'
65
- import 'vue-amazing-ui/es/tag/Tag.css'
66
-
67
- const app = createApp(App)
68
- app.use(Button).use(Tag)
69
- app.mount('#app')
70
- ```
71
-
72
- **Local Registration**
73
-
74
- *In this form, only the imported components will be bundled as well.*
75
-
76
- ```vue
77
- <script setup lang="ts">
78
- import { Button, Tag } from 'vue-amazing-ui'
79
- import 'vue-amazing-ui/es/button/Button.css'
80
- import 'vue-amazing-ui/es/tag/Tag.css'
81
- </script>
82
- <template>
83
- <Button>button</Button>
84
- <Tag>tag</Tag>
85
- </template>
86
- ```
87
-
88
- **Both Global Partial Registration and Local Registration require manually importing the global default styles of the component library ([Automatic On-Demand Import](https://themusecatcher.github.io/vue-amazing-ui/guide/ondemand.html#%E8%87%AA%E5%8A%A8%E6%8C%89%E9%9C%80%E5%BC%95%E5%85%A5-%E5%BC%BA%E7%83%88%E6%8E%A8%E8%8D%90) is recommended).**
89
-
90
- ```ts
91
- import { createApp } from 'vue'
92
- import App from './App.vue'
93
- import 'vue-amazing-ui/es/style/global.css' // 引入全局默认样式
94
-
95
- const app = createApp(App)
96
- app.mount('#app')
97
- ```
98
-
99
- **Automatic On-Demand Import (Strongly Recommended)**
100
-
101
- Use the [`unplugin-vue-components`](https://github.com/unplugin/unplugin-vue-components) plugin to automatically import components on demand. The plugin will automatically parse the components used in the template and import the components and styles.
102
-
103
- ```sh
104
- pnpm add unplugin-vue-components -D
105
- # or
106
- npm install unplugin-vue-components -D
107
- # or
108
- yarn add unplugin-vue-components -D
109
- # or
110
- bun add unplugin-vue-components -D
111
- ```
112
-
113
- ```ts
114
- // vite.config.ts
115
- import { defineConfig } from 'vite'
116
- import vue from '@vitejs/plugin-vue'
117
- import Components from 'unplugin-vue-components/vite'
118
- // vue-amazing-ui on-demand import
119
- import { VueAmazingUIResolver } from 'vue-amazing-ui'
120
-
121
- // https://vitejs.dev/config/
122
- export default defineConfig({
123
- plugins: [
124
- vue(),
125
- Components({
126
- resolvers: [
127
- // auto import components from VueAmazingUI
128
- VueAmazingUIResolver({
129
- cjs: false // whether use commonjs build, default false
130
- })
131
- ]
132
- })
133
- ]
134
- })
135
- ```
136
-
137
- Then, you can directly use all components from `vue-amazing-ui` in your code.
138
-
139
- ```vue
140
- <template>
141
- <Button>button</Button>
142
- <Tag>tag</Tag>
143
- </template>
144
- ```
145
-
146
- ## Use Types
147
-
148
- *All types can be directly imported and used from `vue-amazing-ui` without any additional installation.*
149
-
150
- ```vue
151
- <script setup lang="ts">
152
- import { ref } from 'vue'
153
- import type { ButtonProps } from 'vue-amazing-ui'
154
- const shape = ref<ButtonProps['shape']>('default')
155
- </script>
156
- <template>
157
- <Button :shape="shape">button</Button>
158
- </template>
159
- ```
160
-
161
- ## Use Functions
162
-
163
- ```vue
164
- <script setup lang="ts">
165
- import {
166
- dateFormat,
167
- formatNumber,
168
- rafTimeout,
169
- cancelRaf,
170
- throttle,
171
- debounce,
172
- add,
173
- downloadFile,
174
- toggleDark,
175
- useEventListener,
176
- useMutationObserver,
177
- useScroll,
178
- useFps,
179
- useMediaQuery,
180
- useResizeObserver,
181
- useSlotsExist,
182
- useInject
183
- } from 'vue-amazing-ui'
184
- </script>
185
- ```
186
-
187
- ## Project
188
-
189
- - Get the project code
190
-
191
- ```sh
192
- git clone https://github.com/themusecatcher/vue-amazing-ui.git
193
- ```
194
-
195
- - Install dependencies
196
-
197
- ```sh
198
- cd vue-amazing-ui
199
-
200
- pnpm i
201
- ```
202
-
203
- - Run project
204
-
205
- ```sh
206
- pnpm dev
207
- ```
208
-
209
- - Run docs
210
-
211
- ```sh
212
- docs:dev
213
- ```
214
-
215
- ## Blogs
216
-
217
- [My CSDN Blogs](https://blog.csdn.net/Dandrose)
218
-
219
- ## Sponsorship
220
-
221
- `Vue Amazing UI` is an open-source project licensed under the `MIT` license, and it is completely free to use. All work on the component library and documentation is completed by the author alone, and the development and iteration process has been challenging. For the healthy and sustainable development of the component library, your support and sponsorship are greatly appreciated.
222
-
223
- #### [Become a Sponsor](https://themusecatcher.github.io/vue-amazing-ui/sponsor/charge.html)
224
-
225
- ## Sponsors 🫡
226
-
227
- All sponsors will be listed here, thank you very much for your support and sponsorship ❤️
228
-
229
- <a href="https://github.com/themusecatcher" target="_blank"><img width="64" height="64" src="./docs/public/avatar.png" alt="GitHub@themusecatcher" title="GitHub@themusecatcher"></a> <img width="64" height="64" src="./docs/public/avatar_1.jpeg" alt="WeChat@Ant" title="WeChat@Ant" /> <a href="https://github.com/nizhensh-i" target="_blank"><img width="64" height="64" src="./docs/public/avatar_2.jpg" alt="GitHub@nizhensh-i" title="GitHub@nizhensh-i"></a> <a href="https://github.com/beijin1949" target="_blank"><img width="64" height="64" src="./docs/public/avatar_3.png" alt="GitHub@beijin1949" title="GitHub@beijin1949"></a>
230
-
231
- ## Components
232
-
233
- Name | Description | Name | Description
234
- :-- | :-- | :-- | :--
235
- Alert | 警告提示 | Avatar | 头像
236
- BackTop | 回到顶部 | Badge | 徽标
237
- Breadcrumb | 面包屑 | Button | 按钮
238
- Calendar | 日历 | Card | 卡片
239
- Carousel | 轮播图 | Cascader | 级联选择
240
- Checkbox | 复选框 | Collapse | 折叠面板
241
- ColorPicker | 颜色选择器 | ConfigProvider | 全局化配置
242
- Countdown | 倒计时 | DatePicker | 日期选择器
243
- Descriptions | 描述列表 | Dialog | 对话框
244
- Divider | 分割线 | Drawer | 抽屉
245
- Ellipsis | 文本省略 | Empty | 空状态
246
- Flex | 弹性布局 | FloatButton | 浮动按钮
247
- GradientText | 渐变文字 | Grid | 栅格
248
- Image | 图片 | Input | 输入框
249
- InputNumber | 数字输入框 | InputSearch | 搜索框
250
- List | 列表 | LoadingBar | 加载条
251
- Message | 全局提示 | Modal | 模态框
252
- Notification | 通知提醒 | NumberAnimation | 数值动画
253
- Pagination | 分页 | Popconfirm | 弹出确认
254
- Popover | 气泡卡片 | Progress | 进度条
255
- QRCode | 二维码 | Radio | 单选框
256
- Rate | 评分 | Result | 结果
257
- Scrollbar | 滚动条 | Segmented | 分段控制器
258
- Select | 选择器 | Skeleton | 骨架屏
259
- Slider | 滑动输入条 | Space | 间距
260
- Spin | 加载中 | Statistic | 统计数值
261
- Steps | 步骤条 | Swiper | 触摸滑动插件
262
- Switch | 开关 | Table | 表格
263
- Tabs | 标签页 | Tag | 标签
264
- Textarea | 文本域 | TextScroll | 文字滚动
265
- Timeline | 时间轴 | Tooltip | 文字提示
266
- Upload | 上传 | Video | 播放器
267
- Waterfall | 瀑布流 | Watermark | 水印
268
-
269
- ## Functions
270
-
271
- Name | Description | Type
272
- :-- | :-- | :--
273
- dateFormat | Format date-time string function | (value: number &#124; string &#124; Date = Date.now(), format: string = 'YYYY-MM-DD HH:mm:ss') => string
274
- formatNumber | Number formatting function | (value: number &#124; string, precision: number = 2, separator: string = ',', decimal: string = '.', prefix?: string, suffix?: string) => string
275
- rafTimeout | Function to implement `setTimeout` or `setInterval` using `requestAnimationFrame` | (fn: Function, delay: number = 0, interval: boolean = false) => object
276
- cancelRaf | Function to cancel the `rafTimeout` function | (raf: { id: number }) => void
277
- throttle | Throttle function | (fn: Function, delay: number = 300) => any
278
- debounce | Debounce function | (fn: Function, delay: number = 300) => any
279
- add | Addition function that eliminates precision issues in JavaScript arithmetic | (num1: number, num2: number) => number
280
- downloadFile | Function to download a file with a custom filename; if no filename is provided, it extracts the filename from the URL | (url: string, fileName?: string) => void
281
- toggleDark | Function to toggle dark mode | () => void
282
- useEventListener | Function to add and remove event listeners using Vue lifecycle hooks | (target: HTMLElement &#124; Window &#124; Document, event: string, callback: Function) => void
283
- useMutationObserver | Function to observe changes in DOM elements using `MutationObserver` | (target: Ref &#124; Ref[] &#124; HTMLElement &#124; HTMLElement[], callback: MutationCallback, options = {}) => object
284
- useScroll | Function to monitor the scroll position and state of a target element in real time | (target: Ref &#124; HTMLElement &#124; Window &#124; Document = window, throttleDelay: number = 0, onScroll?: (e: Event) => void, onStop?: (e: Event) => void) => object
285
- useFps | Function to monitor the browser's refresh rate (FPS) in real time | () => object
286
- useMediaQuery | Function to determine if the current environment matches a specified media query condition | (mediaQuery: string) => object
287
- useResizeObserver | Function to observe changes in the dimensions of DOM elements using `ResizeObserver` | (target: Ref &#124; Ref[] &#124; HTMLElement &#124; HTMLElement[], callback: ResizeObserverCallback, options = {}) => object
288
- useSlotsExist | Function to watch for the existence of slots with given names, supporting single slots or an array of slots | (slotsName: string &#124; string[] = 'default') => Reactive &#124; Ref\<boolean>
289
- useInject | A function that uses injection to obtain color palettes and shadow color | (key: string) => { colorPalettes: Ref<string[]>; shadowColor: Ref<string> }
1
+ <p align="center">
2
+ <a href="https://themusecatcher.github.io/vue-amazing-ui/">
3
+ <img width="200" src="https://themusecatcher.github.io/vue-amazing-ui/amazing-logo.svg">
4
+ </a>
5
+ </p>
6
+
7
+ <h1 align="center">Vue Amazing UI</h1>
8
+ <p align="center">A Vue 3 Component Library</p>
9
+ <p align="center">Theme Customizable, Fully using TypeScript and SFC, Supports tree shaking.</p>
10
+ <p align="center">Kinda Interesting</p>
11
+ <p align="center">English | <a href="README.zh-CN.md">中文</a></p>
12
+
13
+ ## Documentation
14
+
15
+ [Vue Amazing UI](https://themusecatcher.github.io/vue-amazing-ui/)
16
+
17
+ ## Features
18
+
19
+ - The component library is implemented with `Vue@3.5.13`+ `TypeScript@5.8.2` + `Vite@6.2.2` + `Less@4.2.2`.
20
+ - Currently, it includes `66` basic UI components and `17` utility functions, with continuous exploration and updates ongoing...
21
+ - What's more, they are all treeshakable.
22
+ - Theme Customizable, all you need is to provide a theme color, then all the stuffs will be done by me.
23
+ - All the stuff in Vue Amazing UI is written in TypeScript. It can work with your typescript project seamlessly.
24
+ - All components are built in single file component `SFC` and can be used independently.
25
+ - Ready to use out of the box, no fuss.
26
+
27
+ ## Installation
28
+
29
+ ```sh
30
+ pnpm add vue-amazing-ui
31
+ # or
32
+ npm install vue-amazing-ui
33
+ # or
34
+ yarn add vue-amazing-ui
35
+ # or
36
+ bun add vue-amazing-ui
37
+ ```
38
+
39
+ ## Use Components
40
+
41
+ **Global Registration All Components (Not Recommended)**
42
+
43
+ *No tree-shaking. Bundle will have redundant codes.*
44
+
45
+ ```ts
46
+ import { createApp } from 'vue'
47
+ import App from './App.vue'
48
+ import VueAmazingUI from 'vue-amazing-ui'
49
+ import 'vue-amazing-ui/css'
50
+
51
+ const app = createApp(App)
52
+ app.use(VueAmazingUI)
53
+ app.mount('#app')
54
+ ```
55
+
56
+ **Global Partial Registration**
57
+
58
+ *In this form, only the imported components will be bundled.*
59
+
60
+ ```ts
61
+ import { createApp } from 'vue'
62
+ import App from './App.vue'
63
+ import { Button, Tag } from 'vue-amazing-ui'
64
+ import 'vue-amazing-ui/es/button/Button.css'
65
+ import 'vue-amazing-ui/es/tag/Tag.css'
66
+
67
+ const app = createApp(App)
68
+ app.use(Button).use(Tag)
69
+ app.mount('#app')
70
+ ```
71
+
72
+ **Local Registration**
73
+
74
+ *In this form, only the imported components will be bundled as well.*
75
+
76
+ ```vue
77
+ <script setup lang="ts">
78
+ import { Button, Tag } from 'vue-amazing-ui'
79
+ import 'vue-amazing-ui/es/button/Button.css'
80
+ import 'vue-amazing-ui/es/tag/Tag.css'
81
+ </script>
82
+ <template>
83
+ <Button>button</Button>
84
+ <Tag>tag</Tag>
85
+ </template>
86
+ ```
87
+
88
+ **Both Global Partial Registration and Local Registration require manually importing the global default styles of the component library ([Automatic On-Demand Import](https://themusecatcher.github.io/vue-amazing-ui/guide/ondemand.html#%E8%87%AA%E5%8A%A8%E6%8C%89%E9%9C%80%E5%BC%95%E5%85%A5-%E5%BC%BA%E7%83%88%E6%8E%A8%E8%8D%90) is recommended).**
89
+
90
+ ```ts
91
+ import { createApp } from 'vue'
92
+ import App from './App.vue'
93
+ import 'vue-amazing-ui/es/style/global.css' // 引入全局默认样式
94
+
95
+ const app = createApp(App)
96
+ app.mount('#app')
97
+ ```
98
+
99
+ **Automatic On-Demand Import (Strongly Recommended)**
100
+
101
+ Use the [`unplugin-vue-components`](https://github.com/unplugin/unplugin-vue-components) plugin to automatically import components on demand. The plugin will automatically parse the components used in the template and import the components and styles.
102
+
103
+ ```sh
104
+ pnpm add unplugin-vue-components -D
105
+ # or
106
+ npm install unplugin-vue-components -D
107
+ # or
108
+ yarn add unplugin-vue-components -D
109
+ # or
110
+ bun add unplugin-vue-components -D
111
+ ```
112
+
113
+ ```ts
114
+ // vite.config.ts
115
+ import { defineConfig } from 'vite'
116
+ import vue from '@vitejs/plugin-vue'
117
+ import Components from 'unplugin-vue-components/vite'
118
+ // vue-amazing-ui on-demand import
119
+ import { VueAmazingUIResolver } from 'vue-amazing-ui'
120
+
121
+ // https://vitejs.dev/config/
122
+ export default defineConfig({
123
+ plugins: [
124
+ vue(),
125
+ Components({
126
+ resolvers: [
127
+ // auto import components from VueAmazingUI
128
+ VueAmazingUIResolver({
129
+ cjs: false // whether use commonjs build, default false
130
+ })
131
+ ]
132
+ })
133
+ ]
134
+ })
135
+ ```
136
+
137
+ Then, you can directly use all components from `vue-amazing-ui` in your code.
138
+
139
+ ```vue
140
+ <template>
141
+ <Button>button</Button>
142
+ <Tag>tag</Tag>
143
+ </template>
144
+ ```
145
+
146
+ ## Use Types
147
+
148
+ *All types can be directly imported and used from `vue-amazing-ui` without any additional installation.*
149
+
150
+ ```vue
151
+ <script setup lang="ts">
152
+ import { ref } from 'vue'
153
+ import type { ButtonProps } from 'vue-amazing-ui'
154
+ const shape = ref<ButtonProps['shape']>('default')
155
+ </script>
156
+ <template>
157
+ <Button :shape="shape">button</Button>
158
+ </template>
159
+ ```
160
+
161
+ ## Use Functions
162
+
163
+ ```vue
164
+ <script setup lang="ts">
165
+ import {
166
+ dateFormat,
167
+ formatNumber,
168
+ rafTimeout,
169
+ cancelRaf,
170
+ throttle,
171
+ debounce,
172
+ add,
173
+ downloadFile,
174
+ toggleDark,
175
+ useEventListener,
176
+ useMutationObserver,
177
+ useScroll,
178
+ useFps,
179
+ useMediaQuery,
180
+ useResizeObserver,
181
+ useSlotsExist,
182
+ useInject
183
+ } from 'vue-amazing-ui'
184
+ </script>
185
+ ```
186
+
187
+ ## Project
188
+
189
+ - Get the project code
190
+
191
+ ```sh
192
+ git clone https://github.com/themusecatcher/vue-amazing-ui.git
193
+ ```
194
+
195
+ - Install dependencies
196
+
197
+ ```sh
198
+ cd vue-amazing-ui
199
+
200
+ pnpm i
201
+ ```
202
+
203
+ - Run project
204
+
205
+ ```sh
206
+ pnpm dev
207
+ ```
208
+
209
+ - Run docs
210
+
211
+ ```sh
212
+ docs:dev
213
+ ```
214
+
215
+ ## Blogs
216
+
217
+ [My CSDN Blogs](https://blog.csdn.net/Dandrose)
218
+
219
+ ## Sponsorship
220
+
221
+ `Vue Amazing UI` is an open-source project licensed under the `MIT` license, and it is completely free to use. All work on the component library and documentation is completed by the author alone, and the development and iteration process has been challenging. For the healthy and sustainable development of the component library, your support and sponsorship are greatly appreciated.
222
+
223
+ #### [Become a Sponsor](https://themusecatcher.github.io/vue-amazing-ui/sponsor/charge.html)
224
+
225
+ ## Sponsors 🫡
226
+
227
+ All sponsors will be listed here, thank you very much for your support and sponsorship ❤️
228
+
229
+ <a href="https://github.com/themusecatcher" target="_blank"><img width="64" height="64" src="./docs/public/avatar.png" alt="GitHub@themusecatcher" title="GitHub@themusecatcher"></a> <img width="64" height="64" src="./docs/public/avatar_1.jpeg" alt="WeChat@Ant" title="WeChat@Ant" /> <a href="https://github.com/nizhensh-i" target="_blank"><img width="64" height="64" src="./docs/public/avatar_2.jpg" alt="GitHub@nizhensh-i" title="GitHub@nizhensh-i"></a> <a href="https://github.com/beijin1949" target="_blank"><img width="64" height="64" src="./docs/public/avatar_3.png" alt="GitHub@beijin1949" title="GitHub@beijin1949"></a>
230
+
231
+ ## Components
232
+
233
+ Name | Description | Name | Description
234
+ :-- | :-- | :-- | :--
235
+ Alert | 警告提示 | Avatar | 头像
236
+ BackTop | 回到顶部 | Badge | 徽标
237
+ Breadcrumb | 面包屑 | Button | 按钮
238
+ Calendar | 日历 | Card | 卡片
239
+ Carousel | 轮播图 | Cascader | 级联选择
240
+ Checkbox | 复选框 | Collapse | 折叠面板
241
+ ColorPicker | 颜色选择器 | ConfigProvider | 全局化配置
242
+ Countdown | 倒计时 | DatePicker | 日期选择器
243
+ Descriptions | 描述列表 | Dialog | 对话框
244
+ Divider | 分割线 | Drawer | 抽屉
245
+ Ellipsis | 文本省略 | Empty | 空状态
246
+ Flex | 弹性布局 | FloatButton | 浮动按钮
247
+ GradientText | 渐变文字 | Grid | 栅格
248
+ Image | 图片 | Input | 输入框
249
+ InputNumber | 数字输入框 | InputSearch | 搜索框
250
+ List | 列表 | LoadingBar | 加载条
251
+ Message | 全局提示 | Modal | 模态框
252
+ Notification | 通知提醒 | NumberAnimation | 数值动画
253
+ Pagination | 分页 | Popconfirm | 弹出确认
254
+ Popover | 气泡卡片 | Progress | 进度条
255
+ QRCode | 二维码 | Radio | 单选框
256
+ Rate | 评分 | Result | 结果
257
+ Scrollbar | 滚动条 | Segmented | 分段控制器
258
+ Select | 选择器 | Skeleton | 骨架屏
259
+ Slider | 滑动输入条 | Space | 间距
260
+ Spin | 加载中 | Statistic | 统计数值
261
+ Steps | 步骤条 | Swiper | 触摸滑动插件
262
+ Switch | 开关 | Table | 表格
263
+ Tabs | 标签页 | Tag | 标签
264
+ Textarea | 文本域 | TextScroll | 文字滚动
265
+ Timeline | 时间轴 | Tooltip | 文字提示
266
+ Upload | 上传 | Video | 播放器
267
+ Waterfall | 瀑布流 | Watermark | 水印
268
+
269
+ ## Functions
270
+
271
+ Name | Description | Type
272
+ :-- | :-- | :--
273
+ dateFormat | Format date-time string function | (value: number &#124; string &#124; Date = Date.now(), format: string = 'YYYY-MM-DD HH:mm:ss') => string
274
+ formatNumber | Number formatting function | (value: number &#124; string, precision: number = 2, separator: string = ',', decimal: string = '.', prefix?: string, suffix?: string) => string
275
+ rafTimeout | Function to implement `setTimeout` or `setInterval` using `requestAnimationFrame` | (fn: Function, delay: number = 0, interval: boolean = false) => object
276
+ cancelRaf | Function to cancel the `rafTimeout` function | (raf: { id: number }) => void
277
+ throttle | Throttle function | (fn: Function, delay: number = 300) => any
278
+ debounce | Debounce function | (fn: Function, delay: number = 300) => any
279
+ add | Addition function that eliminates precision issues in JavaScript arithmetic | (num1: number, num2: number) => number
280
+ downloadFile | Function to download a file with a custom filename; if no filename is provided, it extracts the filename from the URL | (url: string, fileName?: string) => void
281
+ toggleDark | Function to toggle dark mode | () => void
282
+ useEventListener | Function to add and remove event listeners using Vue lifecycle hooks | (target: HTMLElement &#124; Window &#124; Document, event: string, callback: Function) => void
283
+ useMutationObserver | Function to observe changes in DOM elements using `MutationObserver` | (target: Ref &#124; Ref[] &#124; HTMLElement &#124; HTMLElement[], callback: MutationCallback, options = {}) => object
284
+ useScroll | Function to monitor the scroll position and state of a target element in real time | (target: Ref &#124; HTMLElement &#124; Window &#124; Document = window, throttleDelay: number = 0, onScroll?: (e: Event) => void, onStop?: (e: Event) => void) => object
285
+ useFps | Function to monitor the browser's refresh rate (FPS) in real time | () => object
286
+ useMediaQuery | Function to determine if the current environment matches a specified media query condition | (mediaQuery: string) => object
287
+ useResizeObserver | Function to observe changes in the dimensions of DOM elements using `ResizeObserver` | (target: Ref &#124; Ref[] &#124; HTMLElement &#124; HTMLElement[], callback: ResizeObserverCallback, options = {}) => object
288
+ useSlotsExist | Function to watch for the existence of slots with given names, supporting single slots or an array of slots | (slotsName: string &#124; string[] = 'default') => Reactive &#124; Ref\<boolean>
289
+ useInject | A function that uses injection to obtain color palettes and shadow color | (key: string) => { colorPalettes: Ref<string[]>; shadowColor: Ref<string> }