vue-devui 1.0.0-rc.1 → 1.0.0-rc.4

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 (293) hide show
  1. package/README.md +132 -200
  2. package/auto-complete/index.es.js +150 -110
  3. package/auto-complete/index.umd.js +5 -1
  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 +23 -15
  8. package/button/index.umd.js +1 -1
  9. package/button/style.css +1 -1
  10. package/card/index.es.js +3 -6
  11. package/card/index.umd.js +1 -1
  12. package/checkbox/index.es.js +5 -11
  13. package/checkbox/index.umd.js +1 -1
  14. package/comment/index.es.js +4 -6
  15. package/comment/index.umd.js +1 -1
  16. package/countdown/index.es.js +3 -6
  17. package/countdown/index.umd.js +1 -1
  18. package/editable-select/index.es.js +120 -167
  19. package/editable-select/index.umd.js +1 -1
  20. package/grid/index.es.js +30 -36
  21. package/grid/index.umd.js +1 -1
  22. package/image-preview/index.es.js +19 -19
  23. package/image-preview/index.umd.js +1 -1
  24. package/input/index.es.js +2 -5
  25. package/input/index.umd.js +1 -1
  26. package/layout/index.es.js +9 -22
  27. package/layout/index.umd.js +1 -1
  28. package/loading/index.es.js +40 -25
  29. package/loading/index.umd.js +1 -1
  30. package/modal/index.es.js +55 -47
  31. package/modal/index.umd.js +1 -1
  32. package/notification/index.es.js +100 -10
  33. package/notification/index.umd.js +1 -1
  34. package/notification/style.css +1 -1
  35. package/nuxt/components/DropdownPropsKey.js +3 -0
  36. package/nuxt/components/LoadingOptions.js +3 -0
  37. package/nuxt/components/autoCompleteProps.js +3 -0
  38. package/nuxt/components/avatarProps.js +3 -0
  39. package/nuxt/components/cardProps.js +3 -0
  40. package/nuxt/components/checkboxGroupInjectionKey.js +3 -0
  41. package/nuxt/components/checkboxGroupProps.js +3 -0
  42. package/nuxt/components/checkboxProps.js +3 -0
  43. package/nuxt/components/colProps.js +3 -0
  44. package/nuxt/components/colPropsBaseClass.js +3 -0
  45. package/nuxt/components/colPropsBaseStyle.js +3 -0
  46. package/nuxt/components/commentProps.js +3 -0
  47. package/nuxt/components/countdownProps.js +3 -0
  48. package/nuxt/components/editableSelectProps.js +3 -0
  49. package/nuxt/components/imagePreviewProps.js +3 -0
  50. package/nuxt/components/inputProps.js +3 -0
  51. package/nuxt/components/loadingProps.js +3 -0
  52. package/nuxt/components/modalProps.js +3 -0
  53. package/nuxt/components/progressProps.js +3 -0
  54. package/nuxt/components/rateProps.js +3 -0
  55. package/nuxt/components/readTipProps.js +3 -0
  56. package/nuxt/components/resultProps.js +3 -0
  57. package/nuxt/components/rowProps.js +3 -0
  58. package/nuxt/components/screenSizes.js +3 -0
  59. package/nuxt/components/skeletonProps.js +3 -0
  60. package/nuxt/components/sliderProps.js +3 -0
  61. package/nuxt/components/splitterProps.js +3 -0
  62. package/nuxt/components/statisticProps.js +3 -0
  63. package/nuxt/components/switchProps.js +3 -0
  64. package/nuxt/components/tagInputProps.js +3 -0
  65. package/nuxt/components/tagProps.js +3 -0
  66. package/nuxt/components/textareaProps.js +3 -0
  67. package/nuxt/components/timeAxisProps.js +3 -0
  68. package/overlay/index.es.js +5 -5
  69. package/overlay/index.umd.js +1 -1
  70. package/package.json +1 -1
  71. package/pagination/index.es.js +14 -13
  72. package/pagination/index.umd.js +1 -1
  73. package/popover/index.es.js +7 -7
  74. package/popover/index.umd.js +12 -12
  75. package/progress/index.es.js +34 -36
  76. package/progress/index.umd.js +3 -3
  77. package/progress/style.css +1 -1
  78. package/radio/index.es.js +8 -2
  79. package/radio/index.umd.js +1 -1
  80. package/radio/style.css +1 -1
  81. package/rate/index.es.js +4 -7
  82. package/rate/index.umd.js +1 -1
  83. package/read-tip/index.es.js +34 -34
  84. package/read-tip/index.umd.js +1 -1
  85. package/read-tip/style.css +1 -1
  86. package/result/index.es.js +2 -5
  87. package/result/index.umd.js +1 -1
  88. package/ripple/index.es.js +43 -42
  89. package/ripple/index.umd.js +1 -1
  90. package/search/index.es.js +11 -11
  91. package/search/index.umd.js +8 -8
  92. package/skeleton/index.es.js +9 -12
  93. package/skeleton/index.umd.js +1 -1
  94. package/slider/index.es.js +59 -62
  95. package/slider/index.umd.js +1 -1
  96. package/splitter/index.es.js +176 -136
  97. package/splitter/index.umd.js +13 -13
  98. package/statistic/index.es.js +7 -18
  99. package/statistic/index.umd.js +1 -1
  100. package/style.css +1 -1
  101. package/switch/index.es.js +4 -7
  102. package/switch/index.umd.js +1 -1
  103. package/switch/style.css +1 -1
  104. package/tag/index.es.js +13 -17
  105. package/tag/index.umd.js +1 -1
  106. package/tag/style.css +1 -1
  107. package/tag-input/index.es.js +3 -6
  108. package/tag-input/index.umd.js +1 -1
  109. package/textarea/index.es.js +2 -5
  110. package/textarea/index.umd.js +1 -1
  111. package/timeline/index.es.js +10 -16
  112. package/timeline/index.umd.js +1 -1
  113. package/upload/index.es.js +160 -67
  114. package/upload/index.umd.js +1 -1
  115. package/upload/style.css +1 -1
  116. package/vue-devui.es.js +12182 -24718
  117. package/vue-devui.umd.js +24 -20
  118. package/accordion/index.d.ts +0 -7
  119. package/accordion/index.es.js +0 -723
  120. package/accordion/index.umd.js +0 -1
  121. package/accordion/package.json +0 -7
  122. package/accordion/style.css +0 -1
  123. package/anchor/index.d.ts +0 -7
  124. package/anchor/index.es.js +0 -263
  125. package/anchor/index.umd.js +0 -1
  126. package/anchor/package.json +0 -7
  127. package/anchor/style.css +0 -1
  128. package/back-top/index.d.ts +0 -7
  129. package/back-top/index.es.js +0 -130
  130. package/back-top/index.umd.js +0 -1
  131. package/back-top/package.json +0 -7
  132. package/back-top/style.css +0 -1
  133. package/breadcrumb/index.d.ts +0 -7
  134. package/breadcrumb/index.es.js +0 -128
  135. package/breadcrumb/index.umd.js +0 -1
  136. package/breadcrumb/package.json +0 -7
  137. package/breadcrumb/style.css +0 -1
  138. package/carousel/index.d.ts +0 -7
  139. package/carousel/index.es.js +0 -314
  140. package/carousel/index.umd.js +0 -1
  141. package/carousel/package.json +0 -7
  142. package/carousel/style.css +0 -1
  143. package/cascader/index.d.ts +0 -7
  144. package/cascader/index.es.js +0 -5971
  145. package/cascader/index.umd.js +0 -27
  146. package/cascader/package.json +0 -7
  147. package/cascader/style.css +0 -1
  148. package/color-picker/index.d.ts +0 -7
  149. package/color-picker/index.es.js +0 -8196
  150. package/color-picker/index.umd.js +0 -27
  151. package/color-picker/package.json +0 -7
  152. package/color-picker/style.css +0 -1
  153. package/date-picker/index.d.ts +0 -7
  154. package/date-picker/index.es.js +0 -1154
  155. package/date-picker/index.umd.js +0 -1
  156. package/date-picker/package.json +0 -7
  157. package/date-picker/style.css +0 -1
  158. package/dragdrop/index.d.ts +0 -7
  159. package/dragdrop/index.es.js +0 -157
  160. package/dragdrop/index.umd.js +0 -1
  161. package/dragdrop/package.json +0 -7
  162. package/drawer/index.d.ts +0 -7
  163. package/drawer/index.es.js +0 -234
  164. package/drawer/index.umd.js +0 -1
  165. package/drawer/package.json +0 -7
  166. package/drawer/style.css +0 -1
  167. package/dropdown/index.d.ts +0 -7
  168. package/dropdown/index.es.js +0 -693
  169. package/dropdown/index.umd.js +0 -1
  170. package/dropdown/package.json +0 -7
  171. package/dropdown/style.css +0 -1
  172. package/form/index.d.ts +0 -7
  173. package/form/index.es.js +0 -7876
  174. package/form/index.umd.js +0 -27
  175. package/form/package.json +0 -7
  176. package/form/style.css +0 -1
  177. package/gantt/index.d.ts +0 -7
  178. package/gantt/index.es.js +0 -523
  179. package/gantt/index.umd.js +0 -1
  180. package/gantt/package.json +0 -7
  181. package/gantt/style.css +0 -1
  182. package/input-icon/index.d.ts +0 -7
  183. package/input-icon/index.es.js +0 -332
  184. package/input-icon/index.umd.js +0 -1
  185. package/input-icon/package.json +0 -7
  186. package/input-icon/style.css +0 -1
  187. package/input-number/index.d.ts +0 -7
  188. package/input-number/index.es.js +0 -229
  189. package/input-number/index.umd.js +0 -1
  190. package/input-number/package.json +0 -7
  191. package/input-number/style.css +0 -1
  192. package/list/index.d.ts +0 -7
  193. package/list/index.es.js +0 -39
  194. package/list/index.umd.js +0 -1
  195. package/list/package.json +0 -7
  196. package/list/style.css +0 -1
  197. package/nav-sprite/index.d.ts +0 -7
  198. package/nav-sprite/index.es.js +0 -68
  199. package/nav-sprite/index.umd.js +0 -1
  200. package/nav-sprite/package.json +0 -7
  201. package/nuxt/components/Accordion.js +0 -3
  202. package/nuxt/components/Anchor.js +0 -3
  203. package/nuxt/components/BackTop.js +0 -3
  204. package/nuxt/components/Breadcrumb.js +0 -3
  205. package/nuxt/components/Carousel.js +0 -3
  206. package/nuxt/components/CarouselItem.js +0 -3
  207. package/nuxt/components/Cascader.js +0 -3
  208. package/nuxt/components/ColorPicker.js +0 -3
  209. package/nuxt/components/Column.js +0 -3
  210. package/nuxt/components/DatePicker.js +0 -3
  211. package/nuxt/components/Drawer.js +0 -3
  212. package/nuxt/components/DrawerService.js +0 -3
  213. package/nuxt/components/Dropdown.js +0 -3
  214. package/nuxt/components/DropdownMenu.js +0 -3
  215. package/nuxt/components/Form.js +0 -3
  216. package/nuxt/components/FormControl.js +0 -3
  217. package/nuxt/components/FormItem.js +0 -3
  218. package/nuxt/components/FormLabel.js +0 -3
  219. package/nuxt/components/FormOperation.js +0 -3
  220. package/nuxt/components/Gantt.js +0 -3
  221. package/nuxt/components/InputIcon.js +0 -3
  222. package/nuxt/components/InputNumber.js +0 -3
  223. package/nuxt/components/List.js +0 -3
  224. package/nuxt/components/ListItem.js +0 -3
  225. package/nuxt/components/NavSprite.js +0 -2
  226. package/nuxt/components/QuadrantDiagram.js +0 -3
  227. package/nuxt/components/Select.js +0 -3
  228. package/nuxt/components/StepsGuide.js +0 -3
  229. package/nuxt/components/StickSlider.js +0 -3
  230. package/nuxt/components/Sticky.js +0 -2
  231. package/nuxt/components/Table.js +0 -3
  232. package/nuxt/components/Tabs.js +0 -3
  233. package/nuxt/components/TimePicker.js +0 -3
  234. package/nuxt/components/Tooltip.js +0 -3
  235. package/nuxt/components/Transfer.js +0 -3
  236. package/nuxt/components/Tree.js +0 -3
  237. package/nuxt/components/TreeSelect.js +0 -3
  238. package/nuxt/components/dropdownMenuProps.js +0 -3
  239. package/nuxt/components/tooltipProps.js +0 -3
  240. package/quadrant-diagram/index.d.ts +0 -7
  241. package/quadrant-diagram/index.es.js +0 -5728
  242. package/quadrant-diagram/index.umd.js +0 -27
  243. package/quadrant-diagram/package.json +0 -7
  244. package/quadrant-diagram/style.css +0 -1
  245. package/select/index.d.ts +0 -7
  246. package/select/index.es.js +0 -706
  247. package/select/index.umd.js +0 -1
  248. package/select/package.json +0 -7
  249. package/select/style.css +0 -1
  250. package/steps-guide/index.d.ts +0 -7
  251. package/steps-guide/index.es.js +0 -242
  252. package/steps-guide/index.umd.js +0 -1
  253. package/steps-guide/package.json +0 -7
  254. package/steps-guide/style.css +0 -1
  255. package/sticky/index.d.ts +0 -7
  256. package/sticky/index.es.js +0 -197
  257. package/sticky/index.umd.js +0 -1
  258. package/sticky/package.json +0 -7
  259. package/table/index.d.ts +0 -7
  260. package/table/index.es.js +0 -2024
  261. package/table/index.umd.js +0 -1
  262. package/table/package.json +0 -7
  263. package/table/style.css +0 -1
  264. package/tabs/index.d.ts +0 -7
  265. package/tabs/index.es.js +0 -194
  266. package/tabs/index.umd.js +0 -1
  267. package/tabs/package.json +0 -7
  268. package/tabs/style.css +0 -1
  269. package/time-picker/index.d.ts +0 -7
  270. package/time-picker/index.es.js +0 -1238
  271. package/time-picker/index.umd.js +0 -1
  272. package/time-picker/package.json +0 -7
  273. package/time-picker/style.css +0 -1
  274. package/tooltip/index.d.ts +0 -7
  275. package/tooltip/index.es.js +0 -5835
  276. package/tooltip/index.umd.js +0 -27
  277. package/tooltip/package.json +0 -7
  278. package/tooltip/style.css +0 -1
  279. package/transfer/index.d.ts +0 -7
  280. package/transfer/index.es.js +0 -7615
  281. package/transfer/index.umd.js +0 -27
  282. package/transfer/package.json +0 -7
  283. package/transfer/style.css +0 -1
  284. package/tree/index.d.ts +0 -7
  285. package/tree/index.es.js +0 -6495
  286. package/tree/index.umd.js +0 -27
  287. package/tree/package.json +0 -7
  288. package/tree/style.css +0 -1
  289. package/tree-select/index.d.ts +0 -7
  290. package/tree-select/index.es.js +0 -627
  291. package/tree-select/index.umd.js +0 -1
  292. package/tree-select/package.json +0 -7
  293. package/tree-select/style.css +0 -1
