vue-devui 1.0.0-rc.7 → 1.0.0

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 (231) hide show
  1. package/README.md +163 -146
  2. package/alert/index.es.js +46 -15
  3. package/alert/index.umd.js +1 -1
  4. package/alert/style.css +1 -1
  5. package/auto-complete/index.es.js +8230 -231
  6. package/auto-complete/index.umd.js +29 -5
  7. package/auto-complete/style.css +1 -1
  8. package/avatar/index.es.js +81 -70
  9. package/avatar/index.umd.js +1 -1
  10. package/avatar/style.css +1 -1
  11. package/badge/index.es.js +34 -4
  12. package/badge/index.umd.js +1 -1
  13. package/badge/style.css +1 -1
  14. package/button/index.es.js +5706 -98
  15. package/button/index.umd.js +27 -1
  16. package/button/style.css +1 -1
  17. package/card/index.es.js +38 -13
  18. package/card/index.umd.js +1 -1
  19. package/card/style.css +1 -1
  20. package/checkbox/index.es.js +8066 -245
  21. package/checkbox/index.umd.js +27 -1
  22. package/checkbox/style.css +1 -1
  23. package/{date-picker → collapse}/index.d.ts +0 -0
  24. package/collapse/index.es.js +213 -0
  25. package/collapse/index.umd.js +1 -0
  26. package/{date-picker → collapse}/package.json +1 -1
  27. package/collapse/style.css +1 -0
  28. package/countdown/index.es.js +56 -13
  29. package/countdown/index.umd.js +1 -1
  30. package/date-picker-pro/index.d.ts +7 -0
  31. package/date-picker-pro/index.es.js +12020 -0
  32. package/date-picker-pro/index.umd.js +27 -0
  33. package/date-picker-pro/package.json +7 -0
  34. package/date-picker-pro/style.css +1 -0
  35. package/drawer/index.es.js +29 -4
  36. package/drawer/index.umd.js +1 -1
  37. package/drawer/style.css +1 -1
  38. package/dropdown/index.es.js +178 -142
  39. package/dropdown/index.umd.js +1 -1
  40. package/dropdown/style.css +1 -1
  41. package/editable-select/index.es.js +742 -107
  42. package/editable-select/index.umd.js +1 -1
  43. package/editable-select/style.css +1 -1
  44. package/form/index.es.js +544 -316
  45. package/form/index.umd.js +17 -17
  46. package/form/style.css +1 -1
  47. package/fullscreen/index.es.js +28 -4
  48. package/fullscreen/index.umd.js +1 -1
  49. package/fullscreen/style.css +1 -1
  50. package/grid/index.es.js +71 -50
  51. package/grid/index.umd.js +1 -1
  52. package/grid/style.css +1 -1
  53. package/icon/index.es.js +184 -23
  54. package/icon/index.umd.js +1 -1
  55. package/icon/style.css +1 -0
  56. package/image-preview/index.es.js +34 -11
  57. package/image-preview/index.umd.js +1 -1
  58. package/image-preview/style.css +1 -1
  59. package/input/index.es.js +8250 -131
  60. package/input/index.umd.js +27 -1
  61. package/input/style.css +1 -1
  62. package/input-number/index.es.js +275 -203
  63. package/input-number/index.umd.js +1 -1
  64. package/input-number/style.css +1 -1
  65. package/layout/index.es.js +34 -6
  66. package/layout/index.umd.js +1 -1
  67. package/layout/style.css +1 -1
  68. package/loading/index.es.js +34 -10
  69. package/loading/index.umd.js +1 -1
  70. package/loading/style.css +1 -1
  71. package/mention/index.d.ts +7 -0
  72. package/mention/index.es.js +8310 -0
  73. package/mention/index.umd.js +36 -0
  74. package/mention/package.json +7 -0
  75. package/mention/style.css +1 -0
  76. package/menu/index.d.ts +7 -0
  77. package/menu/index.es.js +934 -0
  78. package/menu/index.umd.js +1 -0
  79. package/menu/package.json +7 -0
  80. package/menu/style.css +1 -0
  81. package/message/index.d.ts +7 -0
  82. package/message/index.es.js +538 -0
  83. package/message/index.umd.js +1 -0
  84. package/message/package.json +7 -0
  85. package/message/style.css +1 -0
  86. package/modal/index.es.js +359 -170
  87. package/modal/index.umd.js +1 -1
  88. package/modal/style.css +1 -1
  89. package/notification/index.es.js +236 -65
  90. package/notification/index.umd.js +1 -1
  91. package/notification/style.css +1 -1
  92. package/nuxt/components/ButtonGroup.js +3 -0
  93. package/nuxt/components/CheckboxButton.js +3 -0
  94. package/nuxt/components/Collapse.js +3 -0
  95. package/nuxt/components/CollapseItem.js +3 -0
  96. package/nuxt/components/DRangeDatePickerPro.js +3 -0
  97. package/nuxt/components/DatePickerPro.js +3 -0
  98. package/nuxt/components/Icon.js +1 -0
  99. package/nuxt/components/IconGroup.js +3 -0
  100. package/nuxt/components/LABEL_DATA.js +3 -0
  101. package/nuxt/components/Mention.js +3 -0
  102. package/nuxt/components/Menu.js +3 -0
  103. package/nuxt/components/MenuItem.js +3 -0
  104. package/nuxt/components/Message.js +3 -0
  105. package/nuxt/components/Option.js +3 -0
  106. package/nuxt/components/OptionGroup.js +3 -0
  107. package/nuxt/components/RadioButton.js +3 -0
  108. package/nuxt/components/Step.js +3 -0
  109. package/nuxt/components/Steps.js +3 -0
  110. package/nuxt/components/SubMenu.js +3 -0
  111. package/nuxt/components/TABLE_TOKEN.js +3 -0
  112. package/nuxt/components/TimePicker.js +3 -0
  113. package/nuxt/components/TimeSelect.js +3 -0
  114. package/nuxt/components/animationInjectionKey.js +3 -0
  115. package/nuxt/components/buttonGroupInjectionKey.js +3 -0
  116. package/nuxt/components/buttonGroupProps.js +3 -0
  117. package/nuxt/components/collapseItemProps.js +3 -0
  118. package/nuxt/components/collapseProps.js +3 -0
  119. package/nuxt/components/datePickerProCommonProps.js +3 -0
  120. package/nuxt/components/datePickerProPanelProps.js +3 -0
  121. package/nuxt/components/datePickerProProps.js +3 -0
  122. package/nuxt/components/iconProps.js +1 -0
  123. package/nuxt/components/mentionProps.js +3 -0
  124. package/nuxt/components/messageProps.js +3 -0
  125. package/nuxt/components/roundInjectionKey.js +3 -0
  126. package/nuxt/components/skeletonItemProps.js +3 -0
  127. package/nuxt/components/stepProps.js +3 -0
  128. package/nuxt/components/stepsProps.js +3 -0
  129. package/nuxt/components/svgIconProps.js +3 -0
  130. package/nuxt/components/tableProps.js +3 -0
  131. package/nuxt/components/timerPickerPanelProps.js +3 -0
  132. package/nuxt/components/treeNodeProps.js +3 -0
  133. package/overlay/index.es.js +84 -125
  134. package/overlay/index.umd.js +1 -1
  135. package/overlay/style.css +1 -1
  136. package/package.json +7 -3
  137. package/pagination/index.es.js +234 -39
  138. package/pagination/index.umd.js +1 -1
  139. package/pagination/style.css +1 -1
  140. package/panel/style.css +1 -1
  141. package/popover/index.es.js +274 -220
  142. package/popover/index.umd.js +13 -13
  143. package/popover/style.css +1 -1
  144. package/progress/index.es.js +31 -9
  145. package/progress/index.umd.js +3 -3
  146. package/progress/style.css +1 -1
  147. package/radio/index.es.js +7969 -152
  148. package/radio/index.umd.js +27 -1
  149. package/radio/style.css +1 -1
  150. package/rate/index.es.js +46 -14
  151. package/rate/index.umd.js +1 -1
  152. package/rate/style.css +1 -1
  153. package/result/index.es.js +169 -22
  154. package/result/index.umd.js +1 -1
  155. package/result/style.css +1 -1
  156. package/search/index.es.js +3823 -1090
  157. package/search/index.umd.js +18 -18
  158. package/search/style.css +1 -1
  159. package/select/index.es.js +9186 -478
  160. package/select/index.umd.js +27 -1
  161. package/select/style.css +1 -1
  162. package/skeleton/index.es.js +110 -259
  163. package/skeleton/index.umd.js +1 -1
  164. package/skeleton/style.css +1 -1
  165. package/slider/index.es.js +143 -146
  166. package/slider/index.umd.js +1 -1
  167. package/slider/style.css +1 -1
  168. package/splitter/index.es.js +433 -207
  169. package/splitter/index.umd.js +17 -17
  170. package/splitter/style.css +1 -1
  171. package/statistic/index.es.js +34 -16
  172. package/statistic/index.umd.js +1 -1
  173. package/statistic/style.css +1 -1
  174. package/status/index.es.js +26 -2
  175. package/status/index.umd.js +1 -1
  176. package/status/style.css +1 -1
  177. package/steps/index.d.ts +7 -0
  178. package/steps/index.es.js +386 -0
  179. package/steps/index.umd.js +1 -0
  180. package/steps/package.json +7 -0
  181. package/steps/style.css +1 -0
  182. package/style.css +1 -1
  183. package/switch/index.es.js +7802 -59
  184. package/switch/index.umd.js +27 -1
  185. package/switch/style.css +1 -1
  186. package/table/index.es.js +9769 -919
  187. package/table/index.umd.js +27 -1
  188. package/table/style.css +1 -1
  189. package/tabs/index.es.js +309 -96
  190. package/tabs/index.umd.js +1 -1
  191. package/tabs/style.css +1 -1
  192. package/tag/index.es.js +35 -7
  193. package/tag/index.umd.js +1 -1
  194. package/tag/style.css +1 -1
  195. package/textarea/index.es.js +7922 -78
  196. package/textarea/index.umd.js +35 -1
  197. package/textarea/style.css +1 -1
  198. package/time-picker/index.d.ts +7 -0
  199. package/time-picker/index.es.js +9549 -0
  200. package/time-picker/index.umd.js +27 -0
  201. package/time-picker/package.json +7 -0
  202. package/time-picker/style.css +1 -0
  203. package/time-select/index.d.ts +7 -0
  204. package/time-select/index.es.js +9585 -0
  205. package/time-select/index.umd.js +27 -0
  206. package/time-select/package.json +7 -0
  207. package/time-select/style.css +1 -0
  208. package/timeline/index.es.js +169 -22
  209. package/timeline/index.umd.js +1 -1
  210. package/timeline/style.css +1 -1
  211. package/tooltip/index.es.js +265 -212
  212. package/tooltip/index.umd.js +15 -15
  213. package/tooltip/style.css +1 -1
  214. package/tree/index.es.js +11343 -795
  215. package/tree/index.umd.js +27 -1
  216. package/tree/style.css +1 -1
  217. package/upload/index.es.js +494 -106
  218. package/upload/index.umd.js +1 -1
  219. package/upload/style.css +1 -1
  220. package/vue-devui.es.js +22849 -13614
  221. package/vue-devui.umd.js +30 -23
  222. package/date-picker/index.es.js +0 -1145
  223. package/date-picker/index.umd.js +0 -1
  224. package/date-picker/style.css +0 -1
  225. package/nuxt/components/DatePicker.js +0 -3
  226. package/nuxt/components/FormControl.js +0 -3
  227. package/nuxt/components/FormLabel.js +0 -3
  228. package/nuxt/components/StickSlider.js +0 -3
  229. package/nuxt/components/formControlProps.js +0 -3
  230. package/nuxt/components/overlayEmits.js +0 -3
  231. package/nuxt/components/overlayProps.js +0 -3
