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

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 (352) hide show
  1. package/README.md +70 -121
  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 +8204 -296
  6. package/auto-complete/index.umd.js +29 -1
  7. package/auto-complete/style.css +1 -1
  8. package/avatar/index.es.js +153 -146
  9. package/avatar/index.umd.js +1 -1
  10. package/avatar/style.css +1 -1
  11. package/badge/index.es.js +36 -5
  12. package/badge/index.umd.js +1 -1
  13. package/badge/style.css +1 -1
  14. package/button/index.es.js +5727 -111
  15. package/button/index.umd.js +27 -1
  16. package/button/style.css +1 -1
  17. package/card/index.es.js +63 -35
  18. package/card/index.umd.js +1 -1
  19. package/card/style.css +1 -1
  20. package/checkbox/index.es.js +8068 -255
  21. package/checkbox/index.umd.js +27 -1
  22. package/checkbox/style.css +1 -1
  23. package/{accordion → collapse}/index.d.ts +0 -0
  24. package/collapse/index.es.js +213 -0
  25. package/collapse/index.umd.js +1 -0
  26. package/{anchor → collapse}/package.json +1 -1
  27. package/collapse/style.css +1 -0
  28. package/countdown/index.es.js +59 -19
  29. package/countdown/index.umd.js +1 -1
  30. package/{anchor → date-picker-pro}/index.d.ts +0 -0
  31. package/date-picker-pro/index.es.js +10856 -0
  32. package/date-picker-pro/index.umd.js +27 -0
  33. package/{breadcrumb → date-picker-pro}/package.json +1 -1
  34. package/date-picker-pro/style.css +1 -0
  35. package/drawer/index.es.js +31 -4
  36. package/drawer/index.umd.js +1 -1
  37. package/drawer/style.css +1 -1
  38. package/dropdown/index.es.js +210 -149
  39. package/dropdown/index.umd.js +1 -1
  40. package/dropdown/style.css +1 -1
  41. package/editable-select/index.es.js +569 -159
  42. package/editable-select/index.umd.js +1 -1
  43. package/editable-select/style.css +1 -1
  44. package/form/index.es.js +1048 -1187
  45. package/form/index.umd.js +15 -15
  46. package/form/style.css +1 -1
  47. package/fullscreen/index.es.js +29 -5
  48. package/fullscreen/index.umd.js +1 -1
  49. package/fullscreen/style.css +1 -1
  50. package/grid/index.es.js +101 -86
  51. package/grid/index.umd.js +1 -1
  52. package/grid/style.css +1 -1
  53. package/icon/index.es.js +183 -23
  54. package/icon/index.umd.js +1 -1
  55. package/icon/style.css +1 -0
  56. package/image-preview/index.es.js +53 -30
  57. package/image-preview/index.umd.js +1 -1
  58. package/image-preview/style.css +1 -1
  59. package/input/index.es.js +8101 -144
  60. package/input/index.umd.js +27 -1
  61. package/input/style.css +1 -1
  62. package/input-number/index.es.js +274 -177
  63. package/input-number/index.umd.js +1 -1
  64. package/input-number/style.css +1 -1
  65. package/layout/index.es.js +40 -25
  66. package/layout/index.umd.js +1 -1
  67. package/layout/style.css +1 -1
  68. package/loading/index.es.js +74 -35
  69. package/loading/index.umd.js +1 -1
  70. package/loading/style.css +1 -1
  71. package/modal/index.es.js +375 -171
  72. package/modal/index.umd.js +1 -1
  73. package/modal/style.css +1 -1
  74. package/notification/index.es.js +293 -40
  75. package/notification/index.umd.js +1 -1
  76. package/notification/style.css +1 -1
  77. package/nuxt/components/ButtonGroup.js +3 -0
  78. package/nuxt/components/CheckboxButton.js +3 -0
  79. package/nuxt/components/CheckboxGroup.js +3 -0
  80. package/nuxt/components/Collapse.js +3 -0
  81. package/nuxt/components/CollapseItem.js +3 -0
  82. package/nuxt/components/DRangeDatePickerPro.js +3 -0
  83. package/nuxt/components/DatePickerPro.js +3 -0
  84. package/nuxt/components/DropdownPropsKey.js +3 -0
  85. package/nuxt/components/FORM_ITEM_TOKEN.js +3 -0
  86. package/nuxt/components/FORM_TOKEN.js +3 -0
  87. package/nuxt/components/Icon.js +1 -0
  88. package/nuxt/components/IconGroup.js +3 -0
  89. package/nuxt/components/LABEL_DATA.js +3 -0
  90. package/nuxt/components/LoadingOptions.js +3 -0
  91. package/nuxt/components/Option.js +3 -0
  92. package/nuxt/components/OptionGroup.js +3 -0
  93. package/nuxt/components/RadioButton.js +3 -0
  94. package/nuxt/components/Step.js +3 -0
  95. package/nuxt/components/Steps.js +3 -0
  96. package/nuxt/components/TABLE_TOKEN.js +3 -0
  97. package/nuxt/components/Tab.js +3 -0
  98. package/nuxt/components/TimeSelect.js +3 -0
  99. package/nuxt/components/autoCompleteProps.js +3 -0
  100. package/nuxt/components/avatarProps.js +3 -0
  101. package/nuxt/components/buttonGroupInjectionKey.js +3 -0
  102. package/nuxt/components/buttonGroupProps.js +3 -0
  103. package/nuxt/components/cardProps.js +3 -0
  104. package/nuxt/components/checkboxGroupInjectionKey.js +3 -0
  105. package/nuxt/components/checkboxGroupProps.js +3 -0
  106. package/nuxt/components/checkboxProps.js +3 -0
  107. package/nuxt/components/colProps.js +3 -0
  108. package/nuxt/components/colPropsBaseClass.js +3 -0
  109. package/nuxt/components/colPropsBaseStyle.js +3 -0
  110. package/nuxt/components/collapseItemProps.js +3 -0
  111. package/nuxt/components/collapseProps.js +3 -0
  112. package/nuxt/components/countdownProps.js +3 -0
  113. package/nuxt/components/datePickerProCommonProps.js +3 -0
  114. package/nuxt/components/datePickerProPanelProps.js +3 -0
  115. package/nuxt/components/datePickerProProps.js +3 -0
  116. package/nuxt/components/editableSelectProps.js +3 -0
  117. package/nuxt/components/formItemProps.js +3 -0
  118. package/nuxt/components/formProps.js +3 -0
  119. package/nuxt/components/iconProps.js +1 -0
  120. package/nuxt/components/imagePreviewProps.js +3 -0
  121. package/nuxt/components/inputProps.js +3 -0
  122. package/nuxt/components/loadingProps.js +3 -0
  123. package/nuxt/components/modalProps.js +3 -0
  124. package/nuxt/components/progressProps.js +3 -0
  125. package/nuxt/components/rateProps.js +3 -0
  126. package/nuxt/components/resultProps.js +3 -0
  127. package/nuxt/components/rowProps.js +3 -0
  128. package/nuxt/components/screenSizes.js +3 -0
  129. package/nuxt/components/skeletonProps.js +3 -0
  130. package/nuxt/components/sliderProps.js +3 -0
  131. package/nuxt/components/splitterProps.js +3 -0
  132. package/nuxt/components/statisticProps.js +3 -0
  133. package/nuxt/components/stepProps.js +3 -0
  134. package/nuxt/components/stepsProps.js +3 -0
  135. package/nuxt/components/svgIconProps.js +3 -0
  136. package/nuxt/components/switchProps.js +3 -0
  137. package/nuxt/components/tableProps.js +3 -0
  138. package/nuxt/components/tabsProps.js +3 -0
  139. package/nuxt/components/tagProps.js +3 -0
  140. package/nuxt/components/textareaProps.js +3 -0
  141. package/nuxt/components/timeAxisProps.js +3 -0
  142. package/nuxt/components/timerPickerPanelProps.js +3 -0
  143. package/nuxt/components/treeProps.js +3 -0
  144. package/overlay/index.es.js +104 -133
  145. package/overlay/index.umd.js +1 -1
  146. package/overlay/style.css +1 -1
  147. package/package.json +4 -2
  148. package/pagination/index.es.js +171 -141
  149. package/pagination/index.umd.js +1 -1
  150. package/pagination/style.css +1 -1
  151. package/panel/style.css +1 -1
  152. package/popover/index.es.js +294 -230
  153. package/popover/index.umd.js +15 -15
  154. package/popover/style.css +1 -1
  155. package/progress/index.es.js +110 -56
  156. package/progress/index.umd.js +3 -3
  157. package/progress/style.css +1 -1
  158. package/radio/index.es.js +7967 -146
  159. package/radio/index.umd.js +27 -1
  160. package/radio/style.css +1 -1
  161. package/rate/index.es.js +77 -55
  162. package/rate/index.umd.js +1 -1
  163. package/rate/style.css +1 -1
  164. package/result/index.es.js +170 -27
  165. package/result/index.umd.js +1 -1
  166. package/result/style.css +1 -1
  167. package/ripple/index.es.js +43 -42
  168. package/ripple/index.umd.js +1 -1
  169. package/search/index.es.js +3660 -1097
  170. package/search/index.umd.js +18 -18
  171. package/search/style.css +1 -1
  172. package/select/index.es.js +8998 -487
  173. package/select/index.umd.js +27 -1
  174. package/select/style.css +1 -1
  175. package/skeleton/index.es.js +46 -24
  176. package/skeleton/index.umd.js +1 -1
  177. package/skeleton/style.css +1 -1
  178. package/slider/index.es.js +144 -138
  179. package/slider/index.umd.js +1 -1
  180. package/slider/style.css +1 -1
  181. package/splitter/index.es.js +468 -340
  182. package/splitter/index.umd.js +16 -16
  183. package/splitter/style.css +1 -1
  184. package/statistic/index.es.js +41 -34
  185. package/statistic/index.umd.js +1 -1
  186. package/statistic/style.css +1 -1
  187. package/status/index.es.js +26 -2
  188. package/status/index.umd.js +1 -1
  189. package/status/style.css +1 -1
  190. package/{back-top → steps}/index.d.ts +0 -0
  191. package/steps/index.es.js +385 -0
  192. package/steps/index.umd.js +1 -0
  193. package/{gantt → steps}/package.json +1 -1
  194. package/steps/style.css +1 -0
  195. package/style.css +1 -1
  196. package/switch/index.es.js +7802 -64
  197. package/switch/index.umd.js +27 -1
  198. package/switch/style.css +1 -1
  199. package/table/index.es.js +10315 -1147
  200. package/table/index.umd.js +27 -1
  201. package/table/style.css +1 -1
  202. package/tabs/index.es.js +345 -142
  203. package/tabs/index.umd.js +1 -1
  204. package/tabs/style.css +1 -1
  205. package/tag/index.es.js +47 -23
  206. package/tag/index.umd.js +1 -1
  207. package/tag/style.css +1 -1
  208. package/textarea/index.es.js +7921 -83
  209. package/textarea/index.umd.js +35 -1
  210. package/textarea/style.css +1 -1
  211. package/time-picker/index.es.js +8704 -559
  212. package/time-picker/index.umd.js +27 -1
  213. package/time-picker/style.css +1 -1
  214. package/{breadcrumb → time-select}/index.d.ts +0 -0
  215. package/{color-picker → time-select}/index.es.js +4116 -2914
  216. package/time-select/index.umd.js +27 -0
  217. package/{back-top → time-select}/package.json +1 -1
  218. package/time-select/style.css +1 -0
  219. package/timeline/index.es.js +177 -37
  220. package/timeline/index.umd.js +1 -1
  221. package/timeline/style.css +1 -1
  222. package/tooltip/index.es.js +286 -221
  223. package/tooltip/index.umd.js +15 -15
  224. package/tooltip/style.css +1 -1
  225. package/tree/index.es.js +5325 -1855
  226. package/tree/index.umd.js +18 -18
  227. package/tree/style.css +1 -1
  228. package/upload/index.es.js +456 -133
  229. package/upload/index.umd.js +1 -1
  230. package/upload/style.css +1 -1
  231. package/vue-devui.es.js +14986 -16343
  232. package/vue-devui.umd.js +30 -20
  233. package/accordion/index.es.js +0 -723
  234. package/accordion/index.umd.js +0 -1
  235. package/accordion/package.json +0 -7
  236. package/accordion/style.css +0 -1
  237. package/anchor/index.es.js +0 -263
  238. package/anchor/index.umd.js +0 -1
  239. package/anchor/style.css +0 -1
  240. package/back-top/index.es.js +0 -130
  241. package/back-top/index.umd.js +0 -1
  242. package/back-top/style.css +0 -1
  243. package/breadcrumb/index.es.js +0 -128
  244. package/breadcrumb/index.umd.js +0 -1
  245. package/breadcrumb/style.css +0 -1
  246. package/carousel/index.d.ts +0 -7
  247. package/carousel/index.es.js +0 -314
  248. package/carousel/index.umd.js +0 -1
  249. package/carousel/package.json +0 -7
  250. package/carousel/style.css +0 -1
  251. package/cascader/index.d.ts +0 -7
  252. package/cascader/index.es.js +0 -5971
  253. package/cascader/index.umd.js +0 -27
  254. package/cascader/package.json +0 -7
  255. package/cascader/style.css +0 -1
  256. package/color-picker/index.d.ts +0 -7
  257. package/color-picker/index.umd.js +0 -27
  258. package/color-picker/package.json +0 -7
  259. package/color-picker/style.css +0 -1
  260. package/comment/index.d.ts +0 -7
  261. package/comment/index.es.js +0 -86
  262. package/comment/index.umd.js +0 -1
  263. package/comment/package.json +0 -7
  264. package/comment/style.css +0 -1
  265. package/date-picker/index.d.ts +0 -7
  266. package/date-picker/index.es.js +0 -1154
  267. package/date-picker/index.umd.js +0 -1
  268. package/date-picker/package.json +0 -7
  269. package/date-picker/style.css +0 -1
  270. package/dragdrop/index.d.ts +0 -7
  271. package/dragdrop/index.es.js +0 -157
  272. package/dragdrop/index.umd.js +0 -1
  273. package/dragdrop/package.json +0 -7
  274. package/gantt/index.d.ts +0 -7
  275. package/gantt/index.es.js +0 -523
  276. package/gantt/index.umd.js +0 -1
  277. package/gantt/style.css +0 -1
  278. package/input-icon/index.d.ts +0 -7
  279. package/input-icon/index.es.js +0 -332
  280. package/input-icon/index.umd.js +0 -1
  281. package/input-icon/package.json +0 -7
  282. package/input-icon/style.css +0 -1
  283. package/list/index.d.ts +0 -7
  284. package/list/index.es.js +0 -39
  285. package/list/index.umd.js +0 -1
  286. package/list/package.json +0 -7
  287. package/list/style.css +0 -1
  288. package/nav-sprite/index.d.ts +0 -7
  289. package/nav-sprite/index.es.js +0 -68
  290. package/nav-sprite/index.umd.js +0 -1
  291. package/nav-sprite/package.json +0 -7
  292. package/nuxt/components/Accordion.js +0 -3
  293. package/nuxt/components/Anchor.js +0 -3
  294. package/nuxt/components/BackTop.js +0 -3
  295. package/nuxt/components/Breadcrumb.js +0 -3
  296. package/nuxt/components/Carousel.js +0 -3
  297. package/nuxt/components/CarouselItem.js +0 -3
  298. package/nuxt/components/Cascader.js +0 -3
  299. package/nuxt/components/ColorPicker.js +0 -3
  300. package/nuxt/components/Comment.js +0 -3
  301. package/nuxt/components/DatePicker.js +0 -3
  302. package/nuxt/components/FormControl.js +0 -3
  303. package/nuxt/components/FormLabel.js +0 -3
  304. package/nuxt/components/Gantt.js +0 -3
  305. package/nuxt/components/InputIcon.js +0 -3
  306. package/nuxt/components/List.js +0 -3
  307. package/nuxt/components/ListItem.js +0 -3
  308. package/nuxt/components/NavSprite.js +0 -2
  309. package/nuxt/components/QuadrantDiagram.js +0 -3
  310. package/nuxt/components/ReadTip.js +0 -3
  311. package/nuxt/components/StepsGuide.js +0 -3
  312. package/nuxt/components/StickSlider.js +0 -3
  313. package/nuxt/components/Sticky.js +0 -2
  314. package/nuxt/components/TagInput.js +0 -3
  315. package/nuxt/components/Transfer.js +0 -3
  316. package/nuxt/components/TreeSelect.js +0 -3
  317. package/nuxt/components/overlayEmits.js +0 -3
  318. package/nuxt/components/overlayProps.js +0 -3
  319. package/quadrant-diagram/index.d.ts +0 -7
  320. package/quadrant-diagram/index.es.js +0 -5728
  321. package/quadrant-diagram/index.umd.js +0 -27
  322. package/quadrant-diagram/package.json +0 -7
  323. package/quadrant-diagram/style.css +0 -1
  324. package/read-tip/index.d.ts +0 -7
  325. package/read-tip/index.es.js +0 -261
  326. package/read-tip/index.umd.js +0 -1
  327. package/read-tip/package.json +0 -7
  328. package/read-tip/style.css +0 -1
  329. package/steps-guide/index.d.ts +0 -7
  330. package/steps-guide/index.es.js +0 -242
  331. package/steps-guide/index.umd.js +0 -1
  332. package/steps-guide/package.json +0 -7
  333. package/steps-guide/style.css +0 -1
  334. package/sticky/index.d.ts +0 -7
  335. package/sticky/index.es.js +0 -197
  336. package/sticky/index.umd.js +0 -1
  337. package/sticky/package.json +0 -7
  338. package/tag-input/index.d.ts +0 -7
  339. package/tag-input/index.es.js +0 -331
  340. package/tag-input/index.umd.js +0 -1
  341. package/tag-input/package.json +0 -7
  342. package/tag-input/style.css +0 -1
  343. package/transfer/index.d.ts +0 -7
  344. package/transfer/index.es.js +0 -7615
  345. package/transfer/index.umd.js +0 -27
  346. package/transfer/package.json +0 -7
  347. package/transfer/style.css +0 -1
  348. package/tree-select/index.d.ts +0 -7
  349. package/tree-select/index.es.js +0 -627
  350. package/tree-select/index.umd.js +0 -1
  351. package/tree-select/package.json +0 -7
  352. package/tree-select/style.css +0 -1