@@ -18,9 +18,14 @@ var __publicField = (obj, key, value) => {
18
18
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
19
19
  return value;
20
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";
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: {
@@ -39,14 +44,9 @@ const autoCompleteProps = {
39
44
  type: Boolean,
40
45
  default: false
41
46
  },
42
- appendToBodyDirections: {
43
- type: Object,
44
- default: () => ({
45
- originX: "left",
46
- originY: "bottom",
47
- overlayX: "left",
48
- overlayY: "top"
49
- })
47
+ position: {
48
+ type: Array,
49
+ default: ["bottom-end"]
50
50
  },
51
51
  disabled: {
52
52
  type: Boolean,
@@ -92,9 +92,9 @@ const autoCompleteProps = {
92
92
  type: Boolean,
93
93
  default: false
94
94
  },
95
- dAutoCompleteWidth: {
95
+ width: {
96
96
  type: Number,
97
- default: null
97
+ default: 400
98
98
  },
99
99
  showAnimation: {
100
100
  type: Boolean,
@@ -121,32 +121,32 @@ const DropdownPropsKey = Symbol("DropdownPropsKey");
121
121
  function useCustomTemplate(ctx2, modelValue) {
122
122
  const itemTemplate = (item, index2) => {
123
123
  const arr = { item, index: index2 };
124
- if (ctx2.slots.itemTemplate) {
125
- return ctx2.slots.itemTemplate(arr);
124
+ if (ctx2.slots.item) {
125
+ return ctx2.slots.item(arr);
126
126
  }
127
127
  return null;
128
128
  };
129
129
  const noResultItemTemplate = () => {
130
- if (ctx2.slots.noResultItemTemplate) {
131
- return ctx2.slots.noResultItemTemplate(modelValue.value);
130
+ if (ctx2.slots.nothing) {
131
+ return ctx2.slots.nothing(modelValue.value);
132
132
  }
133
133
  return null;
134
134
  };
135
135
  const searchingTemplate = () => {
136
- if (ctx2.slots.searchingTemplate) {
137
- return ctx2.slots.searchingTemplate(modelValue.value);
136
+ if (ctx2.slots.searching) {
137
+ return ctx2.slots.searching(modelValue.value);
138
138
  }
139
139
  return null;
140
140
  };
141
141
  const customRenderSolts = () => {
142
142
  const slots = {};
143
- if (ctx2.slots.itemTemplate) {
143
+ if (ctx2.slots.item) {
144
144
  slots["itemTemplate"] = itemTemplate;
145
145
  }
146
- if (ctx2.slots.noResultItemTemplate) {
146
+ if (ctx2.slots.nothing) {
147
147
  slots["noResultItemTemplate"] = noResultItemTemplate;
148
148
  }
149
- if (ctx2.slots.searchingTemplate) {
149
+ if (ctx2.slots.searching) {
150
150
  slots["searchingTemplate"] = searchingTemplate;
151
151
  }
152
152
  return slots;
@@ -156,8 +156,19 @@ function useCustomTemplate(ctx2, modelValue) {
156
156
  function useSearchFn(ctx2, allowEmptyValueSearch, source, searchFn, formatter) {
157
157
  const searchList = ref([]);
158
158
  const showNoResultItemTemplate = ref(false);
159
- const handleSearch = async (term, enableLazyLoad) => {
160
- if (term == "" && !allowEmptyValueSearch.value) {
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) => {
171
+ if (term === "" && !allowEmptyValueSearch.value) {
161
172
  searchList.value = [];
162
173
  showNoResultItemTemplate.value = false;
163
174
  return;
@@ -167,18 +178,12 @@ function useSearchFn(ctx2, allowEmptyValueSearch, source, searchFn, formatter) {
167
178
  if (enableLazyLoad) {
168
179
  arr = source.value;
169
180
  } 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
- });
181
+ arr = defaultSearchFn(term);
177
182
  } else {
178
183
  arr = await searchFn.value(term);
179
184
  }
180
185
  searchList.value = arr;
181
- if (searchList.value.length == 0) {
186
+ if (searchList.value.length === 0) {
182
187
  showNoResultItemTemplate.value = true;
183
188
  } else {
184
189
  showNoResultItemTemplate.value = false;
@@ -202,13 +207,13 @@ function useInputHandle(ctx2, searchList, showNoResultItemTemplate, modelValue,
202
207
  const searchStatus = ref(false);
203
208
  const debounce = (cb, time) => {
204
209
  let timer;
205
- return (...args) => {
210
+ return (arg) => {
206
211
  if (timer) {
207
212
  clearTimeout(timer);
208
213
  }
209
214
  timer = setTimeout(async () => {
210
215
  searchStatus.value = true;
211
- await cb(...args);
216
+ await cb(arg);
212
217
  searchStatus.value = false;
213
218
  }, time);
214
219
  };
@@ -227,7 +232,7 @@ function useInputHandle(ctx2, searchList, showNoResultItemTemplate, modelValue,
227
232
  };
228
233
  const onFocus = () => {
229
234
  handleSearch(modelValue.value);
230
- recentlyFocus(latestSource.value);
235
+ recentlyFocus(latestSource == null ? void 0 : latestSource.value);
231
236
  transInputFocusEmit.value && transInputFocusEmit.value();
232
237
  };
233
238
  const handleClose = () => {
@@ -241,7 +246,7 @@ function useInputHandle(ctx2, searchList, showNoResultItemTemplate, modelValue,
241
246
  handleClose();
242
247
  } else {
243
248
  visible.value = true;
244
- if (ctx2.slots.noResultItemTemplate && searchList.value.length == 0 && modelValue.value.trim() != "") {
249
+ if (ctx2.slots.noResultItemTemplate && searchList.value.length === 0 && modelValue.value.trim() !== "") {
245
250
  showNoResultItemTemplate.value = true;
246
251
  }
247
252
  }
@@ -259,12 +264,23 @@ function useInputHandle(ctx2, searchList, showNoResultItemTemplate, modelValue,
259
264
  }
260
265
  function useSelectHandle(ctx2, searchList, selectValue, handleSearch, formatter, handleClose) {
261
266
  const selectedIndex = ref(0);
262
- const getListIndex = (item) => {
263
- if (searchList.value.length == 0) {
267
+ const getListIndex = (cur) => {
268
+ if (searchList.value.length === 0) {
264
269
  return 0;
265
270
  }
266
- const ind = searchList.value.indexOf(item);
267
- return ind == -1 ? 0 : ind;
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
+ });
283
+ return ind === -1 ? 0 : ind;
268
284
  };
269
285
  const selectOptionClick = async (item) => {
270
286
  const cur = formatter.value(item);
@@ -272,7 +288,7 @@ function useSelectHandle(ctx2, searchList, selectValue, handleSearch, formatter,
272
288
  handleClose();
273
289
  await handleSearch(cur);
274
290
  selectedIndex.value = getListIndex(cur);
275
- selectValue.value && selectValue.value();
291
+ selectValue.value && selectValue.value(cur);
276
292
  };
277
293
  return {
278
294
  selectedIndex,
@@ -294,11 +310,11 @@ function useLazyHandle(props, ctx2, handleSearch) {
294
310
  showLoading.value = true;
295
311
  }
296
312
  };
297
- ctx2.expose({ loadFinish });
298
313
  async function loadFinish() {
299
314
  await handleSearch(props.modelValue, props.enableLazyLoad);
300
315
  showLoading.value = false;
301
316
  }
317
+ ctx2.expose({ loadFinish });
302
318
  return {
303
319
  showLoading,
304
320
  dropDownRef,
@@ -359,14 +375,13 @@ function useKeyBoardHandle(dropDownRef, visible, searchList, selectedIndex, sear
359
375
  handlekeyDown
360
376
  };
361
377
  }
362
- var autoComplete = "";
363
378
  class View {
364
379
  constructor() {
365
380
  __publicField(this, "top", "50%");
366
381
  __publicField(this, "left", "50%");
367
382
  }
368
383
  }
369
- const componentProps = {
384
+ const loadingProps = {
370
385
  message: String,
371
386
  backdrop: Boolean,
372
387
  view: {
@@ -379,7 +394,7 @@ const componentProps = {
379
394
  default: false
380
395
  }
381
396
  };
382
- class LoadingProps {
397
+ class LoadingOptions {
383
398
  constructor() {
384
399
  __publicField(this, "target");
385
400
  __publicField(this, "message");
@@ -394,7 +409,7 @@ var loading = "";
394
409
  var Loading = defineComponent({
395
410
  name: "DLoading",
396
411
  inheritAttrs: false,
397
- props: componentProps,
412
+ props: loadingProps,
398
413
  setup(props) {
399
414
  const style = {
400
415
  top: props.view.top,
@@ -453,8 +468,8 @@ var Loading = defineComponent({
453
468
  }
454
469
  });
455
470
  const COMPONENT_CONTAINER_SYMBOL = Symbol("dev_component_container");
456
- function createComponent(Component, props, children = null) {
457
- const vnode = h(Component, __spreadValues({}, props), children);
471
+ function createComponent(component, props, children = null) {
472
+ const vnode = h(component, __spreadValues({}, props), children);
458
473
  const container = document.createElement("div");
459
474
  vnode[COMPONENT_CONTAINER_SYMBOL] = container;
460
475
  render(vnode, container);
@@ -466,14 +481,18 @@ function unmountComponent(ComponnetInstance) {
466
481
  const loadingConstructor = defineComponent(Loading);
467
482
  const cacheInstance = /* @__PURE__ */ new WeakSet();
468
483
  const isEmpty = (val) => {
469
- if (!val)
484
+ if (!val) {
470
485
  return true;
471
- if (Array.isArray(val))
486
+ }
487
+ if (Array.isArray(val)) {
472
488
  return val.length === 0;
473
- if (val instanceof Set || val instanceof Map)
489
+ }
490
+ if (val instanceof Set || val instanceof Map) {
474
491
  return val.size === 0;
475
- if (val instanceof Promise)
492
+ }
493
+ if (val instanceof Promise) {
476
494
  return false;
495
+ }
477
496
  if (typeof val === "object") {
478
497
  try {
479
498
  return Object.keys(val).length === 0;
@@ -507,11 +526,13 @@ const unmount = (el) => {
507
526
  unmountComponent(el.instance);
508
527
  };
509
528
  const toggleLoading = (el, binding) => {
529
+ var _a, _b, _c;
510
530
  if (binding.value) {
511
531
  const vals = isPromise(binding.value);
512
- if (vals === "error")
532
+ if (vals === "error") {
513
533
  return;
514
- el.instance.proxy.open();
534
+ }
535
+ (_c = (_b = (_a = el == null ? void 0 : el.instance) == null ? void 0 : _a.proxy) == null ? void 0 : _b.open) == null ? void 0 : _c.call(_b);
515
536
  el.appendChild(el.mask);
516
537
  cacheInstance.add(el);
517
538
  if (vals) {
@@ -534,13 +555,14 @@ const removeAttribute = (el) => {
534
555
  el.removeAttribute("loadingtemplateref");
535
556
  };
536
557
  const handleProps = (el, vprops) => {
537
- const props = __spreadValues(__spreadValues({}, new LoadingProps()), vprops);
558
+ var _a;
559
+ const props = __spreadValues(__spreadValues({}, new LoadingOptions()), vprops);
538
560
  const loadingTemplateRef = props.loadingTemplateRef;
539
561
  const loadingInstance = createComponent(loadingConstructor, __spreadValues({}, props), loadingTemplateRef ? () => loadingTemplateRef : null);
540
562
  el.style.position = props.positionType;
541
563
  el.options = props;
542
564
  el.instance = loadingInstance;
543
- el.mask = loadingInstance.proxy.$el;
565
+ el.mask = (_a = loadingInstance == null ? void 0 : loadingInstance.proxy) == null ? void 0 : _a.$el;
544
566
  };
545
567
  const loadingDirective = {
546
568
  mounted: function(el, binding, vnode) {
@@ -549,8 +571,9 @@ const loadingDirective = {
549
571
  !isEmpty(binding.value) && toggleLoading(el, binding);
550
572
  },
551
573
  updated: function(el, binding, vnode) {
552
- if (!isEmpty(binding.value) && cacheInstance.has(el) || isEmpty(binding.value) && !cacheInstance.has(el))
574
+ if (!isEmpty(binding.value) && cacheInstance.has(el) || isEmpty(binding.value) && !cacheInstance.has(el)) {
553
575
  return;
576
+ }
554
577
  !cacheInstance.has(el) && handleProps(el, vnode.props);
555
578
  removeAttribute(el);
556
579
  toggleLoading(el, binding);
@@ -575,25 +598,26 @@ var DAutoCompleteDropdown = defineComponent({
575
598
  showNoResultItemTemplate,
576
599
  latestSource,
577
600
  modelValue,
578
- hoverIndex
601
+ hoverIndex,
602
+ valueParser
579
603
  } = propsData;
580
604
  const {
581
605
  disabled,
582
606
  maxHeight,
583
- appendToBody,
584
607
  formatter,
585
608
  disabledKey,
586
609
  isSearching
587
610
  } = propsData.props;
588
611
  const onSelect = (item) => {
589
- if (item[disabledKey]) {
612
+ item = valueParser.value(item);
613
+ if (typeof item === "object" && item[disabledKey]) {
590
614
  return;
591
615
  }
592
616
  selectOptionClick(item);
593
617
  };
594
618
  return () => {
595
619
  return withDirectives(createVNode("div", {
596
- "class": ["devui-dropdown-menu", appendToBody && "devui-dropdown-menu-cdk", disabled && "disabled", latestSource.value && "devui-dropdown-latestSource"]
620
+ "class": ["devui-dropdown-menu", "devui-dropdown-menu-cdk", disabled && "disabled", latestSource.value && "devui-dropdown-latestSource"]
597
621
  }, [createVNode("ul", {
598
622
  "ref": dropDownRef,
599
623
  "class": "devui-list-unstyled scroll-height",
@@ -601,28 +625,28 @@ var DAutoCompleteDropdown = defineComponent({
601
625
  maxHeight: `${maxHeight}px`
602
626
  },
603
627
  "onScroll": loadMore
604
- }, [isSearching && ctx2.slots.searchingTemplate && searchStatus.value && createVNode("li", {
628
+ }, [isSearching && ctx2.slots.searchingTemplate && (searchStatus == null ? void 0 : searchStatus.value) && createVNode("li", {
605
629
  "class": "devui-is-searching-template"
606
630
  }, [createVNode("div", {
607
631
  "class": "devui-no-data-tip"
608
632
  }, [ctx2.slots.searchingTemplate()])]), latestSource.value && !modelValue.value && createVNode("li", {
609
633
  "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) => {
634
+ }, [createTextVNode("\u6700\u8FD1\u8F93\u5165")]), !showNoResultItemTemplate.value && !(searchStatus == null ? void 0 : searchStatus.value) && searchList != null && searchList.value.length > 0 && searchList.value.map((item, index2) => {
611
635
  return createVNode("li", {
612
636
  "onClick": () => onSelect(item),
613
- "class": ["devui-dropdown-item", selectedIndex.value == index2 && "selected", {
614
- "disabled": disabledKey && item[disabledKey]
637
+ "class": ["devui-dropdown-item", selectedIndex.value === index2 && "selected", {
638
+ "disabled": disabledKey && typeof item === "object" && item[disabledKey]
615
639
  }, {
616
- "devui-dropdown-bg": hoverIndex.value == index2
640
+ "devui-dropdown-bg": hoverIndex.value === index2
617
641
  }],
618
642
  "title": formatter(item),
619
643
  "key": formatter(item)
620
644
  }, [ctx2.slots.itemTemplate ? ctx2.slots.itemTemplate(item, index2) : formatter(item)]);
621
- }), !searchStatus.value && searchList.value.length == 0 && ctx2.slots.noResultItemTemplate && showNoResultItemTemplate.value && createVNode("li", {
645
+ }), !(searchStatus == null ? void 0 : searchStatus.value) && searchList.value.length === 0 && ctx2.slots.noResultItemTemplate && showNoResultItemTemplate.value && createVNode("li", {
622
646
  "class": "devui-no-result-template"
623
647
  }, [createVNode("div", {
624
648
  "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]]);
649
+ }, [ctx2.slots.noResultItemTemplate()])])])]), [[resolveDirective("dLoading"), showLoading.value], [vShow, visible.value && searchList.value.length > 0 || ctx2.slots.noResultItemTemplate && showNoResultItemTemplate.value || isSearching && ctx2.slots.searchingTemplate && (searchStatus == null ? void 0 : searchStatus.value)]]);
626
650
  };
627
651
  }
628
652
  });
@@ -743,6 +767,7 @@ function adjustArrowPosition(isArrowCenter, point, placement, originRect) {
743
767
  function useOverlay(props, emit) {
744
768
  const overlayRef = ref();
745
769
  const arrowRef = ref();
770
+ let originParent = null;
746
771
  const updateArrowPosition = (arrowEl, placement, point, overlayEl) => {
747
772
  const { x, y } = adjustArrowPosition(props.isArrowCenter, point, placement, overlayEl.getBoundingClientRect());
748
773
  const staticSide = {
@@ -781,21 +806,20 @@ function useOverlay(props, emit) {
781
806
  props.showArrow && updateArrowPosition(arrowEl, placement, middlewareData.arrow, overlayEl);
782
807
  };
783
808
  watch(() => props.modelValue, () => {
784
- const originParent = getScrollParent(props.origin);
785
809
  if (props.modelValue && props.origin) {
810
+ originParent = getScrollParent(props.origin);
786
811
  nextTick(updatePosition);
787
- originParent.addEventListener("scroll", updatePosition);
812
+ originParent == null ? void 0 : originParent.addEventListener("scroll", updatePosition);
788
813
  originParent !== window && window.addEventListener("scroll", updatePosition);
789
814
  window.addEventListener("resize", updatePosition);
790
815
  } else {
791
- originParent.removeEventListener("scroll", updatePosition);
816
+ originParent == null ? void 0 : originParent.removeEventListener("scroll", updatePosition);
792
817
  originParent !== window && window.removeEventListener("scroll", updatePosition);
793
818
  window.removeEventListener("resize", updatePosition);
794
819
  }
795
820
  });
796
821
  onUnmounted(() => {
797
- const originParent = getScrollParent(props.origin);
798
- originParent.removeEventListener("scroll", updatePosition);
822
+ originParent == null ? void 0 : originParent.removeEventListener("scroll", updatePosition);
799
823
  originParent !== window && window.removeEventListener("scroll", updatePosition);
800
824
  window.removeEventListener("resize", updatePosition);
801
825
  });
@@ -833,6 +857,7 @@ const FlexibleOverlay = defineComponent({
833
857
  };
834
858
  }
835
859
  });
860
+ var autoComplete = "";
836
861
  function _isSlot(s) {
837
862
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
838
863
  }
@@ -847,18 +872,19 @@ var AutoComplete = defineComponent({
847
872
  const {
848
873
  disabled,
849
874
  modelValue,
850
- appendToBody,
851
- dAutoCompleteWidth,
875
+ width,
852
876
  delay,
853
877
  allowEmptyValueSearch,
878
+ appendToBody,
854
879
  formatter,
855
880
  transInputFocusEmit,
856
881
  selectValue,
857
882
  source,
858
883
  searchFn,
859
- appendToBodyDirections,
884
+ position,
860
885
  latestSource,
861
- showAnimation
886
+ showAnimation,
887
+ valueParser
862
888
  } = toRefs(props);
863
889
  const {
864
890
  handleSearch,
@@ -905,46 +931,63 @@ var AutoComplete = defineComponent({
905
931
  latestSource,
906
932
  modelValue,
907
933
  showNoResultItemTemplate,
908
- hoverIndex
934
+ hoverIndex,
935
+ valueParser
909
936
  });
910
937
  const origin = ref();
911
- const position = reactive({
912
- appendToBodyDirections: {}
913
- });
914
- position.appendToBodyDirections = appendToBodyDirections;
915
938
  const renderDropdown = () => {
916
939
  if (appendToBody.value) {
917
940
  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
941
+ return createVNode(Teleport, {
942
+ "to": "body"
924
943
  }, {
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
- })])]
944
+ default: () => [createVNode(Transition, {
945
+ "name": showAnimation ? "fade" : ""
946
+ }, {
947
+ default: () => [createVNode(FlexibleOverlay, {
948
+ "show-arrow": true,
949
+ "origin": origin.value,
950
+ "position": position.value,
951
+ "modelValue": visible.value,
952
+ "onUpdate:modelValue": ($event) => visible.value = $event
953
+ }, {
954
+ default: () => [createVNode("div", {
955
+ "class": "devui-auto-complete-menu",
956
+ "style": {
957
+ width: `
958
+ ${width.value + "px"}
959
+ `
960
+ }
961
+ }, [createVNode(DAutoCompleteDropdown, null, _isSlot(_slot = customRenderSolts()) ? _slot : {
962
+ default: () => [_slot]
963
+ })])]
964
+ })]
965
+ })]
933
966
  });
934
967
  } else {
935
968
  let _slot2;
936
- return createVNode("div", {
937
- "class": "devui-dropdown",
938
- "style": {
939
- width: dAutoCompleteWidth.value > 0 && dAutoCompleteWidth.value + "px"
940
- }
941
- }, [createVNode(Transition, {
969
+ return createVNode(Transition, {
942
970
  "name": showAnimation ? "fade" : ""
943
971
  }, {
944
- default: () => [createVNode(DAutoCompleteDropdown, null, _isSlot(_slot2 = customRenderSolts()) ? _slot2 : {
945
- default: () => [_slot2]
972
+ default: () => [createVNode(FlexibleOverlay, {
973
+ "show-arrow": true,
974
+ "origin": origin.value,
975
+ "position": position.value,
976
+ "modelValue": visible.value,
977
+ "onUpdate:modelValue": ($event) => visible.value = $event
978
+ }, {
979
+ default: () => [createVNode("div", {
980
+ "class": "devui-auto-complete-menu",
981
+ "style": {
982
+ width: `
983
+ ${width.value + "px"}
984
+ `
985
+ }
986
+ }, [createVNode(DAutoCompleteDropdown, null, _isSlot(_slot2 = customRenderSolts()) ? _slot2 : {
987
+ default: () => [_slot2]
988
+ })])]
946
989
  })]
947
- })]);
990
+ });
948
991
  }
949
992
  };
950
993
  return () => {
@@ -952,7 +995,7 @@ var AutoComplete = defineComponent({
952
995
  "class": ["devui-auto-complete", "devui-form-group", "devui-has-feedback", visible.value && "devui-select-open"],
953
996
  "ref": origin,
954
997
  "style": {
955
- width: dAutoCompleteWidth.value > 0 && dAutoCompleteWidth.value + "px"
998
+ width: `${width.value + "px"}`
956
999
  }
957
1000
  }, [createVNode("input", {
958
1001
  "disabled": disabled.value,
@@ -969,15 +1012,12 @@ var AutoComplete = defineComponent({
969
1012
  };
970
1013
  }
971
1014
  });
972
- AutoComplete.install = function(app) {
973
- app.component(AutoComplete.name, AutoComplete);
974
- };
975
1015
  var index = {
976
1016
  title: "AutoComplete \u81EA\u52A8\u8865\u5168",
977
1017
  category: "\u6570\u636E\u5F55\u5165",
978
1018
  status: "100%",
979
1019
  install(app) {
980
- app.use(AutoComplete);
1020
+ app.component(AutoComplete.name, AutoComplete);
981
1021
  }
982
1022
  };
983
- export { AutoComplete, index as default };
1023
+ export { AutoComplete, DropdownPropsKey, autoCompleteProps, index as default };
@@ -1 +1,5 @@
1
- var Be=Object.defineProperty;var re=Object.getOwnPropertySymbols;var Oe=Object.prototype.hasOwnProperty,je=Object.prototype.propertyIsEnumerable;var O=(p,t,m)=>t in p?Be(p,t,{enumerable:!0,configurable:!0,writable:!0,value:m}):p[t]=m,E=(p,t)=>{for(var m in t||(t={}))Oe.call(t,m)&&O(p,m,t[m]);if(re)for(var m of re(t))je.call(t,m)&&O(p,m,t[m]);return p};var C=(p,t,m)=>(O(p,typeof t!="symbol"?t+"":t,m),m);(function(p,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue"),require("@floating-ui/dom")):typeof define=="function"&&define.amd?define(["exports","vue","@floating-ui/dom"],t):(p=typeof globalThis!="undefined"?globalThis:p||self,t(p.index={},p.Vue,p.dom))})(this,function(p,t,m){"use strict";const se={modelValue:{type:String,default:""},source:{type:Array,default:null},allowEmptyValueSearch:{type:Boolean,default:!1},appendToBody:{type:Boolean,default:!1},appendToBodyDirections:{type:Object,default:()=>({originX:"left",originY:"bottom",overlayX:"left",overlayY:"top"})},disabled:{type:Boolean,default:!1},delay:{type:Number,default:300},disabledKey:{type:String,default:null},formatter:{type:Function,default:e=>e?e.label||e.toString():""},isSearching:{type:Boolean,default:!1},sceneType:{type:String,default:null},searchFn:{type:Function,default:null},tipsText:{type:String,default:"\u6700\u8FD1\u8F93\u5165"},latestSource:{type:Array,default:null},valueParser:{type:Function,default:e=>e},enableLazyLoad:{type:Boolean,default:!1},dAutoCompleteWidth:{type:Number,default:null},showAnimation:{type:Boolean,default:!0},maxHeight:{type:Number,default:300},transInputFocusEmit:{type:Function,default:null},selectValue:{type:Function,default:null},loadMore:{type:Function,default:null}},j=Symbol("DropdownPropsKey");function ie(e,n){const o=(r,u)=>{const i={item:r,index:u};return e.slots.itemTemplate?e.slots.itemTemplate(i):null},l=()=>e.slots.noResultItemTemplate?e.slots.noResultItemTemplate(n.value):null,s=()=>e.slots.searchingTemplate?e.slots.searchingTemplate(n.value):null;return{customRenderSolts:()=>{const r={};return e.slots.itemTemplate&&(r.itemTemplate=o),e.slots.noResultItemTemplate&&(r.noResultItemTemplate=l),e.slots.searchingTemplate&&(r.searchingTemplate=s),r}}}function ue(e,n,o,l,s){const a=t.ref([]),r=t.ref(!1);return{handleSearch:async(d,c)=>{if(d==""&&!n.value){a.value=[],r.value=!1;return}let v=[];d=d.toLowerCase(),c?v=o.value:l.value?v=await l.value(d):o.value.forEach(f=>{let y=s.value(f);y=y.toLowerCase(),y.startsWith(d)&&v.push(f)}),a.value=v,a.value.length==0?r.value=!0:r.value=!1},recentlyFocus:d=>{d&&(a.value=d)},searchList:a,showNoResultItemTemplate:r}}function de(e,n,o,l,s,a,r,u,i,d){const c=t.ref(!1),v=t.ref(),f=t.ref(!1),h=((S,D)=>{let g;return(...b)=>{g&&clearTimeout(g),g=setTimeout(async()=>{f.value=!0,await S(...b),f.value=!1},D)}})(async S=>{await r(S),c.value=!0},a.value),T=S=>{const D=S.target;f.value=!1,o.value=!1,e.emit("update:modelValue",D.value),h(D.value)},A=()=>{r(l.value),i(d.value),u.value&&u.value()},V=()=>{c.value=!1,f.value=!1,o.value=!1};return{handleClose:V,toggleMenu:()=>{s.value||(c.value?V():(c.value=!0,e.slots.noResultItemTemplate&&n.value.length==0&&l.value.trim()!=""&&(o.value=!0)))},onInput:T,onFocus:A,inputRef:v,visible:c,searchStatus:f}}function ce(e,n,o,l,s,a){const r=t.ref(0),u=d=>{if(n.value.length==0)return 0;const c=n.value.indexOf(d);return c==-1?0:c};return{selectedIndex:r,selectOptionClick:async d=>{const c=s.value(d);e.emit("update:modelValue",c),a(),await l(c),r.value=u(c),o.value&&o.value()}}}function fe(e,n,o){const l=t.ref(!1),s=t.ref(),a=()=>{if(!e.enableLazyLoad&&l)return;const u=s.value,i=u.scrollHeight,d=u.clientHeight+u.scrollTop;d>=i&&d>=e.maxHeight&&(e.loadMore(),l.value=!0)};n.expose({loadFinish:r});async function r(){await o(e.modelValue,e.enableLazyLoad),l.value=!1}return{showLoading:l,dropDownRef:s,loadMore:a}}function pe(e,n,o,l,s,a,r,u){var v;const i=t.ref((v=l.value)!=null?v:0),d=f=>{const y=e.value,w=y.children[f];t.nextTick(()=>{if(w.scrollIntoViewIfNeeded)w.scrollIntoViewIfNeeded(!1);else{const h=y.getBoundingClientRect(),T=w.getBoundingClientRect();(T.bottom>h.bottom||T.top<h.top)&&w.scrollIntoView(!1)}})};return{hoverIndex:i,handlekeyDown:f=>{var h;const y=f.key||f.code;if(y==="Escape"&&(n.value&&o.value.length||s.value||a.value)){u();return}const w=n.value&&o.value.length&&!s.value&&!a.value;if(y==="ArrowDown"&&w){if(i.value===o.value.length-1){i.value=0,d(i.value);return}i.value=i.value+1,d(i.value)}else if(y==="ArrowUp"&&w){if(i.value===0){i.value=o.value.length-1,d(i.value);return}i.value=i.value-1,d(i.value)}if(y==="Enter"&&w){r(o.value[i.value]),i.value=(h=l.value)!=null?h:0;return}}}}var ze="";class M{constructor(){C(this,"top","50%");C(this,"left","50%")}}const ve={message:String,backdrop:Boolean,view:{type:Object,default:()=>new M},zIndex:Number,isFull:{type:Boolean,default:!1}};class me{constructor(){C(this,"target");C(this,"message");C(this,"loadingTemplateRef");C(this,"backdrop",!0);C(this,"positionType","relative");C(this,"view",new M);C(this,"zIndex")}}var _e="",ye=t.defineComponent({name:"DLoading",inheritAttrs:!1,props:ve,setup(e){const n={top:e.view.top,left:e.view.left,zIndex:e.zIndex};e.message||(n.background="none");const o=t.ref(!1);return{style:n,isShow:o,open:()=>{o.value=!0},close:()=>{o.value=!1}}},render(){var r;const{isShow:e,isFull:n,backdrop:o,style:l,message:s,$slots:a}=this;return e&&t.createVNode("div",{class:["devui-loading-contanier",n?"devui-loading--full":""]},[((r=a.default)==null?void 0:r.call(a))||t.createVNode("div",{class:"devui-loading-wrapper"},[o?t.createVNode("div",{class:"devui-loading-mask"},null):null,t.createVNode("div",{style:l,class:"devui-loading-area"},[t.createVNode("div",{class:"devui-busy-default-spinner"},[t.createVNode("div",{class:"devui-loading-bar1"},null),t.createVNode("div",{class:"devui-loading-bar2"},null),t.createVNode("div",{class:"devui-loading-bar3"},null),t.createVNode("div",{class:"devui-loading-bar4"},null)]),s?t.createVNode("span",{class:"devui-loading-text"},[s]):null])])])}});const H=Symbol("dev_component_container");function ge(e,n,o=null){const l=t.h(e,E({},n),o),s=document.createElement("div");return l[H]=s,t.render(l,s),l.component}function we(e){t.render(null,e==null?void 0:e.vnode[H])}const he=t.defineComponent(ye),F=new WeakSet,R=e=>{if(!e)return!0;if(Array.isArray(e))return e.length===0;if(e instanceof Set||e instanceof Map)return e.size===0;if(e instanceof Promise)return!1;if(typeof e=="object")try{return Object.keys(e).length===0}catch{return!1}return!1},z=e=>Object.prototype.toString.call(e).slice(8,-1).toLowerCase(),be=e=>{switch(z(e)){case"promise":return[e];case"array":return e.some(o=>z(o)!=="promise")?(console.error(new TypeError("Binding values should all be of type Promise")),"error"):e;default:return!1}},_=e=>{F.delete(e),e.instance.proxy.close(),we(e.instance)},K=(e,n)=>{if(n.value){const o=be(n.value);if(o==="error")return;e.instance.proxy.open(),e.appendChild(e.mask),F.add(e),o&&Promise.all(o).catch(l=>{console.error(new Error("Promise handling errors"),l)}).finally(()=>{_(e)})}else _(e)},$=e=>{e.removeAttribute("zindex"),e.removeAttribute("positiontype"),e.removeAttribute("backdrop"),e.removeAttribute("message"),e.removeAttribute("view"),e.removeAttribute("loadingtemplateref")},W=(e,n)=>{const o=E(E({},new me),n),l=o.loadingTemplateRef,s=ge(he,E({},o),l?()=>l:null);e.style.position=o.positionType,e.options=o,e.instance=s,e.mask=s.proxy.$el},Te={mounted:function(e,n,o){W(e,o.props),$(e),!R(n.value)&&K(e,n)},updated:function(e,n,o){!R(n.value)&&F.has(e)||R(n.value)&&!F.has(e)||(!F.has(e)&&W(e,o.props),$(e),K(e,n))}};var Y=t.defineComponent({name:"DAutoCompleteDropdown",directives:{dLoading:Te},setup(e,n){const o=t.inject(j),{visible:l,selectedIndex:s,selectOptionClick:a,searchList:r,searchStatus:u,dropDownRef:i,loadMore:d,showLoading:c,showNoResultItemTemplate:v,latestSource:f,modelValue:y,hoverIndex:w}=o,{disabled:h,maxHeight:T,appendToBody:A,formatter:V,disabledKey:k,isSearching:S}=o.props,D=g=>{g[k]||a(g)};return()=>t.withDirectives(t.createVNode("div",{class:["devui-dropdown-menu",A&&"devui-dropdown-menu-cdk",h&&"disabled",f.value&&"devui-dropdown-latestSource"]},[t.createVNode("ul",{ref:i,class:"devui-list-unstyled scroll-height",style:{maxHeight:`${T}px`},onScroll:d},[S&&n.slots.searchingTemplate&&u.value&&t.createVNode("li",{class:"devui-is-searching-template"},[t.createVNode("div",{class:"devui-no-data-tip"},[n.slots.searchingTemplate()])]),f.value&&!y.value&&t.createVNode("li",{class:"devui-popup-tips"},[t.createTextVNode("\u6700\u8FD1\u8F93\u5165")]),!v.value&&!u.value&&r!=null&&r.value.length>0&&r.value.map((g,b)=>t.createVNode("li",{onClick:()=>D(g),class:["devui-dropdown-item",s.value==b&&"selected",{disabled:k&&g[k]},{"devui-dropdown-bg":w.value==b}],title:V(g),key:V(g)},[n.slots.itemTemplate?n.slots.itemTemplate(g,b):V(g)])),!u.value&&r.value.length==0&&n.slots.noResultItemTemplate&&v.value&&t.createVNode("li",{class:"devui-no-result-template"},[t.createVNode("div",{class:"devui-no-data-tip"},[n.slots.noResultItemTemplate()])])])]),[[t.resolveDirective("dLoading"),c.value],[t.vShow,l.value&&r.value.length>0||n.slots.noResultItemTemplate&&v.value||S&&n.slots.searchingTemplate&&u.value]])}});const Ve=typeof window!="undefined";function q(e,n,o){document.addEventListener?e&&n&&o&&e.addEventListener(n,o,!1):e&&n&&o&&e.attachEvent("on"+n,o)}const N=Symbol("@@clickoutside"),x=new Map;let U,P=0,X=!0;function G(e,n,o){return Ve&&X&&(X=!1,q(document,"mousedown",l=>{U=l}),q(document,"mouseup",l=>{for(const[s,a]of x)a[N].documentHandler(l,U)})),function(l,s){!o||!n.instance||!l.target||!s.target||e.contains(l.target)||e.contains(s.target)||e===l.target||e[N].bindingFn&&e[N].bindingFn()}}const Se={beforeMount:function(e,n,o){P++,x.set(P,e),e[N]={nid:P,documentHandler:G(e,n,o),bindingFn:n.value}},updated:function(e,n,o){e[N].documentHandler=G(e,n,o),e[N].bindingFn=n.value},unmounted:function(e){x.delete(e[N].nid),delete e[N]}},Ce={modelValue:{type:Boolean,default:!1},origin:{type:Object,require:!0},position:{type:Array,default:["bottom"]},offset:{type:[Number,Object],default:8},align:{type:String,default:null},showArrow:{type:Boolean,default:!1},isArrowCenter:{type:Boolean,default:!0}};function J(e){const n=/(auto|scroll|hidden)/;for(let o=e;o=o.parentElement;o.parentElement!==document.body){const l=window.getComputedStyle(o);if(n.test(l.overflow+l.overflowX+l.overflowY))return o}return window}function Ne(e,n,o,l){let{x:s,y:a}=n;if(!e){const{width:r,height:u}=l;s&&o.includes("start")&&(s=12),s&&o.includes("end")&&(s=Math.round(r-24)),a&&o.includes("start")&&(a=10),a&&o.includes("end")&&(a=u-14)}return{x:s,y:a}}function Ae(e,n){const o=t.ref(),l=t.ref(),s=(r,u,i,d)=>{const{x:c,y:v}=Ne(e.isArrowCenter,i,u,d.getBoundingClientRect()),f={top:"bottom",right:"left",bottom:"top",left:"right"}[u.split("-")[0]];Object.assign(r.style,{left:c?`${c}px`:"",top:v?`${v}px`:"",right:"",bottom:"",[f]:"-4px"})},a=async()=>{const r=e.origin,u=t.unref(o.value),i=t.unref(l.value),d=[m.shift(),m.offset(e.offset),m.autoPlacement({alignment:e.align,allowedPlacements:e.position})];e.showArrow&&d.push(m.arrow({element:i}));const{x:c,y:v,placement:f,middlewareData:y}=await m.computePosition(r,u,{strategy:"fixed",middleware:d});n("positionChange",f),Object.assign(u.style,{top:`${v}px`,left:`${c}px`}),e.showArrow&&s(i,f,y.arrow,u)};return t.watch(()=>e.modelValue,()=>{const r=J(e.origin);e.modelValue&&e.origin?(t.nextTick(a),r.addEventListener("scroll",a),r!==window&&window.addEventListener("scroll",a),window.addEventListener("resize",a)):(r.removeEventListener("scroll",a),r!==window&&window.removeEventListener("scroll",a),window.removeEventListener("resize",a))}),t.onUnmounted(()=>{const r=J(e.origin);r.removeEventListener("scroll",a),r!==window&&window.removeEventListener("scroll",a),window.removeEventListener("resize",a)}),{arrowRef:l,overlayRef:o,updatePosition:a}}var Ke="";const De=t.defineComponent({name:"DFlexibleOverlay",inheritAttrs:!1,props:Ce,emits:["update:modelValue","positionChange"],setup(e,{slots:n,attrs:o,emit:l,expose:s}){const{arrowRef:a,overlayRef:r,updatePosition:u}=Ae(e,l);return s({updatePosition:u}),()=>{var i;return e.modelValue&&t.createVNode("div",t.mergeProps({ref:r,class:"devui-flexible-overlay"},o),[(i=n.default)==null?void 0:i.call(n),e.showArrow&&t.createVNode("div",{ref:a,class:"devui-flexible-overlay-arrow"},null)])}}});function Q(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}var L=t.defineComponent({name:"DAutoComplete",directives:{ClickOutside:Se},props:se,emits:["update:modelValue"],setup(e,n){const{disabled:o,modelValue:l,appendToBody:s,dAutoCompleteWidth:a,delay:r,allowEmptyValueSearch:u,formatter:i,transInputFocusEmit:d,selectValue:c,source:v,searchFn:f,appendToBodyDirections:y,latestSource:w,showAnimation:h}=t.toRefs(e),{handleSearch:T,searchList:A,showNoResultItemTemplate:V,recentlyFocus:k}=ue(n,u,v,f,i),{onInput:S,onFocus:D,inputRef:g,visible:b,searchStatus:Z,handleClose:B,toggleMenu:ke}=de(n,A,V,l,o,r,T,d,k,w),{selectedIndex:ee,selectOptionClick:te}=ce(n,A,c,T,i,B),{showLoading:Fe,dropDownRef:oe,loadMore:Le}=fe(e,n,T),{customRenderSolts:ne}=ie(n,l),{hoverIndex:Ee,handlekeyDown:Re}=pe(oe,b,A,ee,Z,V,te,B);t.provide(j,{props:e,visible:b,term:"",searchList:A,selectedIndex:ee,searchStatus:Z,selectOptionClick:te,dropDownRef:oe,showLoading:Fe,loadMore:Le,latestSource:w,modelValue:l,showNoResultItemTemplate:V,hoverIndex:Ee});const le=t.ref(),ae=t.reactive({appendToBodyDirections:{}});ae.appendToBodyDirections=y;const xe=()=>{if(s.value){let I;return t.createVNode(De,{hasBackdrop:!1,origin:le,position:ae.appendToBodyDirections,visible:b.value,"onUpdate:visible":Pe=>b.value=Pe},{default:()=>[t.createVNode("div",{class:"devui-dropdown devui-auto-complete-menu",style:{width:a.value>0&&a.value+"px"}},[t.createVNode(Y,null,Q(I=ne())?I:{default:()=>[I]})])]})}else{let I;return t.createVNode("div",{class:"devui-dropdown",style:{width:a.value>0&&a.value+"px"}},[t.createVNode(t.Transition,{name:h?"fade":""},{default:()=>[t.createVNode(Y,null,Q(I=ne())?I:{default:()=>[I]})]})])}};return()=>t.withDirectives(t.createVNode("div",{class:["devui-auto-complete","devui-form-group","devui-has-feedback",b.value&&"devui-select-open"],ref:le,style:{width:a.value>0&&a.value+"px"}},[t.createVNode("input",{disabled:o.value,type:"text",onClick:ke,class:["devui-form-control","devui-dropdown-origin","devui-dropdown-origin-open",o.value&&"disabled"],placeholder:"Search",onInput:S,onFocus:D,value:l.value,ref:g,onKeydown:Re},null),xe()]),[[t.resolveDirective("click-outside"),B]])}});L.install=function(e){e.component(L.name,L)};var Ie={title:"AutoComplete \u81EA\u52A8\u8865\u5168",category:"\u6570\u636E\u5F55\u5165",status:"100%",install(e){e.use(L)}};p.AutoComplete=L,p.default=Ie,Object.defineProperty(p,"__esModule",{value:!0}),p[Symbol.toStringTag]="Module"});
1
+ var Pe=Object.defineProperty;var ie=Object.getOwnPropertySymbols;var Be=Object.prototype.hasOwnProperty,je=Object.prototype.propertyIsEnumerable;var z=(v,t,y)=>t in v?Pe(v,t,{enumerable:!0,configurable:!0,writable:!0,value:y}):v[t]=y,I=(v,t)=>{for(var y in t||(t={}))Be.call(t,y)&&z(v,y,t[y]);if(ie)for(var y of ie(t))je.call(t,y)&&z(v,y,t[y]);return v};var T=(v,t,y)=>(z(v,typeof t!="symbol"?t+"":t,y),y);(function(v,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue"),require("@floating-ui/dom")):typeof define=="function"&&define.amd?define(["exports","vue","@floating-ui/dom"],t):(v=typeof globalThis!="undefined"?globalThis:v||self,t(v.index={},v.Vue,v.dom))})(this,function(v,t,y){"use strict";const _={modelValue:{type:String,default:""},source:{type:Array,default:null},allowEmptyValueSearch:{type:Boolean,default:!1},appendToBody:{type:Boolean,default:!1},position:{type:Array,default:["bottom-end"]},disabled:{type:Boolean,default:!1},delay:{type:Number,default:300},disabledKey:{type:String,default:null},formatter:{type:Function,default:e=>typeof e=="string"?e:e!==null?e.label||e.toString():""},isSearching:{type:Boolean,default:!1},sceneType:{type:String,default:null},searchFn:{type:Function,default:null},tipsText:{type:String,default:"\u6700\u8FD1\u8F93\u5165"},latestSource:{type:Array,default:null},valueParser:{type:Function,default:e=>e},enableLazyLoad:{type:Boolean,default:!1},width:{type:Number,default:400},showAnimation:{type:Boolean,default:!0},maxHeight:{type:Number,default:300},transInputFocusEmit:{type:Function,default:null},selectValue:{type:Function,default:null},loadMore:{type:Function,default:null}},R=Symbol("DropdownPropsKey");function ue(e,n){const o=(r,u)=>{const i={item:r,index:u};return e.slots.item?e.slots.item(i):null},a=()=>e.slots.nothing?e.slots.nothing(n.value):null,l=()=>e.slots.searching?e.slots.searching(n.value):null;return{customRenderSolts:()=>{const r={};return e.slots.item&&(r.itemTemplate=o),e.slots.nothing&&(r.noResultItemTemplate=a),e.slots.searching&&(r.searchingTemplate=l),r}}}function de(e,n,o,a,l){const s=t.ref([]),r=t.ref(!1),u=d=>{const p=[];return o.value.forEach(c=>{let m=l.value(c);m=m.toLowerCase(),m.startsWith(d)&&p.push(c)}),p};return{handleSearch:async(d,p=!1)=>{if(d===""&&!n.value){s.value=[],r.value=!1;return}let c=[];d=d.toLowerCase(),p?c=o.value:a.value?c=await a.value(d):c=u(d),s.value=c,s.value.length===0?r.value=!0:r.value=!1},recentlyFocus:d=>{d&&(s.value=d)},searchList:s,showNoResultItemTemplate:r}}function ce(e,n,o,a,l,s,r,u,i,f){const d=t.ref(!1),p=t.ref(),c=t.ref(!1),h=((V,F)=>{let g;return E=>{g&&clearTimeout(g),g=setTimeout(async()=>{c.value=!0,await V(E),c.value=!1},F)}})(async V=>{await r(V),d.value=!0},s.value),C=V=>{const F=V.target;c.value=!1,o.value=!1,e.emit("update:modelValue",F.value),h(F.value)},S=()=>{r(a.value),i(f==null?void 0:f.value),u.value&&u.value()},b=()=>{d.value=!1,c.value=!1,o.value=!1};return{handleClose:b,toggleMenu:()=>{l.value||(d.value?b():(d.value=!0,e.slots.noResultItemTemplate&&n.value.length===0&&a.value.trim()!==""&&(o.value=!0)))},onInput:C,onFocus:S,inputRef:p,visible:d,searchStatus:c}}function fe(e,n,o,a,l,s){const r=t.ref(0),u=f=>{if(n.value.length===0)return 0;let d=0;return n.value.forEach((p,c)=>{typeof p=="string"?p===f&&(d=c):String(p.label)===f&&(d=c)}),d===-1?0:d};return{selectedIndex:r,selectOptionClick:async f=>{const d=l.value(f);e.emit("update:modelValue",d),s(),await a(d),r.value=u(d),o.value&&o.value(d)}}}function pe(e,n,o){const a=t.ref(!1),l=t.ref(),s=()=>{if(!e.enableLazyLoad&&a)return;const u=l.value,i=u.scrollHeight,f=u.clientHeight+u.scrollTop;f>=i&&f>=e.maxHeight&&(e.loadMore(),a.value=!0)};async function r(){await o(e.modelValue,e.enableLazyLoad),a.value=!1}return n.expose({loadFinish:r}),{showLoading:a,dropDownRef:l,loadMore:s}}function ve(e,n,o,a,l,s,r,u){var p;const i=t.ref((p=a.value)!=null?p:0),f=c=>{const m=e.value,w=m.children[c];t.nextTick(()=>{if(w.scrollIntoViewIfNeeded)w.scrollIntoViewIfNeeded(!1);else{const h=m.getBoundingClientRect(),C=w.getBoundingClientRect();(C.bottom>h.bottom||C.top<h.top)&&w.scrollIntoView(!1)}})};return{hoverIndex:i,handlekeyDown:c=>{var h;const m=c.key||c.code;if(m==="Escape"&&(n.value&&o.value.length||l.value||s.value)){u();return}const w=n.value&&o.value.length&&!l.value&&!s.value;if(m==="ArrowDown"&&w){if(i.value===o.value.length-1){i.value=0,f(i.value);return}i.value=i.value+1,f(i.value)}else if(m==="ArrowUp"&&w){if(i.value===0){i.value=o.value.length-1,f(i.value);return}i.value=i.value-1,f(i.value)}if(m==="Enter"&&w){r(o.value[i.value]),i.value=(h=a.value)!=null?h:0;return}}}}class ${constructor(){T(this,"top","50%");T(this,"left","50%")}}const me={message:String,backdrop:Boolean,view:{type:Object,default:()=>new $},zIndex:Number,isFull:{type:Boolean,default:!1}};class ye{constructor(){T(this,"target");T(this,"message");T(this,"loadingTemplateRef");T(this,"backdrop",!0);T(this,"positionType","relative");T(this,"view",new $);T(this,"zIndex")}}var ze="",ge=t.defineComponent({name:"DLoading",inheritAttrs:!1,props:me,setup(e){const n={top:e.view.top,left:e.view.left,zIndex:e.zIndex};e.message||(n.background="none");const o=t.ref(!1);return{style:n,isShow:o,open:()=>{o.value=!0},close:()=>{o.value=!1}}},render(){var r;const{isShow:e,isFull:n,backdrop:o,style:a,message:l,$slots:s}=this;return e&&t.createVNode("div",{class:["devui-loading-contanier",n?"devui-loading--full":""]},[((r=s.default)==null?void 0:r.call(s))||t.createVNode("div",{class:"devui-loading-wrapper"},[o?t.createVNode("div",{class:"devui-loading-mask"},null):null,t.createVNode("div",{style:a,class:"devui-loading-area"},[t.createVNode("div",{class:"devui-busy-default-spinner"},[t.createVNode("div",{class:"devui-loading-bar1"},null),t.createVNode("div",{class:"devui-loading-bar2"},null),t.createVNode("div",{class:"devui-loading-bar3"},null),t.createVNode("div",{class:"devui-loading-bar4"},null)]),l?t.createVNode("span",{class:"devui-loading-text"},[l]):null])])])}});const K=Symbol("dev_component_container");function we(e,n,o=null){const a=t.h(e,I({},n),o),l=document.createElement("div");return a[K]=l,t.render(a,l),a.component}function he(e){t.render(null,e==null?void 0:e.vnode[K])}const be=t.defineComponent(ge),D=new WeakSet,x=e=>{if(!e)return!0;if(Array.isArray(e))return e.length===0;if(e instanceof Set||e instanceof Map)return e.size===0;if(e instanceof Promise)return!1;if(typeof e=="object")try{return Object.keys(e).length===0}catch{return!1}return!1},U=e=>Object.prototype.toString.call(e).slice(8,-1).toLowerCase(),Ve=e=>{switch(U(e)){case"promise":return[e];case"array":return e.some(o=>U(o)!=="promise")?(console.error(new TypeError("Binding values should all be of type Promise")),"error"):e;default:return!1}},q=e=>{D.delete(e),e.instance.proxy.close(),he(e.instance)},W=(e,n)=>{var o,a,l;if(n.value){const s=Ve(n.value);if(s==="error")return;(l=(a=(o=e==null?void 0:e.instance)==null?void 0:o.proxy)==null?void 0:a.open)==null||l.call(a),e.appendChild(e.mask),D.add(e),s&&Promise.all(s).catch(r=>{console.error(new Error("Promise handling errors"),r)}).finally(()=>{q(e)})}else q(e)},Y=e=>{e.removeAttribute("zindex"),e.removeAttribute("positiontype"),e.removeAttribute("backdrop"),e.removeAttribute("message"),e.removeAttribute("view"),e.removeAttribute("loadingtemplateref")},X=(e,n)=>{var s;const o=I(I({},new ye),n),a=o.loadingTemplateRef,l=we(be,I({},o),a?()=>a:null);e.style.position=o.positionType,e.options=o,e.instance=l,e.mask=(s=l==null?void 0:l.proxy)==null?void 0:s.$el},Te={mounted:function(e,n,o){X(e,o.props),Y(e),!x(n.value)&&W(e,n)},updated:function(e,n,o){!x(n.value)&&D.has(e)||x(n.value)&&!D.has(e)||(!D.has(e)&&X(e,o.props),Y(e),W(e,n))}};var G=t.defineComponent({name:"DAutoCompleteDropdown",directives:{dLoading:Te},setup(e,n){const o=t.inject(R),{visible:a,selectedIndex:l,selectOptionClick:s,searchList:r,searchStatus:u,dropDownRef:i,loadMore:f,showLoading:d,showNoResultItemTemplate:p,latestSource:c,modelValue:m,hoverIndex:w,valueParser:h}=o,{disabled:C,maxHeight:S,formatter:b,disabledKey:A,isSearching:V}=o.props,F=g=>{g=h.value(g),!(typeof g=="object"&&g[A])&&s(g)};return()=>t.withDirectives(t.createVNode("div",{class:["devui-dropdown-menu","devui-dropdown-menu-cdk",C&&"disabled",c.value&&"devui-dropdown-latestSource"]},[t.createVNode("ul",{ref:i,class:"devui-list-unstyled scroll-height",style:{maxHeight:`${S}px`},onScroll:f},[V&&n.slots.searchingTemplate&&(u==null?void 0:u.value)&&t.createVNode("li",{class:"devui-is-searching-template"},[t.createVNode("div",{class:"devui-no-data-tip"},[n.slots.searchingTemplate()])]),c.value&&!m.value&&t.createVNode("li",{class:"devui-popup-tips"},[t.createTextVNode("\u6700\u8FD1\u8F93\u5165")]),!p.value&&!(u==null?void 0:u.value)&&r!=null&&r.value.length>0&&r.value.map((g,E)=>t.createVNode("li",{onClick:()=>F(g),class:["devui-dropdown-item",l.value===E&&"selected",{disabled:A&&typeof g=="object"&&g[A]},{"devui-dropdown-bg":w.value===E}],title:b(g),key:b(g)},[n.slots.itemTemplate?n.slots.itemTemplate(g,E):b(g)])),!(u==null?void 0:u.value)&&r.value.length===0&&n.slots.noResultItemTemplate&&p.value&&t.createVNode("li",{class:"devui-no-result-template"},[t.createVNode("div",{class:"devui-no-data-tip"},[n.slots.noResultItemTemplate()])])])]),[[t.resolveDirective("dLoading"),d.value],[t.vShow,a.value&&r.value.length>0||n.slots.noResultItemTemplate&&p.value||V&&n.slots.searchingTemplate&&(u==null?void 0:u.value)]])}});const Ne=typeof window!="undefined";function J(e,n,o){document.addEventListener?e&&n&&o&&e.addEventListener(n,o,!1):e&&n&&o&&e.attachEvent("on"+n,o)}const N=Symbol("@@clickoutside"),O=new Map;let Q,P=0,Z=!0;function ee(e,n,o){return Ne&&Z&&(Z=!1,J(document,"mousedown",a=>{Q=a}),J(document,"mouseup",a=>{for(const[l,s]of O)s[N].documentHandler(a,Q)})),function(a,l){!o||!n.instance||!a.target||!l.target||e.contains(a.target)||e.contains(l.target)||e===a.target||e[N].bindingFn&&e[N].bindingFn()}}const Ce={beforeMount:function(e,n,o){P++,O.set(P,e),e[N]={nid:P,documentHandler:ee(e,n,o),bindingFn:n.value}},updated:function(e,n,o){e[N].documentHandler=ee(e,n,o),e[N].bindingFn=n.value},unmounted:function(e){O.delete(e[N].nid),delete e[N]}},Ae={modelValue:{type:Boolean,default:!1},origin:{type:Object,require:!0},position:{type:Array,default:["bottom"]},offset:{type:[Number,Object],default:8},align:{type:String,default:null},showArrow:{type:Boolean,default:!1},isArrowCenter:{type:Boolean,default:!0}};function Fe(e){const n=/(auto|scroll|hidden)/;for(let o=e;o=o.parentElement;o.parentElement!==document.body){const a=window.getComputedStyle(o);if(n.test(a.overflow+a.overflowX+a.overflowY))return o}return window}function Se(e,n,o,a){let{x:l,y:s}=n;if(!e){const{width:r,height:u}=a;l&&o.includes("start")&&(l=12),l&&o.includes("end")&&(l=Math.round(r-24)),s&&o.includes("start")&&(s=10),s&&o.includes("end")&&(s=u-14)}return{x:l,y:s}}function Ee(e,n){const o=t.ref(),a=t.ref();let l=null;const s=(u,i,f,d)=>{const{x:p,y:c}=Se(e.isArrowCenter,f,i,d.getBoundingClientRect()),m={top:"bottom",right:"left",bottom:"top",left:"right"}[i.split("-")[0]];Object.assign(u.style,{left:p?`${p}px`:"",top:c?`${c}px`:"",right:"",bottom:"",[m]:"-4px"})},r=async()=>{const u=e.origin,i=t.unref(o.value),f=t.unref(a.value),d=[y.shift(),y.offset(e.offset),y.autoPlacement({alignment:e.align,allowedPlacements:e.position})];e.showArrow&&d.push(y.arrow({element:f}));const{x:p,y:c,placement:m,middlewareData:w}=await y.computePosition(u,i,{strategy:"fixed",middleware:d});n("positionChange",m),Object.assign(i.style,{top:`${c}px`,left:`${p}px`}),e.showArrow&&s(f,m,w.arrow,i)};return t.watch(()=>e.modelValue,()=>{e.modelValue&&e.origin?(l=Fe(e.origin),t.nextTick(r),l==null||l.addEventListener("scroll",r),l!==window&&window.addEventListener("scroll",r),window.addEventListener("resize",r)):(l==null||l.removeEventListener("scroll",r),l!==window&&window.removeEventListener("scroll",r),window.removeEventListener("resize",r))}),t.onUnmounted(()=>{l==null||l.removeEventListener("scroll",r),l!==window&&window.removeEventListener("scroll",r),window.removeEventListener("resize",r)}),{arrowRef:a,overlayRef:o,updatePosition:r}}var _e="";const te=t.defineComponent({name:"DFlexibleOverlay",inheritAttrs:!1,props:Ae,emits:["update:modelValue","positionChange"],setup(e,{slots:n,attrs:o,emit:a,expose:l}){const{arrowRef:s,overlayRef:r,updatePosition:u}=Ee(e,a);return l({updatePosition:u}),()=>{var i;return e.modelValue&&t.createVNode("div",t.mergeProps({ref:r,class:"devui-flexible-overlay"},o),[(i=n.default)==null?void 0:i.call(n),e.showArrow&&t.createVNode("div",{ref:s,class:"devui-flexible-overlay-arrow"},null)])}}});var $e="";function oe(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}var B=t.defineComponent({name:"DAutoComplete",directives:{ClickOutside:Ce},props:_,emits:["update:modelValue"],setup(e,n){const{disabled:o,modelValue:a,width:l,delay:s,allowEmptyValueSearch:r,appendToBody:u,formatter:i,transInputFocusEmit:f,selectValue:d,source:p,searchFn:c,position:m,latestSource:w,showAnimation:h,valueParser:C}=t.toRefs(e),{handleSearch:S,searchList:b,showNoResultItemTemplate:A,recentlyFocus:V}=de(n,r,p,c,i),{onInput:F,onFocus:g,inputRef:E,visible:L,searchStatus:ne,handleClose:j,toggleMenu:ke}=ce(n,b,A,a,o,s,S,f,V,w),{selectedIndex:le,selectOptionClick:ae}=fe(n,b,d,S,i,j),{showLoading:De,dropDownRef:re,loadMore:Ie}=pe(e,n,S),{customRenderSolts:se}=ue(n,a),{hoverIndex:Re,handlekeyDown:xe}=ve(re,L,b,le,ne,A,ae,j);t.provide(R,{props:e,visible:L,term:"",searchList:b,selectedIndex:le,searchStatus:ne,selectOptionClick:ae,dropDownRef:re,showLoading:De,loadMore:Ie,latestSource:w,modelValue:a,showNoResultItemTemplate:A,hoverIndex:Re,valueParser:C});const M=t.ref(),Oe=()=>{if(u.value){let k;return t.createVNode(t.Teleport,{to:"body"},{default:()=>[t.createVNode(t.Transition,{name:h?"fade":""},{default:()=>[t.createVNode(te,{"show-arrow":!0,origin:M.value,position:m.value,modelValue:L.value,"onUpdate:modelValue":H=>L.value=H},{default:()=>[t.createVNode("div",{class:"devui-auto-complete-menu",style:{width:`
2
+ ${l.value+"px"}
3
+ `}},[t.createVNode(G,null,oe(k=se())?k:{default:()=>[k]})])]})]})]})}else{let k;return t.createVNode(t.Transition,{name:h?"fade":""},{default:()=>[t.createVNode(te,{"show-arrow":!0,origin:M.value,position:m.value,modelValue:L.value,"onUpdate:modelValue":H=>L.value=H},{default:()=>[t.createVNode("div",{class:"devui-auto-complete-menu",style:{width:`
4
+ ${l.value+"px"}
5
+ `}},[t.createVNode(G,null,oe(k=se())?k:{default:()=>[k]})])]})]})}};return()=>t.withDirectives(t.createVNode("div",{class:["devui-auto-complete","devui-form-group","devui-has-feedback",L.value&&"devui-select-open"],ref:M,style:{width:`${l.value+"px"}`}},[t.createVNode("input",{disabled:o.value,type:"text",onClick:ke,class:["devui-form-control","devui-dropdown-origin","devui-dropdown-origin-open",o.value&&"disabled"],placeholder:"Search",onInput:F,onFocus:g,value:a.value,ref:E,onKeydown:xe},null),Oe()]),[[t.resolveDirective("click-outside"),j]])}}),Le={title:"AutoComplete \u81EA\u52A8\u8865\u5168",category:"\u6570\u636E\u5F55\u5165",status:"100%",install(e){e.component(B.name,B)}};v.AutoComplete=B,v.DropdownPropsKey=R,v.autoCompleteProps=_,v.default=Le,Object.defineProperty(v,"__esModule",{value:!0}),v[Symbol.toStringTag]="Module"});