vue-devui 1.0.0-beta.9 → 1.0.0-rc.1

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 (294) hide show
  1. package/README.md +100 -72
  2. package/accordion/index.es.js +525 -39
  3. package/accordion/index.umd.js +1 -1
  4. package/accordion/style.css +1 -1
  5. package/alert/index.es.js +34 -37
  6. package/alert/index.umd.js +1 -1
  7. package/alert/style.css +1 -1
  8. package/{time-axis → auto-complete}/index.d.ts +0 -0
  9. package/auto-complete/index.es.js +983 -0
  10. package/auto-complete/index.umd.js +1 -0
  11. package/auto-complete/package.json +7 -0
  12. package/auto-complete/style.css +1 -0
  13. package/back-top/index.es.js +5 -3
  14. package/back-top/index.umd.js +1 -1
  15. package/badge/index.es.js +13 -19
  16. package/badge/index.umd.js +1 -1
  17. package/badge/style.css +1 -1
  18. package/breadcrumb/index.es.js +2 -1
  19. package/button/index.es.js +296 -117
  20. package/button/index.umd.js +1 -1
  21. package/button/style.css +1 -1
  22. package/carousel/index.es.js +43 -57
  23. package/carousel/index.umd.js +1 -1
  24. package/cascader/index.es.js +5412 -784
  25. package/cascader/index.umd.js +27 -1
  26. package/cascader/style.css +1 -1
  27. package/checkbox/style.css +1 -1
  28. package/{toast → color-picker}/index.d.ts +0 -0
  29. package/color-picker/index.es.js +8196 -0
  30. package/color-picker/index.umd.js +27 -0
  31. package/color-picker/package.json +7 -0
  32. package/color-picker/style.css +1 -0
  33. package/comment/index.es.js +42 -13
  34. package/comment/index.umd.js +1 -1
  35. package/comment/style.css +1 -1
  36. package/countdown/index.es.js +27 -17
  37. package/countdown/index.umd.js +1 -1
  38. package/countdown/style.css +1 -1
  39. package/date-picker/index.es.js +48 -66
  40. package/date-picker/index.umd.js +1 -1
  41. package/date-picker/style.css +1 -1
  42. package/dragdrop/index.es.js +135 -10
  43. package/dragdrop/index.umd.js +1 -1
  44. package/drawer/index.es.js +169 -223
  45. package/drawer/index.umd.js +1 -1
  46. package/drawer/style.css +1 -1
  47. package/dropdown/index.es.js +463 -300
  48. package/dropdown/index.umd.js +1 -1
  49. package/dropdown/style.css +1 -1
  50. package/editable-select/index.es.js +293 -5660
  51. package/editable-select/index.umd.js +1 -27
  52. package/editable-select/style.css +1 -1
  53. package/form/index.es.js +6210 -531
  54. package/form/index.umd.js +27 -1
  55. package/form/style.css +1 -1
  56. package/fullscreen/index.es.js +112 -133
  57. package/fullscreen/index.umd.js +1 -1
  58. package/fullscreen/style.css +1 -1
  59. package/gantt/index.es.js +6 -18
  60. package/gantt/index.umd.js +1 -1
  61. package/gantt/style.css +1 -1
  62. package/grid/index.es.js +1 -1
  63. package/grid/style.css +1 -1
  64. package/icon/index.es.js +39 -56
  65. package/icon/index.umd.js +1 -1
  66. package/image-preview/index.es.js +35 -16
  67. package/image-preview/index.umd.js +1 -1
  68. package/input/index.es.js +4 -5
  69. package/input/index.umd.js +1 -1
  70. package/input/style.css +1 -1
  71. package/input-icon/index.es.js +42 -41
  72. package/input-icon/index.umd.js +1 -1
  73. package/input-icon/style.css +1 -1
  74. package/input-number/index.es.js +46 -56
  75. package/input-number/index.umd.js +1 -1
  76. package/input-number/style.css +1 -1
  77. package/list/index.d.ts +7 -0
  78. package/list/index.es.js +39 -0
  79. package/list/index.umd.js +1 -0
  80. package/{toast → list}/package.json +1 -1
  81. package/list/style.css +1 -0
  82. package/loading/index.es.js +2 -2
  83. package/modal/index.es.js +304 -765
  84. package/modal/index.umd.js +1 -1
  85. package/modal/style.css +1 -1
  86. package/nav-sprite/index.es.js +1 -675
  87. package/nav-sprite/index.umd.js +1 -1
  88. package/notification/index.d.ts +7 -0
  89. package/notification/index.es.js +284 -0
  90. package/notification/index.umd.js +1 -0
  91. package/notification/package.json +7 -0
  92. package/notification/style.css +1 -0
  93. package/nuxt/components/Accordion.js +3 -0
  94. package/nuxt/components/Alert.js +3 -0
  95. package/nuxt/components/Anchor.js +3 -0
  96. package/nuxt/components/Aside.js +3 -0
  97. package/nuxt/components/AutoComplete.js +3 -0
  98. package/nuxt/components/Avatar.js +3 -0
  99. package/nuxt/components/BackTop.js +3 -0
  100. package/nuxt/components/Badge.js +3 -0
  101. package/nuxt/components/Breadcrumb.js +3 -0
  102. package/nuxt/components/Button.js +3 -0
  103. package/nuxt/components/Card.js +3 -0
  104. package/nuxt/components/Carousel.js +3 -0
  105. package/nuxt/components/CarouselItem.js +3 -0
  106. package/nuxt/components/Cascader.js +3 -0
  107. package/nuxt/components/Checkbox.js +3 -0
  108. package/nuxt/components/Col.js +3 -0
  109. package/nuxt/components/ColorPicker.js +3 -0
  110. package/nuxt/components/Column.js +3 -0
  111. package/nuxt/components/Comment.js +3 -0
  112. package/nuxt/components/Content.js +3 -0
  113. package/nuxt/components/Countdown.js +3 -0
  114. package/nuxt/components/DatePicker.js +3 -0
  115. package/nuxt/components/Drawer.js +3 -0
  116. package/nuxt/components/DrawerService.js +3 -0
  117. package/nuxt/components/Dropdown.js +3 -0
  118. package/nuxt/components/DropdownMenu.js +3 -0
  119. package/nuxt/components/EditableSelect.js +3 -0
  120. package/nuxt/components/FixedOverlay.js +3 -0
  121. package/nuxt/components/FlexibleOverlay.js +3 -0
  122. package/nuxt/components/Footer.js +3 -0
  123. package/nuxt/components/Form.js +3 -0
  124. package/nuxt/components/FormControl.js +3 -0
  125. package/nuxt/components/FormItem.js +3 -0
  126. package/nuxt/components/FormLabel.js +3 -0
  127. package/nuxt/components/FormOperation.js +3 -0
  128. package/nuxt/components/Fullscreen.js +3 -0
  129. package/nuxt/components/Gantt.js +3 -0
  130. package/nuxt/components/Header.js +3 -0
  131. package/nuxt/components/IFileOptions.js +3 -0
  132. package/nuxt/components/IUploadOptions.js +3 -0
  133. package/nuxt/components/Icon.js +2 -0
  134. package/nuxt/components/ImagePreviewService.js +3 -0
  135. package/nuxt/components/Input.js +3 -0
  136. package/nuxt/components/InputIcon.js +3 -0
  137. package/nuxt/components/InputNumber.js +3 -0
  138. package/nuxt/components/Layout.js +3 -0
  139. package/nuxt/components/List.js +3 -0
  140. package/nuxt/components/ListItem.js +3 -0
  141. package/nuxt/components/Loading.js +3 -0
  142. package/nuxt/components/LoadingService.js +3 -0
  143. package/nuxt/components/Modal.js +3 -0
  144. package/nuxt/components/NavSprite.js +2 -0
  145. package/nuxt/components/Notification.js +3 -0
  146. package/nuxt/components/NotificationService.js +3 -0
  147. package/nuxt/components/Pagination.js +3 -0
  148. package/nuxt/components/Panel.js +3 -0
  149. package/nuxt/components/PanelBody.js +3 -0
  150. package/nuxt/components/PanelFooter.js +3 -0
  151. package/nuxt/components/PanelHeader.js +3 -0
  152. package/nuxt/components/Popover.js +3 -0
  153. package/nuxt/components/Progress.js +3 -0
  154. package/nuxt/components/QuadrantDiagram.js +3 -0
  155. package/nuxt/components/Radio.js +3 -0
  156. package/nuxt/components/RadioGroup.js +3 -0
  157. package/nuxt/components/Rate.js +3 -0
  158. package/nuxt/components/ReadTip.js +3 -0
  159. package/nuxt/components/Result.js +3 -0
  160. package/nuxt/components/Row.js +3 -0
  161. package/nuxt/components/Search.js +3 -0
  162. package/nuxt/components/Select.js +3 -0
  163. package/nuxt/components/Skeleton.js +3 -0
  164. package/nuxt/components/SkeletonItem.js +3 -0
  165. package/nuxt/components/Slider.js +3 -0
  166. package/nuxt/components/Splitter.js +3 -0
  167. package/nuxt/components/Statistic.js +3 -0
  168. package/nuxt/components/Status.js +3 -0
  169. package/nuxt/components/StepsGuide.js +3 -0
  170. package/nuxt/components/StickSlider.js +3 -0
  171. package/nuxt/components/Sticky.js +2 -0
  172. package/nuxt/components/Switch.js +3 -0
  173. package/nuxt/components/Table.js +3 -0
  174. package/nuxt/components/Tabs.js +3 -0
  175. package/nuxt/components/Tag.js +3 -0
  176. package/nuxt/components/TagInput.js +3 -0
  177. package/nuxt/components/Textarea.js +3 -0
  178. package/nuxt/components/TimePicker.js +3 -0
  179. package/nuxt/components/Timeline.js +3 -0
  180. package/nuxt/components/TimelineItem.js +3 -0
  181. package/nuxt/components/Tooltip.js +3 -0
  182. package/nuxt/components/Transfer.js +3 -0
  183. package/nuxt/components/Tree.js +3 -0
  184. package/nuxt/components/TreeSelect.js +3 -0
  185. package/nuxt/components/Upload.js +3 -0
  186. package/nuxt/components/UploadStatus.js +3 -0
  187. package/nuxt/components/alertProps.js +3 -0
  188. package/nuxt/components/badgeProps.js +3 -0
  189. package/nuxt/components/buttonProps.js +3 -0
  190. package/nuxt/components/dropdownMenuProps.js +3 -0
  191. package/nuxt/components/fixedOverlayProps.js +3 -0
  192. package/nuxt/components/flexibleOverlayProps.js +3 -0
  193. package/nuxt/components/fullscreenProps.js +3 -0
  194. package/nuxt/components/iconProps.js +2 -0
  195. package/nuxt/components/notificationProps.js +3 -0
  196. package/nuxt/components/overlayEmits.js +3 -0
  197. package/nuxt/components/overlayProps.js +3 -0
  198. package/nuxt/components/paginationProps.js +3 -0
  199. package/nuxt/components/panelProps.js +3 -0
  200. package/nuxt/components/popoverProps.js +3 -0
  201. package/nuxt/components/searchProps.js +3 -0
  202. package/nuxt/components/tooltipProps.js +3 -0
  203. package/nuxt/components/uploadProps.js +3 -0
  204. package/nuxt/index.js +13 -0
  205. package/overlay/index.es.js +156 -205
  206. package/overlay/index.umd.js +1 -1
  207. package/overlay/style.css +1 -1
  208. package/package.json +12 -55
  209. package/pagination/index.es.js +11 -13
  210. package/pagination/index.umd.js +1 -1
  211. package/pagination/style.css +1 -1
  212. package/panel/index.es.js +48 -35
  213. package/panel/index.umd.js +1 -1
  214. package/popover/index.es.js +5954 -189
  215. package/popover/index.umd.js +27 -1
  216. package/popover/style.css +1 -1
  217. package/progress/index.es.js +8 -8
  218. package/progress/index.umd.js +3 -3
  219. package/quadrant-diagram/index.es.js +5405 -166
  220. package/quadrant-diagram/index.umd.js +27 -1
  221. package/radio/index.es.js +8 -14
  222. package/radio/index.umd.js +1 -1
  223. package/radio/style.css +1 -1
  224. package/read-tip/index.es.js +6 -3
  225. package/read-tip/style.css +1 -1
  226. package/result/index.es.js +38 -52
  227. package/result/index.umd.js +1 -1
  228. package/ripple/index.es.js +10 -6
  229. package/search/index.es.js +5428 -200
  230. package/search/index.umd.js +27 -1
  231. package/search/style.css +1 -1
  232. package/select/index.es.js +43 -42
  233. package/select/index.umd.js +1 -1
  234. package/select/style.css +1 -1
  235. package/skeleton/index.es.js +17 -17
  236. package/skeleton/index.umd.js +1 -1
  237. package/slider/index.es.js +4 -6
  238. package/slider/index.umd.js +1 -1
  239. package/slider/style.css +1 -1
  240. package/splitter/index.es.js +5896 -39
  241. package/splitter/index.umd.js +27 -1
  242. package/splitter/style.css +1 -1
  243. package/statistic/index.es.js +19 -32
  244. package/statistic/index.umd.js +1 -1
  245. package/statistic/style.css +1 -1
  246. package/status/index.es.js +1 -4
  247. package/status/index.umd.js +1 -1
  248. package/status/style.css +1 -1
  249. package/steps-guide/index.es.js +6 -3
  250. package/sticky/index.umd.js +1 -1
  251. package/style.css +1 -1
  252. package/table/index.es.js +753 -358
  253. package/table/index.umd.js +1 -1
  254. package/table/style.css +1 -1
  255. package/tabs/index.es.js +3 -4
  256. package/tabs/index.umd.js +1 -1
  257. package/tabs/style.css +1 -1
  258. package/tag/index.es.js +4 -3
  259. package/tag/index.umd.js +1 -1
  260. package/tag/style.css +1 -1
  261. package/tag-input/index.es.js +4 -14
  262. package/tag-input/index.umd.js +1 -1
  263. package/textarea/style.css +1 -1
  264. package/{theme → theme/theme.scss} +0 -0
  265. package/time-picker/index.es.js +309 -123
  266. package/time-picker/index.umd.js +1 -1
  267. package/time-picker/style.css +1 -1
  268. package/timeline/index.d.ts +7 -0
  269. package/{time-axis → timeline}/index.es.js +65 -77
  270. package/timeline/index.umd.js +1 -0
  271. package/{time-axis → timeline}/package.json +1 -1
  272. package/timeline/style.css +1 -0
  273. package/tooltip/index.es.js +5805 -141
  274. package/tooltip/index.umd.js +27 -1
  275. package/tooltip/style.css +1 -1
  276. package/transfer/index.es.js +6521 -630
  277. package/transfer/index.umd.js +27 -1
  278. package/transfer/style.css +1 -1
  279. package/tree/index.es.js +5781 -193
  280. package/tree/index.umd.js +27 -1
  281. package/tree/style.css +1 -1
  282. package/tree-select/index.es.js +138 -39
  283. package/tree-select/index.umd.js +1 -1
  284. package/tree-select/style.css +1 -1
  285. package/upload/index.es.js +450 -2669
  286. package/upload/index.umd.js +1 -1
  287. package/upload/style.css +1 -1
  288. package/vue-devui.es.js +14414 -14096
  289. package/vue-devui.umd.js +19 -19
  290. package/time-axis/index.umd.js +0 -1
  291. package/time-axis/style.css +0 -1
  292. package/toast/index.es.js +0 -2059
  293. package/toast/index.umd.js +0 -1
  294. package/toast/style.css +0 -1
