vue-devui 1.0.0-rc.2 → 1.0.0-rc.3

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 (94) hide show
  1. package/README.md +129 -126
  2. package/auto-complete/index.es.js +98 -43
  3. package/auto-complete/index.umd.js +5 -3
  4. package/auto-complete/style.css +1 -1
  5. package/avatar/index.es.js +77 -81
  6. package/avatar/index.umd.js +1 -1
  7. package/button/index.es.js +4 -3
  8. package/button/index.umd.js +1 -1
  9. package/card/index.es.js +3 -6
  10. package/card/index.umd.js +1 -1
  11. package/checkbox/index.es.js +5 -11
  12. package/checkbox/index.umd.js +1 -1
  13. package/comment/index.es.js +2 -5
  14. package/comment/index.umd.js +1 -1
  15. package/countdown/index.es.js +3 -6
  16. package/countdown/index.umd.js +1 -1
  17. package/editable-select/index.es.js +2 -5
  18. package/editable-select/index.umd.js +1 -1
  19. package/grid/index.es.js +30 -36
  20. package/grid/index.umd.js +1 -1
  21. package/image-preview/index.es.js +19 -19
  22. package/image-preview/index.umd.js +1 -1
  23. package/input/index.es.js +2 -5
  24. package/input/index.umd.js +1 -1
  25. package/layout/index.es.js +6 -21
  26. package/layout/index.umd.js +1 -1
  27. package/loading/index.es.js +20 -12
  28. package/loading/index.umd.js +1 -1
  29. package/modal/index.es.js +54 -46
  30. package/modal/index.umd.js +1 -1
  31. package/nuxt/components/DropdownPropsKey.js +3 -0
  32. package/nuxt/components/autoCompleteProps.js +3 -0
  33. package/nuxt/components/avatarProps.js +3 -0
  34. package/nuxt/components/cardProps.js +3 -0
  35. package/nuxt/components/checkboxGroupInjectionKey.js +3 -0
  36. package/nuxt/components/checkboxGroupProps.js +3 -0
  37. package/nuxt/components/checkboxProps.js +3 -0
  38. package/nuxt/components/colProps.js +3 -0
  39. package/nuxt/components/colPropsBaseClass.js +3 -0
  40. package/nuxt/components/colPropsBaseStyle.js +3 -0
  41. package/nuxt/components/commentProps.js +3 -0
  42. package/nuxt/components/countdownProps.js +3 -0
  43. package/nuxt/components/editableSelectProps.js +3 -0
  44. package/nuxt/components/imagePreviewProps.js +3 -0
  45. package/nuxt/components/inputProps.js +3 -0
  46. package/nuxt/components/progressProps.js +3 -0
  47. package/nuxt/components/rateProps.js +3 -0
  48. package/nuxt/components/readTipProps.js +3 -0
  49. package/nuxt/components/resultProps.js +3 -0
  50. package/nuxt/components/rowProps.js +3 -0
  51. package/nuxt/components/screenSizes.js +3 -0
  52. package/nuxt/components/skeletonProps.js +3 -0
  53. package/nuxt/components/splitterProps.js +3 -0
  54. package/nuxt/components/statisticProps.js +3 -0
  55. package/nuxt/components/switchProps.js +3 -0
  56. package/nuxt/components/tagInputProps.js +3 -0
  57. package/nuxt/components/textareaProps.js +3 -0
  58. package/nuxt/components/timeAxisProps.js +3 -0
  59. package/overlay/index.es.js +5 -5
  60. package/overlay/index.umd.js +1 -1
  61. package/package.json +1 -1
  62. package/pagination/index.es.js +14 -13
  63. package/pagination/index.umd.js +1 -1
  64. package/popover/index.es.js +5 -5
  65. package/popover/index.umd.js +12 -12
  66. package/progress/index.es.js +33 -35
  67. package/progress/index.umd.js +3 -3
  68. package/rate/index.es.js +4 -7
  69. package/rate/index.umd.js +1 -1
  70. package/read-tip/index.es.js +2 -5
  71. package/read-tip/index.umd.js +1 -1
  72. package/result/index.es.js +2 -5
  73. package/result/index.umd.js +1 -1
  74. package/search/index.es.js +11 -11
  75. package/search/index.umd.js +8 -8
  76. package/skeleton/index.es.js +3 -6
  77. package/skeleton/index.umd.js +1 -1
  78. package/splitter/index.es.js +8 -11
  79. package/splitter/index.umd.js +15 -15
  80. package/statistic/index.es.js +7 -18
  81. package/statistic/index.umd.js +1 -1
  82. package/style.css +1 -1
  83. package/switch/index.es.js +3 -6
  84. package/switch/index.umd.js +1 -1
  85. package/tag-input/index.es.js +3 -6
  86. package/tag-input/index.umd.js +1 -1
  87. package/textarea/index.es.js +2 -5
  88. package/textarea/index.umd.js +1 -1
  89. package/timeline/index.es.js +8 -14
  90. package/timeline/index.umd.js +1 -1
  91. package/upload/index.es.js +60 -57
  92. package/upload/index.umd.js +1 -1
  93. package/vue-devui.es.js +11986 -24782
  94. package/vue-devui.umd.js +24 -22