@@ -1,16 +1,45 @@
1
- import { computed, ref, nextTick, defineComponent, watch, withDirectives, createVNode, withModifiers, resolveComponent, vShow, resolveDirective } from "vue";
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __publicField = (obj, key, value) => {
21
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
22
+ return value;
23
+ };
24
+ import { defineComponent, ref, createVNode, h, render, computed, nextTick, unref, watch, onUnmounted, mergeProps, reactive, getCurrentInstance, withDirectives, withModifiers, resolveComponent, Teleport, Transition, vShow, resolveDirective } from "vue";
25
+ import { offset, autoPlacement, arrow, shift, computePosition } from "@floating-ui/dom";
2
26
  const editableSelectProps = {
27
+ modelValue: {
28
+ type: String,
29
+ default: ""
30
+ },
3
31
  options: {
4
32
  type: Array,
5
33
  default: () => []
6
34
  },
7
- disabled: {
8
- type: Boolean
35
+ allowClear: {
36
+ type: Boolean,
37
+ default: false
9
38
  },
10
- loading: {
39
+ disabled: {
11
40
  type: Boolean
12
41
  },
13
- optionDisabledKey: {
42
+ disabledKey: {
14
43
  type: String,
15
44
  default: ""
16
45
  },
@@ -18,16 +47,22 @@ const editableSelectProps = {
18
47
  type: String,
19
48
  default: "Search"
20
49
  },
21
- modelValue: {
22
- type: String,
23
- default: ""
24
- },
25
50
  width: {
26
51
  type: Number
27
52
  },
28
53
  maxHeight: {
29
54
  type: Number
30
55
  },
56
+ loading: {
57
+ type: Boolean
58
+ },
59
+ enableLazyLoad: {
60
+ type: Boolean,
61
+ default: false
62
+ },
63
+ searchFn: {
64
+ type: Function
65
+ },
31
66
  filterOption: {
32
67
  type: [Function, Boolean]
33
68
  }
@@ -87,6 +122,234 @@ const clickoutsideDirective = {
87
122
  delete el[ctx];
88
123
  }
89
124
  };
125
+ class View {
126
+ constructor() {
127
+ __publicField(this, "top", "50%");
128
+ __publicField(this, "left", "50%");
129
+ }
130
+ }
131
+ const loadingProps = {
132
+ message: String,
133
+ backdrop: Boolean,
134
+ view: {
135
+ type: Object,
136
+ default: () => new View()
137
+ },
138
+ zIndex: Number,
139
+ isFull: {
140
+ type: Boolean,
141
+ default: false
142
+ }
143
+ };
144
+ class LoadingOptions {
145
+ constructor() {
146
+ __publicField(this, "target");
147
+ __publicField(this, "message");
148
+ __publicField(this, "loadingTemplateRef");
149
+ __publicField(this, "backdrop", true);
150
+ __publicField(this, "positionType", "relative");
151
+ __publicField(this, "view", new View());
152
+ __publicField(this, "zIndex");
153
+ }
154
+ }
155
+ function createBem(namespace, element, modifier) {
156
+ let cls = namespace;
157
+ if (element) {
158
+ cls += `__${element}`;
159
+ }
160
+ if (modifier) {
161
+ cls += `--${modifier}`;
162
+ }
163
+ return cls;
164
+ }
165
+ function useNamespace(block, needDot = false) {
166
+ const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
167
+ const b = () => createBem(namespace);
168
+ const e = (element) => element ? createBem(namespace, element) : "";
169
+ const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
170
+ const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
171
+ return {
172
+ b,
173
+ e,
174
+ m,
175
+ em
176
+ };
177
+ }
178
+ var loading = "";
179
+ var Loading = defineComponent({
180
+ name: "DLoading",
181
+ inheritAttrs: false,
182
+ props: loadingProps,
183
+ setup(props) {
184
+ const style = {
185
+ top: props.view.top,
186
+ left: props.view.left,
187
+ zIndex: props.zIndex
188
+ };
189
+ if (!props.message) {
190
+ style.background = "none";
191
+ }
192
+ const isShow = ref(false);
193
+ const open = () => {
194
+ isShow.value = true;
195
+ };
196
+ const close = () => {
197
+ isShow.value = false;
198
+ };
199
+ return {
200
+ style,
201
+ isShow,
202
+ open,
203
+ close
204
+ };
205
+ },
206
+ render() {
207
+ var _a;
208
+ const {
209
+ isShow,
210
+ isFull,
211
+ backdrop,
212
+ style,
213
+ message,
214
+ $slots
215
+ } = this;
216
+ const ns = useNamespace("loading");
217
+ return isShow && createVNode("div", {
218
+ "class": [ns.b(), isFull ? ns.m("full") : ""]
219
+ }, [((_a = $slots.default) == null ? void 0 : _a.call($slots)) || createVNode("div", {
220
+ "class": ns.e("wrapper")
221
+ }, [backdrop ? createVNode("div", {
222
+ "class": ns.e("mask")
223
+ }, null) : null, createVNode("div", {
224
+ "style": style,
225
+ "class": ns.e("area")
226
+ }, [createVNode("div", {
227
+ "class": ns.e("busy-default-spinner")
228
+ }, [createVNode("div", {
229
+ "class": ns.e("bar1")
230
+ }, null), createVNode("div", {
231
+ "class": ns.e("bar2")
232
+ }, null), createVNode("div", {
233
+ "class": ns.e("bar3")
234
+ }, null), createVNode("div", {
235
+ "class": ns.e("bar4")
236
+ }, null)]), message ? createVNode("span", {
237
+ "class": ns.e("text")
238
+ }, [message]) : null])])]);
239
+ }
240
+ });
241
+ const COMPONENT_CONTAINER_SYMBOL = Symbol("dev_component_container");
242
+ function createComponent(component, props, children = null) {
243
+ const vnode = h(component, __spreadValues({}, props), children);
244
+ const container = document.createElement("div");
245
+ vnode[COMPONENT_CONTAINER_SYMBOL] = container;
246
+ render(vnode, container);
247
+ return vnode.component;
248
+ }
249
+ function unmountComponent(ComponnetInstance) {
250
+ render(null, ComponnetInstance == null ? void 0 : ComponnetInstance.vnode[COMPONENT_CONTAINER_SYMBOL]);
251
+ }
252
+ const loadingConstructor = defineComponent(Loading);
253
+ const cacheInstance = /* @__PURE__ */ new WeakSet();
254
+ const isEmpty = (val) => {
255
+ if (!val) {
256
+ return true;
257
+ }
258
+ if (Array.isArray(val)) {
259
+ return val.length === 0;
260
+ }
261
+ if (val instanceof Set || val instanceof Map) {
262
+ return val.size === 0;
263
+ }
264
+ if (val instanceof Promise) {
265
+ return false;
266
+ }
267
+ if (typeof val === "object") {
268
+ try {
269
+ return Object.keys(val).length === 0;
270
+ } catch (e) {
271
+ return false;
272
+ }
273
+ }
274
+ return false;
275
+ };
276
+ const getType = (vari) => {
277
+ return Object.prototype.toString.call(vari).slice(8, -1).toLowerCase();
278
+ };
279
+ const isPromise = (value) => {
280
+ const type = getType(value);
281
+ switch (type) {
282
+ case "promise":
283
+ return [value];
284
+ case "array":
285
+ if (value.some((val) => getType(val) !== "promise")) {
286
+ console.error(new TypeError("Binding values should all be of type Promise"));
287
+ return "error";
288
+ }
289
+ return value;
290
+ default:
291
+ return false;
292
+ }
293
+ };
294
+ const unmount = (el) => {
295
+ cacheInstance.delete(el);
296
+ el.instance.proxy.close();
297
+ unmountComponent(el.instance);
298
+ };
299
+ const toggleLoading = (el, binding) => {
300
+ var _a, _b, _c;
301
+ if (binding.value) {
302
+ const vals = isPromise(binding.value);
303
+ if (vals === "error") {
304
+ return;
305
+ }
306
+ (_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);
307
+ el.appendChild(el.mask);
308
+ cacheInstance.add(el);
309
+ if (vals) {
310
+ Promise.all(vals).catch((err) => {
311
+ console.error(new Error("Promise handling errors"), err);
312
+ }).finally(() => {
313
+ unmount(el);
314
+ });
315
+ }
316
+ } else {
317
+ unmount(el);
318
+ }
319
+ };
320
+ const removeAttribute = (el) => {
321
+ el.removeAttribute("zindex");
322
+ el.removeAttribute("positiontype");
323
+ el.removeAttribute("backdrop");
324
+ el.removeAttribute("message");
325
+ el.removeAttribute("view");
326
+ el.removeAttribute("loadingtemplateref");
327
+ };
328
+ const handleProps = (el, vprops) => {
329
+ var _a;
330
+ const props = __spreadValues(__spreadValues({}, new LoadingOptions()), vprops);
331
+ const loadingTemplateRef = props.loadingTemplateRef;
332
+ const loadingInstance = createComponent(loadingConstructor, __spreadValues({}, props), loadingTemplateRef ? () => loadingTemplateRef : null);
333
+ el.style.position = props.positionType;
334
+ el.options = props;
335
+ el.instance = loadingInstance;
336
+ el.mask = (_a = loadingInstance == null ? void 0 : loadingInstance.proxy) == null ? void 0 : _a.$el;
337
+ };
338
+ const loadingDirective = {
339
+ mounted: function(el, binding, vnode) {
340
+ handleProps(el, vnode.props);
341
+ removeAttribute(el);
342
+ !isEmpty(binding.value) && toggleLoading(el, binding);
343
+ },
344
+ updated: function(el, binding, vnode) {
345
+ if (!isEmpty(binding.value) && cacheInstance.has(el) || isEmpty(binding.value) && !cacheInstance.has(el)) {
346
+ return;
347
+ }
348
+ !cacheInstance.has(el) && handleProps(el, vnode.props);
349
+ removeAttribute(el);
350
+ toggleLoading(el, binding);
351
+ }
352
+ };
90
353
  function className(classStr, classOpt) {
91
354
  let classname = classStr;
92
355
  if (typeof classOpt === "object") {
@@ -97,47 +360,63 @@ function className(classStr, classOpt) {
97
360
  return classname;
98
361
  }
99
362
  var editableSelect = "";
100
- const getFilterFunc = () => (val, option) => option.label.toLocaleLowerCase().indexOf(val.toLocaleLowerCase()) > -1;
101
- const userFilterOptions = (normalizeOptions, inputValue, filterOption) => computed(() => {
102
- const filteredOptions = [];
103
- if (!inputValue.value || filterOption === false) {
104
- return normalizeOptions.value;
105
- }
106
- const filterFunc = typeof filterOption === "function" ? filterOption : getFilterFunc();
107
- normalizeOptions.value.forEach((option) => {
108
- if (filterFunc(inputValue.value, option)) {
109
- filteredOptions.push(option);
363
+ function useSelect(props) {
364
+ const normalizeOptions = computed(() => {
365
+ return props.options.map((option) => {
366
+ let res;
367
+ if (option !== "null" && typeof option === "object") {
368
+ res = __spreadProps(__spreadValues({}, option), {
369
+ label: option.label || "",
370
+ value: option.value !== void 0 ? option.value : option.label || ""
371
+ });
372
+ } else {
373
+ res = {
374
+ label: String(option),
375
+ value: option
376
+ };
377
+ }
378
+ return res;
379
+ });
380
+ });
381
+ return { normalizeOptions };
382
+ }
383
+ function useFilterOptions(enableLazyLoad, normalizeOptions, inputValue, searchFn) {
384
+ const filteredOptions = computed(() => {
385
+ if (!inputValue.value || enableLazyLoad) {
386
+ return normalizeOptions.value;
110
387
  }
388
+ return normalizeOptions.value.filter((option) => {
389
+ return searchFn(option, inputValue.value);
390
+ });
111
391
  });
112
- return filteredOptions;
113
- });
114
- const useInput = (inputValue, ctx2) => {
392
+ return { filteredOptions };
393
+ }
394
+ function useInput(inputValue, ctx2) {
115
395
  const onInputChange = (value) => {
116
396
  ctx2.emit("search", value);
117
397
  };
118
398
  const handleInput = (event) => {
119
399
  const value = event.target.value;
120
400
  inputValue.value = value;
121
- ctx2.emit("update:modelValue", value);
122
401
  onInputChange(value);
123
402
  };
124
403
  return {
125
404
  handleInput
126
405
  };
127
- };
128
- const useLazyLoad = (dropdownRef, inputValue, filterOtion, ctx2) => {
406
+ }
407
+ function useLazyLoad(dropdownRef, enableLazyLoad, ctx2) {
129
408
  const loadMore = () => {
130
409
  const dropdownVal = dropdownRef.value;
131
- if (filterOtion !== false) {
410
+ if (!enableLazyLoad) {
132
411
  return;
133
412
  }
134
413
  if (dropdownVal.clientHeight + dropdownVal.scrollTop >= dropdownVal.scrollHeight) {
135
- ctx2.emit("loadMore", inputValue.value);
414
+ ctx2.emit("loadMore");
136
415
  }
137
416
  };
138
417
  return { loadMore };
139
- };
140
- const useKeyboardSelect = (dropdownRef, visible, inputValue, filteredOptions, optionDisabledKey, filterOption, loading, handleClick, closeMenu, toggleMenu) => {
418
+ }
419
+ function useKeyboardSelect(dropdownRef, visible, inputValue, cacheInput, filteredOptions, optionDisabledKey, filterOption, loading2, handleClick, closeMenu, toggleMenu) {
141
420
  const hoverIndex = ref(0);
142
421
  const selectedIndex = ref(0);
143
422
  const updateHoveringIndex = (index2) => {
@@ -159,18 +438,15 @@ const useKeyboardSelect = (dropdownRef, visible, inputValue, filteredOptions, op
159
438
  });
160
439
  };
161
440
  const handleEscape = () => {
162
- if (inputValue.value) {
163
- inputValue.value = "";
164
- } else {
165
- closeMenu();
166
- }
441
+ inputValue.value = cacheInput.value;
442
+ closeMenu();
167
443
  };
168
444
  const handleEnter = () => {
169
445
  const len = filteredOptions.value.length;
170
446
  if (!visible.value || !len) {
171
447
  return toggleMenu();
172
448
  }
173
- len && len === 1 ? handleClick(filteredOptions.value[0]) : handleClick(filteredOptions.value[hoverIndex.value]);
449
+ len && len === 1 ? handleClick(filteredOptions.value[0], 1) : handleClick(filteredOptions.value[hoverIndex.value], hoverIndex.value);
174
450
  return closeMenu();
175
451
  };
176
452
  const handleKeyboardNavigation = (direction) => {
@@ -181,7 +457,7 @@ const useKeyboardSelect = (dropdownRef, visible, inputValue, filteredOptions, op
181
457
  if (!["ArrowDown", "ArrowUp"].includes(direction)) {
182
458
  return;
183
459
  }
184
- if (filterOption === false && loading.value) {
460
+ if (filterOption === false && loading2.value) {
185
461
  return;
186
462
  }
187
463
  let newIndex = 0;
@@ -219,47 +495,393 @@ const useKeyboardSelect = (dropdownRef, visible, inputValue, filteredOptions, op
219
495
  }
220
496
  };
221
497
  return { handleKeydown, hoverIndex, selectedIndex };
498
+ }
499
+ const flexibleOverlayProps = {
500
+ modelValue: {
501
+ type: Boolean,
502
+ default: false
503
+ },
504
+ origin: {
505
+ type: Object,
506
+ require: true
507
+ },
508
+ position: {
509
+ type: Array,
510
+ default: ["bottom"]
511
+ },
512
+ offset: {
513
+ type: [Number, Object],
514
+ default: 8
515
+ },
516
+ shiftOffset: {
517
+ type: Number
518
+ },
519
+ align: {
520
+ type: String,
521
+ default: null
522
+ },
523
+ showArrow: {
524
+ type: Boolean,
525
+ default: false
526
+ },
527
+ isArrowCenter: {
528
+ type: Boolean,
529
+ default: true
530
+ }
222
531
  };
532
+ function getScrollParent(element) {
533
+ const overflowRegex = /(auto|scroll|hidden)/;
534
+ for (let parent = element; parent = parent.parentElement; parent.parentElement !== document.body) {
535
+ const style = window.getComputedStyle(parent);
536
+ if (overflowRegex.test(style.overflow + style.overflowX + style.overflowY)) {
537
+ return parent;
538
+ }
539
+ }
540
+ return window;
541
+ }
542
+ function adjustArrowPosition(isArrowCenter, point, placement, originRect) {
543
+ let { x, y } = point;
544
+ if (!isArrowCenter) {
545
+ const { width, height } = originRect;
546
+ if (x && placement.includes("start")) {
547
+ x = 12;
548
+ }
549
+ if (x && placement.includes("end")) {
550
+ x = Math.round(width - 24);
551
+ }
552
+ if (y && placement.includes("start")) {
553
+ y = 10;
554
+ }
555
+ if (y && placement.includes("end")) {
556
+ y = height - 14;
557
+ }
558
+ }
559
+ return { x, y };
560
+ }
561
+ function useOverlay(props, emit) {
562
+ const overlayRef = ref();
563
+ const arrowRef = ref();
564
+ let originParent = null;
565
+ const updateArrowPosition = (arrowEl, placement, point, overlayEl) => {
566
+ const { x, y } = adjustArrowPosition(props.isArrowCenter, point, placement, overlayEl.getBoundingClientRect());
567
+ const staticSide = {
568
+ top: "bottom",
569
+ right: "left",
570
+ bottom: "top",
571
+ left: "right"
572
+ }[placement.split("-")[0]];
573
+ Object.assign(arrowEl.style, {
574
+ left: x ? `${x}px` : "",
575
+ top: y ? `${y}px` : "",
576
+ right: "",
577
+ bottom: "",
578
+ [staticSide]: "-4px"
579
+ });
580
+ };
581
+ const updatePosition = async () => {
582
+ const hostEl = props.origin;
583
+ const overlayEl = unref(overlayRef.value);
584
+ const arrowEl = unref(arrowRef.value);
585
+ const middleware = [
586
+ offset(props.offset),
587
+ autoPlacement({
588
+ alignment: props.align,
589
+ allowedPlacements: props.position
590
+ })
591
+ ];
592
+ props.showArrow && middleware.push(arrow({ element: arrowEl }));
593
+ props.shiftOffset !== void 0 && middleware.push(shift());
594
+ const { x, y, placement, middlewareData } = await computePosition(hostEl, overlayEl, {
595
+ strategy: "fixed",
596
+ middleware
597
+ });
598
+ let applyX = x;
599
+ let applyY = y;
600
+ if (props.shiftOffset !== void 0) {
601
+ const { x: shiftX, y: shiftY } = middlewareData.shift;
602
+ shiftX < 0 && (applyX -= props.shiftOffset);
603
+ shiftX > 0 && (applyX += props.shiftOffset);
604
+ shiftY < 0 && (applyY -= props.shiftOffset);
605
+ shiftY > 0 && (applyY += props.shiftOffset);
606
+ }
607
+ emit("positionChange", placement);
608
+ Object.assign(overlayEl.style, { top: `${applyY}px`, left: `${applyX}px` });
609
+ props.showArrow && updateArrowPosition(arrowEl, placement, middlewareData.arrow, overlayEl);
610
+ };
611
+ watch(() => props.modelValue, () => {
612
+ if (props.modelValue && props.origin) {
613
+ originParent = getScrollParent(props.origin);
614
+ nextTick(updatePosition);
615
+ originParent == null ? void 0 : originParent.addEventListener("scroll", updatePosition);
616
+ originParent !== window && window.addEventListener("scroll", updatePosition);
617
+ window.addEventListener("resize", updatePosition);
618
+ } else {
619
+ originParent == null ? void 0 : originParent.removeEventListener("scroll", updatePosition);
620
+ originParent !== window && window.removeEventListener("scroll", updatePosition);
621
+ window.removeEventListener("resize", updatePosition);
622
+ }
623
+ });
624
+ onUnmounted(() => {
625
+ originParent == null ? void 0 : originParent.removeEventListener("scroll", updatePosition);
626
+ originParent !== window && window.removeEventListener("scroll", updatePosition);
627
+ window.removeEventListener("resize", updatePosition);
628
+ });
629
+ return { arrowRef, overlayRef, updatePosition };
630
+ }
631
+ var flexibleOverlay = "";
632
+ const FlexibleOverlay = defineComponent({
633
+ name: "DFlexibleOverlay",
634
+ inheritAttrs: false,
635
+ props: flexibleOverlayProps,
636
+ emits: ["update:modelValue", "positionChange"],
637
+ setup(props, {
638
+ slots,
639
+ attrs,
640
+ emit,
641
+ expose
642
+ }) {
643
+ const ns = useNamespace("flexible-overlay");
644
+ const {
645
+ arrowRef,
646
+ overlayRef,
647
+ updatePosition
648
+ } = useOverlay(props, emit);
649
+ expose({
650
+ updatePosition
651
+ });
652
+ return () => {
653
+ var _a;
654
+ return props.modelValue && createVNode("div", mergeProps({
655
+ "ref": overlayRef,
656
+ "class": ns.b()
657
+ }, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots), props.showArrow && createVNode("div", {
658
+ "ref": arrowRef,
659
+ "class": ns.e("arrow")
660
+ }, null)]);
661
+ };
662
+ }
663
+ });
664
+ function useCacheFilteredOptions(filteredOptions) {
665
+ const cacheFilteredOptions = computed(() => {
666
+ const map = /* @__PURE__ */ new Map();
667
+ filteredOptions.value.forEach((item) => {
668
+ map.set(item, item.value);
669
+ });
670
+ return map;
671
+ });
672
+ const getOptionValue = (option) => cacheFilteredOptions.value.get(option);
673
+ return {
674
+ getOptionValue
675
+ };
676
+ }
677
+ function deepAssign(...objects) {
678
+ const isObject = (obj) => obj && typeof obj === "object";
679
+ return objects.reduce((prev, from) => {
680
+ Object.keys(from).forEach((key) => {
681
+ const pVal = prev[key];
682
+ const oVal = from[key];
683
+ if (Array.isArray(pVal) && Array.isArray(oVal)) {
684
+ prev[key] = Array.from(/* @__PURE__ */ new Set([...oVal, ...pVal]));
685
+ } else if (isObject(pVal) && isObject(oVal)) {
686
+ prev[key] = deepAssign(pVal, oVal);
687
+ } else {
688
+ prev[key] = oVal;
689
+ }
690
+ });
691
+ return prev;
692
+ }, {});
693
+ }
694
+ var zhCN = {
695
+ pagination: {
696
+ totalItemText: "\u6240\u6709\u6761\u76EE",
697
+ goToText: "\u8DF3\u81F3"
698
+ },
699
+ accordion: {
700
+ loading: "\u52A0\u8F7D\u4E2D",
701
+ noData: "\u6CA1\u6709\u6570\u636E"
702
+ },
703
+ autoCompleteDropdown: {
704
+ latestInput: "\u6700\u8FD1\u8F93\u5165"
705
+ },
706
+ cascaderList: {
707
+ noData: "\u6CA1\u6709\u6570\u636E"
708
+ },
709
+ colorPicker: {
710
+ foundationPanel: "\u57FA\u7840\u9762\u677F",
711
+ advancedPanel: "\u9AD8\u7EA7\u9762\u677F"
712
+ },
713
+ datePickerPro: {
714
+ ok: "\u786E\u5B9A",
715
+ placeholder: "\u8BF7\u9009\u62E9\u65E5\u671F",
716
+ month1: "1\u6708",
717
+ month2: "2\u6708",
718
+ month3: "3\u6708",
719
+ month4: "4\u6708",
720
+ month5: "5\u6708",
721
+ month6: "6\u6708",
722
+ month7: "7\u6708",
723
+ month8: "8\u6708",
724
+ month9: "9\u6708",
725
+ month10: "10\u6708",
726
+ month11: "11\u6708",
727
+ month12: "12\u6708",
728
+ year: "\u5E74",
729
+ startPlaceholder: "\u8BF7\u9009\u62E9\u5F00\u59CB\u65E5\u671F",
730
+ endPlaceholder: "\u8BF7\u9009\u62E9\u7ED3\u675F\u65E5\u671F",
731
+ getWeekDays() {
732
+ return ["\u65E5", "\u4E00", "\u4E8C", "\u4E09", "\u56DB", "\u4E94", "\u516D"];
733
+ },
734
+ getTimeArr() {
735
+ return ["\u65F6", "\u5206", "\u79D2"];
736
+ },
737
+ getYearMonthStr(year, month) {
738
+ return `${year}\u5E74${month}\u6708`;
739
+ }
740
+ },
741
+ editableSelect: {
742
+ noRelatedRecords: "\u627E\u4E0D\u5230\u76F8\u5173\u8BB0\u5F55",
743
+ noData: "\u6CA1\u6709\u6570\u636E"
744
+ },
745
+ input: {
746
+ placeholder: "\u8BF7\u8F93\u5165"
747
+ },
748
+ splitterBar: {
749
+ collapse: "\u6536\u8D77",
750
+ expand: "\u5C55\u5F00"
751
+ },
752
+ stepsGuide: {
753
+ previous: "\u4E0A\u4E00\u6B65",
754
+ continue: "\u6211\u77E5\u9053\u5566\uFF0C\u7EE7\u7EED",
755
+ ok: "\u6211\u77E5\u9053\u5566"
756
+ },
757
+ table: {
758
+ selectAll: "\u5168\u9009",
759
+ ok: "\u786E\u5B9A"
760
+ },
761
+ timePopup: {
762
+ ok: "\u786E\u5B9A"
763
+ },
764
+ transfer: {
765
+ unit: "\u9879",
766
+ panelUnit: "\u9879",
767
+ headerUnit: "\u9879",
768
+ noData: "\u6682\u65E0\u6570\u636E",
769
+ placeholder: "\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22"
770
+ },
771
+ tree: {
772
+ loading: "\u52A0\u8F7D\u4E2D",
773
+ newNode: "\u65B0\u8282\u70B9",
774
+ selectPlaceholder: "\u8BF7\u9009\u62E9"
775
+ },
776
+ upload: {
777
+ placeholder: "\u9009\u62E9\u6587\u4EF6",
778
+ getExistSameNameFilesMsg(sameNames) {
779
+ return `\u60A8\u4E0A\u4F20\u7684 "${sameNames}" \u5B58\u5728\u91CD\u540D\u6587\u4EF6, \u8BF7\u91CD\u65B0\u9009\u62E9\u6587\u4EF6`;
780
+ },
781
+ getAllFilesBeyondMaximalFileSizeMsg(maximalSize) {
782
+ return `\u6700\u5927\u652F\u6301\u4E0A\u4F20${maximalSize}MB\u7684\u6587\u4EF6, \u60A8\u672C\u6B21\u4E0A\u4F20\u7684\u6240\u6709\u6587\u4EF6\u8D85\u8FC7\u53EF\u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F`;
783
+ },
784
+ getBeyondMaximalFileSizeMsg(filename, maximalSize) {
785
+ return `\u6700\u5927\u652F\u6301\u4E0A\u4F20${maximalSize}MB\u7684\u6587\u4EF6, \u60A8\u4E0A\u4F20\u7684\u6587\u4EF6"${filename}"\u8D85\u8FC7\u53EF\u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F`;
786
+ },
787
+ getNotAllowedFileTypeMsg(filename, scope) {
788
+ return `\u652F\u6301\u7684\u6587\u4EF6\u7C7B\u578B: "${scope}", \u60A8\u4E0A\u4F20\u7684\u6587\u4EF6"${filename}"\u4E0D\u5728\u5141\u8BB8\u8303\u56F4\u5185\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u6587\u4EF6`;
789
+ }
790
+ },
791
+ search: {
792
+ placeholder: "\u8BF7\u8F93\u5165\u5173\u952E\u5B57"
793
+ },
794
+ select: {
795
+ placeholder: "\u8BF7\u9009\u62E9",
796
+ noDataText: "\u65E0\u6570\u636E",
797
+ noMatchText: "\u627E\u4E0D\u5230\u76F8\u5173\u8BB0\u5F55",
798
+ loadingText: "\u52A0\u8F7D\u4E2D..."
799
+ },
800
+ tagInput: {
801
+ maxTagsText: "\u5DF2\u8FBE\u5230\u6700\u5927\u4E2A\u6570\uFF1A"
802
+ },
803
+ timeSelect: {
804
+ placeholder: "\u8BF7\u9009\u62E9\u65F6\u95F4"
805
+ }
806
+ };
807
+ const lang = ref("zh-CN");
808
+ let langMessages = reactive({
809
+ [lang.value]: zhCN
810
+ });
811
+ const Locale = {
812
+ messages() {
813
+ return langMessages[lang.value];
814
+ },
815
+ lang() {
816
+ return lang.value;
817
+ },
818
+ use(newLang, newMessages) {
819
+ lang.value = newLang;
820
+ this.add({ [newLang]: newMessages });
821
+ },
822
+ add(newMessages = {}) {
823
+ langMessages = deepAssign(langMessages, newMessages);
824
+ }
825
+ };
826
+ const camelize = (name) => name.substring(1).replace(/^\S/, (s) => s.toLocaleLowerCase());
827
+ function get(object, path) {
828
+ const keys = path.split(".");
829
+ let result = object;
830
+ keys.forEach((key) => {
831
+ var _a;
832
+ result = (_a = result[key]) != null ? _a : "";
833
+ });
834
+ return result;
835
+ }
836
+ function createI18nTranslate(name, app, newPrefix) {
837
+ const prefix = newPrefix || camelize(name) + ".";
838
+ return (path) => {
839
+ var _a;
840
+ const messages = ((_a = app == null ? void 0 : app.appContext.config.globalProperties.langMessages) == null ? void 0 : _a.value) || Locale.messages();
841
+ const message = get(messages, prefix + path) || get(messages, path);
842
+ return message;
843
+ };
844
+ }
223
845
  var EditableSelect = defineComponent({
224
846
  name: "DEditableSelect",
225
847
  directives: {
226
- clickOutside: clickoutsideDirective
848
+ clickOutside: clickoutsideDirective,
849
+ dLoading: loadingDirective
227
850
  },
228
851
  props: editableSelectProps,
229
852
  emits: ["update:modelValue", "search", "loadMore"],
230
853
  setup(props, ctx2) {
854
+ const app = getCurrentInstance();
855
+ const t = createI18nTranslate("DEditableSelect", app);
856
+ const ns = useNamespace("editable-select");
231
857
  const dropdownRef = ref();
232
858
  const origin = ref();
233
859
  const position = ref(["bottom"]);
234
860
  const visible = ref(false);
235
861
  const inputValue = ref(props.modelValue);
236
- const loading = ref(props.loading);
237
- const normalizeOptions = computed(() => {
238
- return props.options.map((option) => {
239
- if (typeof option === "object") {
240
- return Object.assign({}, option, {
241
- label: option.label ? option.label : option.value,
242
- value: option.value
243
- });
244
- }
245
- return {
246
- label: option + "",
247
- value: option
248
- };
249
- });
250
- });
251
- const filteredOptions = userFilterOptions(normalizeOptions, inputValue, props.filterOption);
862
+ const cacheInput = ref();
863
+ const loading2 = ref(props.loading);
864
+ const {
865
+ normalizeOptions
866
+ } = useSelect(props);
867
+ const searchFn = props.searchFn || ((option, term) => option.label.toLocaleLowerCase().includes(term.trim().toLocaleLowerCase()));
868
+ const {
869
+ filteredOptions
870
+ } = useFilterOptions(props.enableLazyLoad, normalizeOptions, inputValue, searchFn);
871
+ const {
872
+ getOptionValue
873
+ } = useCacheFilteredOptions(filteredOptions);
252
874
  const emptyText = computed(() => {
253
- let text = "";
254
- if (props.filterOption !== false && !filteredOptions.value.length) {
255
- text = "\u627E\u4E0D\u5230\u76F8\u5173\u8BB0\u5F55";
256
- } else if (props.filterOption === false && !filteredOptions.value.length) {
257
- text = "\u6CA1\u6709\u6570\u636E";
875
+ let text;
876
+ if (props.enableLazyLoad) {
877
+ text = t("noData");
878
+ } else {
879
+ text = t("noRelatedRecords");
258
880
  }
259
881
  return text;
260
882
  });
261
883
  watch(() => props.loading, (newVal) => {
262
- loading.value = newVal;
884
+ loading2.value = newVal;
263
885
  });
264
886
  const toggleMenu = () => {
265
887
  visible.value = !visible.value;
@@ -269,45 +891,47 @@ var EditableSelect = defineComponent({
269
891
  };
270
892
  const {
271
893
  loadMore
272
- } = useLazyLoad(dropdownRef, inputValue, props.filterOption, ctx2);
894
+ } = useLazyLoad(dropdownRef, props.enableLazyLoad, ctx2);
273
895
  const {
274
896
  handleInput
275
897
  } = useInput(inputValue, ctx2);
276
- const handleClick = (option) => {
898
+ const handleClick = (option, index2, curSelectedIndex) => {
277
899
  const {
278
- optionDisabledKey: disabledKey
900
+ disabledKey
279
901
  } = props;
280
902
  if (disabledKey && !!option[disabledKey]) {
281
903
  return;
282
904
  }
283
- ctx2.emit("update:modelValue", option.label);
905
+ inputValue.value = option.label;
906
+ cacheInput.value = option.label;
907
+ curSelectedIndex.value = index2;
908
+ const value = getOptionValue(option);
909
+ ctx2.emit("update:modelValue", value + "");
284
910
  closeMenu();
285
911
  };
912
+ const handleClear = () => {
913
+ inputValue.value = "";
914
+ };
286
915
  const {
287
916
  handleKeydown,
288
917
  hoverIndex,
289
918
  selectedIndex
290
- } = useKeyboardSelect(dropdownRef, visible, inputValue, filteredOptions, props.optionDisabledKey, props.filterOption, loading, handleClick, closeMenu, toggleMenu);
291
- watch(() => props.modelValue, (newVal) => {
292
- if (newVal) {
293
- inputValue.value = newVal;
294
- }
295
- });
919
+ } = useKeyboardSelect(dropdownRef, visible, inputValue, cacheInput, filteredOptions, props.disabledKey, props.filterOption, loading2, (option, index2) => handleClick(option, index2, selectedIndex), closeMenu, toggleMenu);
296
920
  const getItemCls = (option, index2) => {
297
921
  const {
298
- optionDisabledKey: disabledKey
922
+ disabledKey
299
923
  } = props;
300
- return className("devui-dropdown-item", {
924
+ return className(`devui-dropdown-item`, {
301
925
  disabled: disabledKey ? !!option[disabledKey] : false,
302
926
  selected: index2 === selectedIndex.value,
303
- "devui-dropdown-bg": index2 === hoverIndex.value
927
+ [`${ns.em("dropdown", "bg")}`]: index2 === hoverIndex.value
304
928
  });
305
929
  };
306
930
  return () => {
307
- const selectCls = className("devui-editable-select devui-form-group devui-has-feedback", {
308
- "devui-select-open": visible.value === true
931
+ const selectCls = className(`${ns.b()} devui-form-group devui-has-feedback ${inputValue.value && props.allowClear && "allow-clear"}`, {
932
+ [`${ns.m("open")}`]: visible.value === true
309
933
  });
310
- const inputCls = className("devui-form-control devui-dropdown-origin", {
934
+ const inputCls = className(`devui-form-control devui-dropdown-origin`, {
311
935
  "devui-dropdown-origin-open": visible.value === true
312
936
  });
313
937
  return withDirectives(createVNode("div", {
@@ -328,42 +952,53 @@ var EditableSelect = defineComponent({
328
952
  }, null), createVNode("span", {
329
953
  "class": "devui-form-control-feedback"
330
954
  }, [createVNode("span", {
955
+ "class": "devui-select-clear-icon",
956
+ "onClick": handleClear
957
+ }, [createVNode(resolveComponent("d-icon"), {
958
+ "name": "icon-remove"
959
+ }, null)]), createVNode("span", {
331
960
  "class": "devui-select-chevron-icon"
332
961
  }, [createVNode(resolveComponent("d-icon"), {
333
962
  "name": "select-arrow"
334
- }, null)])]), createVNode(resolveComponent("d-flexible-overlay"), {
335
- "origin": origin.value,
336
- "modelValue": visible.value,
337
- "onUpdate:modelValue": ($event) => visible.value = $event,
338
- "position": position.value,
339
- "hasBackdrop": false
963
+ }, null)])]), createVNode(Teleport, {
964
+ "to": "body"
340
965
  }, {
341
- default: () => [createVNode("div", {
342
- "style": {
343
- width: props.width + "px"
344
- }
345
- }, [withDirectives(createVNode("div", {
346
- "class": "devui-dropdown-menu "
347
- }, [createVNode("ul", {
348
- "ref": dropdownRef,
349
- "class": "devui-list-unstyled scroll-height",
350
- "style": {
351
- maxHeight: props.maxHeight + "px"
352
- },
353
- "onScroll": loadMore
354
- }, [filteredOptions.value.map((option, index2) => {
355
- return createVNode("li", {
356
- "class": getItemCls(option, index2),
357
- "onClick": (e) => {
358
- e.stopPropagation();
359
- handleClick(option);
360
- }
361
- }, [ctx2.slots.item ? ctx2.slots.item(option) : option.label]);
362
- }), withDirectives(createVNode("li", {
363
- "class": "devui-no-result-template"
364
- }, [createVNode("div", {
365
- "class": "devui-no-data-tip"
366
- }, [ctx2.slots.noResultItem ? ctx2.slots.noResultItem() : emptyText.value])]), [[vShow, !filteredOptions.value.length]])])]), [[resolveDirective("dLoading"), props.loading], [vShow, visible.value]])])]
966
+ default: () => [createVNode(Transition, {
967
+ "name": "fade"
968
+ }, {
969
+ default: () => [createVNode(FlexibleOverlay, {
970
+ "origin": origin.value,
971
+ "modelValue": visible.value,
972
+ "onUpdate:modelValue": ($event) => visible.value = $event,
973
+ "position": position.value
974
+ }, {
975
+ default: () => [createVNode("div", {
976
+ "style": {
977
+ width: props.width + "px"
978
+ },
979
+ "class": `${ns.e("menu")}`
980
+ }, [withDirectives(createVNode("div", {
981
+ "class": `devui-dropdown-menu`
982
+ }, [createVNode("ul", {
983
+ "ref": dropdownRef,
984
+ "class": `${ns.em("list", "unstyled")} devui-scrollbar scroll-height`,
985
+ "style": {
986
+ maxHeight: props.maxHeight + "px"
987
+ },
988
+ "onScroll": loadMore
989
+ }, [filteredOptions.value.map((option, index2) => {
990
+ return createVNode("li", {
991
+ "class": getItemCls(option, index2),
992
+ "onClick": (e) => {
993
+ e.stopPropagation();
994
+ handleClick(option, index2, selectedIndex);
995
+ }
996
+ }, [ctx2.slots.item ? ctx2.slots.item(option) : option.label]);
997
+ }), withDirectives(createVNode("div", {
998
+ "class": "devui-no-data-tip"
999
+ }, [ctx2.slots.noResultItem ? ctx2.slots.noResultItem(inputValue.value) : emptyText.value]), [[vShow, !filteredOptions.value.length]])])]), [[vShow, visible.value], [resolveDirective("d-loading"), props.loading]])])]
1000
+ })]
1001
+ })]
367
1002
  })]), [[resolveDirective("click-outside"), closeMenu]]);
368
1003
  };
369
1004
  }