@@ -14,11 +14,13 @@ var __spreadValues = (a, b) => {
14
14
  }
15
15
  return a;
16
16
  };
17
- import { computed, nextTick, defineComponent, ref, reactive, watch, withDirectives, createVNode, withModifiers, resolveComponent, resolveDirective, vShow, Transition } from "vue";
17
+ var __publicField = (obj, key, value) => {
18
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
19
+ return value;
20
+ };
21
+ import { defineComponent, ref, createVNode, h, render, computed, nextTick, unref, watch, onUnmounted, mergeProps, getCurrentInstance, withDirectives, withModifiers, resolveComponent, Teleport, Transition, vShow, resolveDirective } from "vue";
22
+ import { offset, autoPlacement, arrow, shift, computePosition } from "@floating-ui/dom";
18
23
  const editableSelectProps = {
19
- appendToBody: {
20
- type: Boolean
21
- },
22
24
  options: {
23
25
  type: Array,
24
26
  default: () => []
@@ -38,7 +40,8 @@ const editableSelectProps = {
38
40
  default: "Search"
39
41
  },
40
42
  modelValue: {
41
- type: String
43
+ type: String,
44
+ default: ""
42
45
  },
43
46
  width: {
44
47
  type: Number
@@ -48,9 +51,6 @@ const editableSelectProps = {
48
51
  },
49
52
  filterOption: {
50
53
  type: [Function, Boolean]
51
- },
52
- loadMore: {
53
- type: Function
54
54
  }
55
55
  };
56
56
  const inBrowser = typeof window !== "undefined";
@@ -108,6 +108,234 @@ const clickoutsideDirective = {
108
108
  delete el[ctx];
109
109
  }
110
110
  };
111
+ class View {
112
+ constructor() {
113
+ __publicField(this, "top", "50%");
114
+ __publicField(this, "left", "50%");
115
+ }
116
+ }
117
+ const loadingProps = {
118
+ message: String,
119
+ backdrop: Boolean,
120
+ view: {
121
+ type: Object,
122
+ default: () => new View()
123
+ },
124
+ zIndex: Number,
125
+ isFull: {
126
+ type: Boolean,
127
+ default: false
128
+ }
129
+ };
130
+ class LoadingOptions {
131
+ constructor() {
132
+ __publicField(this, "target");
133
+ __publicField(this, "message");
134
+ __publicField(this, "loadingTemplateRef");
135
+ __publicField(this, "backdrop", true);
136
+ __publicField(this, "positionType", "relative");
137
+ __publicField(this, "view", new View());
138
+ __publicField(this, "zIndex");
139
+ }
140
+ }
141
+ function createBem(namespace, element, modifier) {
142
+ let cls = namespace;
143
+ if (element) {
144
+ cls += `__${element}`;
145
+ }
146
+ if (modifier) {
147
+ cls += `--${modifier}`;
148
+ }
149
+ return cls;
150
+ }
151
+ function useNamespace(block, needDot = false) {
152
+ const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
153
+ const b = () => createBem(namespace);
154
+ const e = (element) => element ? createBem(namespace, element) : "";
155
+ const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
156
+ const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
157
+ return {
158
+ b,
159
+ e,
160
+ m,
161
+ em
162
+ };
163
+ }
164
+ var loading = "";
165
+ var Loading = defineComponent({
166
+ name: "DLoading",
167
+ inheritAttrs: false,
168
+ props: loadingProps,
169
+ setup(props) {
170
+ const style = {
171
+ top: props.view.top,
172
+ left: props.view.left,
173
+ zIndex: props.zIndex
174
+ };
175
+ if (!props.message) {
176
+ style.background = "none";
177
+ }
178
+ const isShow = ref(false);
179
+ const open = () => {
180
+ isShow.value = true;
181
+ };
182
+ const close = () => {
183
+ isShow.value = false;
184
+ };
185
+ return {
186
+ style,
187
+ isShow,
188
+ open,
189
+ close
190
+ };
191
+ },
192
+ render() {
193
+ var _a;
194
+ const {
195
+ isShow,
196
+ isFull,
197
+ backdrop,
198
+ style,
199
+ message,
200
+ $slots
201
+ } = this;
202
+ const ns = useNamespace("loading");
203
+ return isShow && createVNode("div", {
204
+ "class": [ns.b(), isFull ? ns.m("full") : ""]
205
+ }, [((_a = $slots.default) == null ? void 0 : _a.call($slots)) || createVNode("div", {
206
+ "class": ns.e("wrapper")
207
+ }, [backdrop ? createVNode("div", {
208
+ "class": ns.e("mask")
209
+ }, null) : null, createVNode("div", {
210
+ "style": style,
211
+ "class": ns.e("area")
212
+ }, [createVNode("div", {
213
+ "class": ns.e("busy-default-spinner")
214
+ }, [createVNode("div", {
215
+ "class": ns.e("bar1")
216
+ }, null), createVNode("div", {
217
+ "class": ns.e("bar2")
218
+ }, null), createVNode("div", {
219
+ "class": ns.e("bar3")
220
+ }, null), createVNode("div", {
221
+ "class": ns.e("bar4")
222
+ }, null)]), message ? createVNode("span", {
223
+ "class": ns.e("text")
224
+ }, [message]) : null])])]);
225
+ }
226
+ });
227
+ const COMPONENT_CONTAINER_SYMBOL = Symbol("dev_component_container");
228
+ function createComponent(component, props, children = null) {
229
+ const vnode = h(component, __spreadValues({}, props), children);
230
+ const container = document.createElement("div");
231
+ vnode[COMPONENT_CONTAINER_SYMBOL] = container;
232
+ render(vnode, container);
233
+ return vnode.component;
234
+ }
235
+ function unmountComponent(ComponnetInstance) {
236
+ render(null, ComponnetInstance == null ? void 0 : ComponnetInstance.vnode[COMPONENT_CONTAINER_SYMBOL]);
237
+ }
238
+ const loadingConstructor = defineComponent(Loading);
239
+ const cacheInstance = /* @__PURE__ */ new WeakSet();
240
+ const isEmpty = (val) => {
241
+ if (!val) {
242
+ return true;
243
+ }
244
+ if (Array.isArray(val)) {
245
+ return val.length === 0;
246
+ }
247
+ if (val instanceof Set || val instanceof Map) {
248
+ return val.size === 0;
249
+ }
250
+ if (val instanceof Promise) {
251
+ return false;
252
+ }
253
+ if (typeof val === "object") {
254
+ try {
255
+ return Object.keys(val).length === 0;
256
+ } catch (e) {
257
+ return false;
258
+ }
259
+ }
260
+ return false;
261
+ };
262
+ const getType = (vari) => {
263
+ return Object.prototype.toString.call(vari).slice(8, -1).toLowerCase();
264
+ };
265
+ const isPromise = (value) => {
266
+ const type = getType(value);
267
+ switch (type) {
268
+ case "promise":
269
+ return [value];
270
+ case "array":
271
+ if (value.some((val) => getType(val) !== "promise")) {
272
+ console.error(new TypeError("Binding values should all be of type Promise"));
273
+ return "error";
274
+ }
275
+ return value;
276
+ default:
277
+ return false;
278
+ }
279
+ };
280
+ const unmount = (el) => {
281
+ cacheInstance.delete(el);
282
+ el.instance.proxy.close();
283
+ unmountComponent(el.instance);
284
+ };
285
+ const toggleLoading = (el, binding) => {
286
+ var _a, _b, _c;
287
+ if (binding.value) {
288
+ const vals = isPromise(binding.value);
289
+ if (vals === "error") {
290
+ return;
291
+ }
292
+ (_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);
293
+ el.appendChild(el.mask);
294
+ cacheInstance.add(el);
295
+ if (vals) {
296
+ Promise.all(vals).catch((err) => {
297
+ console.error(new Error("Promise handling errors"), err);
298
+ }).finally(() => {
299
+ unmount(el);
300
+ });
301
+ }
302
+ } else {
303
+ unmount(el);
304
+ }
305
+ };
306
+ const removeAttribute = (el) => {
307
+ el.removeAttribute("zindex");
308
+ el.removeAttribute("positiontype");
309
+ el.removeAttribute("backdrop");
310
+ el.removeAttribute("message");
311
+ el.removeAttribute("view");
312
+ el.removeAttribute("loadingtemplateref");
313
+ };
314
+ const handleProps = (el, vprops) => {
315
+ var _a;
316
+ const props = __spreadValues(__spreadValues({}, new LoadingOptions()), vprops);
317
+ const loadingTemplateRef = props.loadingTemplateRef;
318
+ const loadingInstance = createComponent(loadingConstructor, __spreadValues({}, props), loadingTemplateRef ? () => loadingTemplateRef : null);
319
+ el.style.position = props.positionType;
320
+ el.options = props;
321
+ el.instance = loadingInstance;
322
+ el.mask = (_a = loadingInstance == null ? void 0 : loadingInstance.proxy) == null ? void 0 : _a.$el;
323
+ };
324
+ const loadingDirective = {
325
+ mounted: function(el, binding, vnode) {
326
+ handleProps(el, vnode.props);
327
+ removeAttribute(el);
328
+ !isEmpty(binding.value) && toggleLoading(el, binding);
329
+ },
330
+ updated: function(el, binding, vnode) {
331
+ if (!isEmpty(binding.value) && cacheInstance.has(el) || isEmpty(binding.value) && !cacheInstance.has(el)) {
332
+ return;
333
+ }
334
+ !cacheInstance.has(el) && handleProps(el, vnode.props);
335
+ removeAttribute(el);
336
+ toggleLoading(el, binding);
337
+ }
338
+ };
111
339
  function className(classStr, classOpt) {
112
340
  let classname = classStr;
113
341
  if (typeof classOpt === "object") {
@@ -145,18 +373,21 @@ const useInput = (inputValue, ctx2) => {
145
373
  handleInput
146
374
  };
147
375
  };
148
- const useLazyLoad = (dropdownRef, inputValue, filterOtion, load) => {
376
+ const useLazyLoad = (dropdownRef, inputValue, filterOtion, ctx2) => {
149
377
  const loadMore = () => {
378
+ const dropdownVal = dropdownRef.value;
150
379
  if (filterOtion !== false) {
151
380
  return;
152
381
  }
153
- if (dropdownRef.value.clientHeight + dropdownRef.value.scrollTop >= dropdownRef.value.scrollHeight) {
154
- load(inputValue.value);
382
+ if (dropdownVal.clientHeight + dropdownVal.scrollTop >= dropdownVal.scrollHeight) {
383
+ ctx2.emit("loadMore", inputValue.value);
155
384
  }
156
385
  };
157
386
  return { loadMore };
158
387
  };
159
- const useKeyboardSelect = (dropdownRef, disabled, visible, hoverIndex, selectedIndex, options, toggleMenu, closeMenu, handleClick) => {
388
+ const useKeyboardSelect = (dropdownRef, visible, inputValue, cacheInput, filteredOptions, optionDisabledKey, filterOption, loading2, handleClick, closeMenu, toggleMenu) => {
389
+ const hoverIndex = ref(0);
390
+ const selectedIndex = ref(0);
160
391
  const updateHoveringIndex = (index2) => {
161
392
  hoverIndex.value = index2;
162
393
  };
@@ -175,170 +406,288 @@ const useKeyboardSelect = (dropdownRef, disabled, visible, hoverIndex, selectedI
175
406
  }
176
407
  });
177
408
  };
178
- const onKeyboardNavigation = (direction, newIndex) => {
179
- if (!newIndex) {
180
- newIndex = hoverIndex.value;
409
+ const handleEscape = () => {
410
+ inputValue.value = cacheInput.value;
411
+ closeMenu();
412
+ };
413
+ const handleEnter = () => {
414
+ const len = filteredOptions.value.length;
415
+ if (!visible.value || !len) {
416
+ return toggleMenu();
417
+ }
418
+ len && len === 1 ? handleClick(filteredOptions.value[0], 1) : handleClick(filteredOptions.value[hoverIndex.value], hoverIndex.value);
419
+ return closeMenu();
420
+ };
421
+ const handleKeyboardNavigation = (direction) => {
422
+ const len = filteredOptions.value.length;
423
+ if (!len || len === 1) {
424
+ return;
181
425
  }
182
426
  if (!["ArrowDown", "ArrowUp"].includes(direction)) {
183
427
  return;
184
428
  }
429
+ if (filterOption === false && loading2.value) {
430
+ return;
431
+ }
432
+ let newIndex = 0;
433
+ newIndex = hoverIndex.value;
185
434
  if (direction === "ArrowUp") {
186
- if (newIndex === 0) {
187
- newIndex = options.value.length - 1;
188
- scrollToItem(newIndex);
189
- updateHoveringIndex(newIndex);
190
- return;
435
+ newIndex -= 1;
436
+ if (newIndex === -1) {
437
+ newIndex = len - 1;
191
438
  }
192
- newIndex = newIndex - 1;
193
439
  } else if (direction === "ArrowDown") {
194
- if (newIndex === options.value.length - 1) {
440
+ newIndex += 1;
441
+ if (newIndex === len) {
195
442
  newIndex = 0;
196
- scrollToItem(newIndex);
197
- updateHoveringIndex(newIndex);
198
- return;
199
443
  }
200
- newIndex = newIndex + 1;
201
444
  }
202
- const option = options.value[newIndex];
203
- if (option[disabled]) {
204
- return onKeyboardNavigation(direction, newIndex);
445
+ hoverIndex.value = newIndex;
446
+ const option = filteredOptions.value[newIndex];
447
+ if (option[optionDisabledKey]) {
448
+ return handleKeyboardNavigation(direction);
205
449
  }
206
- scrollToItem(newIndex);
207
450
  updateHoveringIndex(newIndex);
451
+ scrollToItem(newIndex);
208
452
  };
209
453
  const handleKeydown = (event) => {
210
454
  const keyCode = event.key || event.code;
211
- if (options.value.length === 0) {
212
- return;
213
- }
214
- if (!visible.value) {
215
- return toggleMenu();
216
- }
217
- const onKeydownEnter = () => {
218
- handleClick(options.value[hoverIndex.value]);
219
- closeMenu();
220
- };
221
- const onKeydownEsc = () => {
222
- closeMenu();
223
- };
224
455
  switch (keyCode) {
225
- case "Enter":
226
- onKeydownEnter();
227
- break;
228
456
  case "Escape":
229
- onKeydownEsc();
457
+ handleEscape();
458
+ break;
459
+ case "Enter":
460
+ handleEnter();
230
461
  break;
231
462
  default:
232
- onKeyboardNavigation(keyCode);
463
+ handleKeyboardNavigation(keyCode);
464
+ }
465
+ };
466
+ return { handleKeydown, hoverIndex, selectedIndex };
467
+ };
468
+ const flexibleOverlayProps = {
469
+ modelValue: {
470
+ type: Boolean,
471
+ default: false
472
+ },
473
+ origin: {
474
+ type: Object,
475
+ require: true
476
+ },
477
+ position: {
478
+ type: Array,
479
+ default: ["bottom"]
480
+ },
481
+ offset: {
482
+ type: [Number, Object],
483
+ default: 8
484
+ },
485
+ shiftOffset: {
486
+ type: Number
487
+ },
488
+ align: {
489
+ type: String,
490
+ default: null
491
+ },
492
+ showArrow: {
493
+ type: Boolean,
494
+ default: false
495
+ },
496
+ isArrowCenter: {
497
+ type: Boolean,
498
+ default: true
499
+ }
500
+ };
501
+ function getScrollParent(element) {
502
+ const overflowRegex = /(auto|scroll|hidden)/;
503
+ for (let parent = element; parent = parent.parentElement; parent.parentElement !== document.body) {
504
+ const style = window.getComputedStyle(parent);
505
+ if (overflowRegex.test(style.overflow + style.overflowX + style.overflowY)) {
506
+ return parent;
233
507
  }
508
+ }
509
+ return window;
510
+ }
511
+ function adjustArrowPosition(isArrowCenter, point, placement, originRect) {
512
+ let { x, y } = point;
513
+ if (!isArrowCenter) {
514
+ const { width, height } = originRect;
515
+ if (x && placement.includes("start")) {
516
+ x = 12;
517
+ }
518
+ if (x && placement.includes("end")) {
519
+ x = Math.round(width - 24);
520
+ }
521
+ if (y && placement.includes("start")) {
522
+ y = 10;
523
+ }
524
+ if (y && placement.includes("end")) {
525
+ y = height - 14;
526
+ }
527
+ }
528
+ return { x, y };
529
+ }
530
+ function useOverlay(props, emit) {
531
+ const overlayRef = ref();
532
+ const arrowRef = ref();
533
+ let originParent = null;
534
+ const updateArrowPosition = (arrowEl, placement, point, overlayEl) => {
535
+ const { x, y } = adjustArrowPosition(props.isArrowCenter, point, placement, overlayEl.getBoundingClientRect());
536
+ const staticSide = {
537
+ top: "bottom",
538
+ right: "left",
539
+ bottom: "top",
540
+ left: "right"
541
+ }[placement.split("-")[0]];
542
+ Object.assign(arrowEl.style, {
543
+ left: x ? `${x}px` : "",
544
+ top: y ? `${y}px` : "",
545
+ right: "",
546
+ bottom: "",
547
+ [staticSide]: "-4px"
548
+ });
234
549
  };
550
+ const updatePosition = async () => {
551
+ const hostEl = props.origin;
552
+ const overlayEl = unref(overlayRef.value);
553
+ const arrowEl = unref(arrowRef.value);
554
+ const middleware = [
555
+ offset(props.offset),
556
+ autoPlacement({
557
+ alignment: props.align,
558
+ allowedPlacements: props.position
559
+ })
560
+ ];
561
+ props.showArrow && middleware.push(arrow({ element: arrowEl }));
562
+ props.shiftOffset !== void 0 && middleware.push(shift());
563
+ const { x, y, placement, middlewareData } = await computePosition(hostEl, overlayEl, {
564
+ strategy: "fixed",
565
+ middleware
566
+ });
567
+ let applyX = x;
568
+ let applyY = y;
569
+ if (props.shiftOffset !== void 0) {
570
+ const { x: shiftX, y: shiftY } = middlewareData.shift;
571
+ shiftX < 0 && (applyX -= props.shiftOffset);
572
+ shiftX > 0 && (applyX += props.shiftOffset);
573
+ shiftY < 0 && (applyY -= props.shiftOffset);
574
+ shiftY > 0 && (applyY += props.shiftOffset);
575
+ }
576
+ emit("positionChange", placement);
577
+ Object.assign(overlayEl.style, { top: `${applyY}px`, left: `${applyX}px` });
578
+ props.showArrow && updateArrowPosition(arrowEl, placement, middlewareData.arrow, overlayEl);
579
+ };
580
+ watch(() => props.modelValue, () => {
581
+ if (props.modelValue && props.origin) {
582
+ originParent = getScrollParent(props.origin);
583
+ nextTick(updatePosition);
584
+ originParent == null ? void 0 : originParent.addEventListener("scroll", updatePosition);
585
+ originParent !== window && window.addEventListener("scroll", updatePosition);
586
+ window.addEventListener("resize", updatePosition);
587
+ } else {
588
+ originParent == null ? void 0 : originParent.removeEventListener("scroll", updatePosition);
589
+ originParent !== window && window.removeEventListener("scroll", updatePosition);
590
+ window.removeEventListener("resize", updatePosition);
591
+ }
592
+ });
593
+ onUnmounted(() => {
594
+ originParent == null ? void 0 : originParent.removeEventListener("scroll", updatePosition);
595
+ originParent !== window && window.removeEventListener("scroll", updatePosition);
596
+ window.removeEventListener("resize", updatePosition);
597
+ });
598
+ return { arrowRef, overlayRef, updatePosition };
599
+ }
600
+ var flexibleOverlay = "";
601
+ const FlexibleOverlay = defineComponent({
602
+ name: "DFlexibleOverlay",
603
+ inheritAttrs: false,
604
+ props: flexibleOverlayProps,
605
+ emits: ["update:modelValue", "positionChange"],
606
+ setup(props, {
607
+ slots,
608
+ attrs,
609
+ emit,
610
+ expose
611
+ }) {
612
+ const ns = useNamespace("flexible-overlay");
613
+ const {
614
+ arrowRef,
615
+ overlayRef,
616
+ updatePosition
617
+ } = useOverlay(props, emit);
618
+ expose({
619
+ updatePosition
620
+ });
621
+ return () => {
622
+ var _a;
623
+ return props.modelValue && createVNode("div", mergeProps({
624
+ "ref": overlayRef,
625
+ "class": ns.b()
626
+ }, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots), props.showArrow && createVNode("div", {
627
+ "ref": arrowRef,
628
+ "class": ns.e("arrow")
629
+ }, null)]);
630
+ };
631
+ }
632
+ });
633
+ const useCacheFilteredOptions = (filteredOptions) => {
634
+ const cacheFilteredOptions = computed(() => {
635
+ const map = /* @__PURE__ */ new Map();
636
+ filteredOptions.value.forEach((item) => {
637
+ map.set(item.label, item.value);
638
+ });
639
+ return map;
640
+ });
641
+ const getOptionValue = (label) => cacheFilteredOptions.value.get(label);
235
642
  return {
236
- handleKeydown
643
+ getOptionValue
237
644
  };
238
645
  };
646
+ const camelize = (name) => name.substring(1).replace(/^\S/, (s) => s.toLocaleLowerCase());
647
+ function get(object, path) {
648
+ const keys = path.split(".");
649
+ let result = object;
650
+ keys.forEach((key) => {
651
+ var _a;
652
+ result = (_a = result[key]) != null ? _a : "";
653
+ });
654
+ return result;
655
+ }
656
+ function createI18nTranslate(name, app, newPrefix) {
657
+ const prefix = newPrefix || camelize(name) + ".";
658
+ return (path) => {
659
+ const messages = app == null ? void 0 : app.appContext.config.globalProperties.langMessages.value;
660
+ const message = get(messages, prefix + path) || get(messages, path);
661
+ return message;
662
+ };
663
+ }
239
664
  var EditableSelect = defineComponent({
240
665
  name: "DEditableSelect",
241
666
  directives: {
242
- clickOutside: clickoutsideDirective
667
+ clickOutside: clickoutsideDirective,
668
+ dLoading: loadingDirective
243
669
  },
244
670
  props: editableSelectProps,
245
671
  emits: ["update:modelValue", "search", "loadMore"],
246
672
  setup(props, ctx2) {
247
- const getItemCls = (option, index2) => {
248
- const {
249
- optionDisabledKey: disabledKey
250
- } = props;
251
- return className("devui-dropdown-item", {
252
- disabled: disabledKey ? !!option[disabledKey] : false,
253
- selected: index2 === selectIndex.value,
254
- "devui-dropdown-bg": index2 === hoverIndex.value
255
- });
256
- };
257
- const renderDropdown = () => {
258
- if (props.appendToBody) {
259
- return createVNode(resolveComponent("d-flexible-overlay"), {
260
- "origin": origin,
261
- "visible": visible.value,
262
- "onUpdate:visible": ($event) => visible.value = $event,
263
- "position": position,
264
- "hasBackdrop": false
265
- }, {
266
- default: () => [createVNode("div", {
267
- "class": "devui-editable-select-dropdown",
268
- "style": {
269
- width: props.width + "px"
270
- }
271
- }, [withDirectives(createVNode("div", {
272
- "class": "devui-dropdown-menu"
273
- }, [createVNode("ul", {
274
- "ref": dopdownRef,
275
- "class": "devui-list-unstyled scroll-height",
276
- "style": {
277
- maxHeight: props.maxHeight + "px"
278
- },
279
- "onScroll": loadMore
280
- }, [filteredOptions.value.map((option, index2) => {
281
- return createVNode("li", {
282
- "class": getItemCls(option, index2),
283
- "onClick": (e) => {
284
- e.stopPropagation();
285
- handleClick(option);
286
- }
287
- }, [ctx2.slots.itemTemplate ? ctx2.slots.itemTemplate(option) : option.label]);
288
- }), withDirectives(createVNode("li", {
289
- "class": "devui-no-result-template"
290
- }, [createVNode("div", {
291
- "class": "devui-no-data-tip"
292
- }, [emptyText.value])]), [[vShow, !filteredOptions.value.length]])])]), [[resolveDirective("dLoading"), props.loading], [vShow, visible.value]])])]
293
- });
294
- } else {
295
- return createVNode(Transition, {
296
- "name": "fade"
297
- }, {
298
- default: () => [withDirectives(createVNode("div", {
299
- "class": "devui-dropdown-menu"
300
- }, [createVNode("ul", {
301
- "ref": dopdownRef,
302
- "class": "devui-list-unstyled scroll-height",
303
- "style": {
304
- maxHeight: props.maxHeight + "px"
305
- },
306
- "onScroll": loadMore
307
- }, [filteredOptions.value.map((option, index2) => {
308
- return createVNode("li", {
309
- "class": getItemCls(option, index2),
310
- "onClick": (e) => {
311
- e.stopPropagation();
312
- handleClick(option);
313
- }
314
- }, [ctx2.slots.itemTemplate ? ctx2.slots.itemTemplate(option) : option.label]);
315
- }), withDirectives(createVNode("li", {
316
- "class": "devui-no-result-template"
317
- }, [createVNode("div", {
318
- "class": "devui-no-data-tip"
319
- }, [emptyText.value])]), [[vShow, !filteredOptions.value.length]])])]), [[vShow, visible.value]])]
320
- });
321
- }
322
- };
323
- const dopdownRef = ref();
673
+ const app = getCurrentInstance();
674
+ const t = createI18nTranslate("DEditableSelect", app);
675
+ const ns = useNamespace("editable-select");
676
+ const dropdownNS = useNamespace("editable-select-dropdown");
677
+ const dropdownRef = ref();
324
678
  const origin = ref();
325
- const position = reactive({
326
- originX: "left",
327
- originY: "bottom",
328
- overlayX: "left",
329
- overlayY: "top"
330
- });
679
+ const position = ref(["bottom"]);
331
680
  const visible = ref(false);
332
681
  const inputValue = ref(props.modelValue);
333
- const hoverIndex = ref(0);
334
- const selectIndex = ref(0);
682
+ const cacheInput = ref();
683
+ const loading2 = ref(props.loading);
335
684
  const normalizeOptions = computed(() => {
336
685
  return props.options.map((option) => {
337
686
  if (typeof option === "object") {
338
- return __spreadValues({
687
+ return Object.assign({}, option, {
339
688
  label: option.label ? option.label : option.value,
340
689
  value: option.value
341
- }, option);
690
+ });
342
691
  }
343
692
  return {
344
693
  label: option + "",
@@ -347,14 +696,20 @@ var EditableSelect = defineComponent({
347
696
  });
348
697
  });
349
698
  const filteredOptions = userFilterOptions(normalizeOptions, inputValue, props.filterOption);
699
+ const {
700
+ getOptionValue
701
+ } = useCacheFilteredOptions(filteredOptions);
350
702
  const emptyText = computed(() => {
351
- let text;
703
+ let text = "";
352
704
  if (props.filterOption !== false && !filteredOptions.value.length) {
353
- text = "\u627E\u4E0D\u5230\u76F8\u5173\u8BB0\u5F55";
705
+ text = t("noRelatedRecords");
354
706
  } else if (props.filterOption === false && !filteredOptions.value.length) {
355
- text = "\u6CA1\u6709\u6570\u636E";
707
+ text = t("noData");
356
708
  }
357
- return ctx2.slots.noResultItemTemplate ? ctx2.slots.noResultItemTemplate() : text;
709
+ return text;
710
+ });
711
+ watch(() => props.loading, (newVal) => {
712
+ loading2.value = newVal;
358
713
  });
359
714
  const toggleMenu = () => {
360
715
  visible.value = !visible.value;
@@ -364,28 +719,45 @@ var EditableSelect = defineComponent({
364
719
  };
365
720
  const {
366
721
  loadMore
367
- } = useLazyLoad(dopdownRef, inputValue, props.filterOption, props.loadMore);
722
+ } = useLazyLoad(dropdownRef, inputValue, props.filterOption, ctx2);
368
723
  const {
369
724
  handleInput
370
725
  } = useInput(inputValue, ctx2);
371
- const handleClick = (option) => {
726
+ const handleClick = (option, index2) => {
372
727
  const {
373
728
  optionDisabledKey: disabledKey
374
729
  } = props;
375
- if (disabledKey && !!option[disabledKey])
730
+ if (disabledKey && !!option[disabledKey]) {
376
731
  return;
377
- ctx2.emit("update:modelValue", option.label);
732
+ }
733
+ inputValue.value = option.label;
734
+ cacheInput.value = option.label;
735
+ selectedIndex.value = index2;
736
+ const value = getOptionValue(option.label);
737
+ ctx2.emit("update:modelValue", value + "");
378
738
  closeMenu();
379
739
  };
380
740
  const {
381
- handleKeydown
382
- } = useKeyboardSelect(dopdownRef, props.optionDisabledKey, visible, hoverIndex, selectIndex, filteredOptions, toggleMenu, closeMenu, handleClick);
383
- watch(() => props.modelValue, (newVal) => {
384
- inputValue.value = newVal;
385
- });
741
+ handleKeydown,
742
+ hoverIndex,
743
+ selectedIndex
744
+ } = useKeyboardSelect(dropdownRef, visible, inputValue, cacheInput, filteredOptions, props.optionDisabledKey, props.filterOption, loading2, handleClick, closeMenu, toggleMenu);
745
+ const getItemCls = (option, index2) => {
746
+ const {
747
+ optionDisabledKey: disabledKey
748
+ } = props;
749
+ return className(`${dropdownNS.e("item")}`, {
750
+ disabled: disabledKey ? !!option[disabledKey] : false,
751
+ selected: index2 === selectedIndex.value,
752
+ [`${dropdownNS.m("bg")}`]: index2 === hoverIndex.value
753
+ });
754
+ };
386
755
  return () => {
387
- const selectCls = className("devui-editable-select devui-form-group devui-has-feedback", {
388
- "devui-select-open": visible.value === true
756
+ const selectCls = className(`${ns.b()} devui-form-group devui-has-feedback`, {
757
+ [`${ns.m("open")}`]: visible.value === true
758
+ });
759
+ const inputCls = className(`${ns.e("input")} devui-dropdown-origin devui-form-control`, {
760
+ "devui-dropdown-origin-open": visible.value === true
389
761
  });
390
762
  return withDirectives(createVNode("div", {
391
763
  "class": selectCls,
@@ -394,7 +766,7 @@ var EditableSelect = defineComponent({
394
766
  width: props.width + "px"
395
767
  }
396
768
  }, [createVNode("input", {
397
- "class": "devui-form-control devui-dropdown-origin devui-dropdown-origin-open",
769
+ "class": inputCls,
398
770
  "onClick": withModifiers(toggleMenu, ["self"]),
399
771
  "onInput": handleInput,
400
772
  "onKeydown": handleKeydown,
@@ -408,19 +780,57 @@ var EditableSelect = defineComponent({
408
780
  "class": "devui-select-chevron-icon"
409
781
  }, [createVNode(resolveComponent("d-icon"), {
410
782
  "name": "select-arrow"
411
- }, null)])]), renderDropdown()]), [[resolveDirective("click-outside"), closeMenu]]);
783
+ }, null)])]), createVNode(Teleport, {
784
+ "to": "body"
785
+ }, {
786
+ default: () => [createVNode(Transition, {
787
+ "name": "fade"
788
+ }, {
789
+ default: () => [createVNode(FlexibleOverlay, {
790
+ "origin": origin.value,
791
+ "modelValue": visible.value,
792
+ "onUpdate:modelValue": ($event) => visible.value = $event,
793
+ "position": position.value
794
+ }, {
795
+ default: () => [createVNode("div", {
796
+ "style": {
797
+ width: props.width + "px"
798
+ },
799
+ "class": `${dropdownNS.b()}`
800
+ }, [withDirectives(createVNode("div", {
801
+ "class": `${dropdownNS.e("wrap")}`
802
+ }, [createVNode("ul", {
803
+ "ref": dropdownRef,
804
+ "class": `${dropdownNS.e("list")}`,
805
+ "style": {
806
+ maxHeight: props.maxHeight + "px"
807
+ },
808
+ "onScroll": loadMore
809
+ }, [filteredOptions.value.map((option, index2) => {
810
+ return createVNode("li", {
811
+ "class": getItemCls(option, index2),
812
+ "onClick": (e) => {
813
+ e.stopPropagation();
814
+ handleClick(option, index2);
815
+ }
816
+ }, [ctx2.slots.item ? ctx2.slots.item(option) : option.label]);
817
+ }), withDirectives(createVNode("li", {
818
+ "class": `${dropdownNS.e("empty")}`
819
+ }, [createVNode("div", {
820
+ "class": `${dropdownNS.em("empty", "tip")}`
821
+ }, [ctx2.slots.noResultItem ? ctx2.slots.noResultItem() : emptyText.value])]), [[vShow, !filteredOptions.value.length]])])]), [[resolveDirective("dLoading"), props.loading], [vShow, visible.value]])])]
822
+ })]
823
+ })]
824
+ })]), [[resolveDirective("click-outside"), closeMenu]]);
412
825
  };
413
826
  }
414
827
  });
415
- EditableSelect.install = function(app) {
416
- app.component(EditableSelect.name, EditableSelect);
417
- };
418
828
  var index = {
419
829
  title: "EditableSelect \u53EF\u8F93\u5165\u4E0B\u62C9\u9009\u62E9\u6846",
420
830
  category: "\u6570\u636E\u5F55\u5165",
421
831
  status: "100%",
422
832
  install(app) {
423
- app.use(EditableSelect);
833
+ app.component(EditableSelect.name, EditableSelect);
424
834
  }
425
835
  };
426
- export { EditableSelect, index as default };
836
+ export { EditableSelect, index as default, editableSelectProps };