@@ -0,0 +1,983 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
4
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __spreadValues = (a, b) => {
7
+ for (var prop in b || (b = {}))
8
+ if (__hasOwnProp.call(b, prop))
9
+ __defNormalProp(a, prop, b[prop]);
10
+ if (__getOwnPropSymbols)
11
+ for (var prop of __getOwnPropSymbols(b)) {
12
+ if (__propIsEnum.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ }
15
+ return a;
16
+ };
17
+ var __publicField = (obj, key, value) => {
18
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
19
+ return value;
20
+ };
21
+ import { ref, nextTick, defineComponent, createVNode, h, render, inject, withDirectives, createTextVNode, resolveDirective, vShow, unref, watch, onUnmounted, mergeProps, toRefs, provide, reactive, isVNode, Transition } from "vue";
22
+ import { shift, offset, autoPlacement, arrow, computePosition } from "@floating-ui/dom";
23
+ const defaultFormatter = (item) => item ? item.label || item.toString() : "";
24
+ const defaultValueParse = (item) => item;
25
+ const autoCompleteProps = {
26
+ modelValue: {
27
+ type: String,
28
+ default: ""
29
+ },
30
+ source: {
31
+ type: Array,
32
+ default: null
33
+ },
34
+ allowEmptyValueSearch: {
35
+ type: Boolean,
36
+ default: false
37
+ },
38
+ appendToBody: {
39
+ type: Boolean,
40
+ default: false
41
+ },
42
+ appendToBodyDirections: {
43
+ type: Object,
44
+ default: () => ({
45
+ originX: "left",
46
+ originY: "bottom",
47
+ overlayX: "left",
48
+ overlayY: "top"
49
+ })
50
+ },
51
+ disabled: {
52
+ type: Boolean,
53
+ default: false
54
+ },
55
+ delay: {
56
+ type: Number,
57
+ default: 300
58
+ },
59
+ disabledKey: {
60
+ type: String,
61
+ default: null
62
+ },
63
+ formatter: {
64
+ type: Function,
65
+ default: defaultFormatter
66
+ },
67
+ isSearching: {
68
+ type: Boolean,
69
+ default: false
70
+ },
71
+ sceneType: {
72
+ type: String,
73
+ default: null
74
+ },
75
+ searchFn: {
76
+ type: Function,
77
+ default: null
78
+ },
79
+ tipsText: {
80
+ type: String,
81
+ default: "\u6700\u8FD1\u8F93\u5165"
82
+ },
83
+ latestSource: {
84
+ type: Array,
85
+ default: null
86
+ },
87
+ valueParser: {
88
+ type: Function,
89
+ default: defaultValueParse
90
+ },
91
+ enableLazyLoad: {
92
+ type: Boolean,
93
+ default: false
94
+ },
95
+ dAutoCompleteWidth: {
96
+ type: Number,
97
+ default: null
98
+ },
99
+ showAnimation: {
100
+ type: Boolean,
101
+ default: true
102
+ },
103
+ maxHeight: {
104
+ type: Number,
105
+ default: 300
106
+ },
107
+ transInputFocusEmit: {
108
+ type: Function,
109
+ default: null
110
+ },
111
+ selectValue: {
112
+ type: Function,
113
+ default: null
114
+ },
115
+ loadMore: {
116
+ type: Function,
117
+ default: null
118
+ }
119
+ };
120
+ const DropdownPropsKey = Symbol("DropdownPropsKey");
121
+ function useCustomTemplate(ctx2, modelValue) {
122
+ const itemTemplate = (item, index2) => {
123
+ const arr = { item, index: index2 };
124
+ if (ctx2.slots.itemTemplate) {
125
+ return ctx2.slots.itemTemplate(arr);
126
+ }
127
+ return null;
128
+ };
129
+ const noResultItemTemplate = () => {
130
+ if (ctx2.slots.noResultItemTemplate) {
131
+ return ctx2.slots.noResultItemTemplate(modelValue.value);
132
+ }
133
+ return null;
134
+ };
135
+ const searchingTemplate = () => {
136
+ if (ctx2.slots.searchingTemplate) {
137
+ return ctx2.slots.searchingTemplate(modelValue.value);
138
+ }
139
+ return null;
140
+ };
141
+ const customRenderSolts = () => {
142
+ const slots = {};
143
+ if (ctx2.slots.itemTemplate) {
144
+ slots["itemTemplate"] = itemTemplate;
145
+ }
146
+ if (ctx2.slots.noResultItemTemplate) {
147
+ slots["noResultItemTemplate"] = noResultItemTemplate;
148
+ }
149
+ if (ctx2.slots.searchingTemplate) {
150
+ slots["searchingTemplate"] = searchingTemplate;
151
+ }
152
+ return slots;
153
+ };
154
+ return { customRenderSolts };
155
+ }
156
+ function useSearchFn(ctx2, allowEmptyValueSearch, source, searchFn, formatter) {
157
+ const searchList = ref([]);
158
+ const showNoResultItemTemplate = ref(false);
159
+ const handleSearch = async (term, enableLazyLoad) => {
160
+ if (term == "" && !allowEmptyValueSearch.value) {
161
+ searchList.value = [];
162
+ showNoResultItemTemplate.value = false;
163
+ return;
164
+ }
165
+ let arr = [];
166
+ term = term.toLowerCase();
167
+ if (enableLazyLoad) {
168
+ arr = source.value;
169
+ } else if (!searchFn.value) {
170
+ source.value.forEach((item) => {
171
+ let cur = formatter.value(item);
172
+ cur = cur.toLowerCase();
173
+ if (cur.startsWith(term)) {
174
+ arr.push(item);
175
+ }
176
+ });
177
+ } else {
178
+ arr = await searchFn.value(term);
179
+ }
180
+ searchList.value = arr;
181
+ if (searchList.value.length == 0) {
182
+ showNoResultItemTemplate.value = true;
183
+ } else {
184
+ showNoResultItemTemplate.value = false;
185
+ }
186
+ };
187
+ const recentlyFocus = (latestSource) => {
188
+ if (latestSource) {
189
+ searchList.value = latestSource;
190
+ }
191
+ };
192
+ return {
193
+ handleSearch,
194
+ recentlyFocus,
195
+ searchList,
196
+ showNoResultItemTemplate
197
+ };
198
+ }
199
+ function useInputHandle(ctx2, searchList, showNoResultItemTemplate, modelValue, disabled, delay, handleSearch, transInputFocusEmit, recentlyFocus, latestSource) {
200
+ const visible = ref(false);
201
+ const inputRef = ref();
202
+ const searchStatus = ref(false);
203
+ const debounce = (cb, time) => {
204
+ let timer;
205
+ return (...args) => {
206
+ if (timer) {
207
+ clearTimeout(timer);
208
+ }
209
+ timer = setTimeout(async () => {
210
+ searchStatus.value = true;
211
+ await cb(...args);
212
+ searchStatus.value = false;
213
+ }, time);
214
+ };
215
+ };
216
+ const onInputCb = async (value) => {
217
+ await handleSearch(value);
218
+ visible.value = true;
219
+ };
220
+ const onInputDebounce = debounce(onInputCb, delay.value);
221
+ const onInput = (e) => {
222
+ const inp = e.target;
223
+ searchStatus.value = false;
224
+ showNoResultItemTemplate.value = false;
225
+ ctx2.emit("update:modelValue", inp.value);
226
+ onInputDebounce(inp.value);
227
+ };
228
+ const onFocus = () => {
229
+ handleSearch(modelValue.value);
230
+ recentlyFocus(latestSource.value);
231
+ transInputFocusEmit.value && transInputFocusEmit.value();
232
+ };
233
+ const handleClose = () => {
234
+ visible.value = false;
235
+ searchStatus.value = false;
236
+ showNoResultItemTemplate.value = false;
237
+ };
238
+ const toggleMenu = () => {
239
+ if (!disabled.value) {
240
+ if (visible.value) {
241
+ handleClose();
242
+ } else {
243
+ visible.value = true;
244
+ if (ctx2.slots.noResultItemTemplate && searchList.value.length == 0 && modelValue.value.trim() != "") {
245
+ showNoResultItemTemplate.value = true;
246
+ }
247
+ }
248
+ }
249
+ };
250
+ return {
251
+ handleClose,
252
+ toggleMenu,
253
+ onInput,
254
+ onFocus,
255
+ inputRef,
256
+ visible,
257
+ searchStatus
258
+ };
259
+ }
260
+ function useSelectHandle(ctx2, searchList, selectValue, handleSearch, formatter, handleClose) {
261
+ const selectedIndex = ref(0);
262
+ const getListIndex = (item) => {
263
+ if (searchList.value.length == 0) {
264
+ return 0;
265
+ }
266
+ const ind = searchList.value.indexOf(item);
267
+ return ind == -1 ? 0 : ind;
268
+ };
269
+ const selectOptionClick = async (item) => {
270
+ const cur = formatter.value(item);
271
+ ctx2.emit("update:modelValue", cur);
272
+ handleClose();
273
+ await handleSearch(cur);
274
+ selectedIndex.value = getListIndex(cur);
275
+ selectValue.value && selectValue.value();
276
+ };
277
+ return {
278
+ selectedIndex,
279
+ selectOptionClick
280
+ };
281
+ }
282
+ function useLazyHandle(props, ctx2, handleSearch) {
283
+ const showLoading = ref(false);
284
+ const dropDownRef = ref();
285
+ const loadMore = () => {
286
+ if (!props.enableLazyLoad && showLoading) {
287
+ return;
288
+ }
289
+ const dropDownValue = dropDownRef.value;
290
+ const height = dropDownValue.scrollHeight;
291
+ const scrollTop = dropDownValue.clientHeight + dropDownValue.scrollTop;
292
+ if (scrollTop >= height && scrollTop >= props.maxHeight) {
293
+ props.loadMore();
294
+ showLoading.value = true;
295
+ }
296
+ };
297
+ ctx2.expose({ loadFinish });
298
+ async function loadFinish() {
299
+ await handleSearch(props.modelValue, props.enableLazyLoad);
300
+ showLoading.value = false;
301
+ }
302
+ return {
303
+ showLoading,
304
+ dropDownRef,
305
+ loadMore
306
+ };
307
+ }
308
+ function useKeyBoardHandle(dropDownRef, visible, searchList, selectedIndex, searchStatus, showNoResultItemTemplate, selectOptionClick, handleClose) {
309
+ var _a;
310
+ const hoverIndex = ref((_a = selectedIndex.value) != null ? _a : 0);
311
+ const scrollToActive = (index2) => {
312
+ const ul = dropDownRef.value;
313
+ const li = ul.children[index2];
314
+ nextTick(() => {
315
+ if (li.scrollIntoViewIfNeeded) {
316
+ li.scrollIntoViewIfNeeded(false);
317
+ } else {
318
+ const containerInfo = ul.getBoundingClientRect();
319
+ const elementInfo = li.getBoundingClientRect();
320
+ if (elementInfo.bottom > containerInfo.bottom || elementInfo.top < containerInfo.top) {
321
+ li.scrollIntoView(false);
322
+ }
323
+ }
324
+ });
325
+ };
326
+ const handlekeyDown = (e) => {
327
+ var _a2;
328
+ const keyCode = e.key || e.code;
329
+ if (keyCode === "Escape" && (visible.value && searchList.value.length || searchStatus.value || showNoResultItemTemplate.value)) {
330
+ handleClose();
331
+ return;
332
+ }
333
+ const status = visible.value && searchList.value.length && !searchStatus.value && !showNoResultItemTemplate.value;
334
+ if (keyCode === "ArrowDown" && status) {
335
+ if (hoverIndex.value === searchList.value.length - 1) {
336
+ hoverIndex.value = 0;
337
+ scrollToActive(hoverIndex.value);
338
+ return;
339
+ }
340
+ hoverIndex.value = hoverIndex.value + 1;
341
+ scrollToActive(hoverIndex.value);
342
+ } else if (keyCode === "ArrowUp" && status) {
343
+ if (hoverIndex.value === 0) {
344
+ hoverIndex.value = searchList.value.length - 1;
345
+ scrollToActive(hoverIndex.value);
346
+ return;
347
+ }
348
+ hoverIndex.value = hoverIndex.value - 1;
349
+ scrollToActive(hoverIndex.value);
350
+ }
351
+ if (keyCode === "Enter" && status) {
352
+ selectOptionClick(searchList.value[hoverIndex.value]);
353
+ hoverIndex.value = (_a2 = selectedIndex.value) != null ? _a2 : 0;
354
+ return;
355
+ }
356
+ };
357
+ return {
358
+ hoverIndex,
359
+ handlekeyDown
360
+ };
361
+ }
362
+ var autoComplete = "";
363
+ class View {
364
+ constructor() {
365
+ __publicField(this, "top", "50%");
366
+ __publicField(this, "left", "50%");
367
+ }
368
+ }
369
+ const componentProps = {
370
+ message: String,
371
+ backdrop: Boolean,
372
+ view: {
373
+ type: Object,
374
+ default: () => new View()
375
+ },
376
+ zIndex: Number,
377
+ isFull: {
378
+ type: Boolean,
379
+ default: false
380
+ }
381
+ };
382
+ class LoadingProps {
383
+ constructor() {
384
+ __publicField(this, "target");
385
+ __publicField(this, "message");
386
+ __publicField(this, "loadingTemplateRef");
387
+ __publicField(this, "backdrop", true);
388
+ __publicField(this, "positionType", "relative");
389
+ __publicField(this, "view", new View());
390
+ __publicField(this, "zIndex");
391
+ }
392
+ }
393
+ var loading = "";
394
+ var Loading = defineComponent({
395
+ name: "DLoading",
396
+ inheritAttrs: false,
397
+ props: componentProps,
398
+ setup(props) {
399
+ const style = {
400
+ top: props.view.top,
401
+ left: props.view.left,
402
+ zIndex: props.zIndex
403
+ };
404
+ if (!props.message) {
405
+ style.background = "none";
406
+ }
407
+ const isShow = ref(false);
408
+ const open = () => {
409
+ isShow.value = true;
410
+ };
411
+ const close = () => {
412
+ isShow.value = false;
413
+ };
414
+ return {
415
+ style,
416
+ isShow,
417
+ open,
418
+ close
419
+ };
420
+ },
421
+ render() {
422
+ var _a;
423
+ const {
424
+ isShow,
425
+ isFull,
426
+ backdrop,
427
+ style,
428
+ message,
429
+ $slots
430
+ } = this;
431
+ return isShow && createVNode("div", {
432
+ "class": ["devui-loading-contanier", isFull ? "devui-loading--full" : ""]
433
+ }, [((_a = $slots.default) == null ? void 0 : _a.call($slots)) || createVNode("div", {
434
+ "class": "devui-loading-wrapper"
435
+ }, [backdrop ? createVNode("div", {
436
+ "class": "devui-loading-mask"
437
+ }, null) : null, createVNode("div", {
438
+ "style": style,
439
+ "class": "devui-loading-area"
440
+ }, [createVNode("div", {
441
+ "class": "devui-busy-default-spinner"
442
+ }, [createVNode("div", {
443
+ "class": "devui-loading-bar1"
444
+ }, null), createVNode("div", {
445
+ "class": "devui-loading-bar2"
446
+ }, null), createVNode("div", {
447
+ "class": "devui-loading-bar3"
448
+ }, null), createVNode("div", {
449
+ "class": "devui-loading-bar4"
450
+ }, null)]), message ? createVNode("span", {
451
+ "class": "devui-loading-text"
452
+ }, [message]) : null])])]);
453
+ }
454
+ });
455
+ const COMPONENT_CONTAINER_SYMBOL = Symbol("dev_component_container");
456
+ function createComponent(Component, props, children = null) {
457
+ const vnode = h(Component, __spreadValues({}, props), children);
458
+ const container = document.createElement("div");
459
+ vnode[COMPONENT_CONTAINER_SYMBOL] = container;
460
+ render(vnode, container);
461
+ return vnode.component;
462
+ }
463
+ function unmountComponent(ComponnetInstance) {
464
+ render(null, ComponnetInstance == null ? void 0 : ComponnetInstance.vnode[COMPONENT_CONTAINER_SYMBOL]);
465
+ }
466
+ const loadingConstructor = defineComponent(Loading);
467
+ const cacheInstance = /* @__PURE__ */ new WeakSet();
468
+ const isEmpty = (val) => {
469
+ if (!val)
470
+ return true;
471
+ if (Array.isArray(val))
472
+ return val.length === 0;
473
+ if (val instanceof Set || val instanceof Map)
474
+ return val.size === 0;
475
+ if (val instanceof Promise)
476
+ return false;
477
+ if (typeof val === "object") {
478
+ try {
479
+ return Object.keys(val).length === 0;
480
+ } catch (e) {
481
+ return false;
482
+ }
483
+ }
484
+ return false;
485
+ };
486
+ const getType = (vari) => {
487
+ return Object.prototype.toString.call(vari).slice(8, -1).toLowerCase();
488
+ };
489
+ const isPromise = (value) => {
490
+ const type = getType(value);
491
+ switch (type) {
492
+ case "promise":
493
+ return [value];
494
+ case "array":
495
+ if (value.some((val) => getType(val) !== "promise")) {
496
+ console.error(new TypeError("Binding values should all be of type Promise"));
497
+ return "error";
498
+ }
499
+ return value;
500
+ default:
501
+ return false;
502
+ }
503
+ };
504
+ const unmount = (el) => {
505
+ cacheInstance.delete(el);
506
+ el.instance.proxy.close();
507
+ unmountComponent(el.instance);
508
+ };
509
+ const toggleLoading = (el, binding) => {
510
+ if (binding.value) {
511
+ const vals = isPromise(binding.value);
512
+ if (vals === "error")
513
+ return;
514
+ el.instance.proxy.open();
515
+ el.appendChild(el.mask);
516
+ cacheInstance.add(el);
517
+ if (vals) {
518
+ Promise.all(vals).catch((err) => {
519
+ console.error(new Error("Promise handling errors"), err);
520
+ }).finally(() => {
521
+ unmount(el);
522
+ });
523
+ }
524
+ } else {
525
+ unmount(el);
526
+ }
527
+ };
528
+ const removeAttribute = (el) => {
529
+ el.removeAttribute("zindex");
530
+ el.removeAttribute("positiontype");
531
+ el.removeAttribute("backdrop");
532
+ el.removeAttribute("message");
533
+ el.removeAttribute("view");
534
+ el.removeAttribute("loadingtemplateref");
535
+ };
536
+ const handleProps = (el, vprops) => {
537
+ const props = __spreadValues(__spreadValues({}, new LoadingProps()), vprops);
538
+ const loadingTemplateRef = props.loadingTemplateRef;
539
+ const loadingInstance = createComponent(loadingConstructor, __spreadValues({}, props), loadingTemplateRef ? () => loadingTemplateRef : null);
540
+ el.style.position = props.positionType;
541
+ el.options = props;
542
+ el.instance = loadingInstance;
543
+ el.mask = loadingInstance.proxy.$el;
544
+ };
545
+ const loadingDirective = {
546
+ mounted: function(el, binding, vnode) {
547
+ handleProps(el, vnode.props);
548
+ removeAttribute(el);
549
+ !isEmpty(binding.value) && toggleLoading(el, binding);
550
+ },
551
+ updated: function(el, binding, vnode) {
552
+ if (!isEmpty(binding.value) && cacheInstance.has(el) || isEmpty(binding.value) && !cacheInstance.has(el))
553
+ return;
554
+ !cacheInstance.has(el) && handleProps(el, vnode.props);
555
+ removeAttribute(el);
556
+ toggleLoading(el, binding);
557
+ }
558
+ };
559
+ var DAutoCompleteDropdown = defineComponent({
560
+ name: "DAutoCompleteDropdown",
561
+ directives: {
562
+ dLoading: loadingDirective
563
+ },
564
+ setup(props, ctx2) {
565
+ const propsData = inject(DropdownPropsKey);
566
+ const {
567
+ visible,
568
+ selectedIndex,
569
+ selectOptionClick,
570
+ searchList,
571
+ searchStatus,
572
+ dropDownRef,
573
+ loadMore,
574
+ showLoading,
575
+ showNoResultItemTemplate,
576
+ latestSource,
577
+ modelValue,
578
+ hoverIndex
579
+ } = propsData;
580
+ const {
581
+ disabled,
582
+ maxHeight,
583
+ appendToBody,
584
+ formatter,
585
+ disabledKey,
586
+ isSearching
587
+ } = propsData.props;
588
+ const onSelect = (item) => {
589
+ if (item[disabledKey]) {
590
+ return;
591
+ }
592
+ selectOptionClick(item);
593
+ };
594
+ return () => {
595
+ return withDirectives(createVNode("div", {
596
+ "class": ["devui-dropdown-menu", appendToBody && "devui-dropdown-menu-cdk", disabled && "disabled", latestSource.value && "devui-dropdown-latestSource"]
597
+ }, [createVNode("ul", {
598
+ "ref": dropDownRef,
599
+ "class": "devui-list-unstyled scroll-height",
600
+ "style": {
601
+ maxHeight: `${maxHeight}px`
602
+ },
603
+ "onScroll": loadMore
604
+ }, [isSearching && ctx2.slots.searchingTemplate && searchStatus.value && createVNode("li", {
605
+ "class": "devui-is-searching-template"
606
+ }, [createVNode("div", {
607
+ "class": "devui-no-data-tip"
608
+ }, [ctx2.slots.searchingTemplate()])]), latestSource.value && !modelValue.value && createVNode("li", {
609
+ "class": "devui-popup-tips"
610
+ }, [createTextVNode("\u6700\u8FD1\u8F93\u5165")]), !showNoResultItemTemplate.value && !searchStatus.value && searchList != null && searchList.value.length > 0 && searchList.value.map((item, index2) => {
611
+ return createVNode("li", {
612
+ "onClick": () => onSelect(item),
613
+ "class": ["devui-dropdown-item", selectedIndex.value == index2 && "selected", {
614
+ "disabled": disabledKey && item[disabledKey]
615
+ }, {
616
+ "devui-dropdown-bg": hoverIndex.value == index2
617
+ }],
618
+ "title": formatter(item),
619
+ "key": formatter(item)
620
+ }, [ctx2.slots.itemTemplate ? ctx2.slots.itemTemplate(item, index2) : formatter(item)]);
621
+ }), !searchStatus.value && searchList.value.length == 0 && ctx2.slots.noResultItemTemplate && showNoResultItemTemplate.value && createVNode("li", {
622
+ "class": "devui-no-result-template"
623
+ }, [createVNode("div", {
624
+ "class": "devui-no-data-tip"
625
+ }, [ctx2.slots.noResultItemTemplate()])])])]), [[resolveDirective("dLoading"), showLoading.value], [vShow, visible.value && searchList.value.length > 0 || ctx2.slots.noResultItemTemplate && showNoResultItemTemplate.value || isSearching && ctx2.slots.searchingTemplate && searchStatus.value]]);
626
+ };
627
+ }
628
+ });
629
+ const inBrowser = typeof window !== "undefined";
630
+ function on(element, eventName, handler) {
631
+ if (document.addEventListener) {
632
+ if (element && eventName && handler) {
633
+ element.addEventListener(eventName, handler, false);
634
+ }
635
+ } else {
636
+ if (element && eventName && handler) {
637
+ element.attachEvent("on" + eventName, handler);
638
+ }
639
+ }
640
+ }
641
+ const ctx = Symbol("@@clickoutside");
642
+ const nodeList = /* @__PURE__ */ new Map();
643
+ let startClick;
644
+ let nid = 0;
645
+ let isFirst = true;
646
+ function createDocumentHandler(el, binding, vnode) {
647
+ if (inBrowser && isFirst) {
648
+ isFirst = false;
649
+ on(document, "mousedown", (e) => {
650
+ startClick = e;
651
+ });
652
+ on(document, "mouseup", (e) => {
653
+ for (const [id, node] of nodeList) {
654
+ node[ctx].documentHandler(e, startClick);
655
+ }
656
+ });
657
+ }
658
+ return function(mouseup, mousedown) {
659
+ if (!vnode || !binding.instance || !mouseup.target || !mousedown.target || el.contains(mouseup.target) || el.contains(mousedown.target) || el === mouseup.target) {
660
+ return;
661
+ }
662
+ el[ctx].bindingFn && el[ctx].bindingFn();
663
+ };
664
+ }
665
+ const clickoutsideDirective = {
666
+ beforeMount: function(el, binding, vnode) {
667
+ nid++;
668
+ nodeList.set(nid, el);
669
+ el[ctx] = {
670
+ nid,
671
+ documentHandler: createDocumentHandler(el, binding, vnode),
672
+ bindingFn: binding.value
673
+ };
674
+ },
675
+ updated: function(el, binding, vnode) {
676
+ el[ctx].documentHandler = createDocumentHandler(el, binding, vnode);
677
+ el[ctx].bindingFn = binding.value;
678
+ },
679
+ unmounted: function(el) {
680
+ nodeList.delete(el[ctx].nid);
681
+ delete el[ctx];
682
+ }
683
+ };
684
+ const flexibleOverlayProps = {
685
+ modelValue: {
686
+ type: Boolean,
687
+ default: false
688
+ },
689
+ origin: {
690
+ type: Object,
691
+ require: true
692
+ },
693
+ position: {
694
+ type: Array,
695
+ default: ["bottom"]
696
+ },
697
+ offset: {
698
+ type: [Number, Object],
699
+ default: 8
700
+ },
701
+ align: {
702
+ type: String,
703
+ default: null
704
+ },
705
+ showArrow: {
706
+ type: Boolean,
707
+ default: false
708
+ },
709
+ isArrowCenter: {
710
+ type: Boolean,
711
+ default: true
712
+ }
713
+ };
714
+ function getScrollParent(element) {
715
+ const overflowRegex = /(auto|scroll|hidden)/;
716
+ for (let parent = element; parent = parent.parentElement; parent.parentElement !== document.body) {
717
+ const style = window.getComputedStyle(parent);
718
+ if (overflowRegex.test(style.overflow + style.overflowX + style.overflowY)) {
719
+ return parent;
720
+ }
721
+ }
722
+ return window;
723
+ }
724
+ function adjustArrowPosition(isArrowCenter, point, placement, originRect) {
725
+ let { x, y } = point;
726
+ if (!isArrowCenter) {
727
+ const { width, height } = originRect;
728
+ if (x && placement.includes("start")) {
729
+ x = 12;
730
+ }
731
+ if (x && placement.includes("end")) {
732
+ x = Math.round(width - 24);
733
+ }
734
+ if (y && placement.includes("start")) {
735
+ y = 10;
736
+ }
737
+ if (y && placement.includes("end")) {
738
+ y = height - 14;
739
+ }
740
+ }
741
+ return { x, y };
742
+ }
743
+ function useOverlay(props, emit) {
744
+ const overlayRef = ref();
745
+ const arrowRef = ref();
746
+ const updateArrowPosition = (arrowEl, placement, point, overlayEl) => {
747
+ const { x, y } = adjustArrowPosition(props.isArrowCenter, point, placement, overlayEl.getBoundingClientRect());
748
+ const staticSide = {
749
+ top: "bottom",
750
+ right: "left",
751
+ bottom: "top",
752
+ left: "right"
753
+ }[placement.split("-")[0]];
754
+ Object.assign(arrowEl.style, {
755
+ left: x ? `${x}px` : "",
756
+ top: y ? `${y}px` : "",
757
+ right: "",
758
+ bottom: "",
759
+ [staticSide]: "-4px"
760
+ });
761
+ };
762
+ const updatePosition = async () => {
763
+ const hostEl = props.origin;
764
+ const overlayEl = unref(overlayRef.value);
765
+ const arrowEl = unref(arrowRef.value);
766
+ const middleware = [
767
+ shift(),
768
+ offset(props.offset),
769
+ autoPlacement({
770
+ alignment: props.align,
771
+ allowedPlacements: props.position
772
+ })
773
+ ];
774
+ props.showArrow && middleware.push(arrow({ element: arrowEl }));
775
+ const { x, y, placement, middlewareData } = await computePosition(hostEl, overlayEl, {
776
+ strategy: "fixed",
777
+ middleware
778
+ });
779
+ emit("positionChange", placement);
780
+ Object.assign(overlayEl.style, { top: `${y}px`, left: `${x}px` });
781
+ props.showArrow && updateArrowPosition(arrowEl, placement, middlewareData.arrow, overlayEl);
782
+ };
783
+ watch(() => props.modelValue, () => {
784
+ const originParent = getScrollParent(props.origin);
785
+ if (props.modelValue && props.origin) {
786
+ nextTick(updatePosition);
787
+ originParent.addEventListener("scroll", updatePosition);
788
+ originParent !== window && window.addEventListener("scroll", updatePosition);
789
+ window.addEventListener("resize", updatePosition);
790
+ } else {
791
+ originParent.removeEventListener("scroll", updatePosition);
792
+ originParent !== window && window.removeEventListener("scroll", updatePosition);
793
+ window.removeEventListener("resize", updatePosition);
794
+ }
795
+ });
796
+ onUnmounted(() => {
797
+ const originParent = getScrollParent(props.origin);
798
+ originParent.removeEventListener("scroll", updatePosition);
799
+ originParent !== window && window.removeEventListener("scroll", updatePosition);
800
+ window.removeEventListener("resize", updatePosition);
801
+ });
802
+ return { arrowRef, overlayRef, updatePosition };
803
+ }
804
+ var flexibleOverlay = "";
805
+ const FlexibleOverlay = defineComponent({
806
+ name: "DFlexibleOverlay",
807
+ inheritAttrs: false,
808
+ props: flexibleOverlayProps,
809
+ emits: ["update:modelValue", "positionChange"],
810
+ setup(props, {
811
+ slots,
812
+ attrs,
813
+ emit,
814
+ expose
815
+ }) {
816
+ const {
817
+ arrowRef,
818
+ overlayRef,
819
+ updatePosition
820
+ } = useOverlay(props, emit);
821
+ expose({
822
+ updatePosition
823
+ });
824
+ return () => {
825
+ var _a;
826
+ return props.modelValue && createVNode("div", mergeProps({
827
+ "ref": overlayRef,
828
+ "class": "devui-flexible-overlay"
829
+ }, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots), props.showArrow && createVNode("div", {
830
+ "ref": arrowRef,
831
+ "class": "devui-flexible-overlay-arrow"
832
+ }, null)]);
833
+ };
834
+ }
835
+ });
836
+ function _isSlot(s) {
837
+ return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
838
+ }
839
+ var AutoComplete = defineComponent({
840
+ name: "DAutoComplete",
841
+ directives: {
842
+ ClickOutside: clickoutsideDirective
843
+ },
844
+ props: autoCompleteProps,
845
+ emits: ["update:modelValue"],
846
+ setup(props, ctx2) {
847
+ const {
848
+ disabled,
849
+ modelValue,
850
+ appendToBody,
851
+ dAutoCompleteWidth,
852
+ delay,
853
+ allowEmptyValueSearch,
854
+ formatter,
855
+ transInputFocusEmit,
856
+ selectValue,
857
+ source,
858
+ searchFn,
859
+ appendToBodyDirections,
860
+ latestSource,
861
+ showAnimation
862
+ } = toRefs(props);
863
+ const {
864
+ handleSearch,
865
+ searchList,
866
+ showNoResultItemTemplate,
867
+ recentlyFocus
868
+ } = useSearchFn(ctx2, allowEmptyValueSearch, source, searchFn, formatter);
869
+ const {
870
+ onInput,
871
+ onFocus,
872
+ inputRef,
873
+ visible,
874
+ searchStatus,
875
+ handleClose,
876
+ toggleMenu
877
+ } = useInputHandle(ctx2, searchList, showNoResultItemTemplate, modelValue, disabled, delay, handleSearch, transInputFocusEmit, recentlyFocus, latestSource);
878
+ const {
879
+ selectedIndex,
880
+ selectOptionClick
881
+ } = useSelectHandle(ctx2, searchList, selectValue, handleSearch, formatter, handleClose);
882
+ const {
883
+ showLoading,
884
+ dropDownRef,
885
+ loadMore
886
+ } = useLazyHandle(props, ctx2, handleSearch);
887
+ const {
888
+ customRenderSolts
889
+ } = useCustomTemplate(ctx2, modelValue);
890
+ const {
891
+ hoverIndex,
892
+ handlekeyDown
893
+ } = useKeyBoardHandle(dropDownRef, visible, searchList, selectedIndex, searchStatus, showNoResultItemTemplate, selectOptionClick, handleClose);
894
+ provide(DropdownPropsKey, {
895
+ props,
896
+ visible,
897
+ term: "",
898
+ searchList,
899
+ selectedIndex,
900
+ searchStatus,
901
+ selectOptionClick,
902
+ dropDownRef,
903
+ showLoading,
904
+ loadMore,
905
+ latestSource,
906
+ modelValue,
907
+ showNoResultItemTemplate,
908
+ hoverIndex
909
+ });
910
+ const origin = ref();
911
+ const position = reactive({
912
+ appendToBodyDirections: {}
913
+ });
914
+ position.appendToBodyDirections = appendToBodyDirections;
915
+ const renderDropdown = () => {
916
+ if (appendToBody.value) {
917
+ let _slot;
918
+ return createVNode(FlexibleOverlay, {
919
+ "hasBackdrop": false,
920
+ "origin": origin,
921
+ "position": position.appendToBodyDirections,
922
+ "visible": visible.value,
923
+ "onUpdate:visible": ($event) => visible.value = $event
924
+ }, {
925
+ default: () => [createVNode("div", {
926
+ "class": "devui-dropdown devui-auto-complete-menu",
927
+ "style": {
928
+ width: dAutoCompleteWidth.value > 0 && dAutoCompleteWidth.value + "px"
929
+ }
930
+ }, [createVNode(DAutoCompleteDropdown, null, _isSlot(_slot = customRenderSolts()) ? _slot : {
931
+ default: () => [_slot]
932
+ })])]
933
+ });
934
+ } else {
935
+ let _slot2;
936
+ return createVNode("div", {
937
+ "class": "devui-dropdown",
938
+ "style": {
939
+ width: dAutoCompleteWidth.value > 0 && dAutoCompleteWidth.value + "px"
940
+ }
941
+ }, [createVNode(Transition, {
942
+ "name": showAnimation ? "fade" : ""
943
+ }, {
944
+ default: () => [createVNode(DAutoCompleteDropdown, null, _isSlot(_slot2 = customRenderSolts()) ? _slot2 : {
945
+ default: () => [_slot2]
946
+ })]
947
+ })]);
948
+ }
949
+ };
950
+ return () => {
951
+ return withDirectives(createVNode("div", {
952
+ "class": ["devui-auto-complete", "devui-form-group", "devui-has-feedback", visible.value && "devui-select-open"],
953
+ "ref": origin,
954
+ "style": {
955
+ width: dAutoCompleteWidth.value > 0 && dAutoCompleteWidth.value + "px"
956
+ }
957
+ }, [createVNode("input", {
958
+ "disabled": disabled.value,
959
+ "type": "text",
960
+ "onClick": toggleMenu,
961
+ "class": ["devui-form-control", "devui-dropdown-origin", "devui-dropdown-origin-open", disabled.value && "disabled"],
962
+ "placeholder": "Search",
963
+ "onInput": onInput,
964
+ "onFocus": onFocus,
965
+ "value": modelValue.value,
966
+ "ref": inputRef,
967
+ "onKeydown": handlekeyDown
968
+ }, null), renderDropdown()]), [[resolveDirective("click-outside"), handleClose]]);
969
+ };
970
+ }
971
+ });
972
+ AutoComplete.install = function(app) {
973
+ app.component(AutoComplete.name, AutoComplete);
974
+ };
975
+ var index = {
976
+ title: "AutoComplete \u81EA\u52A8\u8865\u5168",
977
+ category: "\u6570\u636E\u5F55\u5165",
978
+ status: "100%",
979
+ install(app) {
980
+ app.use(AutoComplete);
981
+ }
982
+ };
983
+ export { AutoComplete, index as default };