package/README.md CHANGED
@@ -1,126 +1,129 @@
1
- <p align="center">
2
- <a href="https://devui.design/home" target="_blank" rel="noopener noreferrer">
3
- <img alt="DevUI Logo" src="https://github.com/DevCloudFE/vue-devui/raw/dev/packages/devui-vue/public/logo.svg" width="180" style="max-width:100%;">
4
- </a>
5
- </p>
6
-
7
- <h1 align="center">Vue DevUI</h1>
8
-
9
- <p align="center">Vue3 component library based on <a href="https://devui.design/" target="_blank" rel="noopener noreferrer">DevUI Design</a></p>
10
-
11
- English | [简体中文](README.zh-CN.md)
12
-
13
- 🌈 Features:
14
-
15
- - 📦 40 high-quality components that are simple, easy to use, and flexible.
16
- - 🔑 Support for TypeScript.
17
- - ⛰️ Support for Nuxt3.
18
- - ⚡ Support for on-demand import.
19
- - 🌍 Support internationalization.
20
- - 🎨 Support theme customization, and built-in seven beautiful themes such as `Galaxy`, `Sweet` and `Provence`.
21
-
22
- ## 🔧 Usage
23
-
24
- The first step is to install vue devui:
25
-
26
- ```
27
- npm i vue-devui
28
- ```
29
-
30
- Then import `DevUI` in the `main.ts` file:
31
-
32
- ```ts
33
- import { createApp } from 'vue'
34
- import App from './App.vue'
35
-
36
- // Import Vue DevUI component and style
37
- import DevUI from 'vue-devui'
38
- import 'vue-devui/style.css'
39
-
40
- createApp(App).use(DevUI).mount('#app')
41
- ```
42
-
43
- Then you can use the vue devui component(such as `<d-button>`) in the `App.vue` file:
44
-
45
- ```vue
46
- <template>
47
- <d-button>Button</d-button>
48
- </template>
49
- ```
50
-
51
- ## 🖥️ Development
52
-
53
- ```shell
54
- git clone git@github.com:DevCloudFE/vue-devui.git
55
- cd vue-devui
56
- pnpm i
57
- pnpm dev
58
- ```
59
-
60
- Open your browser and visit: [http://localhost:3000/](http://localhost:3000/).
61
-
62
- ## 🤝 Contributing
63
-
64
- Welcome to join our Vue DevUI open source project!🎉
65
-
66
- By participating in the Vue DevUI project, we can together:
67
- - 🔥 Learn the latest cool `Vite` + `Vue3` + `TypeScript` + `JSX` technology.
68
- - 🎁 Learn how to design and develop UI components.
69
- - ⭐ Hone programming skills and learn excellent programming practice.
70
- - 🎊 Meet a group of friends who love learning and open source.
71
-
72
- If you don't know how to start, please read our [contributing guide](https://vue-devui.github.io/contributing/)
73
-
74
- ## ✨ Contributors
75
-
76
- Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
77
-
78
- <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
79
- <!-- prettier-ignore-start -->
80
- <!-- markdownlint-disable -->
81
- <table>
82
- <tr>
83
- <td align="center"><a href="https://juejin.cn/user/712139267650141"><img src="https://avatars.githubusercontent.com/u/9566362?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Kagol</b></sub></a><br /><a href="#maintenance-kagol" title="Maintenance">🚧</a> <a href="https://github.com/DevCloudFE/vue-devui/commits?author=kagol" title="Code">💻</a> <a href="https://github.com/DevCloudFE/vue-devui/commits?author=kagol" title="Documentation">📖</a></td>
84
- <td align="center"><a href="https://github.com/TinsFox"><img src="https://avatars.githubusercontent.com/u/33956589?v=4?s=100" width="100px;" alt=""/><br /><sub><b>TinsFox</b></sub></a><br /><a href="#maintenance-TinsFox" title="Maintenance">🚧</a> <a href="#infra-TinsFox" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
85
- <td align="center"><a href="https://github.com/lnzhangsong"><img src="https://avatars.githubusercontent.com/u/15092594?v=4?s=100" width="100px;" alt=""/><br /><sub><b>nif</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=lnzhangsong" title="Code">💻</a></td>
86
- <td align="center"><a href="https://github.com/Zcating"><img src="https://avatars.githubusercontent.com/u/13329558?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Zcating</b></sub></a><br /><a href="#maintenance-Zcating" title="Maintenance">🚧</a> <a href="https://github.com/DevCloudFE/vue-devui/commits?author=Zcating" title="Code">💻</a></td>
87
- <td align="center"><a href="https://github.com/sufuwang"><img src="https://avatars.githubusercontent.com/u/46395105?v=4?s=100" width="100px;" alt=""/><br /><sub><b>王凯</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=sufuwang" title="Code">💻</a></td>
88
- <td align="center"><a href="https://github.com/iel-h"><img src="https://avatars.githubusercontent.com/u/53589602?v=4?s=100" width="100px;" alt=""/><br /><sub><b>iel</b></sub></a><br /><a href="#maintenance-iel-h" title="Maintenance">🚧</a> <a href="https://github.com/DevCloudFE/vue-devui/commits?author=iel-h" title="Code">💻</a></td>
89
- <td align="center"><a href="https://github.com/chenxi24"><img src="https://avatars.githubusercontent.com/u/40349890?v=4?s=100" width="100px;" alt=""/><br /><sub><b>chenxi24</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=chenxi24" title="Code">💻</a></td>
90
- </tr>
91
- <tr>
92
- <td align="center"><a href="https://github.com/asdlml6"><img src="https://avatars.githubusercontent.com/u/61737780?v=4?s=100" width="100px;" alt=""/><br /><sub><b>小九九</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=asdlml6" title="Code">💻</a></td>
93
- <td align="center"><a href="http://blog.alanlee.top"><img src="https://avatars.githubusercontent.com/u/42601044?v=4?s=100" width="100px;" alt=""/><br /><sub><b>AlanLee</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=AlanLee97" title="Code">💻</a></td>
94
- <td align="center"><a href="https://github.com/ForeseeBear"><img src="https://avatars.githubusercontent.com/u/15258339?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Echo</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=ForeseeBear" title="Code">💻</a></td>
95
- <td align="center"><a href="https://github.com/GaoNeng-wWw"><img src="https://avatars.githubusercontent.com/u/31283122?v=4?s=100" width="100px;" alt=""/><br /><sub><b>GaoNeng</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=GaoNeng-wWw" title="Code">💻</a></td>
96
- <td align="center"><a href="https://github.com/xingyan95"><img src="https://avatars.githubusercontent.com/u/11143986?v=4?s=100" width="100px;" alt=""/><br /><sub><b>行言</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=xingyan95" title="Code">💻</a></td>
97
- <td align="center"><a href="https://devin974.github.io/"><img src="https://avatars.githubusercontent.com/u/67035714?v=4?s=100" width="100px;" alt=""/><br /><sub><b>devin</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=devin974" title="Code">💻</a></td>
98
- <td align="center"><a href="https://juejin.cn/user/1618116899507735/posts"><img src="https://avatars.githubusercontent.com/u/70649502?v=4?s=100" width="100px;" alt=""/><br /><sub><b>无声</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=ivestszheng" title="Code">💻</a></td>
99
- </tr>
100
- <tr>
101
- <td align="center"><a href="https://github.com/zxlfly"><img src="https://avatars.githubusercontent.com/u/26324442?v=4?s=100" width="100px;" alt=""/><br /><sub><b>sleep_fish</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=zxlfly" title="Code">💻</a></td>
102
- <td align="center"><a href="https://github.com/whylost"><img src="https://avatars.githubusercontent.com/u/62528887?v=4?s=100" width="100px;" alt=""/><br /><sub><b>迷心whylost</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=whylost" title="Code">💻</a></td>
103
- <td align="center"><a href="https://juejin.im/user/5c15d35fe51d4545ae495e43"><img src="https://avatars.githubusercontent.com/u/31237954?v=4?s=100" width="100px;" alt=""/><br /><sub><b>X.Q. Chen</b></sub></a><br /><a href="#infra-brenner8023" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="https://github.com/DevCloudFE/vue-devui/commits?author=brenner8023" title="Code">💻</a></td>
104
- <td align="center"><a href="https://github.com/git-Where"><img src="https://avatars.githubusercontent.com/u/16344566?v=4?s=100" width="100px;" alt=""/><br /><sub><b>葉家男孩</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=git-Where" title="Code">💻</a></td>
105
- <td align="center"><a href="https://github.com/CatsAndMice"><img src="https://avatars.githubusercontent.com/u/58327088?v=4?s=100" width="100px;" alt=""/><br /><sub><b>lihai</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=CatsAndMice" title="Code">💻</a></td>
106
- <td align="center"><a href="http://www.naluduo.vip"><img src="https://avatars.githubusercontent.com/u/28448589?v=4?s=100" width="100px;" alt=""/><br /><sub><b>纳撸多</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=naluduo233" title="Code">💻</a></td>
107
- <td align="center"><a href="https://github.com/ElsaOOo"><img src="https://avatars.githubusercontent.com/u/48074435?v=4?s=100" width="100px;" alt=""/><br /><sub><b>ElsaOOo</b></sub></a><br /><a href="#maintenance-ElsaOOo" title="Maintenance">🚧</a> <a href="#infra-ElsaOOo" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="https://github.com/DevCloudFE/vue-devui/commits?author=ElsaOOo" title="Code">💻</a></td>
108
- </tr>
109
- <tr>
110
- <td align="center"><a href="https://github.com/liuxdi"><img src="https://avatars.githubusercontent.com/u/10958003?v=4?s=100" width="100px;" alt=""/><br /><sub><b>刘小迪</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=liuxdi" title="Code">💻</a></td>
111
- <td align="center"><a href="https://github.com/unfound"><img src="https://avatars.githubusercontent.com/u/32935349?v=4?s=100" width="100px;" alt=""/><br /><sub><b>unfound</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=unfound" title="Code">💻</a></td>
112
- <td align="center"><a href="https://github.com/Roading"><img src="https://avatars.githubusercontent.com/u/7751774?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Roading</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=Roading" title="Code">💻</a></td>
113
- <td align="center"><a href="http://inreasons.cn"><img src="https://avatars.githubusercontent.com/u/47918504?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Chestnut</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=banlify" title="Code">💻</a></td>
114
- </tr>
115
- </table>
116
-
117
- <!-- markdownlint-restore -->
118
- <!-- prettier-ignore-end -->
119
-
120
- <!-- ALL-CONTRIBUTORS-LIST:END -->
121
-
122
- This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
123
-
124
- ## License
125
-
126
- [MIT](https://github.com/DevCloudFE/vue-devui/blob/dev/LICENSE)
1
+ <p align="center">
2
+ <a href="https://devui.design/home" target="_blank" rel="noopener noreferrer">
3
+ <img alt="DevUI Logo" src="https://github.com/DevCloudFE/vue-devui/raw/dev/packages/devui-vue/public/logo.svg" width="180" style="max-width:100%;">
4
+ </a>
5
+ </p>
6
+
7
+ <h1 align="center">Vue DevUI</h1>
8
+
9
+ <p align="center">Vue3 component library based on <a href="https://devui.design/" target="_blank" rel="noopener noreferrer">DevUI Design</a></p>
10
+
11
+ English | [简体中文](README.zh-CN.md)
12
+
13
+ 🌈 Features:
14
+
15
+ - 📦 40 high-quality components that are simple, easy to use, and flexible.
16
+ - 🔑 Support for TypeScript.
17
+ - ⛰️ Support for Nuxt3.
18
+ - ⚡ Support for on-demand import.
19
+ - 🌍 Support internationalization.
20
+ - 🎨 Support theme customization, and built-in seven beautiful themes such as `Galaxy`, `Sweet` and `Provence`.
21
+
22
+ ## 🔧 Usage
23
+
24
+ The first step is to install vue devui:
25
+
26
+ ```
27
+ npm i vue-devui
28
+ ```
29
+
30
+ Then import `DevUI` in the `main.ts` file:
31
+
32
+ ```ts
33
+ import { createApp } from 'vue'
34
+ import App from './App.vue'
35
+
36
+ // Import Vue DevUI component and style
37
+ import DevUI from 'vue-devui'
38
+ import 'vue-devui/style.css'
39
+
40
+ createApp(App).use(DevUI).mount('#app')
41
+ ```
42
+
43
+ Then you can use the vue devui component(such as `<d-button>`) in the `App.vue` file:
44
+
45
+ ```vue
46
+ <template>
47
+ <d-button>Button</d-button>
48
+ </template>
49
+ ```
50
+
51
+ ## 🖥️ Development
52
+
53
+ ```shell
54
+ git clone git@github.com:DevCloudFE/vue-devui.git
55
+ cd vue-devui
56
+ pnpm i
57
+ pnpm dev
58
+ ```
59
+
60
+ Open your browser and visit: [http://localhost:3000/](http://localhost:3000/).
61
+
62
+ ## 🤝 Contributing
63
+
64
+ Welcome to join our Vue DevUI open source project!🎉
65
+
66
+ By participating in the Vue DevUI project, we can together:
67
+ - 🔥 Learn the latest cool `Vite` + `Vue3` + `TypeScript` + `JSX` technology.
68
+ - 🎁 Learn how to design and develop UI components.
69
+ - ⭐ Hone programming skills and learn excellent programming practice.
70
+ - 🎊 Meet a group of friends who love learning and open source.
71
+
72
+ If you don't know how to start, please read our [contributing guide](https://vue-devui.github.io/contributing/)
73
+
74
+ ## ✨ Contributors
75
+
76
+ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
77
+
78
+ <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
79
+ <!-- prettier-ignore-start -->
80
+ <!-- markdownlint-disable -->
81
+ <table>
82
+ <tr>
83
+ <td align="center"><a href="https://juejin.cn/user/712139267650141"><img src="https://avatars.githubusercontent.com/u/9566362?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Kagol</b></sub></a><br /><a href="#maintenance-kagol" title="Maintenance">🚧</a> <a href="https://github.com/DevCloudFE/vue-devui/commits?author=kagol" title="Code">💻</a> <a href="https://github.com/DevCloudFE/vue-devui/commits?author=kagol" title="Documentation">📖</a></td>
84
+ <td align="center"><a href="https://github.com/TinsFox"><img src="https://avatars.githubusercontent.com/u/33956589?v=4?s=100" width="100px;" alt=""/><br /><sub><b>TinsFox</b></sub></a><br /><a href="#maintenance-TinsFox" title="Maintenance">🚧</a> <a href="#infra-TinsFox" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
85
+ <td align="center"><a href="https://github.com/lnzhangsong"><img src="https://avatars.githubusercontent.com/u/15092594?v=4?s=100" width="100px;" alt=""/><br /><sub><b>nif</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=lnzhangsong" title="Code">💻</a></td>
86
+ <td align="center"><a href="https://github.com/Zcating"><img src="https://avatars.githubusercontent.com/u/13329558?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Zcating</b></sub></a><br /><a href="#maintenance-Zcating" title="Maintenance">🚧</a> <a href="https://github.com/DevCloudFE/vue-devui/commits?author=Zcating" title="Code">💻</a></td>
87
+ <td align="center"><a href="https://github.com/sufuwang"><img src="https://avatars.githubusercontent.com/u/46395105?v=4?s=100" width="100px;" alt=""/><br /><sub><b>王凯</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=sufuwang" title="Code">💻</a></td>
88
+ <td align="center"><a href="https://github.com/iel-h"><img src="https://avatars.githubusercontent.com/u/53589602?v=4?s=100" width="100px;" alt=""/><br /><sub><b>iel</b></sub></a><br /><a href="#maintenance-iel-h" title="Maintenance">🚧</a> <a href="https://github.com/DevCloudFE/vue-devui/commits?author=iel-h" title="Code">💻</a></td>
89
+ <td align="center"><a href="https://github.com/chenxi24"><img src="https://avatars.githubusercontent.com/u/40349890?v=4?s=100" width="100px;" alt=""/><br /><sub><b>chenxi24</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=chenxi24" title="Code">💻</a></td>
90
+ </tr>
91
+ <tr>
92
+ <td align="center"><a href="https://github.com/asdlml6"><img src="https://avatars.githubusercontent.com/u/61737780?v=4?s=100" width="100px;" alt=""/><br /><sub><b>小九九</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=asdlml6" title="Code">💻</a></td>
93
+ <td align="center"><a href="http://blog.alanlee.top"><img src="https://avatars.githubusercontent.com/u/42601044?v=4?s=100" width="100px;" alt=""/><br /><sub><b>AlanLee</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=AlanLee97" title="Code">💻</a></td>
94
+ <td align="center"><a href="https://github.com/ForeseeBear"><img src="https://avatars.githubusercontent.com/u/15258339?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Echo</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=ForeseeBear" title="Code">💻</a></td>
95
+ <td align="center"><a href="https://github.com/GaoNeng-wWw"><img src="https://avatars.githubusercontent.com/u/31283122?v=4?s=100" width="100px;" alt=""/><br /><sub><b>GaoNeng</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=GaoNeng-wWw" title="Code">💻</a></td>
96
+ <td align="center"><a href="https://github.com/xingyan95"><img src="https://avatars.githubusercontent.com/u/11143986?v=4?s=100" width="100px;" alt=""/><br /><sub><b>行言</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=xingyan95" title="Code">💻</a></td>
97
+ <td align="center"><a href="https://devin974.github.io/"><img src="https://avatars.githubusercontent.com/u/67035714?v=4?s=100" width="100px;" alt=""/><br /><sub><b>devin</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=devin974" title="Code">💻</a></td>
98
+ <td align="center"><a href="https://juejin.cn/user/1618116899507735/posts"><img src="https://avatars.githubusercontent.com/u/70649502?v=4?s=100" width="100px;" alt=""/><br /><sub><b>无声</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=ivestszheng" title="Code">💻</a></td>
99
+ </tr>
100
+ <tr>
101
+ <td align="center"><a href="https://github.com/zxlfly"><img src="https://avatars.githubusercontent.com/u/26324442?v=4?s=100" width="100px;" alt=""/><br /><sub><b>sleep_fish</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=zxlfly" title="Code">💻</a></td>
102
+ <td align="center"><a href="https://github.com/whylost"><img src="https://avatars.githubusercontent.com/u/62528887?v=4?s=100" width="100px;" alt=""/><br /><sub><b>迷心whylost</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=whylost" title="Code">💻</a></td>
103
+ <td align="center"><a href="https://juejin.im/user/5c15d35fe51d4545ae495e43"><img src="https://avatars.githubusercontent.com/u/31237954?v=4?s=100" width="100px;" alt=""/><br /><sub><b>X.Q. Chen</b></sub></a><br /><a href="#infra-brenner8023" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="https://github.com/DevCloudFE/vue-devui/commits?author=brenner8023" title="Code">💻</a></td>
104
+ <td align="center"><a href="https://github.com/git-Where"><img src="https://avatars.githubusercontent.com/u/16344566?v=4?s=100" width="100px;" alt=""/><br /><sub><b>葉家男孩</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=git-Where" title="Code">💻</a></td>
105
+ <td align="center"><a href="https://github.com/CatsAndMice"><img src="https://avatars.githubusercontent.com/u/58327088?v=4?s=100" width="100px;" alt=""/><br /><sub><b>lihai</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=CatsAndMice" title="Code">💻</a></td>
106
+ <td align="center"><a href="http://www.naluduo.vip"><img src="https://avatars.githubusercontent.com/u/28448589?v=4?s=100" width="100px;" alt=""/><br /><sub><b>纳撸多</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=naluduo233" title="Code">💻</a></td>
107
+ <td align="center"><a href="https://github.com/ElsaOOo"><img src="https://avatars.githubusercontent.com/u/48074435?v=4?s=100" width="100px;" alt=""/><br /><sub><b>ElsaOOo</b></sub></a><br /><a href="#maintenance-ElsaOOo" title="Maintenance">🚧</a> <a href="#infra-ElsaOOo" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="https://github.com/DevCloudFE/vue-devui/commits?author=ElsaOOo" title="Code">💻</a></td>
108
+ </tr>
109
+ <tr>
110
+ <td align="center"><a href="https://github.com/liuxdi"><img src="https://avatars.githubusercontent.com/u/10958003?v=4?s=100" width="100px;" alt=""/><br /><sub><b>刘小迪</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=liuxdi" title="Code">💻</a></td>
111
+ <td align="center"><a href="https://github.com/unfound"><img src="https://avatars.githubusercontent.com/u/32935349?v=4?s=100" width="100px;" alt=""/><br /><sub><b>unfound</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=unfound" title="Code">💻</a></td>
112
+ <td align="center"><a href="https://github.com/Roading"><img src="https://avatars.githubusercontent.com/u/7751774?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Roading</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=Roading" title="Code">💻</a></td>
113
+ <td align="center"><a href="http://inreasons.cn"><img src="https://avatars.githubusercontent.com/u/47918504?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Chestnut</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=banlify" title="Code">💻</a></td>
114
+ <td align="center"><a href="https://github.com/c0dedance"><img src="https://avatars.githubusercontent.com/u/38075730?v=4?s=100" width="100px;" alt=""/><br /><sub><b>c0dedance</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=c0dedance" title="Code">💻</a></td>
115
+ <td align="center"><a href="https://github.com/duqingyu"><img src="https://avatars.githubusercontent.com/u/30541930?v=4?s=100" width="100px;" alt=""/><br /><sub><b>杜庆愉</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=duqingyu" title="Code">💻</a></td>
116
+ <td align="center"><a href="https://github.com/linxiang07"><img src="https://avatars.githubusercontent.com/u/40119767?v=4?s=100" width="100px;" alt=""/><br /><sub><b>linxiang</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=linxiang07" title="Code">💻</a></td>
117
+ </tr>
118
+ </table>
119
+
120
+ <!-- markdownlint-restore -->
121
+ <!-- prettier-ignore-end -->
122
+
123
+ <!-- ALL-CONTRIBUTORS-LIST:END -->
124
+
125
+ This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
126
+
127
+ ## License
128
+
129
+ [MIT](https://github.com/DevCloudFE/vue-devui/blob/dev/LICENSE)
@@ -20,7 +20,12 @@ var __publicField = (obj, key, value) => {
20
20
  };
21
21
  import { ref, nextTick, defineComponent, createVNode, h, render, inject, withDirectives, createTextVNode, resolveDirective, vShow, unref, watch, onUnmounted, mergeProps, toRefs, provide, Teleport, Transition, isVNode } from "vue";
22
22
  import { shift, offset, autoPlacement, arrow, computePosition } from "@floating-ui/dom";
23
- const defaultFormatter = (item) => item ? item.label || item.toString() : "";
23
+ const defaultFormatter = (item) => {
24
+ if (typeof item === "string") {
25
+ return item;
26
+ }
27
+ return item !== null ? item.label || item.toString() : "";
28
+ };
24
29
  const defaultValueParse = (item) => item;
25
30
  const autoCompleteProps = {
26
31
  modelValue: {
@@ -35,6 +40,10 @@ const autoCompleteProps = {
35
40
  type: Boolean,
36
41
  default: false
37
42
  },
43
+ appendToBody: {
44
+ type: Boolean,
45
+ default: false
46
+ },
38
47
  position: {
39
48
  type: Array,
40
49
  default: ["bottom-end"]
@@ -145,9 +154,20 @@ function useCustomTemplate(ctx2, modelValue) {
145
154
  return { customRenderSolts };
146
155
  }
147
156
  function useSearchFn(ctx2, allowEmptyValueSearch, source, searchFn, formatter) {
148
- const searchList = ref();
157
+ const searchList = ref([]);
149
158
  const showNoResultItemTemplate = ref(false);
150
- const handleSearch = async (term, enableLazyLoad) => {
159
+ const defaultSearchFn = (term) => {
160
+ const arr = [];
161
+ source.value.forEach((item) => {
162
+ let cur = formatter.value(item);
163
+ cur = cur.toLowerCase();
164
+ if (cur.startsWith(term)) {
165
+ arr.push(item);
166
+ }
167
+ });
168
+ return arr;
169
+ };
170
+ const handleSearch = async (term, enableLazyLoad = false) => {
151
171
  if (term === "" && !allowEmptyValueSearch.value) {
152
172
  searchList.value = [];
153
173
  showNoResultItemTemplate.value = false;
@@ -158,13 +178,7 @@ function useSearchFn(ctx2, allowEmptyValueSearch, source, searchFn, formatter) {
158
178
  if (enableLazyLoad) {
159
179
  arr = source.value;
160
180
  } else if (!searchFn.value) {
161
- source.value.forEach((item) => {
162
- let cur = formatter.value(item);
163
- cur = cur.toLowerCase();
164
- if (cur.startsWith(term)) {
165
- arr.push(item);
166
- }
167
- });
181
+ arr = defaultSearchFn(term);
168
182
  } else {
169
183
  arr = await searchFn.value(term);
170
184
  }
@@ -193,13 +207,13 @@ function useInputHandle(ctx2, searchList, showNoResultItemTemplate, modelValue,
193
207
  const searchStatus = ref(false);
194
208
  const debounce = (cb, time) => {
195
209
  let timer;
196
- return (...args) => {
210
+ return (arg) => {
197
211
  if (timer) {
198
212
  clearTimeout(timer);
199
213
  }
200
214
  timer = setTimeout(async () => {
201
215
  searchStatus.value = true;
202
- await cb(...args);
216
+ await cb(arg);
203
217
  searchStatus.value = false;
204
218
  }, time);
205
219
  };
@@ -218,7 +232,7 @@ function useInputHandle(ctx2, searchList, showNoResultItemTemplate, modelValue,
218
232
  };
219
233
  const onFocus = () => {
220
234
  handleSearch(modelValue.value);
221
- recentlyFocus(latestSource.value);
235
+ recentlyFocus(latestSource == null ? void 0 : latestSource.value);
222
236
  transInputFocusEmit.value && transInputFocusEmit.value();
223
237
  };
224
238
  const handleClose = () => {
@@ -250,11 +264,22 @@ function useInputHandle(ctx2, searchList, showNoResultItemTemplate, modelValue,
250
264
  }
251
265
  function useSelectHandle(ctx2, searchList, selectValue, handleSearch, formatter, handleClose) {
252
266
  const selectedIndex = ref(0);
253
- const getListIndex = (item) => {
267
+ const getListIndex = (cur) => {
254
268
  if (searchList.value.length === 0) {
255
269
  return 0;
256
270
  }
257
- const ind = searchList.value.indexOf(item);
271
+ let ind = 0;
272
+ searchList.value.forEach((item, index2) => {
273
+ if (typeof item === "string") {
274
+ if (item === cur) {
275
+ ind = index2;
276
+ }
277
+ } else {
278
+ if (String(item.label) === cur) {
279
+ ind = index2;
280
+ }
281
+ }
282
+ });
258
283
  return ind === -1 ? 0 : ind;
259
284
  };
260
285
  const selectOptionClick = async (item) => {
@@ -285,11 +310,11 @@ function useLazyHandle(props, ctx2, handleSearch) {
285
310
  showLoading.value = true;
286
311
  }
287
312
  };
288
- ctx2.expose({ loadFinish });
289
313
  async function loadFinish() {
290
314
  await handleSearch(props.modelValue, props.enableLazyLoad);
291
315
  showLoading.value = false;
292
316
  }
317
+ ctx2.expose({ loadFinish });
293
318
  return {
294
319
  showLoading,
295
320
  dropDownRef,
@@ -444,8 +469,8 @@ var Loading = defineComponent({
444
469
  }
445
470
  });
446
471
  const COMPONENT_CONTAINER_SYMBOL = Symbol("dev_component_container");
447
- function createComponent(Component, props, children = null) {
448
- const vnode = h(Component, __spreadValues({}, props), children);
472
+ function createComponent(component, props, children = null) {
473
+ const vnode = h(component, __spreadValues({}, props), children);
449
474
  const container = document.createElement("div");
450
475
  vnode[COMPONENT_CONTAINER_SYMBOL] = container;
451
476
  render(vnode, container);
@@ -525,13 +550,14 @@ const removeAttribute = (el) => {
525
550
  el.removeAttribute("loadingtemplateref");
526
551
  };
527
552
  const handleProps = (el, vprops) => {
553
+ var _a;
528
554
  const props = __spreadValues(__spreadValues({}, new LoadingProps()), vprops);
529
555
  const loadingTemplateRef = props.loadingTemplateRef;
530
556
  const loadingInstance = createComponent(loadingConstructor, __spreadValues({}, props), loadingTemplateRef ? () => loadingTemplateRef : null);
531
557
  el.style.position = props.positionType;
532
558
  el.options = props;
533
559
  el.instance = loadingInstance;
534
- el.mask = loadingInstance.proxy.$el;
560
+ el.mask = (_a = loadingInstance == null ? void 0 : loadingInstance.proxy) == null ? void 0 : _a.$el;
535
561
  };
536
562
  const loadingDirective = {
537
563
  mounted: function(el, binding, vnode) {
@@ -566,7 +592,8 @@ var DAutoCompleteDropdown = defineComponent({
566
592
  showNoResultItemTemplate,
567
593
  latestSource,
568
594
  modelValue,
569
- hoverIndex
595
+ hoverIndex,
596
+ valueParser
570
597
  } = propsData;
571
598
  const {
572
599
  disabled,
@@ -576,7 +603,8 @@ var DAutoCompleteDropdown = defineComponent({
576
603
  isSearching
577
604
  } = propsData.props;
578
605
  const onSelect = (item) => {
579
- if (item[disabledKey]) {
606
+ item = valueParser.value(item);
607
+ if (typeof item === "object" && item[disabledKey]) {
580
608
  return;
581
609
  }
582
610
  selectOptionClick(item);
@@ -601,7 +629,7 @@ var DAutoCompleteDropdown = defineComponent({
601
629
  return createVNode("li", {
602
630
  "onClick": () => onSelect(item),
603
631
  "class": ["devui-dropdown-item", selectedIndex.value === index2 && "selected", {
604
- "disabled": disabledKey && item[disabledKey]
632
+ "disabled": disabledKey && typeof item === "object" && item[disabledKey]
605
633
  }, {
606
634
  "devui-dropdown-bg": hoverIndex.value === index2
607
635
  }],
@@ -733,6 +761,7 @@ function adjustArrowPosition(isArrowCenter, point, placement, originRect) {
733
761
  function useOverlay(props, emit) {
734
762
  const overlayRef = ref();
735
763
  const arrowRef = ref();
764
+ let originParent = null;
736
765
  const updateArrowPosition = (arrowEl, placement, point, overlayEl) => {
737
766
  const { x, y } = adjustArrowPosition(props.isArrowCenter, point, placement, overlayEl.getBoundingClientRect());
738
767
  const staticSide = {
@@ -771,21 +800,20 @@ function useOverlay(props, emit) {
771
800
  props.showArrow && updateArrowPosition(arrowEl, placement, middlewareData.arrow, overlayEl);
772
801
  };
773
802
  watch(() => props.modelValue, () => {
774
- const originParent = getScrollParent(props.origin);
775
803
  if (props.modelValue && props.origin) {
804
+ originParent = getScrollParent(props.origin);
776
805
  nextTick(updatePosition);
777
- originParent.addEventListener("scroll", updatePosition);
806
+ originParent == null ? void 0 : originParent.addEventListener("scroll", updatePosition);
778
807
  originParent !== window && window.addEventListener("scroll", updatePosition);
779
808
  window.addEventListener("resize", updatePosition);
780
809
  } else {
781
- originParent.removeEventListener("scroll", updatePosition);
810
+ originParent == null ? void 0 : originParent.removeEventListener("scroll", updatePosition);
782
811
  originParent !== window && window.removeEventListener("scroll", updatePosition);
783
812
  window.removeEventListener("resize", updatePosition);
784
813
  }
785
814
  });
786
815
  onUnmounted(() => {
787
- const originParent = getScrollParent(props.origin);
788
- originParent.removeEventListener("scroll", updatePosition);
816
+ originParent == null ? void 0 : originParent.removeEventListener("scroll", updatePosition);
789
817
  originParent !== window && window.removeEventListener("scroll", updatePosition);
790
818
  window.removeEventListener("resize", updatePosition);
791
819
  });
@@ -840,6 +868,7 @@ var AutoComplete = defineComponent({
840
868
  width,
841
869
  delay,
842
870
  allowEmptyValueSearch,
871
+ appendToBody,
843
872
  formatter,
844
873
  transInputFocusEmit,
845
874
  selectValue,
@@ -847,7 +876,8 @@ var AutoComplete = defineComponent({
847
876
  searchFn,
848
877
  position,
849
878
  latestSource,
850
- showAnimation
879
+ showAnimation,
880
+ valueParser
851
881
  } = toRefs(props);
852
882
  const {
853
883
  handleSearch,
@@ -894,18 +924,46 @@ var AutoComplete = defineComponent({
894
924
  latestSource,
895
925
  modelValue,
896
926
  showNoResultItemTemplate,
897
- hoverIndex
927
+ hoverIndex,
928
+ valueParser
898
929
  });
899
930
  const origin = ref();
900
931
  const renderDropdown = () => {
901
- let _slot;
902
- return createVNode(Teleport, {
903
- "to": "body"
904
- }, {
905
- default: () => [createVNode(Transition, {
932
+ if (appendToBody.value) {
933
+ let _slot;
934
+ return createVNode(Teleport, {
935
+ "to": "body"
936
+ }, {
937
+ default: () => [createVNode(Transition, {
938
+ "name": showAnimation ? "fade" : ""
939
+ }, {
940
+ default: () => [createVNode(FlexibleOverlay, {
941
+ "show-arrow": true,
942
+ "origin": origin.value,
943
+ "position": position.value,
944
+ "modelValue": visible.value,
945
+ "onUpdate:modelValue": ($event) => visible.value = $event
946
+ }, {
947
+ default: () => [createVNode("div", {
948
+ "class": "devui-auto-complete-menu",
949
+ "style": {
950
+ width: `
951
+ ${width.value + "px"}
952
+ `
953
+ }
954
+ }, [createVNode(DAutoCompleteDropdown, null, _isSlot(_slot = customRenderSolts()) ? _slot : {
955
+ default: () => [_slot]
956
+ })])]
957
+ })]
958
+ })]
959
+ });
960
+ } else {
961
+ let _slot2;
962
+ return createVNode(Transition, {
906
963
  "name": showAnimation ? "fade" : ""
907
964
  }, {
908
965
  default: () => [createVNode(FlexibleOverlay, {
966
+ "show-arrow": true,
909
967
  "origin": origin.value,
910
968
  "position": position.value,
911
969
  "modelValue": visible.value,
@@ -918,12 +976,12 @@ var AutoComplete = defineComponent({
918
976
  ${width.value + "px"}
919
977
  `
920
978
  }
921
- }, [createVNode(DAutoCompleteDropdown, null, _isSlot(_slot = customRenderSolts()) ? _slot : {
922
- default: () => [_slot]
979
+ }, [createVNode(DAutoCompleteDropdown, null, _isSlot(_slot2 = customRenderSolts()) ? _slot2 : {
980
+ default: () => [_slot2]
923
981
  })])]
924
982
  })]
925
- })]
926
- });
983
+ });
984
+ }
927
985
  };
928
986
  return () => {
929
987
  return withDirectives(createVNode("div", {
@@ -947,15 +1005,12 @@ var AutoComplete = defineComponent({
947
1005
  };
948
1006
  }
949
1007
  });
950
- AutoComplete.install = function(app) {
951
- app.component(AutoComplete.name, AutoComplete);
952
- };
953
1008
  var index = {
954
1009
  title: "AutoComplete \u81EA\u52A8\u8865\u5168",
955
1010
  category: "\u6570\u636E\u5F55\u5165",
956
1011
  status: "100%",
957
1012
  install(app) {
958
- app.use(AutoComplete);
1013
+ app.component(AutoComplete.name, AutoComplete);
959
1014
  }
960
1015
  };
961
- export { AutoComplete, index as default };
1016
+ export { AutoComplete, DropdownPropsKey, autoCompleteProps, index as default };